Commit 6cd31a2b authored by Tim Jenssen's avatar Tim Jenssen
Browse files

QmlDesigner: deactivate use of F4 to switch in design mode



Introduce a setting for a not implemented in design text edit.

Change-Id: Ie4973ec4fcb2c9b2e2534e40187cf33a0202abaa
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@theqtcompany.com>
parent 711f54bd
...@@ -60,6 +60,7 @@ const char FORWARD_PUPPET_OUTPUT[] = "ForwardPuppetOutput"; ...@@ -60,6 +60,7 @@ const char FORWARD_PUPPET_OUTPUT[] = "ForwardPuppetOutput";
const char REFORMAT_UI_QML_FILES[] = "ReformatUiQmlFiles"; /* This Setting is not exposed in ui. const char REFORMAT_UI_QML_FILES[] = "ReformatUiQmlFiles"; /* This Setting is not exposed in ui.
The setting can be used to turn off the feature, The setting can be used to turn off the feature,
if there are serious issues */ if there are serious issues */
const char TEXTEDIT_IN_DESIGNMODE[] = "TextEditInDesignMode";
} }
class DesignerSettings : public QHash<QByteArray, QVariant> class DesignerSettings : public QHash<QByteArray, QVariant>
......
...@@ -130,6 +130,12 @@ static bool shouldAssertInException() ...@@ -130,6 +130,12 @@ static bool shouldAssertInException()
return !processEnvironment.value("QMLDESIGNER_ASSERT_ON_EXCEPTION").isEmpty(); return !processEnvironment.value("QMLDESIGNER_ASSERT_ON_EXCEPTION").isEmpty();
} }
static bool useTextEditInDesignMode()
{
DesignerSettings settings = QmlDesignerPlugin::instance()->settings();
return settings.value(DesignerSettingsKey::TEXTEDIT_IN_DESIGNMODE, false).toBool();
}
static bool warningsForQmlFilesInsteadOfUiQmlEnabled() static bool warningsForQmlFilesInsteadOfUiQmlEnabled()
{ {
DesignerSettings settings = QmlDesignerPlugin::instance()->settings(); DesignerSettings settings = QmlDesignerPlugin::instance()->settings();
...@@ -208,12 +214,11 @@ bool QmlDesignerPlugin::initialize(const QStringList & /*arguments*/, QString *e ...@@ -208,12 +214,11 @@ bool QmlDesignerPlugin::initialize(const QStringList & /*arguments*/, QString *e
createDesignModeWidget(); createDesignModeWidget();
connect(switchTextDesignAction, &QAction::triggered, this, [](){ connect(switchTextDesignAction, &QAction::triggered, this, [](){
if (Core::ModeManager::currentMode() == Core::Constants::MODE_EDIT) { if (Core::ModeManager::currentMode() == Core::Constants::MODE_DESIGN) {
Core::IEditor *editor = Core::EditorManager::currentEditor(); if (useTextEditInDesignMode())
if (checkIfEditorIsQtQuick(editor)) qDebug() << "not implemented";
Core::ModeManager::activateMode(Core::Constants::MODE_DESIGN); else
} else if (Core::ModeManager::currentMode() == Core::Constants::MODE_DESIGN) { Core::ModeManager::activateMode(Core::Constants::MODE_EDIT);
Core::ModeManager::activateMode(Core::Constants::MODE_EDIT);
} }
}); });
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment