forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/9.0'
Conflicts: src/plugins/qtsupport/qtoptionspage.cpp Change-Id: Ic8ada9fd47f5eb62e751b6188a45b95ddb36122d
This commit is contained in:
@@ -48247,7 +48247,7 @@ Useful if build directory is corrupted or when rebuilding with a newer version o
|
||||
</message>
|
||||
<message>
|
||||
<source>Did not find %1 plugin.</source>
|
||||
<translation>Konnte das Plugin %1 nicht finden.</translation>
|
||||
<translation>Konnte kein %1 Plugin finden.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Install Location</source>
|
||||
|
@@ -217,16 +217,37 @@ static inline QStringList getPluginPaths()
|
||||
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()) {
|
||||
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)));
|
||||
installSettingspath.clear();
|
||||
}
|
||||
static const char kInstallSettingsKey[] = "Settings/InstallSettings";
|
||||
QSettings::setPath(QSettings::IniFormat, QSettings::SystemScope,
|
||||
installSettingspath.isEmpty() ? resourcePath() : installSettingspath);
|
||||
QSettings::setPath(QSettings::IniFormat,
|
||||
QSettings::SystemScope,
|
||||
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.
|
||||
// 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.
|
||||
// (Only the first time with QSettings::UserScope, to allow setting the install settings path
|
||||
// in the user settings.)
|
||||
static const char kInstallSettingsKey[] = "Settings/InstallSettings";
|
||||
QSettings::Scope scope = QSettings::UserScope;
|
||||
int count = 0;
|
||||
bool containsInstallSettingsKey = false;
|
||||
@@ -542,9 +564,11 @@ int main(int argc, char **argv)
|
||||
|
||||
// Must be done before any QSettings class is created
|
||||
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();
|
||||
|
||||
SharedTools::QtSingleApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
|
||||
@@ -563,7 +587,11 @@ int main(int argc, char **argv)
|
||||
|
||||
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);
|
||||
Utils::QtcSettings *settings = createUserSettings();
|
||||
Utils::QtcSettings *globalSettings
|
||||
@@ -645,7 +673,8 @@ int main(int argc, char **argv)
|
||||
QNetworkProxyFactory::setUseSystemConfiguration(true);
|
||||
|
||||
// Load
|
||||
const QStringList pluginPaths = getPluginPaths() + options.customPluginPaths;
|
||||
const QStringList pluginPaths = getPluginPaths() + installPluginPaths
|
||||
+ options.customPluginPaths;
|
||||
PluginManager::setPluginPaths(pluginPaths);
|
||||
QMap<QString, QString> foundAppOptions;
|
||||
if (pluginArguments.size() > 1) {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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"
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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"
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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"
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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"
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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"
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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"
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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"
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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"
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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"
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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"
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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"
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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"
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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"
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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"
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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"
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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"
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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"
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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"
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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"
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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"
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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!
|
||||
#include "glslparsertable_p.h"
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// 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
|
||||
|
@@ -932,29 +932,32 @@ static QStringList qtversionFilesToCheck()
|
||||
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) {
|
||||
return QString(qtDir + '/' + dir);
|
||||
const FilePaths dirsToCheck = Utils::transform(kSubdirsToCheck, [qtDir](const QString &dir) {
|
||||
return qtDir / dir;
|
||||
});
|
||||
const QString validDir = Utils::findOrDefault(dirsToCheck, [](const QString &dir) {
|
||||
return QFile::exists(settingsFile(dir)) || QFile::exists(qtVersionsFile(dir));
|
||||
const FilePath validDir = Utils::findOrDefault(dirsToCheck, [baseDirectory](const FilePath &dir) {
|
||||
return QFile::exists(settingsFile(baseDirectory.resolvePath(dir).toString()))
|
||||
|| QFile::exists(qtVersionsFile(baseDirectory.resolvePath(dir).toString()));
|
||||
});
|
||||
if (!validDir.isEmpty())
|
||||
return validDir;
|
||||
return {};
|
||||
}
|
||||
|
||||
static bool validateQtInstallDir(FancyLineEdit *input, QString *errorString)
|
||||
static bool validateQtInstallDir(PathChooser *input, QString *errorString)
|
||||
{
|
||||
const QString qtDir = input->text();
|
||||
if (!settingsDirForQtDir(qtDir)) {
|
||||
const FilePath qtDir = input->rawFilePath();
|
||||
if (!settingsDirForQtDir(input->baseDirectory(), qtDir)) {
|
||||
if (errorString) {
|
||||
const QStringList filesToCheck = settingsFilesToCheck() + qtversionFilesToCheck();
|
||||
*errorString = "<html><body>" + Tr::tr(
|
||||
"Qt installation information was not found in \"%1\". "
|
||||
"Choose a directory that contains one of the files %2")
|
||||
.arg(qtDir, "<pre>" + filesToCheck.join('\n') + "</pre>");
|
||||
*errorString = "<html><body>"
|
||||
+ Tr::tr("Qt installation information was not found in \"%1\". "
|
||||
"Choose a directory that contains one of the files %2")
|
||||
.arg(qtDir.toUserOutput(),
|
||||
"<pre>" + filesToCheck.join('\n') + "</pre>");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -990,13 +993,14 @@ void QtOptionsPageWidget::linkWithQt()
|
||||
auto pathInput = new PathChooser;
|
||||
pathLayout->addWidget(pathInput);
|
||||
pathInput->setExpectedKind(PathChooser::ExistingDirectory);
|
||||
pathInput->setBaseDirectory(FilePath::fromString(QCoreApplication::applicationDirPath()));
|
||||
pathInput->setPromptDialogTitle(title);
|
||||
pathInput->setMacroExpander(nullptr);
|
||||
pathInput->setValidationFunction([pathInput](FancyLineEdit *input, QString *errorString) {
|
||||
if (pathInput->defaultValidationFunction()
|
||||
&& !pathInput->defaultValidationFunction()(input, errorString))
|
||||
return false;
|
||||
return validateQtInstallDir(input, errorString);
|
||||
return validateQtInstallDir(pathInput, errorString);
|
||||
});
|
||||
const std::optional<FilePath> currentLink = currentlyLinkedQtDir(nullptr);
|
||||
pathInput->setFilePath(currentLink ? *currentLink : defaultQtInstallationPath());
|
||||
@@ -1029,11 +1033,12 @@ void QtOptionsPageWidget::linkWithQt()
|
||||
|
||||
dialog.exec();
|
||||
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)) {
|
||||
const QString settingsFilePath = settingsFile(Core::ICore::resourcePath().toString());
|
||||
QSettings settings(settingsFilePath, QSettings::IniFormat);
|
||||
settings.setValue(kInstallSettingsKey, *settingsDir);
|
||||
settings.setValue(kInstallSettingsKey, settingsDir->toVariant());
|
||||
settings.sync();
|
||||
if (settings.status() == QSettings::AccessError) {
|
||||
QMessageBox::critical(Core::ICore::dialogParent(),
|
||||
|
@@ -38,8 +38,13 @@ void SnippetOverlay::setFinalSelection(const QTextCursor &cursor, const QColor &
|
||||
void SnippetOverlay::updateEquivalentSelections(const QTextCursor &cursor)
|
||||
{
|
||||
const int ¤tIndex = indexForCursor(cursor);
|
||||
if (currentIndex == m_finalSelectionIndex) {
|
||||
accept();
|
||||
return;
|
||||
}
|
||||
if (currentIndex < 0)
|
||||
return;
|
||||
QTC_ASSERT(currentIndex < m_selections.size(), return);
|
||||
const QString ¤tText = cursorForIndex(currentIndex).selectedText();
|
||||
const QList<int> &equivalents = m_variables.value(m_selections[currentIndex].variableIndex);
|
||||
for (int i : equivalents) {
|
||||
|
@@ -7,7 +7,9 @@ def main():
|
||||
startQC()
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
createProject_Qt_GUI(tempDir(), "DesignerTestApp")
|
||||
projectName = "DesignerTestApp"
|
||||
createProject_Qt_GUI(tempDir(), projectName)
|
||||
invokeMenuItem('Build', 'Build Project "%s"' % projectName)
|
||||
selectFromLocator("mainwindow.ui")
|
||||
dragAndDrop(waitForObject("{container=':qdesigner_internal::WidgetBoxCategoryListView'"
|
||||
"text='Push Button' type='QModelIndex'}"), 5, 5,
|
||||
|
Reference in New Issue
Block a user