Mercurial > hg > octave-lyh
comparison m4/acinclude.m4 @ 17115:bb713af2e1d9
build: detect Qt functions required for building the gui
* m4/acinclude.m4 (OCTAVE_CHECK_FUNC_QABSTRACTITEMMODEL_BEGINRESETMODEL):
New macro to detect Qt functions QAbstractItemModel::beginResetModel and
QAbstractItemModel::endResetModel.
* configure.ac: Call it and disable the gui if the functions are not found.
author | Mike Miller <mtmiller@ieee.org> |
---|---|
date | Tue, 30 Jul 2013 00:49:37 -0400 |
parents | 8d84dc5f5b5d |
children | 36fd98b9ce48 |
comparison
equal
deleted
inserted
replaced
17114:95055b814d35 | 17115:bb713af2e1d9 |
---|---|
295 AC_LANG_POP(C++) | 295 AC_LANG_POP(C++) |
296 ]) | 296 ]) |
297 if test $octave_cv_func_setplaceholdertext = yes; then | 297 if test $octave_cv_func_setplaceholdertext = yes; then |
298 AC_DEFINE(HAVE_SETPLACEHOLDERTEXT, 1, | 298 AC_DEFINE(HAVE_SETPLACEHOLDERTEXT, 1, |
299 [Define to 1 if you have the Qt SetPlaceholderText function.]) | 299 [Define to 1 if you have the Qt SetPlaceholderText function.]) |
300 fi | |
301 ]) | |
302 dnl | |
303 dnl Check whether the Qt QAbstractItemModel::beginResetModel() function exists. | |
304 dnl Also checks for QAbstractItemModel::endResetModel(). These are two of the | |
305 dnl newest Qt functions that the Octave GUI depends on, added in Qt 4.6. | |
306 dnl | |
307 AC_DEFUN([OCTAVE_CHECK_FUNC_QABSTRACTITEMMODEL_BEGINRESETMODEL], [ | |
308 AC_CACHE_CHECK([whether Qt has the QAbstractItemModel::beginResetModel() function], | |
309 [octave_cv_func_qabstractitemmodel_beginresetmodel], | |
310 [AC_LANG_PUSH(C++) | |
311 ac_octave_save_CPPFLAGS="$CPPFLAGS" | |
312 CPPFLAGS="$QT_CPPFLAGS $CPPFLAGS" | |
313 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | |
314 #include <QAbstractItemModel> | |
315 class item_model : public QAbstractItemModel | |
316 { | |
317 public: | |
318 item_model (QObject *parent = 0) : QAbstractItemModel (parent) {} | |
319 ~item_model () {} | |
320 QModelIndex index (int, int, const QModelIndex& m) const { return m; } | |
321 QModelIndex parent (const QModelIndex& m) const { return m; } | |
322 int columnCount (const QModelIndex&) const { return 0; } | |
323 int rowCount (const QModelIndex&) const { return 0; } | |
324 QVariant data (const QModelIndex&, int) const { return QVariant(); } | |
325 void update_model () | |
326 { | |
327 this->beginResetModel (); | |
328 this->endResetModel (); | |
329 } | |
330 }; | |
331 ]], [[ | |
332 item_model model; | |
333 model.update_model (); | |
334 ]])], | |
335 octave_cv_func_qabstractitemmodel_beginresetmodel=yes, | |
336 octave_cv_func_qabstractitemmodel_beginresetmodel=no) | |
337 CPPFLAGS="$ac_octave_save_CPPFLAGS" | |
338 AC_LANG_POP(C++) | |
339 ]) | |
340 if test $octave_cv_func_qabstractitemmodel_beginresetmodel = yes; then | |
341 AC_DEFINE(HAVE_QABSTRACTITEMMODEL_BEGINRESETMODEL, 1, | |
342 [Define to 1 if Qt has the QAbstractItemModel::beginResetModel() function.]) | |
300 fi | 343 fi |
301 ]) | 344 ]) |
302 dnl | 345 dnl |
303 dnl Check whether HDF5 library has version 1.6 API functions. | 346 dnl Check whether HDF5 library has version 1.6 API functions. |
304 dnl | 347 dnl |