changeset 31746:28177dcaefad

assume QMainWindow::resizeDocks is available * acinclude.m4 (OCTAVE_CHECK_FUNC_QMAINWINDOW_RESIZEDOCKS): Delete. (OCTAVE_CHECK_QT_VERSION): Delete use. * main-window.cc: Don't check HAVE_QMAINWINDOW_RESIZEDOCKS. Delete code to work around the absence of QMainWindow::resizeDocks.
author John W. Eaton <jwe@octave.org>
date Tue, 17 Jan 2023 09:52:27 -0500
parents 6973fe71f6c5
children 2f730c070d3e
files libgui/src/main-window.cc m4/acinclude.m4
diffstat 2 files changed, 0 insertions(+), 47 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/main-window.cc	Tue Jan 17 09:45:55 2023 -0500
+++ b/libgui/src/main-window.cc	Tue Jan 17 09:52:27 2023 -0500
@@ -2769,23 +2769,11 @@
 
   void main_window::resize_dock (QDockWidget *dw, int width, int height)
   {
-#if defined (HAVE_QMAINWINDOW_RESIZEDOCKS)
     // resizeDockWidget was added to Qt in Qt 5.6
     if (width >= 0)
       resizeDocks ({dw}, {width}, Qt::Horizontal);
     if (height >= 0)
       resizeDocks ({dw}, {height}, Qt::Vertical);
-#else
-    // This replacement of resizeDockWidget is not very reliable.
-    // But even if Qt4 is not yet
-    QSize s = dw->widget ()->size ();
-    if (width >= 0)
-      s.setWidth (width);
-    if (height >= 0)
-      s.setHeight (height);
-    dw->widget ()->resize (s);
-    dw->adjustSize ();
-#endif
   }
 
   // The default main window size relative to the desktop size
--- a/m4/acinclude.m4	Tue Jan 17 09:45:55 2023 -0500
+++ b/m4/acinclude.m4	Tue Jan 17 09:52:27 2023 -0500
@@ -647,40 +647,6 @@
   fi
 ])
 dnl
-dnl Check whether the Qt class QMainWindow has the resizeDocks member function.
-dnl This member function was introduced in Qt 5.6.
-dnl
-dnl FIXME: remove this test when we drop support for Qt older than 5.6
-dnl
-AC_DEFUN([OCTAVE_CHECK_FUNC_QMAINWINDOW_RESIZEDOCKS], [
-  AC_CACHE_CHECK([for QMainWindow::resizeDocks in <QMainWindow>],
-    [octave_cv_func_mainwindow_resizedocks],
-    [AC_LANG_PUSH(C++)
-    ac_octave_save_CPPFLAGS="$CPPFLAGS"
-    ac_octave_save_CXXFLAGS="$CXXFLAGS"
-    CPPFLAGS="$QT_CPPFLAGS $CXXPICFLAG $CPPFLAGS"
-    CXXFLAGS="$CXXPICFLAG $CXXFLAGS"
-    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-        #include <QMainWindow>
-        #include <QDockWidget>
-        ]], [[
-        QMainWindow *mw = new QMainWindow ();
-        QDockWidget *dw = new QDockWidget (mw);
-        mw->addDockWidget (Qt::LeftDockWidgetArea, dw);
-        mw->resizeDocks ({dw},{20},Qt::Horizontal);
-        ]])],
-      octave_cv_func_mainwindow_resizedocks=yes,
-      octave_cv_func_mainwindow_resizedocks=no)
-    CPPFLAGS="$ac_octave_save_CPPFLAGS"
-    CXXFLAGS="$ac_octave_save_CXXFLAGS"
-    AC_LANG_POP(C++)
-  ])
-  if test $octave_cv_func_mainwindow_resizedocks = yes; then
-    AC_DEFINE(HAVE_QMAINWINDOW_RESIZEDOCKS, 1,
-      [Define to 1 if you have the 'QMainWindow::resizeDocks' member function.])
-  fi
-])
-dnl
 dnl Check whether the Qt class QWheelEvent has the position member function.
 dnl This member function was introduced in Qt 5.14.
 dnl
@@ -2219,7 +2185,6 @@
     OCTAVE_CHECK_FUNC_QHELPSEARCHQUERYWIDGET_SEARCHINPUT
     OCTAVE_CHECK_NEW_QHELPINDEXWIDGET_API
     OCTAVE_CHECK_FUNC_QLIST_ITERATOR_CONSTRUCTOR
-    OCTAVE_CHECK_FUNC_QMAINWINDOW_RESIZEDOCKS
     OCTAVE_CHECK_FUNC_QHELPENGINE_DOCUMENTSFORIDENTIFIER
     OCTAVE_CHECK_FUNC_QWHEELEVENT_POSITION
     OCTAVE_CHECK_FUNC_QPAINTER_SETRENDERHINT_LOSSLESS