changeset 25091:2b8442c890d8 stable

Fix locked GUI panels for Qt 5.6.1 through 5.7.0 series versions (bug #53409) * main-window.cc (main_window::construct): Place preprocess conditional around the setDockOptions such that Qt 5.6.1 through 5.7.0 don't use that function. Instead, use the more limited setDockNestingEnabled(). * variable-editor.cc (variable_editor::variable_editor): Ditto. Move this code prior to the addition of the tool bar to the QMainWindow. Add the feature flag AnimatedDocks to the input list of setDockOptions(). (variable_editor::edit_variable): Remove the extraneous restriction on sub-panel allowed areas. * NEWS: Add note for builders of how Qt bug in pertinent range was addressed.
author Daniel J Sebald <daniel.sebald@ieee.org>
date Mon, 02 Apr 2018 14:52:54 -0500
parents c1dab27c55af
children 69cbaa179780
files NEWS libgui/src/main-window.cc libgui/src/variable-editor.cc
diffstat 3 files changed, 20 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Mon Apr 02 15:14:29 2018 -0700
+++ b/NEWS	Mon Apr 02 14:52:54 2018 -0500
@@ -27,6 +27,11 @@
     the new option `--gui'.  The previous `--force-gui' will continue to
     work and maps to `--gui' but will be removed in Octave 4.8.
 
+ ** A known bug in Qt (https://bugreports.qt.io/browse/QTBUG-55357) is
+    addressed by limiting GUI sub-panel relocation capabilities for Qt
+    versions in the range >= 5.6.1 and < 5.7.1.  However, this may not
+    thoroughly avoid issues on all platforms.
+
  ** A new container data type--containers.Map--is available.  Map is a
     key/value storage container (a.k.a, a hash) that efficiently allows
     storing and retrieving values by name, rather than by position which
--- a/libgui/src/main-window.cc	Mon Apr 02 15:14:29 2018 -0700
+++ b/libgui/src/main-window.cc	Mon Apr 02 14:52:54 2018 -0500
@@ -1838,9 +1838,14 @@
 
         setWindowTitle ("Octave");
 
+// See Octave bug #53409 and https://bugreports.qt.io/browse/QTBUG-55357
+#if (QT_VERSION < 0x050601) || (QT_VERSION >= 0x050701)
         setDockOptions (QMainWindow::AnimatedDocks
                         | QMainWindow::AllowNestedDocks
                         | QMainWindow::AllowTabbedDocks);
+#else
+        setDockNestingEnabled (true);
+#endif
 
         addDockWidget (Qt::RightDockWidgetArea, m_command_window);
         addDockWidget (Qt::RightDockWidgetArea, m_doc_browser_window);
--- a/libgui/src/variable-editor.cc	Mon Apr 02 15:14:29 2018 -0700
+++ b/libgui/src/variable-editor.cc	Mon Apr 02 14:52:54 2018 -0500
@@ -997,6 +997,16 @@
     setWindowIcon (QIcon (":/actions/icons/logo.png"));
     setAttribute (Qt::WA_AlwaysShowToolTips);
 
+    m_main->setParent (this);
+// See Octave bug #53409 and https://bugreports.qt.io/browse/QTBUG-55357
+#if (QT_VERSION < 0x050601) || (QT_VERSION >= 0x050701)
+    m_main->setDockOptions (QMainWindow::AnimatedDocks |
+                            QMainWindow::AllowNestedDocks |
+                            QMainWindow::VerticalTabs);
+#else
+    m_main->setDockNestingEnabled (true);
+#endif
+
     // Tool Bar.
 
     construct_tool_bar ();
@@ -1017,9 +1027,6 @@
     central_mdiarea->resize (QSize (0, 0));
     m_main->setCentralWidget (central_mdiarea);
 
-    m_main->setParent (this);
-    m_main->setDockOptions (QMainWindow::AllowNestedDocks |
-                            QMainWindow::VerticalTabs);
     setWidget (m_main);
 
     connect (this, SIGNAL (command_signal (const QString&)),
@@ -1081,8 +1088,6 @@
 
     variable_dock_widget *page = new variable_dock_widget (this);
     page->setObjectName (name);
-    page->setAllowedAreas(Qt::LeftDockWidgetArea |
-                          Qt::RightDockWidgetArea);
     m_main->addDockWidget (Qt::LeftDockWidgetArea, page);
 
     connect (QApplication::instance(), SIGNAL (focusChanged (QWidget *, QWidget *)),