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 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) diff --git a/src/plugins/qmldesigner/CMakeLists.txt b/src/plugins/qmldesigner/CMakeLists.txt index 3cb04afd0d7..8cdc99d001c 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 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 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 84ff8e2317a..f26e8511509 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 @@ -514,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; } diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index e642e2344ab..731c5ba779e 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -1467,7 +1467,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);