changeset 2528:84ddd274fcc0

Further older-Qt bits
author Chris Cannam
date Wed, 29 Apr 2020 16:52:26 +0100
parents e499ec4a32c9
children c7554741550f
files main/MainWindow.cpp
diffstat 1 files changed, 11 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/main/MainWindow.cpp	Wed Apr 29 15:28:00 2020 +0100
+++ b/main/MainWindow.cpp	Wed Apr 29 16:52:26 2020 +0100
@@ -5066,24 +5066,16 @@
     if (m_lastRightButtonPropertyMenu) {
         delete m_lastRightButtonPropertyMenu;
     }
-
-    m_paneStack->setCurrentLayer(pane, nullptr);
     
     QMenu *m = new QMenu;
     IconLoader il;
 
     MenuTitle::addTitle(m, tr("Pane"));
 
-    // We repeat the setCurrentLayer call here just in case some
-    // unexpected UI interaction (scripting?) changes it while the
-    // menu is visible
-    
-    m->addAction(il.load("editdelete"),
-                 tr("&Delete Pane"),
-                 [=]() {
-                     m_paneStack->setCurrentLayer(pane, nullptr);
-                     deleteCurrentPane();
-                 });
+    m_paneStack->setCurrentLayer(pane, nullptr);
+
+    m->addAction(il.load("editdelete"), tr("&Delete Pane"),
+                 this, SLOT(deleteCurrentPane()));
 
     m->popup(position);
     m_lastRightButtonPropertyMenu = m;
@@ -5095,37 +5087,23 @@
     if (m_lastRightButtonPropertyMenu) {
         delete m_lastRightButtonPropertyMenu;
     }
-
-    m_paneStack->setCurrentLayer(pane, layer);
     
     QMenu *m = new QMenu;
     IconLoader il;
 
     MenuTitle::addTitle(m, layer->getLayerPresentationName());
 
-    // We repeat the setCurrentLayer calls here just in case some
-    // unexpected UI interaction (scripting?) changes it while the
-    // menu is visible
-    
+    m_paneStack->setCurrentLayer(pane, layer);
+
     m->addAction(tr("&Rename Layer..."),
-                 [=]() {
-                     m_paneStack->setCurrentLayer(pane, layer);
-                     renameCurrentLayer();
-                 });
+                 this, SLOT(renameCurrentLayer()));
 
     m->addAction(tr("Edit Layer Data"),
-                 [=]() {
-                     m_paneStack->setCurrentLayer(pane, layer);
-                     editCurrentLayer();
-                 })
+                 this, SLOT(editCurrentLayer()))
         ->setEnabled(layer->isLayerEditable());
-    
-    m->addAction(il.load("editdelete"),
-                 tr("&Delete Layer"),
-                 [=]() {
-                     m_paneStack->setCurrentLayer(pane, layer);
-                     deleteCurrentLayer();
-                 });
+
+    m->addAction(il.load("editdelete"), tr("&Delete Layer"),
+                 this, SLOT(deleteCurrentLayer()));
 
     m->popup(position);
     m_lastRightButtonPropertyMenu = m;