aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKnud Dollereder <knud.dollereder@qt.io>2020-09-07 12:48:07 +0200
committerThomas Hartmann <thomas.hartmann@qt.io>2020-09-07 15:04:37 +0000
commitd64ebc0f8b3911bb0f292059150cf1c35df5d417 (patch)
tree36384d99b214aabefda7d9812672b1ea99d12359
parentb0cad9e9c7aad209756fb2409520c0d048614dd9 (diff)
Fix easing-curve-editor context menu for macOS
Change-Id: I99eac383dbd247e42392424712eed001e2750008 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
-rw-r--r--src/plugins/qmldesigner/components/timelineeditor/preseteditor.cpp9
-rw-r--r--src/plugins/qmldesigner/components/timelineeditor/splineeditor.cpp1
2 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/qmldesigner/components/timelineeditor/preseteditor.cpp b/src/plugins/qmldesigner/components/timelineeditor/preseteditor.cpp
index 8ea7692e3d..2ef68f24b4 100644
--- a/src/plugins/qmldesigner/components/timelineeditor/preseteditor.cpp
+++ b/src/plugins/qmldesigner/components/timelineeditor/preseteditor.cpp
@@ -348,18 +348,19 @@ void PresetList::contextMenuEvent(QContextMenuEvent *event)
if (m_scope == QSettings::SystemScope)
return;
- QMenu menu;
+ auto *menu = new QMenu(this);
- QAction *addAction = menu.addAction(tr("Add Preset"));
+ QAction *addAction = menu->addAction(tr("Add Preset"));
connect(addAction, &QAction::triggered, [&]() { createItem(); });
if (selectionModel()->hasSelection()) {
- QAction *removeAction = menu.addAction(tr("Delete Selected Preset"));
+ QAction *removeAction = menu->addAction(tr("Delete Selected Preset"));
connect(removeAction, &QAction::triggered, [&]() { removeSelectedItem(); });
}
- menu.exec(event->globalPos());
+ menu->exec(event->globalPos());
+ menu->deleteLater();
}
void PresetList::dataChanged(const QModelIndex &topLeft,
diff --git a/src/plugins/qmldesigner/components/timelineeditor/splineeditor.cpp b/src/plugins/qmldesigner/components/timelineeditor/splineeditor.cpp
index e6d6be4fb6..3431e5c7a7 100644
--- a/src/plugins/qmldesigner/components/timelineeditor/splineeditor.cpp
+++ b/src/plugins/qmldesigner/components/timelineeditor/splineeditor.cpp
@@ -253,6 +253,7 @@ void SplineEditor::contextMenuEvent(QContextMenuEvent *e)
});
menu->exec(e->globalPos());
+ menu->deleteLater();
e->accept();
}