Mercurial > hg > octave-nkf
diff m4/acinclude.m4 @ 18215:e54cfaae830b gui-release
Make editor tabs draggable if feature is available
* acinclude.m4: Added new macro to test for QTabWidget::setMovable ()
availability
* configure.ac: Add call to new macro OCTAVE_CHECK_FUNC_QTABWIDGET_SETMOVABLE
* file-editor.cc (file_editor::construct): use _tab_widget->setMovable
if available
author | Richard Crozier richard dot crozier(at)yahoo.co.uk |
---|---|
date | Tue, 17 Dec 2013 16:24:29 +0000 |
parents | 5e72998000fb |
children | 81472221adc3 0a66861d8069 |
line wrap: on
line diff
--- a/m4/acinclude.m4 +++ b/m4/acinclude.m4 @@ -454,6 +454,37 @@ fi ]) dnl +dnl Check whether the Qt QTabWidget::setMovable() function exists. +dnl This function was added in Qt 4.5. +dnl +AC_DEFUN([OCTAVE_CHECK_FUNC_QTABWIDGET_SETMOVABLE], [ + AC_CACHE_CHECK([whether Qt has the QTabWidget::setMovable() function], + [octave_cv_func_qtabwidget_setmovable], + [AC_LANG_PUSH(C++) + ac_octave_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$QT_CPPFLAGS $CPPFLAGS" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include <QTabWidget> + class tab_widget : public QTabWidget + { + public: + tab_widget (QWidget *parent = 0) : QTabWidget (parent) { this->setMovable (true); } + ~tab_widget () {} + }; + ]], [[ + tab_widget tw; + ]])], + octave_cv_func_qtabwidget_setmovable=yes, + octave_cv_func_qtabwidget_setmovable=no) + CPPFLAGS="$ac_octave_save_CPPFLAGS" + AC_LANG_POP(C++) + ]) + if test $octave_cv_func_qtabwidget_setmovable = yes; then + AC_DEFINE(HAVE_QTABWIDGET_SETMOVABLE, 1, + [Define to 1 if Qt has the QTabWidget::setMovable() function.]) + fi +]) +dnl dnl Check whether HDF5 library has version 1.6 API functions. dnl AC_DEFUN([OCTAVE_CHECK_HDF5_HAS_VER_16_API], [