From 62c36f516bb9795058a4bff7cfa9ecdcedd182a7 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Mon, 17 Jan 2022 14:41:31 +0100 Subject: [PATCH 1/7] TextEditor: Fix skipping short lines Fixes: QTCREATORBUG-26878 Change-Id: I2d801e3c7e91bad928b203bbca32fdc7b1cdca6e Reviewed-by: Christian Stenger --- src/plugins/texteditor/texteditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index dc4296ac0d6..79228163cc5 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -1398,7 +1398,7 @@ QList TextEditorWidgetPrivate::generateCursorsForBlockSelection( while (block.isValid()) { const QString &blockText = block.text(); const int columnCount = tabSettings.columnCountForText(blockText); - if (blockSelection.anchorColumn < columnCount || blockSelection.column < columnCount) { + if (blockSelection.anchorColumn <= columnCount || blockSelection.column <= columnCount) { const int anchor = tabSettings.positionAtColumn(blockText, blockSelection.anchorColumn); const int position = tabSettings.positionAtColumn(blockText, blockSelection.column); cursor.setPosition(block.position() + anchor); From f884ff2160ed5b3c44663d70e1c6915aff4b8ac0 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 18 Jan 2022 09:47:28 +0100 Subject: [PATCH 2/7] Revert "Avoid starting threads from the wrong hosting thread" This reverts commit 1421694d17d464be59478d573a7873f86b6fd2a2. The commit broke e.g. Utils::mapReduce(....).results() in the main thread. Since the main thread blocks, it cannot start a new thread. Change-Id: I63abd07bcf002546740d0a7627f1fd2007c8b70c Reviewed-by: Allan Sandfeld Jensen --- src/libs/utils/runextensions.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/libs/utils/runextensions.h b/src/libs/utils/runextensions.h index 9339f1a52ee..e7b9dd6c939 100644 --- a/src/libs/utils/runextensions.h +++ b/src/libs/utils/runextensions.h @@ -408,10 +408,7 @@ QFuture runAsync_internal(QThreadPool *pool, QFuture future = job->future(); if (pool) { job->setThreadPool(pool); - if (QThread::currentThread() == pool->thread()) - pool->start(job); - else - QMetaObject::invokeMethod(pool, [pool, job]() { pool->start(job); }, Qt::QueuedConnection); + pool->start(job); } else { auto thread = new Internal::RunnableThread(job); if (stackSize) From 54e7d41726d4fc755bd4d2c8074433d241127335 Mon Sep 17 00:00:00 2001 From: Mahmoud Badri Date: Mon, 17 Jan 2022 16:22:45 +0200 Subject: [PATCH 3/7] QmlDesigner/StateEditor: Remove default state's yellow highlight Task-number: QDS-5973 Change-Id: Ie4b82bfbbb91a48152a969bb988220303854709d Reviewed-by: Reviewed-by: Alessandro Portale --- .../imports/StudioTheme/Values.qml | 1 - .../statesEditorQmlSources/StatesDelegate.qml | 18 +++++++----------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml index 018187596b8..5ba591c174b 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml @@ -289,7 +289,6 @@ QtObject { property string themeTabInactiveBackground: Theme.color(Theme.DStabInactiveBackground) property string themeTabInactiveText: Theme.color(Theme.DStabInactiveText) - property string themeStateDefaultHighlight: Theme.color(Theme.DSstateDefaultHighlight) property string themeStateSeparator: Theme.color(Theme.DSstateSeparatorColor) property string themeStateBackground: Theme.color(Theme.DSstateBackgroundColor) property string themeStatePreviewOutline: Theme.color(Theme.DSstatePreviewOutline) diff --git a/share/qtcreator/qmldesigner/statesEditorQmlSources/StatesDelegate.qml b/share/qtcreator/qmldesigner/statesEditorQmlSources/StatesDelegate.qml index faae1210b5b..08a7bc7dc3d 100644 --- a/share/qtcreator/qmldesigner/statesEditorQmlSources/StatesDelegate.qml +++ b/share/qtcreator/qmldesigner/statesEditorQmlSources/StatesDelegate.qml @@ -53,7 +53,6 @@ Rectangle { property int closeButtonMargin: 6 property int textFieldMargin: 4 - property int highlightBorderWidth: 2 signal delegateInteraction @@ -165,21 +164,11 @@ Rectangle { } } - - Rectangle { // highlight for default state - anchors.margins: (isDefaultState || (isBaseState && !modelHasDefaultState)) ? -myRoot.highlightBorderWidth : 0 - anchors.fill: column - color: StudioTheme.Values.themeStateSeparator - border.color: StudioTheme.Values.themeStateDefaultHighlight - border.width: (isDefaultState || (isBaseState && !modelHasDefaultState)) ? myRoot.highlightBorderWidth : 0 - } - Column { id: column anchors.margins: myRoot.stateMargin anchors.fill: parent - spacing: expanded ? myRoot.columnSpacing : 0 Rectangle { width: myRoot.width - 2 * myRoot.stateMargin @@ -263,6 +252,13 @@ Rectangle { } } + Rectangle { // separator + width: column.width + height: myRoot.columnSpacing + color: StudioTheme.Values.themeStateSeparator + visible: expanded + } + Rectangle { id: stateImageArea width: myRoot.width - 2 * myRoot.stateMargin From c57573708a12b05d0332363e5f17fea6a71d6c82 Mon Sep 17 00:00:00 2001 From: Tapani Mattila Date: Wed, 12 Jan 2022 13:17:11 +0200 Subject: [PATCH 4/7] Move qrc, rcc and CMakeLists.txt generating menu option to file menu Task-number: QDS-5903 Change-Id: I42cba21eaecaf5580c40dab8ce32bbf12c37f13f Reviewed-by: Reviewed-by: Qt CI Bot Reviewed-by: Thomas Hartmann --- src/plugins/qmldesigner/generatecmakelists.cpp | 8 ++++---- src/plugins/qmldesigner/generateresource.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/plugins/qmldesigner/generatecmakelists.cpp b/src/plugins/qmldesigner/generatecmakelists.cpp index 3cadb3a9b07..7609a31c15c 100644 --- a/src/plugins/qmldesigner/generatecmakelists.cpp +++ b/src/plugins/qmldesigner/generatecmakelists.cpp @@ -81,12 +81,12 @@ QVector queuedFiles; void generateMenuEntry() { - Core::ActionContainer *buildMenu = - Core::ActionManager::actionContainer(ProjectExplorer::Constants::M_BUILDPROJECT); - auto action = new QAction(QCoreApplication::translate("QmlDesigner::GenerateCmake", "Generate CMakeLists.txt Files")); + Core::ActionContainer *menu = + Core::ActionManager::actionContainer(Core::Constants::M_FILE); + auto action = new QAction(QCoreApplication::translate("QmlDesigner::GenerateCmake", "Export to Qt Creator (CMake)")); QObject::connect(action, &QAction::triggered, GenerateCmake::onGenerateCmakeLists); Core::Command *cmd = Core::ActionManager::registerAction(action, "QmlProject.CreateCMakeLists"); - buildMenu->addAction(cmd, ProjectExplorer::Constants::G_BUILD_RUN); + menu->addAction(cmd, Core::Constants::G_FILE_EXPORT); action->setEnabled(ProjectExplorer::SessionManager::startupProject() != nullptr); QObject::connect(ProjectExplorer::SessionManager::instance(), diff --git a/src/plugins/qmldesigner/generateresource.cpp b/src/plugins/qmldesigner/generateresource.cpp index f700fd79191..5ad0fe7b81c 100644 --- a/src/plugins/qmldesigner/generateresource.cpp +++ b/src/plugins/qmldesigner/generateresource.cpp @@ -195,8 +195,8 @@ QList getFilesFromQrc(QFile *file, bool inProjec void GenerateResource::generateMenuEntry() { - Core::ActionContainer *buildMenu = - Core::ActionManager::actionContainer(ProjectExplorer::Constants::M_BUILDPROJECT); + Core::ActionContainer *menu = + Core::ActionManager::actionContainer(Core::Constants::M_FILE); const Core::Context projectContext(QmlProjectManager::Constants::QML_PROJECT_ID); // ToDo: move this to QtCreator and add tr to the string then @@ -573,8 +573,8 @@ void GenerateResource::generateMenuEntry() } } }); - buildMenu->addAction(cmd, ProjectExplorer::Constants::G_BUILD_RUN); - buildMenu->addAction(cmd2, ProjectExplorer::Constants::G_BUILD_RUN); + menu->addAction(cmd, Core::Constants::G_FILE_EXPORT); + menu->addAction(cmd2, Core::Constants::G_FILE_EXPORT); } } // namespace QmlDesigner From 81dd1ba294ba7a3e438eedab4e0e250793027afa Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 18 Jan 2022 19:46:28 +0100 Subject: [PATCH 5/7] StudioWelcome: Show text for correct version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QDS-5725 Change-Id: I040d9f1f0817fc719da060dd31ee6a04981199e3 Reviewed-by: Henning Gründl Reviewed-by: Reviewed-by: Qt CI Bot --- .../qml/splashscreen/Welcome_splash.qml | 10 ++++- .../studiowelcome/studiowelcomeplugin.cpp | 45 ++++++++++++++++--- 2 files changed, 48 insertions(+), 7 deletions(-) diff --git a/src/plugins/studiowelcome/qml/splashscreen/Welcome_splash.qml b/src/plugins/studiowelcome/qml/splashscreen/Welcome_splash.qml index 86a1dae3925..a145cbcabef 100644 --- a/src/plugins/studiowelcome/qml/splashscreen/Welcome_splash.qml +++ b/src/plugins/studiowelcome/qml/splashscreen/Welcome_splash.qml @@ -341,10 +341,16 @@ Rectangle { x: 15 y: 65 color: "#ffffff" - text: qsTr("Community Edition") + font.pixelSize: 13 font.family: StudioFonts.titilliumWeb_light - visible: projectModel.communityVersion + text: { + if (projectModel.communityVersion) + return qsTr("Community Edition") + if (projectModel.enterpriseVersion) + return qsTr("Enterprise Edition") + return qsTr("Professional Edition") + } ProjectModel { id: projectModel diff --git a/src/plugins/studiowelcome/studiowelcomeplugin.cpp b/src/plugins/studiowelcome/studiowelcomeplugin.cpp index 424374b8e72..67d02c78f72 100644 --- a/src/plugins/studiowelcome/studiowelcomeplugin.cpp +++ b/src/plugins/studiowelcome/studiowelcomeplugin.cpp @@ -197,6 +197,7 @@ public: enum { FilePathRole = Qt::UserRole + 1, PrettyFilePathRole, PreviewUrl, TagData, Description }; Q_PROPERTY(bool communityVersion MEMBER m_communityVersion NOTIFY communityVersionChanged) + Q_PROPERTY(bool enterpriseVersion MEMBER m_enterpriseVersion NOTIFY enterpriseVersionChanged) explicit ProjectModel(QObject *parent = nullptr); @@ -273,11 +274,48 @@ public slots: signals: void communityVersionChanged(); + void enterpriseVersionChanged(); private: - bool m_communityVersion = false; + void setupVersion(); + + bool m_communityVersion = true; + bool m_enterpriseVersion = false; }; +void ProjectModel::setupVersion() +{ + const ExtensionSystem::PluginSpec *pluginSpec = Utils::findOrDefault( + ExtensionSystem::PluginManager::plugins(), + Utils::equal(&ExtensionSystem::PluginSpec::name, QString("LicenseChecker"))); + + if (!pluginSpec) + return; + + ExtensionSystem::IPlugin *plugin = pluginSpec->plugin(); + + if (!plugin) + return; + + m_communityVersion = false; + + bool retVal = false; + bool success = QMetaObject::invokeMethod(plugin, + "qdsEnterpriseLicense", + Qt::DirectConnection, + Q_RETURN_ARG(bool, retVal)); + + if (!success) { + qWarning("Check for Qt Design Studio Enterprise License failed."); + return; + } + if (!retVal) { + qWarning("No Qt Design Studio Enterprise License. Disabling asset importer."); + return; + } + m_enterpriseVersion = true; +} + ProjectModel::ProjectModel(QObject *parent) : QAbstractListModel(parent) { @@ -286,10 +324,7 @@ ProjectModel::ProjectModel(QObject *parent) this, &ProjectModel::resetProjects); - if (!Utils::findOrDefault(ExtensionSystem::PluginManager::plugins(), - Utils::equal(&ExtensionSystem::PluginSpec::name, - QString("LicenseChecker")))) - m_communityVersion = true; + setupVersion(); } int ProjectModel::rowCount(const QModelIndex &) const From 478fa56021a9618d92af3c8cb66b04d894ac75ba Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 18 Jan 2022 17:34:34 +0100 Subject: [PATCH 6/7] StudioWelcome: Add setting for splash screen timeout Change-Id: I9e9a1b1a190a2cf04ffae5d3ac943621e5b3f9f7 Reviewed-by: Reviewed-by: Qt CI Bot Reviewed-by: Thomas Hartmann --- src/plugins/studiowelcome/studiowelcomeplugin.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/studiowelcome/studiowelcomeplugin.cpp b/src/plugins/studiowelcome/studiowelcomeplugin.cpp index 67d02c78f72..53f6e25a7fc 100644 --- a/src/plugins/studiowelcome/studiowelcomeplugin.cpp +++ b/src/plugins/studiowelcome/studiowelcomeplugin.cpp @@ -549,7 +549,9 @@ bool StudioWelcomePlugin::initialize(const QStringList &arguments, QString *erro m_welcomeMode = new WelcomeMode; m_removeSplashTimer.setSingleShot(true); - m_removeSplashTimer.setInterval(15000); + const QString splashScreenTimeoutEntry = "QML/Designer/splashScreenTimeout"; + m_removeSplashTimer.setInterval( + Core::ICore::settings()->value(splashScreenTimeoutEntry, 15000).toInt()); connect(&m_removeSplashTimer, &QTimer::timeout, this, [this] { closeSplashScreen(); }); return true; } From 8acd2b15a9f12ba7de7281e6617963543a96056e Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 18 Jan 2022 14:46:14 +0100 Subject: [PATCH 7/7] Disable QmlDesigner plugin for Qt 5 based builds Design Studio is Qt 6 based only, and since QmlDesigner development is mostly done for that and by that team, don't restrict it to stay compatible. Change-Id: I9252a2a34f7395d9dc6800f59a37fc23d9f30052 Reviewed-by: hjk --- src/plugins/qmldesigner/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/qmldesigner/CMakeLists.txt b/src/plugins/qmldesigner/CMakeLists.txt index aad701fc308..b032f2c8180 100644 --- a/src/plugins/qmldesigner/CMakeLists.txt +++ b/src/plugins/qmldesigner/CMakeLists.txt @@ -4,7 +4,7 @@ if (APPLE) endif() add_qtc_plugin(QmlDesigner - CONDITION TARGET Qt5::QuickWidgets AND TARGET Qt5::Svg + CONDITION Qt5_VERSION VERSION_GREATER_EQUAL 6.2.0 AND TARGET Qt5::QuickWidgets AND TARGET Qt5::Svg DEPENDS QmlJS LanguageUtils QmlEditorWidgets AdvancedDockingSystem Qt5::QuickWidgets Qt5::CorePrivate Sqlite Qt5::Xml Qt5::Svg