Merge "Merge remote-tracking branch 'origin/9.0' into qds/dev" into qds/dev

This commit is contained in:
The Qt Project
2023-01-10 17:49:33 +00:00
90 changed files with 477 additions and 179 deletions

View File

@@ -7,7 +7,8 @@ on:
- 'doc/**'
env:
QT_VERSION: 6.4.0
QT_VERSION: 6.4.2
MACOS_DEPLOYMENT_TARGET: 10.14
CLANG_VERSION: 15.0.0
ELFUTILS_VERSION: 0.175
CMAKE_VERSION: 3.21.1
@@ -489,7 +490,7 @@ jobs:
run: |
set(ENV{CC} ${{ matrix.config.cc }})
set(ENV{CXX} ${{ matrix.config.cxx }})
set(ENV{MACOSX_DEPLOYMENT_TARGET} "10.13")
set(ENV{MACOSX_DEPLOYMENT_TARGET} "${{ env.MACOS_DEPLOYMENT_TARGET }}")
if ("${{ runner.os }}" STREQUAL "Windows" AND NOT "x${{ matrix.config.environment_script }}" STREQUAL "x")
execute_process(

View File

@@ -171,7 +171,8 @@ feature_summary(INCLUDE_QUIET_PACKAGES WHAT
ENABLED_FEATURES DISABLED_FEATURES
)
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
# Only for non super repo builds
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR
AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.GPL3-EXCEPT")
# Only for opensource, non-super-repo builds
add_subdirectory(packaging)
endif()

View File

@@ -157,15 +157,21 @@ like Qt and LLVM, additionally run
cmake --install . --prefix /path/to/qtcreator_install --component Dependencies
### Performance Analyzer
### Perf Profiler Support
If you have not installed Qt with the Maintenance Tool, you must
either set the path to the `perfparser` executable as a value of
the `PERFPROFILER_PARSER_FILEPATH` environment variable or copy
the executable to from the Qt Creator installation directory to
the build directory. That is, copy it from
`/path/to/qtcreator_install/Tools/QtCreator/libexec/qtcreator/` to
/path/to/qtcreator_buid/libexec/qtcreator/`.
Support for the [perf](https://perf.wiki.kernel.org/index.php/Main_Page) profiler
requires the `perfparser` tool that is part of the Qt Creator source package, and also
part of the Qt Creator Git repository in form of a submodule in `src/tools/perfparser`.
Compilation of `perfparser` requires ELF and DWARF development packages.
You can either download and extract a prebuilt package from
https://download.qt.io/development_releases/prebuilt/elfutils/ and add the
directory to the `CMAKE_PREFIX_PATH` when configuring Qt Creator,
or install the `libdw-dev` package on Debian-style Linux systems.
You can also point Qt Creator to a separate installation of `perfparser` by
setting the `PERFPROFILER_PARSER_FILEPATH` environment variable to the full
path to the executable.
## Getting LLVM/Clang for the Clang Code Model

View File

@@ -60,6 +60,8 @@ if(elfutils_FOUND)
endif()
endif()
endforeach()
else()
message(STATUS " (set ELFUTILS_INSTALL_DIR, or install libdw-dev on a Debian-like system)")
endif()
mark_as_advanced(ELFUTILS_INCLUDE_DIR ELFUTILS_LIB_elf ELFUTILS_LIB_dw)

View File

@@ -1,6 +1,6 @@
set(IDE_VERSION "9.0.1") # The IDE version.
set(IDE_VERSION "9.0.2") # The IDE version.
set(IDE_VERSION_COMPAT "9.0.0") # The IDE Compatibility version.
set(IDE_VERSION_DISPLAY "9.0.1") # The IDE display version.
set(IDE_VERSION_DISPLAY "9.0.2") # The IDE display version.
set(IDE_COPYRIGHT_YEAR "2022") # The IDE current copyright year.
set(IDE_SETTINGSVARIANT "QtProject") # The IDE settings variation.

View File

@@ -10,7 +10,7 @@ instructions:
variableValue: http://master.qt.io/development_releases/prebuilt/libclang/libclang-release_15.0.0-based
- type: EnvironmentVariable
variableName: QTC_QT_BASE_URL
variableValue: "http://ci-files02-hki.intra.qt.io/packages/jenkins/archive/qt/6.4/6.4.0-released/Qt"
variableValue: "http://ci-files02-hki.intra.qt.io/packages/jenkins/archive/qt/6.4/6.4.2-released/Qt"
- type: EnvironmentVariable
variableName: QTC_QT_MODULES
variableValue: "qt5compat qtbase qtdeclarative qtimageformats qtquick3d qtquickcontrols2 qtquicktimeline qtserialport qtshadertools qtsvg qttools qttranslations qtwebengine"

View File

@@ -1,17 +1,110 @@
<div class="sectionlist normallist">
<ul>
<li><a href="qtcreator-toc.html">All Topics</a></li>
</ul>
</div>
<div class="sectionlist normallist">
<div class="heading">
<a name="reference"></a>
<h2 id="reference">Qt Creator Manual</h2>
<h2>Getting Started</h2>
</div>
<div class="indexboxcont indexboxbar">
<ul>
<li><a href="creator-getting-started.html">Getting Started</a></li>
<li><a href="creator-project-managing.html">Managing Projects</a></li>
<li><a href="creator-design-mode.html">Designing User Interfaces</a></li>
<li><a href="creator-coding.html">Coding</a></li>
<li><a href="creator-building-running.html">Building and Running</a></li>
<li><a href="creator-testing.html">Testing</a></li>
<li><a href="creator-advanced.html">Advanced Use</a></li>
<li><a href="creator-help-overview.html">Getting Help</a></li>
<li><a href="creator-overview.html">IDE Overview</a></li>
<li><a href="creator-quick-tour.html">User Interface</a></li>
<li><a href="creator-configuring.html">Configuring Qt Creator</a></li>
<li><a href="creator-build-example-application.html">Building and Running an Example</a></li>
<li><a href="creator-tutorials.html">Tutorials</a></li>
</ul>
</div>
</div>
<div class="sectionlist normallist">
<div class="heading">
<h2>Managing Projects</h2>
</div>
<ul>
<li><a href="creator-project-creating.html">Creating Projects</a></li>
<li><a href="creator-version-control.html">Using Version Control Systems</a></li>
<li><a href="creator-configuring-projects.html">Configuring Projects</a></li>
<li><a href="creator-project-managing-sessions.html">Managing Sessions</a></li>
</ul>
</div>
<div class="sectionlist normallist">
<div class="heading">
<h2>Designing User Interfaces</h2>
</div>
<ul>
<li><a href="creator-visual-editor.html">Developing Qt Quick Applications</a></li>
<li><a href="creator-using-qt-designer.html">Developing Widget Based Applications</a></li>
<li><a href="creator-usability.html">Optimizing Applications for Mobile Devices</a></li>
</ul>
</div>
<div class="sectionlist normallist">
<div class="heading">
<h2>Coding</h2>
</div>
<ul>
<li><a href="creator-editor-functions.html">Writing Code</a></li>
<li><a href="creator-finding-overview.html">Finding</a></li>
<li><a href="creator-editor-refactoring.html">Refactoring</a></li>
<li><a href="creator-editor-quick-fixes.html">Applying Refactoring Actions</a></li>
<li><a href="creator-beautifier.html">Beautifying Source Code</a></li>
<li><a href="creator-editor-options.html">Configuring the Editor</a></li>
<li><a href="creator-language-servers.html">Using Language Servers</a></li>
<li><a href="creator-mime-types.html">Editing MIME Types</a></li>
<li><a href="creator-modeling.html">Modeling</a></li>
<li><a href="creator-scxml.html">Editing State Charts</a></li>
</ul>
</div>
<div class="sectionlist normallist">
<div class="heading">
<h2>Building and Running</h2>
</div>
<ul>
<li><a href="creator-live-preview.html">Validating with Target Hardware</a></li>
<li><a href="creator-building-targets.html">Building for Multiple Platforms</a></li>
<li><a href="creator-running-targets.html">Running on Multiple Platforms</a></li>
<li><a href="creator-deployment.html">Deploying to Devices</a></li>
<li><a href="creator-connecting-mobile.html">Connecting Devices</a></li>
<li><a href="creator-build-process-customizing.html">Customizing the Build Process</a></li>
</ul>
</div>
<div class="sectionlist normallist">
<div class="heading">
<h2>Testing</h2>
</div>
<ul>
<li><a href="creator-debugging.html">Debugging</a></li>
<li><a href="creator-analyze-mode.html">Analyzing Code</a></li>
<li><a href="creator-autotest.html">Running Autotests</a></li>
<li><a href="creator-squish.html">Using Squish</a></li>
</ul>
</div>
<div class="sectionlist normallist">
<div class="heading">
<h2>Advanced Use</h2>
</div>
<ul>
<li><a href="creator-os-supported-platforms.html">Supported Platforms</a></li>
<li><a href="creator-project-other.html">Build Systems</a></li>
<li><a href="creator-cli.html">Using Command Line Options</a></li>
<li><a href="creator-keyboard-shortcuts.html">Keyboard Shortcuts</a></li>
<li><a href="creator-editor-external.html">Using External Tools</a></li>
<li><a href="creator-task-lists.html">Showing Task List Files in Issues</a></li>
<li><a href="creator-logging-viewer.html">Inspecting Internal Logs</a></li>
<li><a href="creator-telemetry.html">Managing Data Collection</a></li>
</ul>
</div>
<div class="sectionlist normallist">
<div class="heading">
<h2>Getting Help</h2>
</div>
<ul>
<li><a href="creator-help.html">Using the Help Mode</a></li>
<li><a href="creator-faq.html">FAQ</a></li>
<li><a href="creator-how-tos.html">How-tos</a></li>
<li><a href="creator-known-issues.html">Known Issues</a></li>
<li><a href="creator-glossary.html">Glossary</a></li>
<li><a href="technical-support.html">Technical Support</a></li>
<li><a href="creator-acknowledgements.html">Acknowledgements</a></li>
</ul>
</div>

View File

@@ -151,6 +151,8 @@
\li Opening the CMakeLists.txt file for the current run configuration in
the editor (\c {cmo}). This is the same build target as when you
select \uicontrol Build > \uicontrol {Build for Run Configuration}.
\li Running a particular run configuration (\c {rr} \e {<name>})
\li Switching to a particular run configuration (\c {sr} \e {<name>})
\endif
\endlist

View File

@@ -6,10 +6,10 @@ import qbs.Utilities
Module {
Depends { name: "cpp"; required: false }
property string qtcreator_display_version: '9.0.1'
property string qtcreator_display_version: '9.0.2'
property string ide_version_major: '9'
property string ide_version_minor: '0'
property string ide_version_release: '1'
property string ide_version_release: '2'
property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.'
+ ide_version_release

View File

@@ -1,6 +1,6 @@
QTCREATOR_VERSION = 9.0.1
QTCREATOR_VERSION = 9.0.2
QTCREATOR_COMPAT_VERSION = 9.0.0
QTCREATOR_DISPLAY_VERSION = 9.0.1
QTCREATOR_DISPLAY_VERSION = 9.0.2
QTCREATOR_COPYRIGHT_YEAR = 2022
IDE_DISPLAY_NAME = Qt Creator

View File

@@ -39,6 +39,13 @@ def get_arguments():
action='store_true', default=False)
parser.add_argument('--build-type', help='Build type to pass to CMake (defaults to RelWithDebInfo)',
default='RelWithDebInfo')
# zipping
parser.add_argument('--zip-threads', help='Sets number of threads to use for 7z. Use "+" for turning threads on '
'without a specific number of threads. This is directly passed to the "-mmt" option of 7z.',
default='2')
# signing
parser.add_argument('--keychain-unlock-script',
help='Path to script for unlocking the keychain used for signing (macOS)')
args = parser.parse_args()
args.with_debug_info = args.build_type == 'RelWithDebInfo'
return args
@@ -144,6 +151,21 @@ def package(args, paths):
common.check_print_call(['7z', 'a', '-mmt2',
os.path.join(paths.result, args.name + '-debug.7z'), '*'],
paths.debug_install)
if common.is_mac_platform() and common.codesign_call():
if args.keychain_unlock_script:
common.check_print_call([args.keychain_unlock_script], paths.install)
if os.environ.get('SIGNING_IDENTITY'):
signed_install_path = paths.install + '-signed'
common.copytree(paths.install, signed_install_path, symlinks=True)
apps = [d for d in os.listdir(signed_install_path) if d.endswith('.app')]
if apps:
app = apps[0]
common.conditional_sign_recursive(os.path.join(signed_install_path, app),
lambda ff: ff.endswith('.dylib'))
common.check_print_call(['7z', 'a', '-mmt' + args.zip_threads,
os.path.join(paths.result, args.name + '-signed.7z'),
app],
signed_install_path)
def get_paths(args):
Paths = collections.namedtuple('Paths',

View File

@@ -110,9 +110,12 @@ def is_ignored_windows_file(use_debug, basepath, filename):
return False
def ignored_qt_lib_files(path, filenames):
# Qt ships some unneeded object files in the qml plugins
# On Windows we also do not want to ship the wrong debug/release .dlls or .lib files etc
if not common.is_windows_platform():
return []
return [fn for fn in filenames if is_ignored_windows_file(debug_build, path, fn)]
return [fn for fn in filenames if fn.endswith('.cpp.o')]
return [fn for fn in filenames
if fn.endswith('.cpp.obj') or is_ignored_windows_file(debug_build, path, fn)]
def copy_qt_libs(target_qt_prefix_path, qt_bin_dir, qt_libs_dir, qt_plugin_dir, qt_qml_dir, plugins):
print("copying Qt libraries...")

View File

@@ -143,6 +143,9 @@ if [ ! -d "$app_path/Contents/Frameworks/QtCore.framework" ]; then
fi
# clean up unneeded object files that are part of Qt for some static libraries
find "$app_path" -ipath "*/objects-*" -delete
# clean up after macdeployqt
# it deploys some plugins (and libs for these) that interfere with what we want
echo "Cleaning up after macdeployqt..."

View File

@@ -239,7 +239,6 @@ class DumperBase():
def setFallbackQtVersion(self, args):
version = int(args.get('version', self.fallbackQtVersion))
DumperBase.warn("got fallback qt version 0x%x" % version)
self.fallbackQtVersion = version
def resetPerStepCaches(self):

View File

@@ -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>

View File

@@ -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) {

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -290,7 +290,10 @@ public:
return val.isUndefined() ? std::nullopt : std::make_optional(fromJsonValue<Error>(val));
}
void setError(const Error &error)
{ m_jsonObject.insert(errorKey, QJsonValue(error)); }
{
QTC_CHECK(error.isValid());
m_jsonObject.insert(errorKey, QJsonValue(error));
}
void clearError() { m_jsonObject.remove(errorKey); }
bool isValid(QString *errorMessage) const override

View File

@@ -917,7 +917,7 @@ QVariant AndroidBuildApkStep::data(Utils::Id id) const
if (id == Constants::AndroidNdkPlatform) {
if (auto qtVersion = QtKitAspect::qtVersion(kit()))
return AndroidConfigurations::currentConfig()
.bestNdkPlatformMatch(AndroidManager::minimumSDK(target()), qtVersion).mid(8);
.bestNdkPlatformMatch(AndroidManager::minimumSDK(target()), qtVersion);
return {};
}
if (id == Constants::NdkLocation) {

View File

@@ -15,6 +15,13 @@
namespace Autotest {
namespace Internal {
static QString functionWithDataTagAsArg(const QString &func, const QString &dataTag)
{
if (dataTag.contains(' '))
return '"' + func + ':' + dataTag + '"';
return func + ':' + dataTag;
}
QtTestTreeItem::QtTestTreeItem(ITestFramework *testFramework, const QString &name,
const Utils::FilePath &filePath, TestTreeItem::Type type)
: TestTreeItem(testFramework, name, filePath, type)
@@ -85,6 +92,13 @@ Qt::ItemFlags QtTestTreeItem::flags(int column) const
Qt::CheckState QtTestTreeItem::checked() const
{
switch (type()) {
case TestDataFunction:
case TestSpecialFunction:
return Qt::Unchecked;
default:
break;
}
return m_multiTest ? Qt::Unchecked : TestTreeItem::checked();
}
@@ -133,9 +147,8 @@ ITestConfiguration *QtTestTreeItem::testConfiguration() const
const TestTreeItem *parent = function ? function->parentItem() : nullptr;
if (!parent)
return nullptr;
const QString functionWithTag = function->name() + ':' + name();
config = new QtTestConfiguration(framework());
config->setTestCases(QStringList(functionWithTag));
config->setTestCases(QStringList(functionWithDataTagAsArg(function->name(), name())));
config->setProjectFile(parent->proFile());
config->setProject(project);
break;
@@ -178,7 +191,7 @@ static void fillTestConfigurationsFromCheckState(const TestTreeItem *item,
const QString funcName = grandChild->name();
grandChild->forFirstLevelChildren([&testCases, &funcName](ITestTreeItem *dataTag) {
if (dataTag->checked() == Qt::Checked)
testCases << funcName + ':' + dataTag->name();
testCases << functionWithDataTagAsArg(funcName, dataTag->name());
});
}
});
@@ -210,7 +223,7 @@ static void collectFailedTestInfo(TestTreeItem *item, QList<ITestConfiguration *
} else {
func->forFirstLevelChildren([&testCases, func](ITestTreeItem *dataTag) {
if (dataTag->data(0, FailedRole).toBool())
testCases << func->name() + ':' + dataTag->name();
testCases << functionWithDataTagAsArg(func->name(), dataTag->name());
});
}
});

View File

@@ -464,10 +464,9 @@ Utils::Text::Replacements ClangFormatBaseIndenter::replacements(QByteArray buffe
bool secondTry) const
{
QTC_ASSERT(replacementsToKeep != ReplacementsToKeep::All, return Utils::Text::Replacements());
QTC_ASSERT(!m_fileName.isEmpty(), return {});
clang::format::FormatStyle style = styleForFile();
QByteArray originalBuffer = buffer;
int utf8Offset = Utils::Text::utf8NthLineOffset(m_doc, buffer, startBlock.blockNumber() + 1);
QTC_ASSERT(utf8Offset >= 0, return Utils::Text::Replacements(););
int utf8Length = selectedLines(m_doc, startBlock, endBlock).toUtf8().size();
@@ -476,6 +475,7 @@ Utils::Text::Replacements ClangFormatBaseIndenter::replacements(QByteArray buffe
if (replacementsToKeep == ReplacementsToKeep::IndentAndBefore)
rangeStart = formattingRangeStart(startBlock, buffer, lastSaveRevision());
clang::format::FormatStyle style = styleForFile();
adjustFormatStyleForLineBreak(style, replacementsToKeep);
if (replacementsToKeep == ReplacementsToKeep::OnlyIndent) {
CharacterContext currentCharContext = CharacterContext::Unknown;
@@ -527,6 +527,7 @@ Utils::Text::Replacements ClangFormatBaseIndenter::replacements(QByteArray buffe
Utils::Text::Replacements ClangFormatBaseIndenter::format(
const TextEditor::RangesInLines &rangesInLines)
{
QTC_ASSERT(!m_fileName.isEmpty(), return {});
if (rangesInLines.empty())
return Utils::Text::Replacements();

View File

@@ -1477,7 +1477,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id)
if (DeviceTypeKitAspect::deviceTypeId(k) == Android::Constants::ANDROID_DEVICE_TYPE) {
buildSteps()->appendStep(Android::Constants::ANDROID_BUILD_APK_ID);
const auto &bs = buildSteps()->steps().constLast();
cmd.addArg("-DANDROID_NATIVE_API_LEVEL:STRING="
cmd.addArg("-DANDROID_PLATFORM:STRING="
+ bs->data(Android::Constants::AndroidNdkPlatform).toString());
auto ndkLocation = bs->data(Android::Constants::NdkLocation).value<FilePath>();
cmd.addArg("-DANDROID_NDK:PATH=" + ndkLocation.path());

View File

@@ -39,6 +39,7 @@
#include <utils/variablechooser.h>
#include <QComboBox>
#include <QCryptographicHash>
#include <QDialog>
#include <QDialogButtonBox>
#include <QGridLayout>
@@ -875,6 +876,7 @@ const char CMAKE_CXX_TOOLCHAIN_KEY[] = "CMAKE_CXX_COMPILER";
const char CMAKE_QMAKE_KEY[] = "QT_QMAKE_EXECUTABLE";
const char CMAKE_PREFIX_PATH_KEY[] = "CMAKE_PREFIX_PATH";
const char QTC_CMAKE_PRESET_KEY[] = "QTC_CMAKE_PRESET";
const char QTC_KIT_DEFAULT_CONFIG_HASH[] = "QTC_KIT_DEFAULT_CONFIG_HASH";
class CMakeConfigurationKitAspectWidget final : public KitAspectWidget
{
@@ -1135,6 +1137,43 @@ CMakeConfigItem CMakeConfigurationKitAspect::cmakePresetConfigItem(const Project
});
}
void CMakeConfigurationKitAspect::setKitDefaultConfigHash(ProjectExplorer::Kit *k)
{
const CMakeConfig defaultConfigExpanded
= Utils::transform(defaultConfiguration(k).toList(), [k](const CMakeConfigItem &item) {
CMakeConfigItem expanded(item);
expanded.value = item.expandedValue(k).toUtf8();
return expanded;
});
const QByteArray kitHash = computeDefaultConfigHash(defaultConfigExpanded);
CMakeConfig config = configuration(k);
config.append(CMakeConfigItem(QTC_KIT_DEFAULT_CONFIG_HASH, CMakeConfigItem::INTERNAL, kitHash));
setConfiguration(k, config);
}
CMakeConfigItem CMakeConfigurationKitAspect::kitDefaultConfigHashItem(const ProjectExplorer::Kit *k)
{
const CMakeConfig config = configuration(k);
return Utils::findOrDefault(config, [](const CMakeConfigItem &item) {
return item.key == QTC_KIT_DEFAULT_CONFIG_HASH;
});
}
QByteArray CMakeConfigurationKitAspect::computeDefaultConfigHash(const CMakeConfig &config)
{
const CMakeConfig defaultConfig = defaultConfiguration(nullptr);
const QByteArray configValues = std::accumulate(defaultConfig.begin(),
defaultConfig.end(),
QByteArray(),
[config](QByteArray &sum,
const CMakeConfigItem &item) {
return sum += config.valueOf(item.key);
});
return QCryptographicHash::hash(configValues, QCryptographicHash::Md5).toHex();
}
QVariant CMakeConfigurationKitAspect::defaultValue(const Kit *k) const
{
// FIXME: Convert preload scripts

View File

@@ -91,6 +91,10 @@ public:
static void setCMakePreset(ProjectExplorer::Kit *k, const QString &presetName);
static CMakeConfigItem cmakePresetConfigItem(const ProjectExplorer::Kit *k);
static void setKitDefaultConfigHash(ProjectExplorer::Kit *k);
static CMakeConfigItem kitDefaultConfigHashItem(const ProjectExplorer::Kit *k);
static QByteArray computeDefaultConfigHash(const CMakeConfig &config);
// KitAspect interface
ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const final;
void setup(ProjectExplorer::Kit *k) final;

View File

@@ -46,6 +46,7 @@ struct DirectoryData
QString cmakePresetDisplayname;
QString cmakePreset;
QByteArray cmakePresetDefaultConfigHash;
// Kit Stuff
FilePath cmakeBinary;
@@ -441,6 +442,28 @@ static QString extractVisualStudioPlatformFromConfig(const CMakeConfig &config)
return platform;
}
void updateCompilerPaths(CMakeConfig &config, const Environment &env)
{
auto updateRelativePath = [&config, env](const QByteArray &key) {
FilePath pathValue = config.filePathValueOf(key);
if (pathValue.isAbsolutePath() || pathValue.isEmpty())
return;
pathValue = env.searchInPath(pathValue.fileName());
auto it = std::find_if(config.begin(), config.end(), [&key](const CMakeConfigItem &item) {
return item.key == key;
});
QTC_ASSERT(it != config.end(), return);
it->value = pathValue.path().toUtf8();
};
updateRelativePath("CMAKE_C_COMPILER");
updateRelativePath("CMAKE_CXX_COMPILER");
}
QList<void *> CMakeProjectImporter::examineDirectory(const FilePath &importPath,
QString *warningMessage) const
{
@@ -518,6 +541,7 @@ QList<void *> CMakeProjectImporter::examineDirectory(const FilePath &importPath,
}
} else {
config = cache;
updateCompilerPaths(config, env);
config << CMakeConfigItem("CMAKE_COMMAND",
CMakeConfigItem::PATH,
configurePreset.cmakeExecutable.value().toUtf8());
@@ -526,6 +550,8 @@ QList<void *> CMakeProjectImporter::examineDirectory(const FilePath &importPath,
CMakeConfigItem::STRING,
configurePreset.generator.value().toUtf8());
}
data->cmakePresetDefaultConfigHash = CMakeConfigurationKitAspect::computeDefaultConfigHash(
config);
const FilePath qmake = qmakeFromCMakeCache(config);
if (!qmake.isEmpty())
@@ -662,8 +688,16 @@ bool CMakeProjectImporter::matchKit(void *directoryData, const Kit *k) const
bool haveCMakePreset = false;
if (!data->cmakePreset.isEmpty()) {
auto presetConfigItem = CMakeConfigurationKitAspect::cmakePresetConfigItem(k);
if (data->cmakePreset != presetConfigItem.expandedValue(k))
const auto presetConfigItem = CMakeConfigurationKitAspect::cmakePresetConfigItem(k);
const auto kitConfigHashItem = CMakeConfigurationKitAspect::kitDefaultConfigHashItem(k);
const QString presetName = presetConfigItem.expandedValue(k);
const bool haveSameKitConfigHash = kitConfigHashItem.isNull()
? true
: data->cmakePresetDefaultConfigHash
== kitConfigHashItem.value;
if (data->cmakePreset != presetName || !haveSameKitConfigHash)
return false;
ensureBuildDirectory(*data, k);
@@ -701,15 +735,6 @@ Kit *CMakeProjectImporter::createKit(void *directoryData) const
CMakeGeneratorKitAspect::setPlatform(k, data->platform);
CMakeGeneratorKitAspect::setToolset(k, data->toolset);
if (!data->cmakePresetDisplayname.isEmpty()) {
k->setUnexpandedDisplayName(
QString("%1 (CMake preset)").arg(data->cmakePresetDisplayname));
CMakeConfigurationKitAspect::setCMakePreset(k, data->cmakePreset);
}
if (!data->cmakePreset.isEmpty())
ensureBuildDirectory(*data, k);
SysRootKitAspect::setSysRoot(k, data->sysroot);
for (const ToolChainDescription &cmtcd : data->toolChains) {
@@ -724,6 +749,16 @@ Kit *CMakeProjectImporter::createKit(void *directoryData) const
ToolChainKitAspect::setToolChain(k, tcd.tcs.at(0));
}
if (!data->cmakePresetDisplayname.isEmpty()) {
k->setUnexpandedDisplayName(
QString("%1 (CMake preset)").arg(data->cmakePresetDisplayname));
CMakeConfigurationKitAspect::setCMakePreset(k, data->cmakePreset);
CMakeConfigurationKitAspect::setKitDefaultConfigHash(k);
}
if (!data->cmakePreset.isEmpty())
ensureBuildDirectory(*data, k);
qCInfo(cmInputLog) << "Temporary Kit created.";
});
}

View File

@@ -78,6 +78,7 @@ FindToolBar::FindToolBar(CurrentDocumentFind *currentDocumentFind)
m_horizontalSpacer = new QSpacerItem(40, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
m_close = new QToolButton;
m_close->setObjectName("closeFindToolBarButton");
auto findButtonsWidget = new QWidget;

View File

@@ -163,10 +163,10 @@ void GeneralSettingsWidget::fillLanguageBox() const
QStringList(QLatin1String("qtcreator*.qm")));
for (const FilePath &languageFile : languageFiles) {
const QString path = languageFile.path();
int start = path.indexOf('_') + 1;
int end = path.lastIndexOf('.');
const QString locale = path.mid(start, end-start);
const QString name = languageFile.fileName();
int start = name.indexOf('_') + 1;
int end = name.lastIndexOf('.');
const QString locale = name.mid(start, end - start);
// no need to show a language that creator will not load anyway
if (hasQmFilesForLocale(locale, creatorTrPath.toString())) {
QLocale tmpLocale(locale);

View File

@@ -165,6 +165,9 @@ void CppCodeStylePreferencesWidget::setCodeStyle(CppCodeStylePreferences *codeSt
setCodeStyleSettings(m_preferences->currentCodeStyleSettings(), false);
slotCurrentPreferencesChanged(m_preferences->currentPreferences(), false);
m_originalCppCodeStyleSettings = cppCodeStyleSettings();
m_originalTabSettings = tabSettings();
updatePreview();
}
@@ -253,6 +256,12 @@ void CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged()
if (m_blockUpdates)
return;
if (m_preferences) {
auto current = qobject_cast<CppCodeStylePreferences *>(m_preferences->currentPreferences());
if (current)
current->setCodeStyleSettings(cppCodeStyleSettings());
}
emit codeStyleSettingsChanged(cppCodeStyleSettings());
updatePreview();
}
@@ -262,6 +271,12 @@ void CppCodeStylePreferencesWidget::slotTabSettingsChanged(const TabSettings &se
if (m_blockUpdates)
return;
if (m_preferences) {
auto current = qobject_cast<CppCodeStylePreferences *>(m_preferences->currentPreferences());
if (current)
current->setTabSettings(settings);
}
emit tabSettingsChanged(settings);
updatePreview();
}
@@ -344,19 +359,21 @@ void CppCodeStylePreferencesWidget::addTab(CppCodeStyleWidget *page, QString tab
void CppCodeStylePreferencesWidget::apply()
{
if (m_preferences) {
auto current = qobject_cast<CppCodeStylePreferences *>(m_preferences->currentPreferences());
if (current) {
current->setTabSettings(tabSettings());
current->setCodeStyleSettings(cppCodeStyleSettings());
}
}
m_originalTabSettings = tabSettings();
m_originalCppCodeStyleSettings = cppCodeStyleSettings();
emit applyEmitted();
}
void CppCodeStylePreferencesWidget::finish()
{
if (m_preferences) {
auto current = qobject_cast<CppCodeStylePreferences *>(m_preferences->currentDelegate());
if (current) {
current->setCodeStyleSettings(m_originalCppCodeStyleSettings);
current->setTabSettings(m_originalTabSettings);
}
}
emit finishEmitted();
}

View File

@@ -8,13 +8,13 @@
#include <coreplugin/dialogs/ioptionspage.h>
#include <texteditor/icodestylepreferencesfactory.h>
#include <texteditor/tabsettings.h>
#include <QWidget>
#include <QPointer>
namespace TextEditor {
class FontSettings;
class TabSettings;
class SnippetEditorWidget;
class CodeStyleEditor;
class CodeStyleEditorWidget;
@@ -72,6 +72,8 @@ private:
CppCodeStylePreferences *m_preferences = nullptr;
Ui::CppCodeStyleSettingsPage *m_ui;
QList<TextEditor::SnippetEditorWidget *> m_previews;
CppCodeStyleSettings m_originalCppCodeStyleSettings;
TextEditor::TabSettings m_originalTabSettings;
bool m_blockUpdates = false;
signals:
void codeStyleSettingsChanged(const CppEditor::CppCodeStyleSettings &);

View File

@@ -159,7 +159,7 @@ DebuggerSettings::DebuggerSettings()
cdbBreakPointCorrection.setSettingsKey(cdbSettingsGroup, "BreakpointCorrection");
cdbBreakPointCorrection.setDefaultValue(true);
cdbBreakPointCorrection.setToolTip("<html><head/><body><p>" + Tr::tr(
"Attempts to correct the location of a breakpoint based on file and line number should"
"Attempts to correct the location of a breakpoint based on file and line number should "
"it be in a comment or in a line for which no code is generated. "
"The correction is based on the code model.") + "</p></body></html>");
cdbBreakPointCorrection.setLabelText(Tr::tr("Correct breakpoint location"));

View File

@@ -1891,6 +1891,7 @@ void ClientPrivate::handleMethod(const QString &method, const MessageId &id, con
Response<JsonObject, JsonObject> response(id);
ResponseError<JsonObject> error;
error.setCode(ResponseError<JsonObject>::MethodNotFound);
error.setMessage(QString("The client cannot handle the method '%1'.").arg(method));
response.setError(error);
sendResponse(response);
}

View File

@@ -621,15 +621,22 @@ Macros MsvcToolChain::msvcPredefinedMacros(const QStringList &cxxflags,
Macros predefinedMacros;
QStringList toProcess;
for (const QString &arg : cxxflags) {
if (arg.startsWith("/D") || arg.startsWith("-D")) {
const QString define = arg.mid(2);
predefinedMacros.append(Macro::fromKeyValue(define));
} else if (arg.startsWith("/U") || arg.startsWith("-U")) {
predefinedMacros.append(
{arg.mid(2).toLocal8Bit(), ProjectExplorer::MacroType::Undefine});
for (auto arg = cxxflags.begin(); arg != cxxflags.end(); ++arg) {
if (arg->startsWith("/D") || arg->startsWith("-D")) {
if (arg->length() > 2)
predefinedMacros.append(Macro::fromKeyValue(arg->mid(2)));
else if (std::next(arg) != cxxflags.end())
predefinedMacros.append(Macro::fromKeyValue(*++arg));
} else if (arg->startsWith("/U") || arg->startsWith("-U")) {
if (arg->length() > 2) {
predefinedMacros.append({arg->mid(2).toLocal8Bit(),
MacroType::Undefine});
} else if (std::next(arg) != cxxflags.end()) {
predefinedMacros.append({(++arg)->toLocal8Bit(),
MacroType::Undefine});
}
} else {
toProcess.append(arg);
toProcess.append(*arg);
}
}

View File

@@ -551,6 +551,11 @@ QWidget *QMakeStep::createConfigWidget()
BuildManager::buildLists({bc->cleanSteps()});
});
connect(widget, &QObject::destroyed, this, [this] {
abisLabel = nullptr;
abisListWidget = nullptr;
});
VariableChooser::addSupportForChildWidgets(widget, macroExpander());
return widget;

View File

@@ -24,6 +24,7 @@ ComponentNameDialog::ComponentNameDialog(QWidget *parent) :
{
setWindowTitle(Tr::tr("Move Component into Separate File"));
m_componentNameEdit = new Utils::ClassNameValidatingLineEdit;
m_componentNameEdit->setObjectName("componentNameEdit");
m_componentNameEdit->setPlaceholderText(Tr::tr("Component Name"));
m_messageLabel = new QLabel;
m_pathEdit = new Utils::PathChooser;

View File

@@ -930,29 +930,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;
}
@@ -988,13 +991,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());
@@ -1027,10 +1031,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)) {
QSettings(settingsFile(Core::ICore::resourcePath().toString()), QSettings::IniFormat)
.setValue(kInstallSettingsKey, *settingsDir);
QSettings settings(settingsFile(Core::ICore::resourcePath().toString()),
QSettings::IniFormat);
settings.setValue(kInstallSettingsKey, settingsDir->toVariant());
askForRestart = true;
}
}

View File

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

View File

@@ -4476,7 +4476,7 @@ void TextEditorWidgetPrivate::paintIndentDepth(PaintEventData &data,
const QTextLine textLine = blockData.layout->lineAt(0);
const QRectF rect = textLine.naturalTextRect();
qreal x = textLine.cursorToX(0) + data.offset.x() + qMax(0, q->cursorWidth() - 1)
qreal x = textLine.x() + data.offset.x() + qMax(0, q->cursorWidth() - 1)
+ horizontalAdvance * m_visualIndentOffset;
int paintColumn = 0;
@@ -4484,8 +4484,10 @@ void TextEditorWidgetPrivate::paintIndentDepth(PaintEventData &data,
while (paintColumn < depth) {
if (x >= 0) {
int paintPosition = tabSettings.positionAtColumn(text, paintColumn);
if (blockData.layout->lineForTextPosition(paintPosition).lineNumber() != 0)
if (q->lineWrapMode() == QPlainTextEdit::WidgetWidth
&& blockData.layout->lineForTextPosition(paintPosition).lineNumber() != 0) {
break;
}
const QPointF top(x, blockData.boundingRect.top());
const QPointF bottom(x, blockData.boundingRect.top() + rect.height());
const QLineF line(top, bottom);

View File

@@ -2,7 +2,7 @@
:*Qt Creator.Cancel Build_QToolButton {text='Cancel Build' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator.Clear_QToolButton {text='Clear' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator.Continue_Core::Internal::FancyToolButton {name='Debug.Button' toolTip?='Continue *' type='Core::Internal::FancyToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator.Find_Find::Internal::FindToolBar {name='Core__Internal__FindWidget' type='Core::Internal::FindToolBar' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Find'}
:*Qt Creator.Find_Find::Internal::FindToolBar {type='Core::Internal::FindToolBar' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Find'}
:*Qt Creator.FormEditorStack_Designer::Internal::FormEditorStack {name='FormEditorStack' type='Designer::Internal::FormEditorStack' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator.Interrupt_Core::Internal::FancyToolButton {name='Debug.Button' toolTip='Interrupt' type='Core::Internal::FancyToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator.ProjectSelectorDockWidget_QDockWidget {name='ProjectSelectorDockWidget' type='QDockWidget' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
@@ -61,7 +61,7 @@
:Dialog.OK_QPushButton {text='OK' type='QPushButton' unnamed='1' visible='1' window=':Dialog_QmlJSEditor::Internal::ComponentNameDialog'}
:Dialog.componentNameEdit_QLineEdit {name='componentNameEdit' type='Utils::ClassNameValidatingLineEdit' visible='1' window=':Dialog_QmlJSEditor::Internal::ComponentNameDialog'}
:Dialog_Debugger::Internal::SymbolPathsDialog {name='Debugger__Internal__SymbolPathsDialog' type='Debugger::Internal::SymbolPathsDialog' visible='1' windowTitle='Dialog'}
:Dialog_QmlJSEditor::Internal::ComponentNameDialog {name='QmlJSEditor__Internal__ComponentNameDialog' type='QmlJSEditor::Internal::ComponentNameDialog' visible='1' windowTitle='Move Component into Separate File'}
:Dialog_QmlJSEditor::Internal::ComponentNameDialog {type='QmlJSEditor::Internal::ComponentNameDialog' unnamed='1' visible='1' windowTitle='Move Component into Separate File'}
:Events.QmlProfilerEventsTable_QmlProfiler::Internal::QmlProfilerStatisticsMainView {container=':Qt Creator.Events_QDockWidget' name='QmlProfilerEventsTable' type='QmlProfiler::Internal::QmlProfilerStatisticsMainView' visible='1'}
:Failed to start application_QMessageBox {type='QMessageBox' unnamed='1' visible='1' windowTitle='Failed to start application'}
:File has been removed.Close_QPushButton {text='Close' type='QPushButton' unnamed='1' visible='1' window=':File has been removed_QMessageBox'}
@@ -118,7 +118,7 @@
:QML Debugging_QMessageBox {text='The option will only take effect if the project is recompiled. Do you want to recompile now?' type='QMessageBox' unnamed='1' visible='1'}
:Qt Creator.Add Bookmark_QToolButton {text='Add Bookmark' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.CloseDoc_QToolButton {toolTip?='Close Document *' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.CloseFind_QToolButton {name='close' type='QToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.CloseFind_QToolButton {name='closeFindToolBarButton' type='QToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.Compile Output_Core::OutputWindow {type='Core::OutputWindow' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Compile Output'}
:Qt Creator.Configure Project_QPushButton {text='Configure Project' type='QPushButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.DebugModeWidget_QSplitter {name='DebugModeWidget' type='QSplitter' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
@@ -132,8 +132,8 @@
:Qt Creator.QML debugging and profiling:_QLabel {text='QML debugging and profiling:' type='QLabel' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.QtCreator.MenuBar_QMenuBar {name='QtCreator.MenuBar' type='QMenuBar' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.ReRun_QToolButton {toolTip='Re-run this run-configuration.' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.Replace All_QToolButton {name='replaceAllButton' text='Replace All' type='QToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.Replace_QToolButton {name='replaceButton' text='Replace' type='QToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.Replace All_QToolButton {text='Replace All' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.Replace_QToolButton {text='Replace' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.Stop_QToolButton {text='Stop' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.Timeline_QDockWidget {container=':Qt Creator.DebugModeWidget_QSplitter' name='QmlProfiler.Timeline.DockDockWidget' type='QDockWidget' visible='1'}
:Qt Creator.Timeline_QTabBar {aboveWidget=':Qt Creator.Timeline_QDockWidget' container=':Qt Creator.DebugModeWidget_QSplitter' type='QTabBar' unnamed='1' visible='1'}

View File

@@ -209,8 +209,7 @@ def runVerify():
availableConfigs = iterateBuildConfigs()
if not availableConfigs:
test.fatal("Haven't found build configurations, quitting")
invokeMenuItem("File", "Save All")
invokeMenuItem("File", "Exit")
saveAndExit()
for kit, config in availableConfigs:
selectBuildConfig(kit, config)
test.log("Using build config '%s'" % config)

View File

@@ -336,9 +336,16 @@ def validateSearchResult(expectedCount):
# this function invokes context menu and command from it
def invokeContextMenuItem(editorArea, command1, command2 = None):
ctxtMenu = openContextMenuOnTextCursorPosition(editorArea)
snooze(1)
item1 = waitForObjectItem(objectMap.realName(ctxtMenu), command1, 2000)
for _ in range(2):
ctxtMenu = openContextMenuOnTextCursorPosition(editorArea)
snooze(1)
try:
item1 = waitForObjectItem(objectMap.realName(ctxtMenu), command1, 2000)
break
except:
test.warning("Context menu item not ready (%s) - trying once more." % command1)
type(editorArea, "<Escape>")
if command2 and platform.system() == 'Darwin':
mouseMove(item1)
activateItem(item1)
@@ -393,8 +400,7 @@ def openDocument(treeElement):
def earlyExit(details="No additional information"):
test.fail("Something went wrong running this test", details)
invokeMenuItem("File", "Save All")
invokeMenuItem("File", "Exit")
saveAndExit()
def openDocumentPlaceCursor(doc, line, additionalFunction=None):
cppEditorStr = ":Qt Creator_CppEditor::Internal::CPPEditorWidget"

View File

@@ -42,7 +42,5 @@ def main():
# wait for issues
test.verify(waitFor("issuesModel.rowCount() == 0", 3000),
"Verifying if error was properly cleared after code fix")
#save and exit
invokeMenuItem("File", "Save All")
invokeMenuItem("File", "Exit")
saveAndExit()

View File

@@ -46,16 +46,13 @@ def main():
waitForObjectItem(":Qt Creator_Utils::NavigationTreeView", addBranchWildcardToRoot(myCompTE), 1000)
except:
test.fail("Refactoring failed - file MyComponent.qml was not generated properly in project explorer")
#save and exit
invokeMenuItem("File", "Save All")
invokeMenuItem("File", "Exit")
saveAndExit()
return
test.passes("Refactoring - file MyComponent.qml was generated properly in project explorer")
# open MyComponent.qml file for verification
if not openDocument(myCompTE):
test.fatal("Could not open MyComponent.qml.")
invokeMenuItem("File", "Save All")
invokeMenuItem("File", "Exit")
saveAndExit()
return
editorArea = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
codeText = str(editorArea.plainText)

View File

@@ -19,8 +19,7 @@ def verifyNextLineIndented(editorArea, expectedIndentation):
def verifyIndentation(editorArea):
#verify indentation
if not placeCursorToLine(editorArea, "id: wdw"):
invokeMenuItem("File", "Save All")
invokeMenuItem("File", "Exit")
saveAndExit()
return False
type(editorArea, "<Up>")
expectedIndentations = [1,1,1,2,2,2,2,3,3,3,4,3,3,2,1]
@@ -58,6 +57,4 @@ def main():
# verify invoked indentation
if not verifyIndentation(editorArea):
return
# save and exit
invokeMenuItem("File", "Save All")
invokeMenuItem("File", "Exit")
saveAndExit()

View File

@@ -196,9 +196,8 @@ def main():
if current.endswith(".lhs"):
type(editor, ">")
type(editor, "<Tab>")
saveAndExit()
invokeMenuItem("File", "Save All")
invokeMenuItem("File", "Exit")
def init():
syntaxDirectory = __highlighterDefinitionsDirectory__()

View File

@@ -24,9 +24,7 @@ def main():
expectedHeaderName=headerName)
if not testRenameMacroAfterSourceMoving():
return
# save and exit
invokeMenuItem("File", "Save All")
invokeMenuItem("File", "Exit")
saveAndExit()
def testRenameMacroAfterSourceModification():
def __deleteAnyClass__():

View File

@@ -21,8 +21,7 @@ def main():
qmlFiles = [treebase + "focus\\.qml", treebase + "Core.ListMenu\\.qml"]
checkOutlineFor(qmlFiles)
testModify()
invokeMenuItem("File", "Save All")
invokeMenuItem("File", "Exit")
saveAndExit()
def checkOutlineFor(qmlFiles):
for qmlFile in qmlFiles:

View File

@@ -53,6 +53,8 @@ def pasteFile(sourceFile, protocol):
typeLines(editor, "// tst_codepasting %s" % datetime.utcnow())
sourceText = editor.plainText
invokeMenuItem("Tools", "Code Pasting", "Paste Snippet...")
pasteView = waitForObject(":Send to Codepaster_CodePaster::PasteView")
waitFor("pasteView.isActiveWindow")
selectFromCombo(":Send to Codepaster.protocolBox_QComboBox", protocol)
pasteEditor = waitForObject(":stackedWidget.plainTextEdit_QPlainTextEdit")
test.compare(pasteEditor.plainText, sourceText, "Verify that dialog shows text from the editor")

View File

@@ -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,
@@ -46,5 +48,4 @@ def main():
'Comparing line "%s" to expected "%s"' % (lineUnderCursor(editor), "ui->%s" % buttonName))
type(editor, "<Shift+Delete>") # Delete line
selectFromLocator("mainwindow.ui")
invokeMenuItem("File", "Save All")
invokeMenuItem("File", "Exit")
saveAndExit()

View File

@@ -33,5 +33,4 @@ def main():
type(editor, "<Up>")
test.verify(waitFor('str(lineUnderCursor(editor)).strip() == con[3]', 1000),
'Comparing line "%s" to expected "%s"' % (lineUnderCursor(editor), con[3]))
invokeMenuItem("File", "Save All")
invokeMenuItem("File", "Exit")
saveAndExit()