Merge remote-tracking branch 'origin/9.0'

Conflicts:
	src/plugins/qtsupport/qtoptionspage.cpp

Change-Id: Ic8ada9fd47f5eb62e751b6188a45b95ddb36122d
This commit is contained in:
Eike Ziller
2023-01-05 09:47:06 +01:00
47 changed files with 108 additions and 67 deletions

View File

@@ -48247,7 +48247,7 @@ Useful if build directory is corrupted or when rebuilding with a newer version o
</message> </message>
<message> <message>
<source>Did not find %1 plugin.</source> <source>Did not find %1 plugin.</source>
<translation>Konnte das Plugin %1 nicht finden.</translation> <translation>Konnte kein %1 Plugin finden.</translation>
</message> </message>
<message> <message>
<source>Install Location</source> <source>Install Location</source>

View File

@@ -217,16 +217,37 @@ static inline QStringList getPluginPaths()
return rc; return rc;
} }
static void setupInstallSettings(QString &installSettingspath) // Returns plugin path that is set in install settings.
// The installer (or rather the packaging) can write that to load optional plugins from
// outside the application bundle on macOS, because installing optional plugins into
// the application bundle would break code signing.
static QStringList getInstallPluginPaths()
{
// uses SystemScope because this really must be an "installation" setting
QSettings installSettings(QSettings::IniFormat,
QSettings::SystemScope,
QLatin1String(Core::Constants::IDE_SETTINGSVARIANT_STR),
QLatin1String(Core::Constants::IDE_CASED_ID));
return Utils::transform(installSettings.value("Settings/InstallPluginPaths").toStringList(),
[](const QString &path) -> QString {
if (QDir::isRelativePath(path))
return applicationDirPath() + '/' + path;
return path;
});
}
static void setupInstallSettings(QString &installSettingspath, bool redirect = true)
{ {
if (!installSettingspath.isEmpty() && !QFileInfo(installSettingspath).isDir()) { if (!installSettingspath.isEmpty() && !QFileInfo(installSettingspath).isDir()) {
displayError(QString("-installsettingspath \"%0\" needs to be the path where a %1/%2.ini exist.").arg(installSettingspath, displayError(QString("-installsettingspath \"%0\" needs to be the path where a %1/%2.ini exist.").arg(installSettingspath,
QLatin1String(Core::Constants::IDE_SETTINGSVARIANT_STR), QLatin1String(Core::Constants::IDE_CASED_ID))); QLatin1String(Core::Constants::IDE_SETTINGSVARIANT_STR), QLatin1String(Core::Constants::IDE_CASED_ID)));
installSettingspath.clear(); installSettingspath.clear();
} }
static const char kInstallSettingsKey[] = "Settings/InstallSettings"; QSettings::setPath(QSettings::IniFormat,
QSettings::setPath(QSettings::IniFormat, QSettings::SystemScope, QSettings::SystemScope,
installSettingspath.isEmpty() ? resourcePath() : installSettingspath); installSettingspath.isEmpty() ? resourcePath() : installSettingspath);
if (!redirect) // ignore redirection via Settings/InstallSettings
return;
// Check if the default install settings contain a setting for the actual install settings. // Check if the default install settings contain a setting for the actual install settings.
// This can be an absolute path, or a path relative to applicationDirPath(). // This can be an absolute path, or a path relative to applicationDirPath().
@@ -236,6 +257,7 @@ static void setupInstallSettings(QString &installSettingspath)
// yet a second time. So try this a few times. // yet a second time. So try this a few times.
// (Only the first time with QSettings::UserScope, to allow setting the install settings path // (Only the first time with QSettings::UserScope, to allow setting the install settings path
// in the user settings.) // in the user settings.)
static const char kInstallSettingsKey[] = "Settings/InstallSettings";
QSettings::Scope scope = QSettings::UserScope; QSettings::Scope scope = QSettings::UserScope;
int count = 0; int count = 0;
bool containsInstallSettingsKey = false; bool containsInstallSettingsKey = false;
@@ -542,9 +564,11 @@ int main(int argc, char **argv)
// Must be done before any QSettings class is created // Must be done before any QSettings class is created
QSettings::setDefaultFormat(QSettings::IniFormat); QSettings::setDefaultFormat(QSettings::IniFormat);
setupInstallSettings(options.installSettingsPath);
// plugin manager takes control of this settings object
// HiDPI variables need to be set before creating QApplication.
// Since we do not have a QApplication yet, we cannot rely on QApplication::applicationDirPath()
// though. So we set up install settings with a educated guess here, and re-setup it later.
setupInstallSettings(options.installSettingsPath);
setHighDpiEnvironmentVariable(); setHighDpiEnvironmentVariable();
SharedTools::QtSingleApplication::setAttribute(Qt::AA_ShareOpenGLContexts); SharedTools::QtSingleApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
@@ -563,7 +587,11 @@ int main(int argc, char **argv)
const QStringList pluginArguments = app.arguments(); const QStringList pluginArguments = app.arguments();
/*Initialize global settings and resetup install settings with QApplication::applicationDirPath */ // Re-setup install settings with QApplication::applicationDirPath() available, but
// first read install plugin paths from original install settings, without redirection
setupInstallSettings(options.installSettingsPath, /*redirect=*/false);
const QStringList installPluginPaths = getInstallPluginPaths();
// Re-setup install settings for real
setupInstallSettings(options.installSettingsPath); setupInstallSettings(options.installSettingsPath);
Utils::QtcSettings *settings = createUserSettings(); Utils::QtcSettings *settings = createUserSettings();
Utils::QtcSettings *globalSettings Utils::QtcSettings *globalSettings
@@ -645,7 +673,8 @@ int main(int argc, char **argv)
QNetworkProxyFactory::setUseSystemConfiguration(true); QNetworkProxyFactory::setUseSystemConfiguration(true);
// Load // Load
const QStringList pluginPaths = getPluginPaths() + options.customPluginPaths; const QStringList pluginPaths = getPluginPaths() + installPluginPaths
+ options.customPluginPaths;
PluginManager::setPluginPaths(pluginPaths); PluginManager::setPluginPaths(pluginPaths);
QMap<QString, QString> foundAppOptions; QMap<QString, QString> foundAppOptions;
if (pluginArguments.size() > 1) { if (pluginArguments.size() > 1) {

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#include "ads_globals.h" #include "ads_globals.h"

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#pragma once #pragma once

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#include "dockareatabbar.h" #include "dockareatabbar.h"

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#pragma once #pragma once

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#include "dockareatitlebar.h" #include "dockareatitlebar.h"

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#pragma once #pragma once

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#include "dockareawidget.h" #include "dockareawidget.h"

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#pragma once #pragma once

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#include "dockcomponentsfactory.h" #include "dockcomponentsfactory.h"

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#pragma once #pragma once

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#include "dockcontainerwidget.h" #include "dockcontainerwidget.h"

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#pragma once #pragma once

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#include "dockfocuscontroller.h" #include "dockfocuscontroller.h"

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#pragma once #pragma once

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#include "dockingstatereader.h" #include "dockingstatereader.h"

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#pragma once #pragma once

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#include "dockmanager.h" #include "dockmanager.h"

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#pragma once #pragma once

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#include "dockoverlay.h" #include "dockoverlay.h"

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#pragma once #pragma once

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#include "docksplitter.h" #include "docksplitter.h"

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#pragma once #pragma once

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#include "dockwidget.h" #include "dockwidget.h"

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#pragma once #pragma once

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#include "dockwidgettab.h" #include "dockwidgettab.h"

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#pragma once #pragma once

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#include "elidinglabel.h" #include "elidinglabel.h"

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#pragma once #pragma once

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#include "floatingdockcontainer.h" #include "floatingdockcontainer.h"

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#pragma once #pragma once

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#include "floatingdragpreview.h" #include "floatingdragpreview.h"

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#pragma once #pragma once

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#include "iconprovider.h" #include "iconprovider.h"

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 Uwe Kindler // Copyright (C) 2020 Uwe Kindler
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#pragma once #pragma once

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 The Qt Company Ltd. // Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#include "workspacedialog.h" #include "workspacedialog.h"

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 The Qt Company Ltd. // Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#pragma once #pragma once

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 The Qt Company Ltd. // Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#include "workspacemodel.h" #include "workspacemodel.h"

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 The Qt Company Ltd. // Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#pragma once #pragma once

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 The Qt Company Ltd. // Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#include "workspaceview.h" #include "workspaceview.h"

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2020 The Qt Company Ltd. // Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
#pragma once #pragma once

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2016 The Qt Company Ltd. // Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
// This file was generated by qlalr - DO NOT EDIT! // This file was generated by qlalr - DO NOT EDIT!
#include "glslparsertable_p.h" #include "glslparsertable_p.h"

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2016 The Qt Company Ltd. // Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later
// //
// W A R N I N G // W A R N I N G

View File

@@ -932,29 +932,32 @@ static QStringList qtversionFilesToCheck()
return Utils::transform(kSubdirsToCheck, [](const QString &dir) { return qtVersionsFile(dir); }); return Utils::transform(kSubdirsToCheck, [](const QString &dir) { return qtVersionsFile(dir); });
} }
static std::optional<QString> settingsDirForQtDir(const QString &qtDir) static std::optional<FilePath> settingsDirForQtDir(const FilePath &baseDirectory,
const FilePath &qtDir)
{ {
const QStringList dirsToCheck = Utils::transform(kSubdirsToCheck, [qtDir](const QString &dir) { const FilePaths dirsToCheck = Utils::transform(kSubdirsToCheck, [qtDir](const QString &dir) {
return QString(qtDir + '/' + dir); return qtDir / dir;
}); });
const QString validDir = Utils::findOrDefault(dirsToCheck, [](const QString &dir) { const FilePath validDir = Utils::findOrDefault(dirsToCheck, [baseDirectory](const FilePath &dir) {
return QFile::exists(settingsFile(dir)) || QFile::exists(qtVersionsFile(dir)); return QFile::exists(settingsFile(baseDirectory.resolvePath(dir).toString()))
|| QFile::exists(qtVersionsFile(baseDirectory.resolvePath(dir).toString()));
}); });
if (!validDir.isEmpty()) if (!validDir.isEmpty())
return validDir; return validDir;
return {}; return {};
} }
static bool validateQtInstallDir(FancyLineEdit *input, QString *errorString) static bool validateQtInstallDir(PathChooser *input, QString *errorString)
{ {
const QString qtDir = input->text(); const FilePath qtDir = input->rawFilePath();
if (!settingsDirForQtDir(qtDir)) { if (!settingsDirForQtDir(input->baseDirectory(), qtDir)) {
if (errorString) { if (errorString) {
const QStringList filesToCheck = settingsFilesToCheck() + qtversionFilesToCheck(); const QStringList filesToCheck = settingsFilesToCheck() + qtversionFilesToCheck();
*errorString = "<html><body>" + Tr::tr( *errorString = "<html><body>"
"Qt installation information was not found in \"%1\". " + Tr::tr("Qt installation information was not found in \"%1\". "
"Choose a directory that contains one of the files %2") "Choose a directory that contains one of the files %2")
.arg(qtDir, "<pre>" + filesToCheck.join('\n') + "</pre>"); .arg(qtDir.toUserOutput(),
"<pre>" + filesToCheck.join('\n') + "</pre>");
} }
return false; return false;
} }
@@ -990,13 +993,14 @@ void QtOptionsPageWidget::linkWithQt()
auto pathInput = new PathChooser; auto pathInput = new PathChooser;
pathLayout->addWidget(pathInput); pathLayout->addWidget(pathInput);
pathInput->setExpectedKind(PathChooser::ExistingDirectory); pathInput->setExpectedKind(PathChooser::ExistingDirectory);
pathInput->setBaseDirectory(FilePath::fromString(QCoreApplication::applicationDirPath()));
pathInput->setPromptDialogTitle(title); pathInput->setPromptDialogTitle(title);
pathInput->setMacroExpander(nullptr); pathInput->setMacroExpander(nullptr);
pathInput->setValidationFunction([pathInput](FancyLineEdit *input, QString *errorString) { pathInput->setValidationFunction([pathInput](FancyLineEdit *input, QString *errorString) {
if (pathInput->defaultValidationFunction() if (pathInput->defaultValidationFunction()
&& !pathInput->defaultValidationFunction()(input, errorString)) && !pathInput->defaultValidationFunction()(input, errorString))
return false; return false;
return validateQtInstallDir(input, errorString); return validateQtInstallDir(pathInput, errorString);
}); });
const std::optional<FilePath> currentLink = currentlyLinkedQtDir(nullptr); const std::optional<FilePath> currentLink = currentlyLinkedQtDir(nullptr);
pathInput->setFilePath(currentLink ? *currentLink : defaultQtInstallationPath()); pathInput->setFilePath(currentLink ? *currentLink : defaultQtInstallationPath());
@@ -1029,11 +1033,12 @@ void QtOptionsPageWidget::linkWithQt()
dialog.exec(); dialog.exec();
if (dialog.result() == QDialog::Accepted) { if (dialog.result() == QDialog::Accepted) {
const std::optional<QString> settingsDir = settingsDirForQtDir(pathInput->rawFilePath().toString()); const std::optional<FilePath> settingsDir = settingsDirForQtDir(pathInput->baseDirectory(),
pathInput->rawFilePath());
if (QTC_GUARD(settingsDir)) { if (QTC_GUARD(settingsDir)) {
const QString settingsFilePath = settingsFile(Core::ICore::resourcePath().toString()); const QString settingsFilePath = settingsFile(Core::ICore::resourcePath().toString());
QSettings settings(settingsFilePath, QSettings::IniFormat); QSettings settings(settingsFilePath, QSettings::IniFormat);
settings.setValue(kInstallSettingsKey, *settingsDir); settings.setValue(kInstallSettingsKey, settingsDir->toVariant());
settings.sync(); settings.sync();
if (settings.status() == QSettings::AccessError) { if (settings.status() == QSettings::AccessError) {
QMessageBox::critical(Core::ICore::dialogParent(), QMessageBox::critical(Core::ICore::dialogParent(),

View File

@@ -38,8 +38,13 @@ void SnippetOverlay::setFinalSelection(const QTextCursor &cursor, const QColor &
void SnippetOverlay::updateEquivalentSelections(const QTextCursor &cursor) void SnippetOverlay::updateEquivalentSelections(const QTextCursor &cursor)
{ {
const int &currentIndex = indexForCursor(cursor); const int &currentIndex = indexForCursor(cursor);
if (currentIndex == m_finalSelectionIndex) {
accept();
return;
}
if (currentIndex < 0) if (currentIndex < 0)
return; return;
QTC_ASSERT(currentIndex < m_selections.size(), return);
const QString &currentText = cursorForIndex(currentIndex).selectedText(); const QString &currentText = cursorForIndex(currentIndex).selectedText();
const QList<int> &equivalents = m_variables.value(m_selections[currentIndex].variableIndex); const QList<int> &equivalents = m_variables.value(m_selections[currentIndex].variableIndex);
for (int i : equivalents) { for (int i : equivalents) {

View File

@@ -7,7 +7,9 @@ def main():
startQC() startQC()
if not startedWithoutPluginError(): if not startedWithoutPluginError():
return return
createProject_Qt_GUI(tempDir(), "DesignerTestApp") projectName = "DesignerTestApp"
createProject_Qt_GUI(tempDir(), projectName)
invokeMenuItem('Build', 'Build Project "%s"' % projectName)
selectFromLocator("mainwindow.ui") selectFromLocator("mainwindow.ui")
dragAndDrop(waitForObject("{container=':qdesigner_internal::WidgetBoxCategoryListView'" dragAndDrop(waitForObject("{container=':qdesigner_internal::WidgetBoxCategoryListView'"
"text='Push Button' type='QModelIndex'}"), 5, 5, "text='Push Button' type='QModelIndex'}"), 5, 5,