changeset 32236:dc84ba676ebe

allow compiling changes in variable editor with Qt < 15.5 * variable-editor.cc (variable_editor_view::createContextMenu)_ use mappedString instead of mapped only with Qt version higher or equal 6.0; (variable_editor_view::createColumnMenu): dito; (variable_editor_view::createRowMenu): dito; (variable_editor::edit_variable): dito
author Torsten Lilge <ttl-octave@mailbox.org>
date Sat, 05 Aug 2023 16:12:11 +0200
parents b92d2724c75a
children 6d20f476936e
files libgui/src/variable-editor.cc
diffstat 1 files changed, 22 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/variable-editor.cc	Sat Aug 05 16:10:49 2023 +0200
+++ b/libgui/src/variable-editor.cc	Sat Aug 05 16:12:11 2023 +0200
@@ -705,8 +705,13 @@
 
           QSignalMapper *plot_mapper = make_plot_mapper (menu);
 
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
           connect (plot_mapper, SIGNAL (mappedString (const QString&)),
                    this, SLOT (selected_command_requested (const QString&)));
+#else
+          connect (plot_mapper, SIGNAL (mapped (const QString&)),
+                   this, SLOT (selected_command_requested (const QString&)));
+#endif
         }
 
       menu->exec (mapToGlobal (qpos));
@@ -753,8 +758,13 @@
 
   QSignalMapper *plot_mapper = make_plot_mapper (menu);
 
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
   connect (plot_mapper, SIGNAL (mappedString (const QString&)),
            this, SLOT (selected_command_requested (const QString&)));
+#else
+  connect (plot_mapper, SIGNAL (mapped (const QString&)),
+           this, SLOT (selected_command_requested (const QString&)));
+#endif
 
   QPoint menupos = pt;
   menupos.setY (horizontalHeader ()->height ());
@@ -800,9 +810,13 @@
 
   QSignalMapper *plot_mapper = make_plot_mapper (menu);
 
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
   connect (plot_mapper, SIGNAL (mappedString (const QString&)),
            this, SLOT (selected_command_requested (const QString&)));
-
+#else
+  connect (plot_mapper, SIGNAL (mapped (const QString&)),
+           this, SLOT (selected_command_requested (const QString&)));
+#endif
   QPoint menupos = pt;
   menupos.setX (verticalHeader ()->width ());
 
@@ -1292,11 +1306,17 @@
   edit_view->verticalHeader ()->setDefaultSectionSize (m_default_height
                                                        + m_add_font_height);
 
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
   connect (m_plot_mapper, SIGNAL (mappedString (const QString&)),
            edit_view, SLOT (selected_command_requested (const QString&)));
-
+  connect (m_save_mapper, SIGNAL (mappedString (const QString&)),
+           stack, SLOT (save (const QString&)));
+#else
+  connect (m_plot_mapper, SIGNAL (mapped (const QString&)),
+           edit_view, SLOT (selected_command_requested (const QString&)));
   connect (m_save_mapper, SIGNAL (mapped (const QString&)),
            stack, SLOT (save (const QString&)));
+#endif
 
   connect (edit_view, &variable_editor_view::command_signal,
            this, &variable_editor::command_signal);