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";
const char REFORMAT_UI_QML_FILES[] = "ReformatUiQmlFiles"; /* This Setting is not exposed in ui.
The setting can be used to turn off the feature,
if there are serious issues */
const char TEXTEDIT_IN_DESIGNMODE[] = "TextEditInDesignMode";
}
class DesignerSettings : public QHash<QByteArray, QVariant>
......
......@@ -130,6 +130,12 @@ static bool shouldAssertInException()
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()
{
DesignerSettings settings = QmlDesignerPlugin::instance()->settings();
......@@ -208,11 +214,10 @@ bool QmlDesignerPlugin::initialize(const QStringList & /*arguments*/, QString *e
createDesignModeWidget();
connect(switchTextDesignAction, &QAction::triggered, this, [](){
if (Core::ModeManager::currentMode() == Core::Constants::MODE_EDIT) {
Core::IEditor *editor = Core::EditorManager::currentEditor();
if (checkIfEditorIsQtQuick(editor))
Core::ModeManager::activateMode(Core::Constants::MODE_DESIGN);
} else if (Core::ModeManager::currentMode() == Core::Constants::MODE_DESIGN) {
if (Core::ModeManager::currentMode() == Core::Constants::MODE_DESIGN) {
if (useTextEditInDesignMode())
qDebug() << "not implemented";
else
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