From 93592abd85a101017db373e822bd6d7f99613541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Wasylk=C3=B3w?= Date: Sat, 15 Jun 2024 21:19:02 +0200 Subject: [PATCH] Add option to disable Qt Quick window (fixes #6) --- QtGui.cpp | 4 +++- dbapi/actions/ActionsConfig.cpp | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/QtGui.cpp b/QtGui.cpp index 5c37494..b565b54 100644 --- a/QtGui.cpp +++ b/QtGui.cpp @@ -191,7 +191,9 @@ static int pluginStart() { plugin.plugin.message = pluginMessage_wrapper; startWidgets(); - startQuick(); + + if (!USE_WIDGETS || DBAPI->conf_get_int("qgui.show_qtquick_window", false)) + startQuick(); // GUI thread loop app->exec(); diff --git a/dbapi/actions/ActionsConfig.cpp b/dbapi/actions/ActionsConfig.cpp index 57a1ca4..0d784ff 100644 --- a/dbapi/actions/ActionsConfig.cpp +++ b/dbapi/actions/ActionsConfig.cpp @@ -243,6 +243,16 @@ ActionsConfig::ActionsConfig(QObject *parent, DBApi *Api) m_actions.append(action); } + ActionSpec quick = { + .path = QStringList{"View", "Qt Quick Window (requires restart)"}, + .id = "q_qtquick_window", + .loc = DBAction::ACTION_LOC_HOTKEY | DBAction::ACTION_LOC_MENUBAR, + .arg = DBAction::ACTION_ARG_NONE, + .props = QHash{{"config_default", QVariant(false)}, {"config", QVariant(QString("qgui.show_qtquick_window"))}} + }; + DBActionConfigBool *quick_action = new DBActionConfigBool(this, Api, quick); + m_actions.append(quick_action); + } ActionsConfig::~ActionsConfig() {