From a2735ec024a82b0d19a2c3f55f83701f95db40ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= Date: Fri, 18 Mar 2022 14:03:20 +0100 Subject: [PATCH 01/26] Squish: Don't configure projects on Qt4 anymore Change-Id: Ib09fc44323e09fa4d6a5d2428c35b5b6afe08f24 Reviewed-by: Reviewed-by: Christian Stenger --- tests/system/suite_CSUP/tst_CSUP03/test.py | 8 +++----- tests/system/suite_general/tst_openqt_creator/test.py | 7 ++----- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/tests/system/suite_CSUP/tst_CSUP03/test.py b/tests/system/suite_CSUP/tst_CSUP03/test.py index a20ac19ea4f..67edd64cd18 100644 --- a/tests/system/suite_CSUP/tst_CSUP03/test.py +++ b/tests/system/suite_CSUP/tst_CSUP03/test.py @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (C) 2016 The Qt Company Ltd. +# Copyright (C) 2022 The Qt Company Ltd. # Contact: https://www.qt.io/licensing/ # # This file is part of Qt Creator. @@ -78,10 +78,8 @@ def main(): continue if not startCreatorVerifyingClang(useClang): continue - targetToChoose = Targets.DESKTOP_4_8_7_DEFAULT - if not qt4Available: - targetToChoose = Targets.DESKTOP_5_14_1_DEFAULT - projectName = createNewNonQtProject(tempDir(), "project-csup03", [targetToChoose]) + projectName = createNewNonQtProject(tempDir(), "project-csup03", + [Targets.DESKTOP_5_14_1_DEFAULT]) checkCodeModelSettings(useClang) openDocument("%s.Sources.main\\.cpp" % projectName) editor = getEditorForFileSuffix("main.cpp") diff --git a/tests/system/suite_general/tst_openqt_creator/test.py b/tests/system/suite_general/tst_openqt_creator/test.py index 6ff0bfb345e..a75be98f7ff 100644 --- a/tests/system/suite_general/tst_openqt_creator/test.py +++ b/tests/system/suite_general/tst_openqt_creator/test.py @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (C) 2016 The Qt Company Ltd. +# Copyright (C) 2022 The Qt Company Ltd. # Contact: https://www.qt.io/licensing/ # # This file is part of Qt Creator. @@ -36,10 +36,7 @@ def main(): return runButton = findObject(':*Qt Creator.Run_Core::Internal::FancyToolButton') - targetToChoose = Targets.DESKTOP_4_8_7_DEFAULT - if not qt4Available: - targetToChoose = Targets.DESKTOP_5_14_1_DEFAULT - openQmakeProject(pathSpeedcrunch, [targetToChoose]) + openQmakeProject(pathSpeedcrunch, [Targets.DESKTOP_5_14_1_DEFAULT]) # Wait for parsing to complete waitFor("runButton.enabled", 30000) # Starting before opening, because this is where Creator froze (QTCREATORBUG-10733) From f347623804caabcaf578364fa0645e38cdc5e6e6 Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Thu, 17 Mar 2022 10:49:04 +0100 Subject: [PATCH 02/26] QmlDesigner: Add missing StudioControl in qmldir Change-Id: I5bbe66b306b0a947256533050a98fc0e4671774f Reviewed-by: Brook Cronin Reviewed-by: Reviewed-by: Thomas Hartmann --- .../propertyEditorQmlSources/imports/StudioControls/qmldir | 1 + 1 file changed, 1 insertion(+) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/qmldir b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/qmldir index 3933e46d781..b5f8c7a4e30 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/qmldir +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/qmldir @@ -33,6 +33,7 @@ SliderPopup 1.0 SliderPopup.qml SpinBox 1.0 SpinBox.qml SpinBoxIndicator 1.0 SpinBoxIndicator.qml SpinBoxInput 1.0 SpinBoxInput.qml +Switch 1.0 Switch.qml TabBar 1.0 TabBar.qml TabButton 1.0 TabButton.qml TextArea 1.0 TextArea.qml From 047253b6a8764efe996e4f86591c7b3dd9f6a878 Mon Sep 17 00:00:00 2001 From: Mats Honkamaa Date: Mon, 21 Mar 2022 10:19:51 +0200 Subject: [PATCH 03/26] Doc: Add information about visualization of emitters and attractors Task-number: QDS-6370 Change-Id: I7c9e2a03b025d16769ed7cc4f3da85fe91193321 Reviewed-by: Miikka Heikkinen Reviewed-by: Reviewed-by: Leena Miettinen --- .../src/qtquick3d-editor/qtdesignstudio-3d-editor.qdoc | 5 +++++ .../src/qtquick3d-editor/qtdesignstudio-3d-particles.qdoc | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-editor.qdoc b/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-editor.qdoc index 7b147fe684a..dee9a01a9d9 100644 --- a/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-editor.qdoc +++ b/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-editor.qdoc @@ -279,6 +279,11 @@ \li Always Show Camera Frustums \li Toggles between always showing the camera frustum and showing it only for cameras selected in \uicontrol {3D Editor}. + \row + \li Always Show Particle Emitters and Attractors + \li Toggle between always showing the particle emitter and attractor + visualizations and only showing them when the emitter or attractor is + selected in \uicontrol {3D Editor}. \endtable \section1 Particle Editor diff --git a/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-particles.qdoc b/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-particles.qdoc index 7f81f8f2de4..6f768c6bd24 100644 --- a/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-particles.qdoc +++ b/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-particles.qdoc @@ -729,8 +729,9 @@ \l {Model Shape} component to use. The shape is scaled, positioned, and rotated based on the emitter node properties. When the shape \uicontrol Fill property is set to false, particles are emitted only from the surface of the - shape. When the shape is not defined, particles are emitted from the center - point of the emitter. + shape. When the shape is defined, it is visualized in + \uicontrol {3D Editor}. When the shape is not defined, particles are emitted + from the center point of the emitter. In \uicontrol {Life span}, specify the lifespan of a single particle in milliseconds. Specify variation in the particle lifespan in @@ -883,7 +884,8 @@ In \uicontrol Shape, select an instance of the \l {Particle Shape} or \l {Model Shape} component to attract particles into a random position - inside the shape. + inside the shape. When the shape is defined, it is visualized in + \uicontrol {3D Editor}. \uicontrol Duration specifies the duration in milliseconds that it takes for particles to reach the attraction position. When the value is -1, From a1929bd9d7d29223a4523d727510fd90a7ff57b4 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Fri, 4 Mar 2022 19:42:46 +0100 Subject: [PATCH 04/26] ClangCodeModel: Add some more timing debug information By setting QT_LOGGING_RULES=qtc.clangcodemodel.clangd.timing=true I can get values like: qtc.clangcodemodel.clangd.timing: highlighting: Start to end: 2953 ms qtc.clangcodemodel.clangd.timing: ClangdCompletionAssistProcessor took: 7343 ms The first tells you how long Creator took to turn clangd's semantic tokens into full highlighting info, and the second how long it took for Ctrl+Space. Change-Id: I99bd04c2889bb7da98c04537eab06d6ed6117167 Reviewed-by: Christian Kandeler --- src/plugins/clangcodemodel/clangdclient.cpp | 35 ++++++++++++++++----- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/src/plugins/clangcodemodel/clangdclient.cpp b/src/plugins/clangcodemodel/clangdclient.cpp index 894f22aaa92..6d343c62a2a 100644 --- a/src/plugins/clangcodemodel/clangdclient.cpp +++ b/src/plugins/clangcodemodel/clangdclient.cpp @@ -997,9 +997,12 @@ public: m_started = true; m_finalized = false; qCDebug(clangdLogTiming).noquote().nospace() << m_task << ": starting"; + + // Used by ThreadedSubtaskTimer to mark the end of the whole highlighting operation + m_startTimer.restart(); } qCDebug(clangdLogTiming).noquote().nospace() << m_task << ": subtask started at " - << QDateTime::currentDateTime().toString(); + << QDateTime::currentDateTime().time().toString("hh:mm:ss.zzz"); QTC_CHECK(!m_timer.isValid()); m_timer.start(); } @@ -1012,7 +1015,7 @@ public: if (--m_subtasks > 0) // See startSubtask(). return; qCDebug(clangdLogTiming).noquote().nospace() << m_task << ": subtask stopped at " - << QDateTime::currentDateTime().toString(); + << QDateTime::currentDateTime().time().toString("hh:mm:ss.zzz"); QTC_CHECK(m_timer.isValid()); m_elapsedMs += m_timer.elapsed(); m_timer.invalidate(); @@ -1020,9 +1023,12 @@ public: stopTask(); } + QElapsedTimer startTimer() const { return m_startTimer; } + private: const QString m_task; QElapsedTimer m_timer; + QElapsedTimer m_startTimer; qint64 m_elapsedMs = 0; int m_subtasks = 0; bool m_started = false; @@ -1052,7 +1058,7 @@ public: class ThreadedSubtaskTimer { public: - ThreadedSubtaskTimer(const QString &task) : m_task(task) + ThreadedSubtaskTimer(const QString &task, const TaskTimer &taskTimer) : m_task(task), m_taskTimer(taskTimer) { qCDebug(clangdLogTiming).noquote().nospace() << m_task << ": starting thread"; m_timer.start(); @@ -1062,10 +1068,15 @@ public: { qCDebug(clangdLogTiming).noquote().nospace() << m_task << ": took " << m_timer.elapsed() << " ms in dedicated thread"; + + qCDebug(clangdLogTiming).noquote().nospace() << m_task << ": Start to end: " + << m_taskTimer.startTimer().elapsed() << " ms"; } + private: const QString m_task; QElapsedTimer m_timer; + const TaskTimer &m_taskTimer; }; class MemoryTreeModel; @@ -1191,6 +1202,13 @@ public: : LanguageClientCompletionAssistProcessor(client, snippetsGroup) , m_client(client) { + m_timer.start(); + } + + ~ClangdCompletionAssistProcessor() + { + qCDebug(clangdLogTiming).noquote().nospace() + << "ClangdCompletionAssistProcessor took: " << m_timer.elapsed() << " ms"; } private: @@ -1208,6 +1226,7 @@ private: const QList &items) const override; ClangdClient * const m_client; + QElapsedTimer m_timer; }; QList @@ -2653,9 +2672,10 @@ static void semanticHighlighter(QFutureInterface &future, const QList &tokens, const QString &docContents, const AstNode &ast, const QPointer &textDocument, - int docRevision, const QVersionNumber &clangdVersion) + int docRevision, const QVersionNumber &clangdVersion, + const TaskTimer &taskTimer) { - ThreadedSubtaskTimer t("highlighting"); + ThreadedSubtaskTimer t("highlighting", taskTimer); if (future.isCanceled()) { future.reportFinished(); return; @@ -2921,9 +2941,10 @@ void ClangdClient::Private::handleSemanticTokens(TextDocument *doc, const auto runner = [tokens, filePath = doc->filePath(), text = doc->document()->toPlainText(), ast, doc = QPointer(doc), rev = doc->document()->revision(), - clangdVersion = q->versionNumber()] { + clangdVersion = q->versionNumber(), + this] { return Utils::runAsync(semanticHighlighter, filePath, tokens, text, ast, doc, rev, - clangdVersion); + clangdVersion, highlightingTimer); }; if (isTesting) { From fb1c6fbfe2aec9c10d71d08963157c9d78ec5640 Mon Sep 17 00:00:00 2001 From: Samuel Ghinet Date: Mon, 14 Mar 2022 14:43:18 +0200 Subject: [PATCH 05/26] Qds: New Project dialog in new Welcome screen should close on Esc Task-number: QDS-5697 Change-Id: I26f2e65bbb98b15b3867e0774a1bf8f78409b430 Reviewed-by: Miikka Heikkinen Reviewed-by: Mahmoud Badri --- src/plugins/studiowelcome/qdsnewdialog.cpp | 13 +++++++++++++ src/plugins/studiowelcome/qdsnewdialog.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/src/plugins/studiowelcome/qdsnewdialog.cpp b/src/plugins/studiowelcome/qdsnewdialog.cpp index 527204c80e8..943ca0be328 100644 --- a/src/plugins/studiowelcome/qdsnewdialog.cpp +++ b/src/plugins/studiowelcome/qdsnewdialog.cpp @@ -99,6 +99,8 @@ QdsNewDialog::QdsNewDialog(QWidget *parent) QObject::connect(&m_wizard, &WizardHandler::statusMessageChanged, this, &QdsNewDialog::onStatusMessageChanged); QObject::connect(&m_wizard, &WizardHandler::projectCanBeCreated, this, &QdsNewDialog::onProjectCanBeCreatedChanged); + m_dialog->installEventFilter(this); + QObject::connect(&m_wizard, &WizardHandler::wizardCreationFailed, this, [this]() { QMessageBox::critical(m_dialog, tr("New project"), tr("Failed to initialize data")); reject(); @@ -110,6 +112,17 @@ QdsNewDialog::QdsNewDialog(QWidget *parent) }); } +bool QdsNewDialog::eventFilter(QObject *obj, QEvent *event) +{ + if (obj == m_dialog && event->type() == QEvent::KeyPress + && static_cast(event)->key() == Qt::Key_Escape) { + reject(); + return true; + } + + return false; +} + void QdsNewDialog::onDeletingWizard() { m_screenSizeModel->setBackendModel(nullptr); diff --git a/src/plugins/studiowelcome/qdsnewdialog.h b/src/plugins/studiowelcome/qdsnewdialog.h index 670b39192d9..09a425c4996 100644 --- a/src/plugins/studiowelcome/qdsnewdialog.h +++ b/src/plugins/studiowelcome/qdsnewdialog.h @@ -42,6 +42,7 @@ class QStandardItemModel; QT_END_NAMESPACE namespace StudioWelcome { + class QdsNewDialog : public QObject, public Core::NewDialog { Q_OBJECT @@ -151,6 +152,7 @@ private: QString projectDescription() const { return m_qmlProjectDescription; } void updateScreenSizes(); + bool eventFilter(QObject *obj, QEvent *ev) override; private slots: void onDeletingWizard(); From 675875c3b4f1435509f94c8c7e8135660bb49e59 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 21 Mar 2022 10:47:44 +0100 Subject: [PATCH 06/26] QmlDesigner: Block more imports Change-Id: I839fb320df61bad0a39ff98e1274201f5a99a8ed Reviewed-by: Thomas Hartmann --- .../qmldesigner/studioplugin/studioplugin.metainfo | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmldesigner/studioplugin/studioplugin.metainfo b/src/plugins/qmldesigner/studioplugin/studioplugin.metainfo index aca27866ac4..207cdbb9773 100644 --- a/src/plugins/qmldesigner/studioplugin/studioplugin.metainfo +++ b/src/plugins/qmldesigner/studioplugin/studioplugin.metainfo @@ -26,7 +26,14 @@ MetaInfo { "QtQuick.Controls.Imagine", "QtQuick.Controls.Universal", "QtQuick.Controls.Material", - "QtQuick.Controls.NativeStyle" + "QtQuick.Controls.NativeStyle", + "QtQuick.NativeStyle", + "QtRemoteObjects", + "Qt5Compat.GraphicalEffects", + "QtQuick.Templates", + "QtQuick.Shapes", + "QtQuick.Studio.EventSystem", + "QtQuick.Studio.EventSimulator" ] showTagsForImports: [ From 638b93591be0b1ddad4b342c85071d8ac7a8f1fb Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Fri, 18 Mar 2022 13:57:44 +0100 Subject: [PATCH 07/26] QmlDesigner: Remove unrequired event filter This event filter was introduced because other wise actions in QML like CTRL+C or CTRL+UP were intercepted by QWidget::QAction. With Qt 6.2.x this workaround is not required anymore. Change-Id: I43a84ae13cca58840afacabe85c36c5f2235cf39 Reviewed-by: Mahmoud Badri Reviewed-by: Reviewed-by: Tim Jenssen Reviewed-by: Qt CI Bot Reviewed-by: Thomas Hartmann --- .../quick2propertyeditorview.cpp | 27 ------------------- .../propertyeditor/quick2propertyeditorview.h | 3 --- 2 files changed, 30 deletions(-) diff --git a/src/plugins/qmldesigner/components/propertyeditor/quick2propertyeditorview.cpp b/src/plugins/qmldesigner/components/propertyeditor/quick2propertyeditorview.cpp index 09450cdb7ca..35b74111d1e 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/quick2propertyeditorview.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/quick2propertyeditorview.cpp @@ -91,31 +91,4 @@ void Quick2PropertyEditorView::registerQmlTypes() } } -bool Quick2PropertyEditorView::event(QEvent *e) -{ - static std::vector overrideSequences = { QKeySequence(Qt::SHIFT + Qt::Key_Up), - QKeySequence(Qt::SHIFT + Qt::Key_Down), - QKeySequence(Qt::CTRL + Qt::Key_Up), - QKeySequence(Qt::CTRL + Qt::Key_Down) - }; - - if (e->type() == QEvent::ShortcutOverride) { - auto keyEvent = static_cast(e); - - static const Qt::KeyboardModifiers relevantModifiers = Qt::ShiftModifier - | Qt::ControlModifier - | Qt::AltModifier - | Qt::MetaModifier; - - QKeySequence keySqeuence(keyEvent->key() | (keyEvent->modifiers() & relevantModifiers)); - for (const QKeySequence &overrideSequence : overrideSequences) - if (keySqeuence.matches(overrideSequence)) { - keyEvent->accept(); - return true; - } - } - - return QQuickWidget::event(e); -} - } //QmlDesigner diff --git a/src/plugins/qmldesigner/components/propertyeditor/quick2propertyeditorview.h b/src/plugins/qmldesigner/components/propertyeditor/quick2propertyeditorview.h index c2c0ba9f36f..7bfc6f15580 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/quick2propertyeditorview.h +++ b/src/plugins/qmldesigner/components/propertyeditor/quick2propertyeditorview.h @@ -38,9 +38,6 @@ public: explicit Quick2PropertyEditorView(QWidget *parent = nullptr); static void registerQmlTypes(); - -protected: - bool event(QEvent *e) override; }; } //QmlDesigner From 137d3367cff2ca9e61d58599e1cf16bc5751589d Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 22 Mar 2022 11:13:27 +0100 Subject: [PATCH 08/26] CppEditor: Do not crash on doxygen comment creation ... for templates that were not parsed entirely successfully. Amends a437539096. Fixes: QTCREATORBUG-27207 Change-Id: I4d7935b30cac9ce14f442977d07417a343ecae11 Reviewed-by: Christian Stenger --- src/plugins/cppeditor/doxygengenerator.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/cppeditor/doxygengenerator.cpp b/src/plugins/cppeditor/doxygengenerator.cpp index 9ab9e109eb6..23d551afc87 100644 --- a/src/plugins/cppeditor/doxygengenerator.cpp +++ b/src/plugins/cppeditor/doxygengenerator.cpp @@ -141,8 +141,10 @@ QString DoxygenGenerator::generate(QTextCursor cursor, QString DoxygenGenerator::generate(QTextCursor cursor, DeclarationAST *decl) { - if (const TemplateDeclarationAST * const templDecl = decl->asTemplateDeclaration()) + if (const TemplateDeclarationAST * const templDecl = decl->asTemplateDeclaration(); + templDecl && templDecl->declaration) { decl = templDecl->declaration; + } SpecifierAST *spec = nullptr; DeclaratorAST *decltr = nullptr; From 2846bef563294226d71634167dfaa9271cf1c460 Mon Sep 17 00:00:00 2001 From: Assam Boudjelthia Date: Fri, 18 Mar 2022 18:25:42 +0200 Subject: [PATCH 09/26] Android: fix logcat retrieval on pre Android Nougat Logcat on pre Android Nougat (API <= 23) was broken because the the returned output from the adb command had lots of null characters \u0000 in the string, and thus the comparison against the deployed package name was failing and the pid was always -1. This makes sure to remove any null characters before the comparison and simplifies the code a bit. Task-number: QTBUG-101673 Fixes: QTCREATORBUG-26732 Change-Id: I3f185eceab376dbb0f4f11cf628b71e058ee5583 Reviewed-by: Alessandro Portale --- src/plugins/android/androidrunnerworker.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/plugins/android/androidrunnerworker.cpp b/src/plugins/android/androidrunnerworker.cpp index 2adc7eaa614..5da5d99ec27 100644 --- a/src/plugins/android/androidrunnerworker.cpp +++ b/src/plugins/android/androidrunnerworker.cpp @@ -88,18 +88,15 @@ static bool isTimedOut(const chrono::high_resolution_clock::time_point &start, return timedOut; } -static qint64 extractPID(const QByteArray &output, const QString &packageName) +static qint64 extractPID(const QString &output, const QString &packageName) { qint64 pid = -1; - foreach (auto tuple, output.split('\n')) { - tuple = tuple.simplified(); - if (!tuple.isEmpty()) { - auto parts = tuple.split(':'); - QString commandName = QString::fromLocal8Bit(parts.first()); - if (parts.length() == 2 && commandName == packageName) { - pid = parts.last().toLongLong(); - break; - } + for (const QString &tuple : output.split('\n')) { + // Make sure to remove null characters which might be present in the provided output + const QStringList parts = tuple.simplified().remove('\0').split(':'); + if (parts.length() == 2 && parts.first() == packageName) { + pid = parts.last().toLongLong(); + break; } } return pid; @@ -126,7 +123,7 @@ static void findProcessPID(QFutureInterface &fi, QStringList selector, QtcProcess proc; proc.setCommand({adbPath, args}); proc.runBlocking(); - const QByteArray out = proc.allRawOutput(); + const QString out = proc.allOutput(); if (preNougat) { processPID = extractPID(out, packageName); } else { From 70c44acdd88efdff3e51eede3f2ce00faf26a028 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 22 Mar 2022 10:04:04 +0100 Subject: [PATCH 10/26] QmlDesigner: Fix itemlibrary template generation Since this is likely executed in a transaction and newQmlObjectNode.setId() uses refactoring on the QML code this is not working as expected. Setting the id without any refactoring, that triggers changes of the QML code, is save to be used. Change-Id: I5d29689eff34827de9e451f433d9a4b42569a64e Reviewed-by: Miikka Heikkinen Reviewed-by: Mahmoud Badri --- src/plugins/qmldesigner/designercore/model/qmlvisualnode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/qmldesigner/designercore/model/qmlvisualnode.cpp b/src/plugins/qmldesigner/designercore/model/qmlvisualnode.cpp index d6f417407c1..f8044fd6da1 100644 --- a/src/plugins/qmldesigner/designercore/model/qmlvisualnode.cpp +++ b/src/plugins/qmldesigner/designercore/model/qmlvisualnode.cpp @@ -335,7 +335,7 @@ QmlObjectNode QmlVisualNode::createQmlObjectNode(AbstractView *view, if (!newQmlObjectNode.isValid()) return; - newQmlObjectNode.setId(view->model()->generateNewId(itemLibraryEntry.name())); + newQmlObjectNode.modelNode().setIdWithoutRefactoring(view->model()->generateNewId(itemLibraryEntry.name())); for (const auto &propertyBindingEntry : propertyBindingList) newQmlObjectNode.modelNode().bindingProperty(propertyBindingEntry.first).setExpression(propertyBindingEntry.second); From 22c67db406ec02d42e34dc182741ad473ba714fb Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 21 Mar 2022 15:52:35 +0100 Subject: [PATCH 11/26] Fix double-clicking in Projects view to open file in extra window When you have an external editor window open (Window > Open in New Window): - make sure that the editor has focus in the main window - switch to the external window - double-click a file in Projects, Open Documents, or File System view The file is supposed to open in the external window. The problem is that clicking into e.g. Projects view activates the main window, which changes focus, and the current editor. Something changed in the event order in Qt (also Qt 5), so the existing workaround that delayed setting the current editor view in that case by just one event loop cycle doesn't work anymore. Delay be the double- click interval instead, so the double-click can be processed before the main window's editor view is made current. Fixes: QTCREATORBUG-26773 Change-Id: I56efd5a50a8bb986563c8c15d340756dace06494 Reviewed-by: Reviewed-by: Christian Stenger --- src/plugins/coreplugin/editormanager/editormanager.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 150d5d957b2..60a81aa027e 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -2395,8 +2395,9 @@ void EditorManagerPrivate::handleContextChange(const QList &context) // the locator line edit) first activates the window and sets focus to its focus widget. // Only afterwards the focus is shifted to the widget that received the click. d->m_scheduledCurrentEditor = editor; - QMetaObject::invokeMethod(d, &EditorManagerPrivate::setCurrentEditorFromContextChange, - Qt::QueuedConnection); + QTimer::singleShot(QApplication::doubleClickInterval() + 10, + d, + &EditorManagerPrivate::setCurrentEditorFromContextChange); } else { updateActions(); } From 9c5f390aa8dae73a6bcaa26d0d9dd205ed6db9a5 Mon Sep 17 00:00:00 2001 From: Samuel Ghinet Date: Tue, 22 Mar 2022 13:00:20 +0200 Subject: [PATCH 12/26] Qds Project Wizard fix: cannot select style This bug was caused by QDS-5741: Use hover states for interactive items Task-number: QDS-6470 Change-Id: Ice12374257645e39a6c488c30ab584636ba52e9a Reviewed-by: Mahmoud Badri Reviewed-by: Miikka Heikkinen --- .../imports/NewProjectDialog/Styles.qml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/Styles.qml b/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/Styles.qml index 2f8da50c6c3..5e1a25cb9d0 100644 --- a/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/Styles.qml +++ b/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/Styles.qml @@ -140,6 +140,7 @@ Item { id: delegateId width: stylesList.width height: DialogValues.styleListItemHeight + hoverEnabled: true onClicked: stylesList.currentIndex = index @@ -161,13 +162,13 @@ Item { height: DialogValues.styleImageHeight + 2 * DialogValues.styleImageBorderWidth - border.color: itemRectMouseArea.containsMouse + border.color: delegateId.hovered ? DialogValues.textColor : (index === stylesList.currentIndex ? DialogValues.textColorInteraction : "transparent") - border.width: index === stylesList.currentIndex || itemRectMouseArea.containsMouse + border.width: index === stylesList.currentIndex || delegateId.hovered ? DialogValues.styleImageBorderWidth : 0 @@ -182,12 +183,6 @@ Item { asynchronous: false source: "image://newprojectdialog_library/" + BackendApi.styleModel.iconId(model.index) } - - MouseArea { - id: itemRectMouseArea - anchors.fill: parent - hoverEnabled: true - } } // Rectangle Text { From 635d6bab0fb28251a02cb8da4fd7ea320c5a52d4 Mon Sep 17 00:00:00 2001 From: Samuel Ghinet Date: Tue, 22 Mar 2022 15:11:30 +0200 Subject: [PATCH 13/26] QDS New Project dialog: Rename NewProjectView.qml to PresetView.qml Change-Id: I5f129a53404bfb80e3e11f9d73754674f3693952 Reviewed-by: Miikka Heikkinen Reviewed-by: Mahmoud Badri --- .../qtcreator/qmldesigner/newprojectdialog/NewProjectDialog.qml | 2 +- .../NewProjectDialog/{NewProjectView.qml => PresetView.qml} | 0 .../newprojectdialog/imports/NewProjectDialog/qmldir | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/{NewProjectView.qml => PresetView.qml} (100%) diff --git a/share/qtcreator/qmldesigner/newprojectdialog/NewProjectDialog.qml b/share/qtcreator/qmldesigner/newprojectdialog/NewProjectDialog.qml index f895cdd8c40..0ce7e633022 100644 --- a/share/qtcreator/qmldesigner/newprojectdialog/NewProjectDialog.qml +++ b/share/qtcreator/qmldesigner/newprojectdialog/NewProjectDialog.qml @@ -265,7 +265,7 @@ Item { anchors.fill: parent anchors.margins: DialogValues.gridMargins - NewProjectView { + PresetView { id: presetView anchors.fill: parent diff --git a/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/NewProjectView.qml b/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/PresetView.qml similarity index 100% rename from share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/NewProjectView.qml rename to share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/PresetView.qml diff --git a/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/qmldir b/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/qmldir index 996b9ec3561..2cabd989f34 100644 --- a/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/qmldir +++ b/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/qmldir @@ -3,5 +3,5 @@ PopupDialogButton 1.0 PopupDialogButton.qml PopupDialogButtonBox 1.0 PopupDialogButtonBox.qml Details 1.0 Details.qml singleton DialogValues 1.0 DialogValues.qml -NewProjectView 1.0 NewProjectView.qml +PresetView 1.0 PresetView.qml Styles 1.0 Styles.qml From fe711ebce43d389157cf68d0c42fb0ab06270533 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 22 Mar 2022 10:01:55 +0100 Subject: [PATCH 14/26] QmlDesigner: Parse .metainfo files from the share folder We have some plugins that essentially only contain a .metainfo file. the possibility to drop .metainfo files into that folder simplifies things. In QDS 3.2 this will be used for the particle library. Change-Id: I0c4bb7f66bb8eaa3f806ec9d34c6991d08ef5a5f Reviewed-by: Thomas Hartmann --- .../designercore/metainfo/metainfo.cpp | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/src/plugins/qmldesigner/designercore/metainfo/metainfo.cpp b/src/plugins/qmldesigner/designercore/metainfo/metainfo.cpp index c49a8c5035b..322adb7b4cf 100644 --- a/src/plugins/qmldesigner/designercore/metainfo/metainfo.cpp +++ b/src/plugins/qmldesigner/designercore/metainfo/metainfo.cpp @@ -30,10 +30,16 @@ #include "iwidgetplugin.h" #include +#include + +#include + #include "pluginmanager/widgetpluginmanager.h" #include #include +#include +#include #include enum { @@ -43,6 +49,30 @@ enum { namespace QmlDesigner { namespace Internal { + +static QString globalMetaInfoPath() +{ +#ifdef SHARE_QML_PATH + if (qEnvironmentVariableIsSet("LOAD_QML_FROM_SOURCE")) + return QLatin1String(SHARE_QML_PATH) + "/globalMetaInfo"; +#endif + return Core::ICore::resourcePath("qmldesigner/globalMetaInfo").toString(); +} + +Utils::FilePaths allGlobalMetaInfoFiles() +{ + static Utils::FilePaths paths; + + if (!paths.isEmpty()) + return paths; + + QDirIterator it(globalMetaInfoPath(), { "*.metainfo" }, QDir::Files, QDirIterator::Subdirectories); + while (it.hasNext()) + paths.append(Utils::FilePath::fromString(it.next())); + + return paths; +} + class MetaInfoPrivate { Q_DISABLE_COPY(MetaInfoPrivate) @@ -99,6 +129,19 @@ void MetaInfoPrivate::parseItemLibraryDescriptions() errorMessage); } } + + const Utils::FilePaths allMetaInfoFiles = allGlobalMetaInfoFiles(); + for (const Utils::FilePath &path : allMetaInfoFiles) { + Internal::MetaInfoReader reader(*m_q); + try { + reader.readMetaInfoFile(path.toString()); + } catch (const InvalidMetaInfoException &e) { + qWarning() << e.description(); + const QString errorMessage = path.toString() + QLatin1Char('\n') + QLatin1Char('\n') + reader.errors().join(QLatin1Char('\n')); + Core::AsynchronousMessageBox::warning(QCoreApplication::translate("QmlDesigner::Internal::MetaInfoPrivate", "Invalid meta info"), + errorMessage); + } + } #endif } From 0c7ec14c626ce6b5b33f49988e32b77848403920 Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Tue, 22 Mar 2022 16:01:10 +0100 Subject: [PATCH 15/26] QmlDesigner: Fix WindowSpecifics for Qt6 * Duplicate WindowSpecifics.qml and move it to QtQuick referencing the original from QtQuick/Window as the import changed in Qt6 * Add missing properties to the original specifics: position, minimumWidth, minimumHeight, maximumWidth, maximumHeight, contentOrientation, flags, modality, visibility Change-Id: I542f94b153172d4c7b5a2c62ad0abdc53b8bd1fd Reviewed-by: Reviewed-by: Thomas Hartmann --- .../QtQuick/Window/WindowSpecifics.qml | 432 ++++++++++++++++++ .../QtQuick/WindowSpecifics.qml | 29 ++ 2 files changed, 461 insertions(+) create mode 100644 share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/WindowSpecifics.qml diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Window/WindowSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Window/WindowSpecifics.qml index 0e2e086a819..a5b73b9e39f 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Window/WindowSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Window/WindowSpecifics.qml @@ -26,6 +26,7 @@ import QtQuick 2.15 import QtQuick.Layouts 1.15 import HelperWidgets 2.0 +import StudioControls 1.0 as StudioControls import StudioTheme 1.0 as StudioTheme Section { @@ -47,6 +48,40 @@ Section { ExpandingSpacer {} } + PropertyLabel { text: qsTr("Position") } + + SecondColumnLayout { + SpinBox { + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + backendValue: backendValues.x + maximumValue: 0xffff + minimumValue: -0xffff + decimals: 0 + } + + Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } + + ControlLabel { text: "X" } + + Spacer { implicitWidth: StudioTheme.Values.controlGap } + + SpinBox { + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + backendValue: backendValues.y + maximumValue: 0xffff + minimumValue: -0xffff + decimals: 0 + } + + Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } + + ControlLabel { text: "Y" } + + ExpandingSpacer {} + } + PropertyLabel { text: qsTr("Size") } SecondColumnLayout { @@ -87,6 +122,92 @@ Section { ExpandingSpacer {} } + PropertyLabel { + text: qsTr("Minimum size") + tooltip: qsTr("Minimum size of the window.") + } + + SecondColumnLayout { + SpinBox { + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + backendValue: backendValues.minimumWidth + minimumValue: 0 + maximumValue: 0xffff + decimals: 0 + } + + Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } + + ControlLabel { + //: The width of the object + text: qsTr("W", "width") + } + + Spacer { implicitWidth: StudioTheme.Values.controlGap } + + SpinBox { + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + backendValue: backendValues.minimumHeight + minimumValue: 0 + maximumValue: 0xffff + decimals: 0 + } + + Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } + + ControlLabel { + //: The height of the object + text: qsTr("H", "height") + } + + ExpandingSpacer {} + } + + PropertyLabel { + text: qsTr("Maximum size") + tooltip: qsTr("Maximum size of the window.") + } + + SecondColumnLayout { + SpinBox { + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + backendValue: backendValues.maximumWidth + minimumValue: 0 + maximumValue: 0xffff + decimals: 0 + } + + Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } + + ControlLabel { + //: The width of the object + text: qsTr("W", "width") + } + + Spacer { implicitWidth: StudioTheme.Values.controlGap } + + SpinBox { + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + backendValue: backendValues.maximumHeight + minimumValue: 0 + maximumValue: 0xffff + decimals: 0 + } + + Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } + + ControlLabel { + //: The height of the object + text: qsTr("H", "height") + } + + ExpandingSpacer {} + } + PropertyLabel { text: qsTr("Color") } ColorEditor { @@ -122,5 +243,316 @@ Section { ExpandingSpacer {} } + + PropertyLabel { text: qsTr("Content orientation") } + + SecondColumnLayout { + StudioControls.ComboBox { + id: contentOrientationComboBox + + property bool __isCompleted: false + + property variant backendValue: backendValues.contentOrientation + property variant valueFromBackend: contentOrientationComboBox.backendValue?.value ?? 0 + property bool isInModel: contentOrientationComboBox.backendValue?.isInModel ?? false + property bool isInSubState: contentOrientationComboBox.backendValue?.isInSubState ?? false + property bool block: false + + onIsInModelChanged: contentOrientationComboBox.evaluateValue() + onIsInSubStateChanged: contentOrientationComboBox.evaluateValue() + onBackendValueChanged: contentOrientationComboBox.evaluateValue() + onValueFromBackendChanged: contentOrientationComboBox.evaluateValue() + + Connections { + target: modelNodeBackend + function onSelectionChanged() { contentOrientationComboBox.evaluateValue() } + } + + function indexOfContentOrientation() { + if (contentOrientationComboBox.backendValue === undefined + || contentOrientationComboBox.backendValue.expression === undefined) + return 0 + + let value = contentOrientationComboBox.backendValue.expression + + if (value.indexOf("PrimaryOrientation") !== -1) return 0 + if (value.indexOf("LandscapeOrientation") !== -1) return 1 + if (value.indexOf("PortraitOrientation") !== -1) return 2 + if (value.indexOf("InvertedLandscapeOrientation") !== -1) return 3 + if (value.indexOf("InvertedPortraitOrientation") !== -1) return 4 + + return 0 + } + + function evaluateValue() { + contentOrientationComboBox.block = true + contentOrientationComboBox.currentIndex = indexOfContentOrientation() + contentOrientationComboBox.block = false + } + + implicitWidth: StudioTheme.Values.singleControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + width: implicitWidth + labelColor: contentOrientationComboBox.currentIndex === 0 + ? contentOrientationColorLogic.__defaultTextColor + : contentOrientationColorLogic.__changedTextColor + model: ["PrimaryOrientation", "LandscapeOrientation", "PortraitOrientation", + "InvertedLandscapeOrientation", "InvertedPortraitOrientation"] + + ColorLogic { id: contentOrientationColorLogic } + + actionIndicator.icon.color: contentOrientationExtFuncLogic.color + actionIndicator.icon.text: contentOrientationExtFuncLogic.glyph + actionIndicator.onClicked: contentOrientationExtFuncLogic.show() + actionIndicator.forceVisible: contentOrientationExtFuncLogic.menuVisible + actionIndicator.visible: true + + ExtendedFunctionLogic { + id: contentOrientationExtFuncLogic + backendValue: backendValues.contentOrientation + onReseted: contentOrientationComboBox.currentIndex = 0 + } + + onActivated: function(index) { + if (!contentOrientationComboBox.__isCompleted) + return + + contentOrientationComboBox.currentIndex = index + contentOrientationComboBox.composeExpressionString() + } + + function composeExpressionString() { + if (contentOrientationComboBox.block) + return + + var expressionStr = "" + if (contentOrientationComboBox.currentIndex !== 0) { + expressionStr = "Qt." + contentOrientationComboBox.currentText + contentOrientationComboBox.backendValue.expression = expressionStr + } + } + + Component.onCompleted: { + contentOrientationComboBox.evaluateValue() + contentOrientationComboBox.__isCompleted = true + } + } + + ExpandingSpacer {} + } + + PropertyLabel { text: qsTr("Flags") } + + SecondColumnLayout { + StudioControls.ComboBox { + id: flagsComboBox + + property bool __isCompleted: false + + property variant backendValue: backendValues.flags + property variant valueFromBackend: flagsComboBox.backendValue?.value ?? 0 + property bool isInModel: flagsComboBox.backendValue?.isInModel ?? false + property bool isInSubState: flagsComboBox.backendValue?.isInSubState ?? false + property bool block: false + + onIsInModelChanged: flagsComboBox.evaluateValue() + onIsInSubStateChanged: flagsComboBox.evaluateValue() + onBackendValueChanged: flagsComboBox.evaluateValue() + onValueFromBackendChanged: flagsComboBox.evaluateValue() + + Connections { + target: modelNodeBackend + function onSelectionChanged() { flagsComboBox.evaluateValue() } + } + + function indexOfFlags() { + if (flagsComboBox.backendValue === undefined + || flagsComboBox.backendValue.expression === undefined) + return 0 + + let value = flagsComboBox.backendValue.expression + + if (value.indexOf("Widget") !== -1) return 0 + if (value.indexOf("Window") !== -1) return 1 + if (value.indexOf("Dialog") !== -1) return 2 + if (value.indexOf("Sheet") !== -1) return 3 + if (value.indexOf("Drawer") !== -1) return 4 + if (value.indexOf("Popup") !== -1) return 5 + if (value.indexOf("Tool") !== -1) return 6 + if (value.indexOf("ToolTip") !== -1) return 7 + if (value.indexOf("SplashScreen") !== -1) return 8 + if (value.indexOf("Desktop") !== -1) return 9 + if (value.indexOf("SubWindow") !== -1) return 10 + if (value.indexOf("ForeignWindow") !== -1) return 11 + if (value.indexOf("CoverWindow") !== -1) return 12 + + return 0 + } + + function evaluateValue() { + flagsComboBox.block = true + flagsComboBox.currentIndex = indexOfFlags() + flagsComboBox.block = false + } + + implicitWidth: StudioTheme.Values.singleControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + width: implicitWidth + labelColor: flagsComboBox.currentIndex === 0 ? flagsColorLogic.__defaultTextColor + : flagsColorLogic.__changedTextColor + model: ["Widget", "Window", "Dialog", "Sheet", "Drawer", "Popup", "Tool", "ToolTip", + "SplashScreen", "Desktop", "SubWindow", "ForeignWindow", "CoverWindow"] + + ColorLogic { id: flagsColorLogic } + + actionIndicator.icon.color: flagsExtFuncLogic.color + actionIndicator.icon.text: flagsExtFuncLogic.glyph + actionIndicator.onClicked: flagsExtFuncLogic.show() + actionIndicator.forceVisible: flagsExtFuncLogic.menuVisible + actionIndicator.visible: true + + ExtendedFunctionLogic { + id: flagsExtFuncLogic + backendValue: backendValues.flags + onReseted: flagsComboBox.currentIndex = 0 + } + + onActivated: function(index) { + if (!flagsComboBox.__isCompleted) + return + + flagsComboBox.currentIndex = index + flagsComboBox.composeExpressionString() + } + + function composeExpressionString() { + if (flagsComboBox.block) + return + + var expressionStr = "" + if (flagsComboBox.currentIndex !== 0) { + expressionStr = "Qt." + flagsComboBox.currentText + flagsComboBox.backendValue.expression = expressionStr + } + } + + Component.onCompleted: { + flagsComboBox.evaluateValue() + flagsComboBox.__isCompleted = true + } + } + + ExpandingSpacer {} + } + + PropertyLabel { text: qsTr("Modality") } + + SecondColumnLayout { + StudioControls.ComboBox { + id: modalityComboBox + + property bool __isCompleted: false + + property variant backendValue: backendValues.modality + property variant valueFromBackend: modalityComboBox.backendValue?.value ?? 0 + property bool isInModel: modalityComboBox.backendValue?.isInModel ?? false + property bool isInSubState: modalityComboBox.backendValue?.isInSubState ?? false + property bool block: false + + onIsInModelChanged: modalityComboBox.evaluateValue() + onIsInSubStateChanged: modalityComboBox.evaluateValue() + onBackendValueChanged: modalityComboBox.evaluateValue() + onValueFromBackendChanged: modalityComboBox.evaluateValue() + + Connections { + target: modelNodeBackend + function onSelectionChanged() { modalityComboBox.evaluateValue() } + } + + function indexOfModality() { + if (modalityComboBox.backendValue === undefined + || modalityComboBox.backendValue.expression === undefined) + return 0 + + let value = modalityComboBox.backendValue.expression + + if (value.indexOf("NonModal") !== -1) return 0 + if (value.indexOf("WindowModal") !== -1) return 1 + if (value.indexOf("ApplicationModal") !== -1) return 2 + + return 0 + } + + function evaluateValue() { + modalityComboBox.block = true + modalityComboBox.currentIndex = indexOfModality() + modalityComboBox.block = false + } + + implicitWidth: StudioTheme.Values.singleControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + width: implicitWidth + labelColor: modalityComboBox.currentIndex === 0 + ? modalityColorLogic.__defaultTextColor + : modalityColorLogic.__changedTextColor + model: ["NonModal", "WindowModal", "ApplicationModal"] + + ColorLogic { id: modalityColorLogic } + + actionIndicator.icon.color: modalityExtFuncLogic.color + actionIndicator.icon.text: modalityExtFuncLogic.glyph + actionIndicator.onClicked: modalityExtFuncLogic.show() + actionIndicator.forceVisible: modalityExtFuncLogic.menuVisible + actionIndicator.visible: true + + ExtendedFunctionLogic { + id: modalityExtFuncLogic + backendValue: backendValues.modality + onReseted: modalityComboBox.currentIndex = 0 + } + + onActivated: function(index) { + if (!modalityComboBox.__isCompleted) + return + + modalityComboBox.currentIndex = index + modalityComboBox.composeExpressionString() + } + + function composeExpressionString() { + if (modalityComboBox.block) + return + + var expressionStr = "" + if (modalityComboBox.currentIndex !== 0) { + expressionStr = "Qt." + modalityComboBox.currentText + modalityComboBox.backendValue.expression = expressionStr + } + } + + Component.onCompleted: { + modalityComboBox.evaluateValue() + modalityComboBox.__isCompleted = true + } + } + + ExpandingSpacer {} + } + + PropertyLabel { text: qsTr("Visibility") } + + SecondColumnLayout { + ComboBox { + scope: "Window" + model: ["AutomaticVisibility", "Windowed", "Minimized", "Maximized", "FullScreen", + "Hidden"] + backendValue: backendValues.visibility + enabled: backendValues.visibility.isAvailable + implicitWidth: StudioTheme.Values.singleControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + } + + ExpandingSpacer {} + } } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/WindowSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/WindowSpecifics.qml new file mode 100644 index 00000000000..56c45ef14d9 --- /dev/null +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/WindowSpecifics.qml @@ -0,0 +1,29 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +import QtQuick 2.15 +import "Window" as Original + +Original.WindowSpecifics {} From f14c9d88e13b921e184243f23ae426dc5dc87c37 Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Tue, 22 Mar 2022 17:40:03 +0100 Subject: [PATCH 16/26] QmlDesigner: Add placeholder functionality Add placeholder functionality to StudioControls TextField Change-Id: I2a6659a40effbc04c42d80a218c0bd70e0b3343f Reviewed-by: Thomas Hartmann --- .../imports/StudioControls/TextField.qml | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TextField.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TextField.qml index ea58bd71958..cd2fbf7f722 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TextField.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TextField.qml @@ -54,6 +54,7 @@ T.TextField { color: StudioTheme.Values.themeTextColor selectionColor: StudioTheme.Values.themeTextSelectionColor selectedTextColor: StudioTheme.Values.themeTextSelectedTextColor + placeholderTextColor: StudioTheme.Values.themePlaceholderTextColor readOnly: false selectByMouse: true @@ -107,6 +108,23 @@ T.TextField { height: actionIndicator.visible ? myTextField.__actionIndicatorHeight : 0 } + Text { + id: placeholder + x: myTextField.leftPadding + y: myTextField.topPadding + width: myTextField.width - (myTextField.leftPadding + myTextField.rightPadding) + height: myTextField.height - (myTextField.topPadding + myTextField.bottomPadding) + + text: myTextField.placeholderText + font: myTextField.font + color: myTextField.placeholderTextColor + verticalAlignment: myTextField.verticalAlignment + visible: !myTextField.length && !myTextField.preeditText + && (!myTextField.activeFocus || myTextField.horizontalAlignment !== Qt.AlignHCenter) + elide: Text.ElideRight + renderType: myTextField.renderType + } + background: Rectangle { id: textFieldBackground color: StudioTheme.Values.themeControlBackground @@ -138,6 +156,7 @@ T.TextField { PropertyChanges { target: myTextField color: StudioTheme.Values.themeTextColor + placeholderTextColor: StudioTheme.Values.themePlaceholderTextColor } PropertyChanges { target: mouseArea @@ -156,6 +175,7 @@ T.TextField { PropertyChanges { target: myTextField color: StudioTheme.Values.themeTextColor + placeholderTextColor: StudioTheme.Values.themePlaceholderTextColor } }, State { @@ -170,6 +190,7 @@ T.TextField { PropertyChanges { target: myTextField color: StudioTheme.Values.themeTextColor + placeholderTextColor: StudioTheme.Values.themePlaceholderTextColor } }, State { @@ -183,6 +204,7 @@ T.TextField { PropertyChanges { target: myTextField color: StudioTheme.Values.themeTextColor + placeholderTextColor: StudioTheme.Values.themePlaceholderTextColorInteraction } PropertyChanges { target: mouseArea @@ -200,6 +222,7 @@ T.TextField { PropertyChanges { target: myTextField color: StudioTheme.Values.themeTextColorDisabled + placeholderTextColor: StudioTheme.Values.themeTextColorDisabled } } ] From e33150d7b23c10b8c26c6e3d24ca7957ae4a5522 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 22 Mar 2022 18:00:55 +0100 Subject: [PATCH 17/26] QmlDesigner: Fix DirectoryFontLoader It was not using the new folder structure. Change-Id: I9ab87ac32dfce203defe7c914f3091121bb6f549 Reviewed-by: Thomas Hartmann --- .../projects/shared-plugin/name/DirectoryFontLoader.qml.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/DirectoryFontLoader.qml.tpl b/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/DirectoryFontLoader.qml.tpl index cf580f1b79f..600d74fecc5 100644 --- a/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/DirectoryFontLoader.qml.tpl +++ b/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/DirectoryFontLoader.qml.tpl @@ -33,7 +33,7 @@ import Qt.labs.folderlistmodel %{QtQuickVersion} QtObject { id: loader - property url fontDirectory: Qt.resolvedUrl("../../" + relativeFontDirectory) + property url fontDirectory: Qt.resolvedUrl("../../content/" + relativeFontDirectory) property string relativeFontDirectory: "fonts" function loadFont(url) { From 0f7a4484d0c11a3cbd51435aaff70719d0eeee61 Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Tue, 22 Mar 2022 17:34:09 +0100 Subject: [PATCH 18/26] qds: disable crashpad with universal builds Change-Id: Iafb1264bfc6b669fd327b052d39ae97c12e329b4 Reviewed-by: Tim Jenssen --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4da4284a495..d2359e6a21c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,7 +89,9 @@ endif() # Crashpad set(CRASHPAD_BACKEND_URL "" CACHE STRING "Crashpad backend URL") set(BUILD_WITH_CRASHPAD OFF) -if(CRASHPAD_BACKEND_URL AND (WIN32 OR APPLE)) # Linux is not supported for now +# Linux is not supported for now +# x86_64;arm64 is not supported for now +if(CRASHPAD_BACKEND_URL AND (WIN32 OR (APPLE AND NOT "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64;arm64"))) find_package(Crashpad QUIET) if(TARGET Crashpad::Crashpad) set(BUILD_WITH_CRASHPAD ON) From 34b94d8cd2da2f06020d54319545493c0abfe3f1 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 22 Mar 2022 14:00:36 +0100 Subject: [PATCH 19/26] Squish: Update Welcome page test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I447addcba50e932886a8ed5e730a1eab663a2224 Reviewed-by: Robert Löhning --- tests/system/shared/welcome.py | 8 ++++---- tests/system/suite_WELP/tst_WELP01/test.py | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/system/shared/welcome.py b/tests/system/shared/welcome.py index cb11074b878..b69a28b5da8 100644 --- a/tests/system/shared/welcome.py +++ b/tests/system/shared/welcome.py @@ -46,10 +46,10 @@ def getWelcomeScreenSideBarButton(buttonLabel, isUrlButton = False): "unnamed='1'}") return __getWelcomeScreenButtonHelper__(buttonLabel, sideBar, isUrlButton) -def getWelcomeScreenMainButton(buttonLabel): - stackedWidget = waitForObject(":Qt Creator.WelcomeScreenStackedWidget") - currentStackWidget = stackedWidget.currentWidget() - return __getWelcomeScreenButtonHelper__(buttonLabel, currentStackWidget) +def getWelcomeScreenBottomButton(buttonLabel): + bottomArea = waitForObject("{type='Welcome::Internal::BottomArea' unnamed='1' " + "window=':Qt Creator_Core::Internal::MainWindow'}") + return __getWelcomeScreenButtonHelper__(buttonLabel, bottomArea, False) def getWelcomeTreeView(treeViewLabel): try: diff --git a/tests/system/suite_WELP/tst_WELP01/test.py b/tests/system/suite_WELP/tst_WELP01/test.py index c3b7c220897..1d8eb312c21 100755 --- a/tests/system/suite_WELP/tst_WELP01/test.py +++ b/tests/system/suite_WELP/tst_WELP01/test.py @@ -25,7 +25,7 @@ source("../../shared/qtcreator.py") -getStarted = 'Get Started Now' +getStarted = 'Get Started' def clickItemVerifyHelpCombo(button, expectedHelpComboRegex, testDetails): global getStarted @@ -41,7 +41,7 @@ def clickItemVerifyHelpCombo(button, expectedHelpComboRegex, testDetails): "Verifying: '%s' button is being displayed." % getStarted) def buttonActive(button): # colors of the default theme for active button on Welcome page - (activeRed, activeGreen, activeBlue) = (64, 65, 66) + (activeRed, activeGreen, activeBlue) = (69, 206, 85) # QPalette::Window (used background color of Welcome page buttons) enumQPaletteWindow = 10 color = button.palette.color(enumQPaletteWindow) @@ -92,8 +92,8 @@ def main(): # select Projects and roughly check this switchToSubMode('Projects') - for button in ['New', 'Open']: - wsButtonFrame, wsButtonLabel = getWelcomeScreenMainButton(button) + for button in ['Create Project...', 'Open Project...']: + wsButtonFrame, wsButtonLabel = getWelcomeScreenSideBarButton(button) if test.verify(all((wsButtonFrame, wsButtonLabel)), "Verified whether '%s' button is shown." % button): test.verify(not buttonActive(wsButtonFrame), @@ -111,7 +111,7 @@ def main(): 'User Guide':'qthelp://org.qt-project.qtcreator/doc/index.html' } for text, url in textUrls.items(): - button, label = getWelcomeScreenSideBarButton(text, True) + button, label = getWelcomeScreenBottomButton(text) if test.verify(all((button, label)), "Verifying whether link button (%s) exists." % text): test.compare(str(button.toolTip), url, "Verifying URL for %s" % text) @@ -135,7 +135,7 @@ def main(): switchToSubMode('Examples') test.verify(waitForButtonsState(False, True, False), "Buttons' states have changed.") - expect = (("QTableView", "unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'", + expect = (("QListView", "unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'", "examples list"), ("QLineEdit", "placeholderText='Search in Examples...'", "examples search line edit"), ("QComboBox", "currentText~='.*Qt.*'", "Qt version combo box")) @@ -149,7 +149,7 @@ def main(): # select Tutorials and roughly check them switchToSubMode('Tutorials') test.verify(waitForButtonsState(False, False, True), "Buttons' states have changed.") - expect = (("QTableView", "unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'", + expect = (("QListView", "unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'", "tutorials list"), ("QLineEdit", "placeholderText='Search in Tutorials...'", "tutorials search line edit")) From 4ed637d8da4170a62184428a56675c7551cdfecc Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 22 Mar 2022 18:01:43 +0100 Subject: [PATCH 20/26] QmlDesigner: Do not allow baseState as id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using this as id will lead to bugs. Change-Id: I76997a31e290e0cd67688fecdb1e9521c88481da Reviewed-by: Henning Gründl --- src/plugins/qmldesigner/designercore/model/modelnode.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmldesigner/designercore/model/modelnode.cpp b/src/plugins/qmldesigner/designercore/model/modelnode.cpp index c6851548759..fe3d0cf1e1b 100644 --- a/src/plugins/qmldesigner/designercore/model/modelnode.cpp +++ b/src/plugins/qmldesigner/designercore/model/modelnode.cpp @@ -196,7 +196,8 @@ static bool isIdToAvoid(const QString& id) "texture", "shaderInfo", "sprite", - "spriteSequence" + "spriteSequence", + "baseState" }; return ids.contains(id); From 6662e138d7f7425339a5e7346425a116e5aa933f Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 22 Mar 2022 18:03:21 +0100 Subject: [PATCH 21/26] QmlDesigner: Remove finishedNotify It is not used anymore. Change-Id: I706a973c55c22211457bac01534a5e7b59a40b25 Reviewed-by: Reviewed-by: Qt CI Bot Reviewed-by: Mahmoud Badri --- .../components/propertyeditor/propertyeditorview.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp index fb5d0c6861e..75681f6468d 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp @@ -119,18 +119,13 @@ void PropertyEditorView::setupPane(const TypeName &typeName) if (!qmlBackend) { qmlBackend = new PropertyEditorQmlBackend(this); - qmlBackend->context()->setContextProperty("finishedNotify", QVariant(false) ); qmlBackend->initialSetup(typeName, qmlSpecificsFile, this); qmlBackend->setSource(qmlFile); - qmlBackend->context()->setContextProperty("finishedNotify", QVariant(true) ); m_stackedWidget->addWidget(qmlBackend->widget()); m_qmlBackendHash.insert(qmlFile.toString(), qmlBackend); } else { - qmlBackend->context()->setContextProperty("finishedNotify", QVariant(false) ); - qmlBackend->initialSetup(typeName, qmlSpecificsFile, this); - qmlBackend->context()->setContextProperty("finishedNotify", QVariant(true) ); } } @@ -499,14 +494,13 @@ void PropertyEditorView::setupQmlBackend() } else { qmlObjectNode.reset(new QmlObjectNode); } - currentQmlBackend->context()->setContextProperty("finishedNotify", QVariant(false)); + if (specificQmlData.isEmpty()) currentQmlBackend->contextObject()->setSpecificQmlData(specificQmlData); currentQmlBackend->contextObject()->setGlobalBaseUrl(qmlFile); currentQmlBackend->contextObject()->setSpecificQmlData(specificQmlData); currentQmlBackend->setSource(qmlFile); - currentQmlBackend->context()->setContextProperty("finishedNotify", QVariant(true)); } else { QScopedPointer qmlObjectNode; if (m_selectedNode.isValid()) @@ -514,7 +508,6 @@ void PropertyEditorView::setupQmlBackend() else qmlObjectNode.reset(new QmlObjectNode); - currentQmlBackend->context()->setContextProperty("finishedNotify", QVariant(false)); if (specificQmlData.isEmpty()) currentQmlBackend->contextObject()->setSpecificQmlData(specificQmlData); currentQmlBackend->setup(*qmlObjectNode, currentStateName, qmlSpecificsFile, this); @@ -524,8 +517,6 @@ void PropertyEditorView::setupQmlBackend() m_stackedWidget->setCurrentWidget(currentQmlBackend->widget()); - currentQmlBackend->context()->setContextProperty("finishedNotify", QVariant(true)); - currentQmlBackend->contextObject()->triggerSelectionChanged(); m_qmlBackEndForCurrentType = currentQmlBackend; From bf2ece2d158cc471c90891b1661802837e5f21eb Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 22 Mar 2022 18:02:48 +0100 Subject: [PATCH 22/26] QmlDesigner: Remove globalBaseUrl It is not used anymore. Change-Id: I1d436888b5a93a187065cd8276b55a233a0f374c Reviewed-by: Reviewed-by: Qt CI Bot Reviewed-by: Mahmoud Badri --- .../propertyeditor/propertyeditorcontextobject.cpp | 9 --------- .../propertyeditor/propertyeditorcontextobject.h | 5 ----- .../propertyeditor/propertyeditorqmlbackend.cpp | 2 -- .../components/propertyeditor/propertyeditorview.cpp | 2 -- 4 files changed, 18 deletions(-) diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp index b569ce37baf..3a9a138b2a3 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp @@ -416,15 +416,6 @@ QQmlComponent *PropertyEditorContextObject::specificQmlComponent() return m_qmlComponent; } -void PropertyEditorContextObject::setGlobalBaseUrl(const QUrl &newBaseUrl) -{ - if (newBaseUrl == m_globalBaseUrl) - return; - - m_globalBaseUrl = newBaseUrl; - emit globalBaseUrlChanged(); -} - void PropertyEditorContextObject::setSpecificsUrl(const QUrl &newSpecificsUrl) { if (newSpecificsUrl == m_specificsUrl) diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.h b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.h index 262e9191ccb..6a3e410c8a1 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.h +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.h @@ -42,7 +42,6 @@ class PropertyEditorContextObject : public QObject { Q_OBJECT - Q_PROPERTY(QUrl globalBaseUrl READ globalBaseUrl WRITE setGlobalBaseUrl NOTIFY globalBaseUrlChanged) Q_PROPERTY(QUrl specificsUrl READ specificsUrl WRITE setSpecificsUrl NOTIFY specificsUrlChanged) Q_PROPERTY(QString specificQmlData READ specificQmlData WRITE setSpecificQmlData NOTIFY specificQmlDataChanged) @@ -68,7 +67,6 @@ class PropertyEditorContextObject : public QObject public: PropertyEditorContextObject(QObject *parent = nullptr); - QUrl globalBaseUrl() const {return m_globalBaseUrl; } QUrl specificsUrl() const {return m_specificsUrl; } QString specificQmlData() const {return m_specificQmlData; } QString stateName() const {return m_stateName; } @@ -122,7 +120,6 @@ public: bool hasAliasExport() const { return m_aliasExport; } signals: - void globalBaseUrlChanged(); void specificsUrlChanged(); void specificQmlDataChanged(); void stateNameChanged(); @@ -139,7 +136,6 @@ signals: void hasActiveTimelineChanged(); public slots: - void setGlobalBaseUrl(const QUrl &newBaseUrl); void setSpecificsUrl(const QUrl &newSpecificsUrl); @@ -161,7 +157,6 @@ public slots: void setHasAliasExport(bool hasAliasExport); private: - QUrl m_globalBaseUrl; QUrl m_specificsUrl; QString m_specificQmlData; diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp index 5d6e16670e4..135bbca9dfa 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp @@ -549,8 +549,6 @@ void PropertyEditorQmlBackend::initialSetup(const TypeName &typeName, const QUrl contextObject()->setIsBaseState(true); contextObject()->setSpecificQmlData(QStringLiteral("")); - - contextObject()->setGlobalBaseUrl(QUrl()); } QString PropertyEditorQmlBackend::propertyEditorResourcesPath() diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp index 75681f6468d..fb1baed3f36 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp @@ -498,7 +498,6 @@ void PropertyEditorView::setupQmlBackend() if (specificQmlData.isEmpty()) currentQmlBackend->contextObject()->setSpecificQmlData(specificQmlData); - currentQmlBackend->contextObject()->setGlobalBaseUrl(qmlFile); currentQmlBackend->contextObject()->setSpecificQmlData(specificQmlData); currentQmlBackend->setSource(qmlFile); } else { @@ -511,7 +510,6 @@ void PropertyEditorView::setupQmlBackend() if (specificQmlData.isEmpty()) currentQmlBackend->contextObject()->setSpecificQmlData(specificQmlData); currentQmlBackend->setup(*qmlObjectNode, currentStateName, qmlSpecificsFile, this); - currentQmlBackend->contextObject()->setGlobalBaseUrl(qmlFile); currentQmlBackend->contextObject()->setSpecificQmlData(specificQmlData); } From faadc86ecea22c668ef32d4dc42210cc87d8262e Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Wed, 23 Mar 2022 10:09:22 +0100 Subject: [PATCH 23/26] qml2puppet: disable multilanguage if Qt version < 6.2.1 Change-Id: I8dc7114ac550e8cc0d5a1f0e5f5524145aa158a3 Reviewed-by: Thomas Hartmann --- src/tools/qml2puppet/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/qml2puppet/CMakeLists.txt b/src/tools/qml2puppet/CMakeLists.txt index 86d9894edaf..890cbbf5dc3 100644 --- a/src/tools/qml2puppet/CMakeLists.txt +++ b/src/tools/qml2puppet/CMakeLists.txt @@ -256,7 +256,7 @@ extend_qtc_executable(qml2puppet qmlprivategate_56.cpp qmlprivategate.h ) -if(DEFINED MULTILANGUAGE_SUPPORT_SUBDIRECTORY) +if(DEFINED MULTILANGUAGE_SUPPORT_SUBDIRECTORY AND Qt6_VERSION VERSION_GREATER_EQUAL 6.2.1) add_subdirectory(${MULTILANGUAGE_SUPPORT_SUBDIRECTORY} multilanguagesupport_static_build) endif() From 816746a06ddf95cba8575edf9664aee23eba07b1 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Mon, 14 Mar 2022 22:12:21 +0100 Subject: [PATCH 24/26] LauncherInterface: Wait for graceful finish of process launcher Give process launcher a chance to finish its processes gracefully before we finish process launcher's process in Creator. Otherwise, when Creator's process reaper kills the process launcher's process while the process launcher is still reaping its processes, the process launcher may leave zombies. Instantiate the ProcessReaper inside ProcessReaper::reap(), otherwise its destructor won't run at all inside process launcher. Reverts e45e16d904f704920bd457fdf3302f3ae7061459 Fixes: QTCREATORBUG-27118 Change-Id: I00290cda05538b5a7ecbeb08240d1e3772d43d62 Reviewed-by: Alessandro Portale Reviewed-by: Eike Ziller --- src/libs/utils/launcherinterface.cpp | 9 ++++---- src/libs/utils/processreaper.cpp | 1 + src/plugins/android/androiddevice.cpp | 31 ++++++--------------------- src/plugins/android/androiddevice.h | 7 +----- src/plugins/android/androidplugin.cpp | 13 +++-------- src/plugins/android/androidplugin.h | 2 -- 6 files changed, 16 insertions(+), 47 deletions(-) diff --git a/src/libs/utils/launcherinterface.cpp b/src/libs/utils/launcherinterface.cpp index a77650745a7..08c93124657 100644 --- a/src/libs/utils/launcherinterface.cpp +++ b/src/libs/utils/launcherinterface.cpp @@ -138,12 +138,11 @@ void LauncherInterfacePrivate::doStart() void LauncherInterfacePrivate::doStop() { m_server->close(); - if (!m_process) - return; - m_process->disconnect(); + QTC_ASSERT(m_process, return); m_socket->shutdown(); - m_process->waitForFinished(3000); - ProcessReaper::reap(m_process); + m_process->waitForFinished(-1); // Let the process interface finish so that it finishes + // reaping any possible processes it has started. + delete m_process; m_process = nullptr; } diff --git a/src/libs/utils/processreaper.cpp b/src/libs/utils/processreaper.cpp index 076981573d3..3ff060be548 100644 --- a/src/libs/utils/processreaper.cpp +++ b/src/libs/utils/processreaper.cpp @@ -195,6 +195,7 @@ void ProcessReaper::reap(QProcess *process, int timeoutMs) return; } + ProcessReaper::instance(); new Internal::Reaper(process, timeoutMs); } diff --git a/src/plugins/android/androiddevice.cpp b/src/plugins/android/androiddevice.cpp index dac30fd1446..1839d16f562 100644 --- a/src/plugins/android/androiddevice.cpp +++ b/src/plugins/android/androiddevice.cpp @@ -35,8 +35,6 @@ #include -#include - #include #include #include @@ -621,28 +619,6 @@ void AndroidDeviceManager::setupDevicesWatcher() updateAvdsList(); } -void AndroidDeviceManager::shutdownDevicesWatcher() -{ - m_avdsFutureWatcher.waitForFinished(); - m_removeAvdFutureWatcher.waitForFinished(); - - if (m_adbDeviceWatcherProcess) { - m_adbDeviceWatcherProcess->terminate(); - m_adbDeviceWatcherProcess->waitForFinished(); - m_adbDeviceWatcherProcess.reset(); - - // Despite terminate/waitForFinished, the process may still - // be around and remain if Qt Creator finishes too early. - QTimer::singleShot(1000, this, [this] { emit devicesWatcherShutdownFinished(); }); - } -} - -ExtensionSystem::IPlugin::ShutdownFlag AndroidDeviceManager::devicesShutdownFlag() const -{ - return m_adbDeviceWatcherProcess ? ExtensionSystem::IPlugin::AsynchronousShutdown - : ExtensionSystem::IPlugin::SynchronousShutdown; -} - void AndroidDeviceManager::HandleAvdsListChange() { DeviceManager *const devMgr = DeviceManager::instance(); @@ -706,6 +682,13 @@ void AndroidDeviceManager::HandleAvdsListChange() } } +void AndroidDeviceManager::shutdownDevicesWatcher() +{ + m_avdsFutureWatcher.waitForFinished(); + m_removeAvdFutureWatcher.waitForFinished(); + m_adbDeviceWatcherProcess.reset(); +} + void AndroidDeviceManager::HandleDevicesListChange(const QString &serialNumber) { DeviceManager *const devMgr = DeviceManager::instance(); diff --git a/src/plugins/android/androiddevice.h b/src/plugins/android/androiddevice.h index 5ecf8101e07..9800098fb16 100644 --- a/src/plugins/android/androiddevice.h +++ b/src/plugins/android/androiddevice.h @@ -30,8 +30,6 @@ #include "androidconfigurations.h" #include "androiddeviceinfo.h" -#include - #include #include @@ -106,7 +104,7 @@ public: static AndroidDeviceManager *instance(); void setupDevicesWatcher(); void shutdownDevicesWatcher(); - ExtensionSystem::IPlugin::ShutdownFlag devicesShutdownFlag() const; + void updateAvdsList(); IDevice::DeviceState getDeviceState(const QString &serial, IDevice::MachineType type) const; void updateDeviceState(const ProjectExplorer::IDevice::ConstPtr &device); @@ -118,9 +116,6 @@ public: QString getRunningAvdsSerialNumber(const QString &name) const; -signals: - void devicesWatcherShutdownFinished(); - private: AndroidDeviceManager(QObject *parent = nullptr); void HandleDevicesListChange(const QString &serialNumber); diff --git a/src/plugins/android/androidplugin.cpp b/src/plugins/android/androidplugin.cpp index bda2f80587e..7eb8e8c0d23 100644 --- a/src/plugins/android/androidplugin.cpp +++ b/src/plugins/android/androidplugin.cpp @@ -160,17 +160,10 @@ bool AndroidPlugin::initialize(const QStringList &arguments, QString *errorMessa return true; } -AndroidPlugin::ShutdownFlag AndroidPlugin::aboutToShutdown() +ExtensionSystem::IPlugin::ShutdownFlag AndroidPlugin::aboutToShutdown() { - AndroidDeviceManager *dm = AndroidDeviceManager::instance(); - const IPlugin::ShutdownFlag sf = dm->devicesShutdownFlag(); - - if (sf == AsynchronousShutdown) - connect(dm, &AndroidDeviceManager::devicesWatcherShutdownFinished, - this, &ExtensionSystem::IPlugin::asynchronousShutdownFinished); - - dm->shutdownDevicesWatcher(); - return sf; + AndroidDeviceManager::instance()->shutdownDevicesWatcher(); + return ExtensionSystem::IPlugin::SynchronousShutdown; } void AndroidPlugin::kitsRestored() diff --git a/src/plugins/android/androidplugin.h b/src/plugins/android/androidplugin.h index 3d46ca08674..e98a5a32cd9 100644 --- a/src/plugins/android/androidplugin.h +++ b/src/plugins/android/androidplugin.h @@ -44,9 +44,7 @@ class AndroidPlugin final : public ExtensionSystem::IPlugin class AndroidPluginPrivate *d = nullptr; -public: ShutdownFlag aboutToShutdown() final; - #ifdef WITH_TESTS private slots: void testAndroidSdkManagerProgressParser_data(); From 39a81a7baa1fc2601f7ac3b9cc0ef6142115d71e Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 23 Mar 2022 10:53:22 +0100 Subject: [PATCH 25/26] QmlDesigner: Force QtQuick.Studio.x components to use version 1.0 With the latest chages and switching to cmake the version is actually 6.x, but 1.0 is also supported and this will keep projects backwards compatible. Change-Id: Id3d77b323f008ca20bd276859d5a4a573663120c Reviewed-by: Reviewed-by: Thomas Hartmann --- .../qmldesigner/designercore/model/texttomodelmerger.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp index d9c369e3dd8..ad3c1693304 100644 --- a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp +++ b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp @@ -958,6 +958,12 @@ static QList generatePossibleLibraryImports(const QHash= 0) { int minorVersion = (importKey.minorVersion == LanguageUtils::ComponentVersion::NoVersion) ? 0 : importKey.minorVersion; + + if (libraryName.contains("QtQuick.Studio")) { + majorVersion = 1; + minorVersion = 0; + } + QString version = QStringLiteral("%1.%2").arg(majorVersion).arg(minorVersion); if (!libraryName.endsWith(".impl")) possibleImports.append(QmlDesigner::Import::createLibraryImport(libraryName, version)); From 031998c988c47aadcbdef6d9e0aec0531150a0cc Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 23 Mar 2022 11:39:40 +0100 Subject: [PATCH 26/26] ++year in copyright template Change-Id: I6c390812559826645f6c04b2c52fdad015765223 Reviewed-by: Eike Ziller --- dist/copyright_template.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/copyright_template.txt b/dist/copyright_template.txt index a825d83797c..dbe14342561 100644 --- a/dist/copyright_template.txt +++ b/dist/copyright_template.txt @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2021 The Qt Company Ltd. +** Copyright (C) 2022 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Creator.