From e2774309fbaa1adefeb8d856a9917b2098bb5a56 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Wed, 2 Jan 2019 19:49:06 -0800 Subject: [PATCH] Fix context menus on Qt 5.9 --- app/gui/AppView.qml | 8 +++++++- app/gui/PcView.qml | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/gui/AppView.qml b/app/gui/AppView.qml index d639fb1e..e8802a83 100644 --- a/app/gui/AppView.qml +++ b/app/gui/AppView.qml @@ -134,7 +134,13 @@ GridView { acceptedButtons: Qt.RightButton onClicked: { // popup() ensures the menu appears under the mouse cursor - appContextMenu.popup() + if (appContextMenu.popup) { + appContextMenu.popup() + } + else { + // Qt 5.9 doesn't have popup() + appContextMenu.open() + } } } diff --git a/app/gui/PcView.qml b/app/gui/PcView.qml index 59b51d5f..2bb25cd4 100644 --- a/app/gui/PcView.qml +++ b/app/gui/PcView.qml @@ -192,7 +192,13 @@ GridView { onClicked: { if (!model.addPc) { // popup() ensures the menu appears under the mouse cursor - pcContextMenu.popup() + if (pcContextMenu.popup) { + pcContextMenu.popup() + } + else { + // Qt 5.9 doesn't have popup() + pcContextMenu.open() + } } } }