Merge remote-tracking branch 'origin/6.0'

Change-Id: I92049adb2b200e9106513eb2275019890bd13b6c
This commit is contained in:
Eike Ziller
2022-01-19 11:42:32 +01:00
9 changed files with 69 additions and 34 deletions

View File

@@ -289,7 +289,6 @@ QtObject {
property string themeTabInactiveBackground: Theme.color(Theme.DStabInactiveBackground) property string themeTabInactiveBackground: Theme.color(Theme.DStabInactiveBackground)
property string themeTabInactiveText: Theme.color(Theme.DStabInactiveText) property string themeTabInactiveText: Theme.color(Theme.DStabInactiveText)
property string themeStateDefaultHighlight: Theme.color(Theme.DSstateDefaultHighlight)
property string themeStateSeparator: Theme.color(Theme.DSstateSeparatorColor) property string themeStateSeparator: Theme.color(Theme.DSstateSeparatorColor)
property string themeStateBackground: Theme.color(Theme.DSstateBackgroundColor) property string themeStateBackground: Theme.color(Theme.DSstateBackgroundColor)
property string themeStatePreviewOutline: Theme.color(Theme.DSstatePreviewOutline) property string themeStatePreviewOutline: Theme.color(Theme.DSstatePreviewOutline)

View File

@@ -53,7 +53,6 @@ Rectangle {
property int closeButtonMargin: 6 property int closeButtonMargin: 6
property int textFieldMargin: 4 property int textFieldMargin: 4
property int highlightBorderWidth: 2
signal delegateInteraction 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 { Column {
id: column id: column
anchors.margins: myRoot.stateMargin anchors.margins: myRoot.stateMargin
anchors.fill: parent anchors.fill: parent
spacing: expanded ? myRoot.columnSpacing : 0
Rectangle { Rectangle {
width: myRoot.width - 2 * myRoot.stateMargin 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 { Rectangle {
id: stateImageArea id: stateImageArea
width: myRoot.width - 2 * myRoot.stateMargin width: myRoot.width - 2 * myRoot.stateMargin

View File

@@ -408,10 +408,7 @@ QFuture<ResultType> runAsync_internal(QThreadPool *pool,
QFuture<ResultType> future = job->future(); QFuture<ResultType> future = job->future();
if (pool) { if (pool) {
job->setThreadPool(pool); job->setThreadPool(pool);
if (QThread::currentThread() == pool->thread()) pool->start(job);
pool->start(job);
else
QMetaObject::invokeMethod(pool, [pool, job]() { pool->start(job); }, Qt::QueuedConnection);
} else { } else {
auto thread = new Internal::RunnableThread(job); auto thread = new Internal::RunnableThread(job);
if (stackSize) if (stackSize)

View File

@@ -4,7 +4,7 @@ if (APPLE)
endif() endif()
add_qtc_plugin(QmlDesigner 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 DEPENDS
QmlJS LanguageUtils QmlEditorWidgets AdvancedDockingSystem QmlJS LanguageUtils QmlEditorWidgets AdvancedDockingSystem
Qt5::QuickWidgets Qt5::CorePrivate Sqlite Qt5::Xml Qt5::Svg Qt5::QuickWidgets Qt5::CorePrivate Sqlite Qt5::Xml Qt5::Svg

View File

@@ -81,12 +81,12 @@ QVector<GeneratableFile> queuedFiles;
void generateMenuEntry() void generateMenuEntry()
{ {
Core::ActionContainer *buildMenu = Core::ActionContainer *menu =
Core::ActionManager::actionContainer(ProjectExplorer::Constants::M_BUILDPROJECT); Core::ActionManager::actionContainer(Core::Constants::M_FILE);
auto action = new QAction(QCoreApplication::translate("QmlDesigner::GenerateCmake", "Generate CMakeLists.txt Files")); auto action = new QAction(QCoreApplication::translate("QmlDesigner::GenerateCmake", "Export to Qt Creator (CMake)"));
QObject::connect(action, &QAction::triggered, GenerateCmake::onGenerateCmakeLists); QObject::connect(action, &QAction::triggered, GenerateCmake::onGenerateCmakeLists);
Core::Command *cmd = Core::ActionManager::registerAction(action, "QmlProject.CreateCMakeLists"); 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); action->setEnabled(ProjectExplorer::SessionManager::startupProject() != nullptr);
QObject::connect(ProjectExplorer::SessionManager::instance(), QObject::connect(ProjectExplorer::SessionManager::instance(),

View File

@@ -195,8 +195,8 @@ QList<GenerateResource::ResourceFile> getFilesFromQrc(QFile *file, bool inProjec
void GenerateResource::generateMenuEntry() void GenerateResource::generateMenuEntry()
{ {
Core::ActionContainer *buildMenu = Core::ActionContainer *menu =
Core::ActionManager::actionContainer(ProjectExplorer::Constants::M_BUILDPROJECT); Core::ActionManager::actionContainer(Core::Constants::M_FILE);
const Core::Context projectContext(QmlProjectManager::Constants::QML_PROJECT_ID); const Core::Context projectContext(QmlProjectManager::Constants::QML_PROJECT_ID);
// ToDo: move this to QtCreator and add tr to the string then // 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); menu->addAction(cmd, Core::Constants::G_FILE_EXPORT);
buildMenu->addAction(cmd2, ProjectExplorer::Constants::G_BUILD_RUN); menu->addAction(cmd2, Core::Constants::G_FILE_EXPORT);
} }
} // namespace QmlDesigner } // namespace QmlDesigner

View File

@@ -341,10 +341,16 @@ Rectangle {
x: 15 x: 15
y: 65 y: 65
color: "#ffffff" color: "#ffffff"
text: qsTr("Community Edition")
font.pixelSize: 13 font.pixelSize: 13
font.family: StudioFonts.titilliumWeb_light 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 { ProjectModel {
id: projectModel id: projectModel

View File

@@ -197,6 +197,7 @@ public:
enum { FilePathRole = Qt::UserRole + 1, PrettyFilePathRole, PreviewUrl, TagData, Description }; enum { FilePathRole = Qt::UserRole + 1, PrettyFilePathRole, PreviewUrl, TagData, Description };
Q_PROPERTY(bool communityVersion MEMBER m_communityVersion NOTIFY communityVersionChanged) Q_PROPERTY(bool communityVersion MEMBER m_communityVersion NOTIFY communityVersionChanged)
Q_PROPERTY(bool enterpriseVersion MEMBER m_enterpriseVersion NOTIFY enterpriseVersionChanged)
explicit ProjectModel(QObject *parent = nullptr); explicit ProjectModel(QObject *parent = nullptr);
@@ -273,11 +274,48 @@ public slots:
signals: signals:
void communityVersionChanged(); void communityVersionChanged();
void enterpriseVersionChanged();
private: 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) ProjectModel::ProjectModel(QObject *parent)
: QAbstractListModel(parent) : QAbstractListModel(parent)
{ {
@@ -286,10 +324,7 @@ ProjectModel::ProjectModel(QObject *parent)
this, this,
&ProjectModel::resetProjects); &ProjectModel::resetProjects);
if (!Utils::findOrDefault(ExtensionSystem::PluginManager::plugins(), setupVersion();
Utils::equal(&ExtensionSystem::PluginSpec::name,
QString("LicenseChecker"))))
m_communityVersion = true;
} }
int ProjectModel::rowCount(const QModelIndex &) const int ProjectModel::rowCount(const QModelIndex &) const
@@ -514,7 +549,9 @@ bool StudioWelcomePlugin::initialize(const QStringList &arguments, QString *erro
m_welcomeMode = new WelcomeMode; m_welcomeMode = new WelcomeMode;
m_removeSplashTimer.setSingleShot(true); 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(); }); connect(&m_removeSplashTimer, &QTimer::timeout, this, [this] { closeSplashScreen(); });
return true; return true;
} }

View File

@@ -1467,7 +1467,7 @@ QList<QTextCursor> TextEditorWidgetPrivate::generateCursorsForBlockSelection(
while (block.isValid()) { while (block.isValid()) {
const QString &blockText = block.text(); const QString &blockText = block.text();
const int columnCount = tabSettings.columnCountForText(blockText); 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 anchor = tabSettings.positionAtColumn(blockText, blockSelection.anchorColumn);
const int position = tabSettings.positionAtColumn(blockText, blockSelection.column); const int position = tabSettings.positionAtColumn(blockText, blockSelection.column);
cursor.setPosition(block.position() + anchor); cursor.setPosition(block.position() + anchor);