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

This commit is contained in:
The Qt Project
2022-12-09 13:07:47 +00:00
61 changed files with 598 additions and 460 deletions

View File

@@ -7,7 +7,7 @@ on:
- 'doc/**'
env:
QT_VERSION: 6.4.1
QT_VERSION: 6.4.0
CLANG_VERSION: 15.0.0
ELFUTILS_VERSION: 0.175
CMAKE_VERSION: 3.21.1

View File

@@ -64,6 +64,7 @@ function(create_python_xy PythonExe PythonZipFilePath)
set(ENV{PYTHONOPTIMIZE} "2")
execute_process(
COMMAND "${PythonExe}" -OO -m compileall "${CMAKE_CURRENT_BINARY_DIR}/python-lib" -b
${QTC_COMMAND_ERROR_IS_FATAL}
)
file(GLOB_RECURSE python_lib_files "${CMAKE_CURRENT_BINARY_DIR}/python-lib/*.py")
@@ -75,5 +76,6 @@ function(create_python_xy PythonExe PythonZipFilePath)
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar cf "${PythonZipFilePath}" . --format=zip
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/python-lib/"
${QTC_COMMAND_ERROR_IS_FATAL}
)
endfunction()

View File

@@ -778,14 +778,14 @@ function(add_qtc_executable name)
set(_code "${_code}
execute_process(COMMAND \"${CMAKE_INSTALL_NAME_TOOL}\"
-delete_rpath \"${_rpath}\"
\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${_EXECUTABLE_FILE_PATH}\")"
\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${_EXECUTABLE_FILE_PATH}\" ${QTC_COMMAND_ERROR_IS_FATAL})"
)
endforeach()
foreach(_rpath ${install_rpath})
set(_code "${_code}
execute_process(COMMAND \"${CMAKE_INSTALL_NAME_TOOL}\"
-add_rpath \"${_rpath}\"
\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${_EXECUTABLE_FILE_PATH}\")"
\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${_EXECUTABLE_FILE_PATH}\" ${QTC_COMMAND_ERROR_IS_FATAL})"
)
endforeach()
install(CODE "${_code}")

View File

@@ -1,3 +1,7 @@
if (CMAKE_VERSION GREATER_EQUAL 3.19)
set(QTC_COMMAND_ERROR_IS_FATAL COMMAND_ERROR_IS_FATAL ANY)
endif()
if (CMAKE_VERSION VERSION_LESS 3.18)
if (CMAKE_CXX_COMPILER_ID STREQUAL GNU)
set(BUILD_WITH_PCH OFF CACHE BOOL "" FORCE)

View File

@@ -22,7 +22,8 @@ function(qt5_query_qmake)
TIMEOUT 10
RESULT_VARIABLE _qmake_result
OUTPUT_VARIABLE _qmake_stdout
OUTPUT_STRIP_TRAILING_WHITESPACE)
OUTPUT_STRIP_TRAILING_WHITESPACE
${QTC_COMMAND_ERROR_IS_FATAL})
if (NOT "${_qmake_result}" STREQUAL "0")
message(FATAL_ERROR "Qmake did not execute successfully: ${_qmake_result}.")

View File

@@ -47,6 +47,7 @@ function(setup_dependencies_component)
\"\${_ide_app_target}\"
\"${_qmake_binary}\"
COMMAND_ECHO STDOUT
\${QTC_COMMAND_ERROR_IS_FATAL}
)
"
COMPONENT Dependencies

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.1-released/Qt"
variableValue: "http://ci-files02-hki.intra.qt.io/packages/jenkins/archive/qt/6.4/6.4.0-released/Qt"
- type: EnvironmentVariable
variableName: QTC_QT_MODULES
variableValue: "qt5compat qtbase qtdeclarative qtimageformats qtquick3d qtquickcontrols2 qtquicktimeline qtserialport qtshadertools qtsvg qttools qttranslations qtwebengine"

View File

@@ -65,7 +65,9 @@
To visualize whitespace in the editor, select \uicontrol Edit >
\uicontrol Preferences > \uicontrol {Text Editor} > \uicontrol Display >
\uicontrol {Visualize whitespace}. To visualize indentation, select
\uicontrol {Visualize Indent}.
\uicontrol {Visualize Indent}. To adjust the color of the visualization,
change the value of the Visual Whitespace setting of the editor color scheme
in \uicontrol {Font & Colors}.
\image qtcreator-options-text-editor-display.png "Text Editor Display preferences"

View File

@@ -682,6 +682,20 @@
\li An import statement has been added twice. For more information,
see \l{Import Statements}.
\row
\li M401
\li Error
\li Do not reference the root item as alias
\li The alias property cannot reference the root component directly.
Create an instance of the component instead.
\row
\li M402
\li Warning
\li Avoid referencing the root item in a hierarchy
\li The alias property cannot reference the root component in a
hierarchy. Create an instance of the component instead.
\endtable
\section1 Resetting the Code Model

View File

@@ -8,8 +8,8 @@
\title Using Squish
\l{https://doc.froglogic.com/squish/latest/}{Squish} is an automated GUI
testing framework for testing Android, iOS, Java, Qt, Tk, Windows, and
\l{https://www.qt.io/product/quality-assurance/squish}{Squish} is an automated GUI
testing framework for testing Android, iOS, Java, \macos, Qt, Tk, Windows, and
XView applications, as well as HTML-based web applications running in
browsers, such as Apple Safari, Mozilla Firefox, Google Chrome, and
Microsoft Internet Explorer and Edge.

View File

@@ -175,19 +175,24 @@
\section1 Supported Qt for MCUs SDKs
Since version 7.0.0, \QC supports version 2.0 and later of the Qt for MCUs SDK.
For older versions, refer to the following table.
\note The Qt for MCUs SDK 2.3 requires \QC 9.0.0, or later.
The following table lists the \QC versions you can use to develop
applications with particular Qt for MCUs SDK versions.
\table
\header
\li \QC version
\li Qt for MCUs SDK version
\row
\li 7.0.0 or later
\li 9.0.0 or later
\li 2.0 or later
\row
\li 7.0.0 up to 8.0.2
\li 2.0 up to 2.2
\row
\li 6.0.x
\li 1.3 or later, including 2.0 or later
\li 1.3 up to 2.2
\row
\li 4.12.4 up to 5.0.3
\li 1.3 up to 1.9

View File

@@ -21,7 +21,7 @@
\li {3,1} Development Platform
\header
\li \l Linux
\li \l macOS
\li \l \macos
\li \l Windows
\row
\li \l Android
@@ -50,7 +50,7 @@
\li
\row
\li \l{Microcontroller Units (MCU)}{MCUs}
\li
\li \image ok.png
\li
\li \image ok.png
\row

View File

@@ -90,7 +90,8 @@
\image webinardemo-qb-fastblur.png "Settings for exporting blurEffect layer"
We want to apply the \l {FastBlur} effect to the \e smallPopup UI control.
We want to apply the \l {https://doc.qt.io/qt-5/qml-qtgraphicaleffects-fastblur.html}
{Fast Blur} effect to the \e smallPopup UI control.
In the artboard, we have a \e blurEffect layer that we want to export as a
\e FastBlurItem component. In the \uicontrol Component field, we enter
\e FastBlurItem.

View File

@@ -78,7 +78,7 @@
\li Description
\row
\li \inlineimage icons/blend-mode-16px.png
\li \l [QML] {Blend}
\li \l {https://doc.qt.io/qt-5/qml-qtgraphicaleffects-blend.html}{Blend}
\li
\li Merges two source components by using a blend mode.
@@ -88,28 +88,34 @@
is subtracted from the source and written over it.
For a list of possible \uicontrol Mode values and examples of their
use, see \l{Blend::mode}{Blend.mode}.
use, see
\l{https://doc.qt.io/qt-5/qml-qtgraphicaleffects-blend.html#mode-prop}
{Blend.mode}.
\row
\li \inlineimage icons/brightness-contrast-16px.png
\li \l {BrightnessContrast}{Brightness Contrast}
\li \l {https://doc.qt.io/qt-5/qml-qtgraphicaleffects-brightnesscontrast.html}
{Brightness Contrast}
\li \inlineimage ok.png
\li Adjusts \uicontrol Brightness and \uicontrol Contrast.
\row
\li \inlineimage icons/colourize-16px.png
\li \l {ColorOverlay}{Color Overlay}
\li \l {https://doc.qt.io/qt-5/qml-qtgraphicaleffects-coloroverlay.html}
{Color Overlay}
\li \inlineimage ok.png
\li Alters the colors of the source component by applying an
\uicontrol {Overlay color}. You can use the color picker
to \l{Picking Colors}{select the color}.
\row
\li \inlineimage icons/colourize-16px.png
\li \l Colorize
\li \l {https://doc.qt.io/qt-5/qml-qtgraphicaleffects-colorize.html}
{Colorize}
\li \inlineimage ok.png
\li Sets the color in the HSL color space by specifying \uicontrol Hue,
\uicontrol Lightness, and \uicontrol Saturation values.
\row
\li \inlineimage icons/desaturation-16px.png
\li \l {Desaturate}{Desaturation}
\li \l {https://doc.qt.io/qt-5/qml-qtgraphicaleffects-desaturate.html}
{Desaturation}
\li \inlineimage ok.png
\li Reduces the saturation of the colors by the value set in the
\uicontrol Desaturation field. The value ranges from \c 0.0
@@ -118,7 +124,8 @@
of the source component.
\row
\li \inlineimage icons/directional-blur-16px.png
\li \l {DirectionalBlur}{Directional Blur}
\li \l {https://doc.qt.io/qt-5/qml-qtgraphicaleffects-directionalblur.html}
{Directional Blur}
\li \inlineimage ok.png
\li Applies a blur effect to the specified direction. The value of the
\uicontrol Angle field defines the direction of the blur. This
@@ -135,7 +142,8 @@
more samples are needed to preserve high visual quality.
\row
\li \inlineimage icons/displace-16px.png
\li \l Displace
\li \l {https://doc.qt.io/qt-5/qml-qtgraphicaleffects-displace.html}
{Displace}
\li \inlineimage ok.png
\li Moves the pixels of the source component according to the displacement
map specified in the \uicontrol {Displacement source} field.
@@ -148,7 +156,8 @@
maximum shift.
\row
\li \inlineimage icons/drop-shadow-16px.png
\li \l {DropShadow}{Drop Shadow}
\li \l {https://doc.qt.io/qt-5/qml-qtgraphicaleffects-dropshadow.html}
{Drop Shadow}
\li \inlineimage ok.png
\li Generates a soft shadow behind the source component using a
gaussian blur. This effect blurs the alpha channel of the input and
@@ -170,7 +179,8 @@
FPS on high-end graphics hardware.
\row
\li \inlineimage icons/fast-blur-16px.png
\li \l {FastBlur}{Fast Blur}
\li \l {https://doc.qt.io/qt-5/qml-qtgraphicaleffects-fastblur.html}
{Fast Blur}
\li \inlineimage ok.png
\li Applies a fast blur effect to one or more source components.
\uicontrol {Fast Blur} offers lower blur quality than
@@ -188,7 +198,8 @@
to provide good rendering performance.
\row
\li \inlineimage icons/gamma-adjust-16px.png
\li \l [QML] {GammaAdjust}{Gamma Adjust}
\li \l {https://doc.qt.io/qt-5/qml-qtgraphicaleffects-gammaadjust.html}
{Gamma Adjust}
\li \inlineimage ok.png
\li Alters the luminance of the source component. This effect is applied
to each pixel according to the curve that is pre-defined as a
@@ -196,7 +207,8 @@
field is used as the reciprocal scaling exponent.
\row
\li \inlineimage icons/gaussian-blur-16px.png
\li \l [QML] {GaussianBlur}{Gaussian Blur}
\li \l {https://doc.qt.io/qt-5/qml-qtgraphicaleffects-gaussianblur.html}
{Gaussian Blur}
\li
\li Applies a gaussian blur effect to one or more source components.
The effect softens the image by blurring it with an algorithm that
@@ -218,7 +230,7 @@
the radius.
\row
\li \inlineimage icons/glow-16px.png
\li \l [QML] {Glow}
\li \l {https://doc.qt.io/qt-5/qml-qtgraphicaleffects-glow.html}{Glow}
\li \inlineimage ok.png
\li Generates a halo-like glow around the source component. This effect
blurs the alpha channel of the source and colorizes it with
@@ -229,7 +241,8 @@
glow can be changed using the value of the \uicontrol Spread field.
\row
\li \inlineimage icons/hue-saturation-16px.png
\li \l {HueSaturation}{Hue Saturation}
\li \l {https://doc.qt.io/qt-5/qml-qtgraphicaleffects-huesaturation.html}
{Hue Saturation}
\li \inlineimage ok.png
\li Alters the source component colors in the HSL color space.
This effect is similar to the \uicontrol Colorize effect, but
@@ -239,7 +252,8 @@
setting them.
\row
\li \inlineimage icons/inner-shadow-16px.png
\li \l {InnerShadow}{Inner Shadow}
\li \l {https://doc.qt.io/qt-5/qml-qtgraphicaleffects-innershadow.html}
{Inner Shadow}
\li
\li Generates a colorized and blurred shadow inside the source using
the color that you specify in the \uicontrol {Inner shadow color}
@@ -261,7 +275,8 @@
check box.
\row
\li \inlineimage icons/levels-16px.png
\li \l {LevelAdjust}{Level Adjust}
\li \l {https://doc.qt.io/qt-5/qml-qtgraphicaleffects-leveladjust.html}
{Level Adjust}
\li \inlineimage ok.png
\li Adjusts color levels in the RGBA color space. This effect adjusts
the source component colors separately for each color channel. Source
@@ -291,7 +306,8 @@
value of the \uicontrol Minimum output field.
\row
\li \inlineimage icons/mask-blur-16px.png
\li \l {MaskedBlur}{Masked Blur}
\li \l {https://doc.qt.io/qt-5/qml-qtgraphicaleffects-maskedblur.html}
{Masked Blur}
\li
\li Softens the image by blurring it. The intensity of the blur can be
controlled for each pixel by specifying a \uicontrol {Mask source},
@@ -306,7 +322,8 @@
samples produce better quality, but are slower to render.
\row
\li \inlineimage icons/opacity-mask-16px.png
\li \l {OpacityMask}{Opacity Mask}
\li \l {https://doc.qt.io/qt-5/qml-qtgraphicaleffects-opacitymask.html}
{Opacity Mask}
\li \inlineimage ok.png
\li Masks the source component with another component specified in the
\uicontrol {Mask source} field. The mask component gets rendered into an
@@ -321,7 +338,8 @@
with the mask alpha: \c {As * Am}.
\row
\li \inlineimage icons/radial-blur-16px.png
\li \l {RadialBlur}{Radial Blur}
\li \l {https://doc.qt.io/qt-5/qml-qtgraphicaleffects-radialblur.html}
{Radial Blur}
\li
\li Applies a directional blur effect in a circular direction around the
component's center point. This effect makes the source component appear
@@ -336,7 +354,8 @@
samples are needed to preserve high visual quality.
\row
\li \inlineimage icons/recursive-blur-16px.png
\li \l {RecursiveBlur}{Recursive Blur}
\li \l {https://doc.qt.io/qt-5/qml-qtgraphicaleffects-recursiveblur.html}
{Recursive Blur}
\li
\li Blurs repeatedly, providing a strong blur effect. This effect
softens the image by blurring it with an algorithm that uses a
@@ -352,7 +371,8 @@
but the result is produced asynchronously and takes more time.
\row
\li \inlineimage icons/threshold-16px.png
\li \l {ThresholdMask}{Threshold Mask}
\li \l {https://doc.qt.io/qt-5/qml-qtgraphicaleffects-thresholdmask.html}
{Threshold Mask}
\li \inlineimage ok.png
\li Masks the source component with another component specified by
\uicontrol {Mask source}. The value of the \uicontrol Spread
@@ -363,7 +383,8 @@
opaque mask pixels by adding interpolated values between them.
\row
\li \inlineimage icons/zoom-blur-16px.png
\li \l {ZoomBlur}{Zoom Blur}
\li \l {https://doc.qt.io/qt-5/qml-qtgraphicaleffects-zoomblur.html}
{Zoom Blur}
\li
\li Applies a directional blur effect towards source component's
center point. This effect makes the source component appear to be

View File

@@ -392,7 +392,8 @@
Typically, this component should be a shader effect with a source texture
specified. You can use the effects in \uicontrol Components >
\uicontrol {Qt Quick Studio Effects} that are based on the components in the
\l {Qt Graphical Effects} module.
\l {https://doc.qt.io/qt-5/qtgraphicaleffects-index.html}
{Qt Graphical Effects} module.
To enable the component to pass the layer's offscreen surface to the effect
correctly, the \uicontrol {Sampler name} field is set to the source

View File

@@ -165,8 +165,15 @@ def qdump__std____1__stack(d, value):
def std_1_string_dumper(d, value):
charType = value['__l']['__data_'].dereference().type
D = None
D = value[0][0][0][0]
try: # LLDB
D = value[0][0][0][0]
except: # GDB
try: # std::string
D = value[0].members(True)[0][0][0]
except: # std::u16string, std::u32string
D = value[2].members(True)[0][0][0]
layoutDecider = D[0][0]
if not layoutDecider:
@@ -218,13 +225,14 @@ def std_1_string_dumper(d, value):
if short_mode and location_sp:
d.putCharArrayHelper(d.extractPointer(location_sp), size,
charType, d.currentItemFormat())
charType, d.currentItemFormat())
else:
d.putCharArrayHelper(location_sp.integer(),
size, charType, d.currentItemFormat())
size, charType, d.currentItemFormat())
return
def qdump__std____1__string(d, value):
std_1_string_dumper(d, value)

File diff suppressed because it is too large Load Diff

View File

@@ -494,6 +494,11 @@ int main(int argc, char **argv)
qputenv("QT_ENABLE_REGEXP_JIT", "0");
}
if (Utils::HostOsInfo::isLinuxHost() && !qEnvironmentVariableIsSet("GTK_THEME"))
// Work around QTCREATORBUG-28497:
// Prevent Qt's GTK3 platform theme plugin from enforcing a dark palette
qputenv("GTK_THEME", ":light");
#if defined(QTC_FORCE_XCB)
if (Utils::HostOsInfo::isLinuxHost() && !qEnvironmentVariableIsSet("QT_QPA_PLATFORM")) {
// Enforce XCB on Linux/Gnome, if the user didn't override via QT_QPA_PLATFORM

View File

@@ -1529,7 +1529,7 @@ static QString normalizePathSegmentHelper(const QString &name)
{
const int len = name.length();
if (len == 0)
if (len == 0 || name.contains("%{"))
return name;
int i = len - 1;

View File

@@ -374,8 +374,10 @@ void InfoBarDisplay::update()
if (infoWidgetCloseButton)
hbox->addWidget(infoWidgetCloseButton);
} else {
infoWidgetCloseButton->setText(info.m_cancelButtonText);
hbox->addWidget(infoWidgetCloseButton);
if (infoWidgetCloseButton) {
infoWidgetCloseButton->setText(info.m_cancelButtonText);
hbox->addWidget(infoWidgetCloseButton);
}
if (infoWidgetSuppressButton)
hbox->addWidget(infoWidgetSuppressButton);
}

View File

@@ -60,8 +60,12 @@ QStringList GTestConfiguration::argumentsForTestRunner(QStringList *omitted) con
}
const QStringList &testSets = testCases();
if (!testSets.isEmpty())
arguments << "--gtest_filter=\"" + testSets.join(':') + '"';
if (!testSets.isEmpty()) {
if (isDebugRunMode()) // debugger does its own special quoting
arguments << "--gtest_filter=" + testSets.join(':');
else
arguments << "--gtest_filter=\"" + testSets.join(':') + '"';
}
auto gSettings = static_cast<GTestSettings *>(framework()->testSettings());
if (!gSettings)

View File

@@ -127,7 +127,7 @@ static void checkSystemForClangdSuitability()
if (ClangdSettings::hardwareFulfillsRequirements())
return;
ClangdSettings::setUseClangd(false);
ClangdSettings::setUseClangdAndSave(false);
const QString warnStr = ClangModelManagerSupport::tr("The use of clangd for the C/C++ "
"code model was disabled, because it is likely that its memory requirements "
"would be higher than what your system can handle.");
@@ -148,7 +148,7 @@ static void checkSystemForClangdSuitability()
return label;
});
info.addCustomButton(ClangModelManagerSupport::tr("Enable Anyway"), [clangdWarningSetting] {
ClangdSettings::setUseClangd(true);
ClangdSettings::setUseClangdAndSave(true);
Core::ICore::infoBar()->removeInfo(clangdWarningSetting);
});
Core::ICore::infoBar()->addInfo(info);
@@ -517,12 +517,14 @@ void ClangModelManagerSupport::updateLanguageClient(ProjectExplorer::Project *pr
&& currentClient->project() == docProject) {
continue;
}
if (!docProject || docProject == project) {
if (currentClient)
currentClient->closeDocument(doc);
LanguageClientManager::openDocumentWithClient(doc, client);
hasDocuments = true;
if (docProject != project
&& (docProject || !ProjectFile::isHeader(doc->filePath()))) {
continue;
}
if (currentClient)
currentClient->closeDocument(doc);
LanguageClientManager::openDocumentWithClient(doc, client);
hasDocuments = true;
}
for (auto it = m_queuedShadowDocuments.begin(); it != m_queuedShadowDocuments.end();) {
@@ -625,11 +627,13 @@ void ClangModelManagerSupport::claimNonProjectSources(ClangdClient *client)
}
if (!ClangdSettings::instance().sizeIsOkay(doc->filePath()))
continue;
if (!ProjectExplorer::SessionManager::projectForFile(doc->filePath())) {
if (currentClient)
currentClient->closeDocument(doc);
LanguageClientManager::openDocumentWithClient(doc, client);
}
if (ProjectExplorer::SessionManager::projectForFile(doc->filePath()))
continue;
if (client->project() && !ProjectFile::isHeader(doc->filePath()))
continue;
if (currentClient)
currentClient->closeDocument(doc);
LanguageClientManager::openDocumentWithClient(doc, client);
}
}
@@ -717,7 +721,7 @@ void ClangModelManagerSupport::onEditorOpened(Core::IEditor *editor)
return;
if (sessionModeEnabled())
project = nullptr;
else if (!project)
else if (!project && ProjectFile::isHeader(document->filePath()))
project = fallbackProject();
if (ClangdClient * const client = clientForProject(project))
LanguageClientManager::openDocumentWithClient(textDocument, client);

View File

@@ -93,7 +93,7 @@ FilterDialog::FilterDialog(const Checks &checks, QWidget *parent)
buttonBox,
}.attachTo(this);
connect(m_view->selectionModel(), &QItemSelectionModel::selectionChanged, this, [&] {
connect(m_view->selectionModel(), &QItemSelectionModel::selectionChanged, this, [=] {
const bool hasSelection = !m_view->selectionModel()->selectedRows().isEmpty();
buttonBox->button(QDialogButtonBox::Ok)->setEnabled(hasSelection);
});

View File

@@ -1621,10 +1621,24 @@ bool CMakeBuildConfiguration::fromMap(const QVariantMap &map)
m_buildSystem->setInitialCMakeArguments(cmd.splitArguments());
}
d->m_clearSystemConfigureEnvironment = map.value(QLatin1String(CLEAR_SYSTEM_ENVIRONMENT_KEY))
.toBool();
// Upgrading from Qt Creator version <9 to 9, if the build environment is set
// apply the specific values to the configure environment
auto settingsKey = [map](const QLatin1String &configureKey, const QLatin1String &buildKey) {
if (!map.contains(configureKey) && map.contains(buildKey))
return buildKey;
return configureKey;
};
const QLatin1String clearSystemEnvironmentKey
= settingsKey(QLatin1String(CLEAR_SYSTEM_ENVIRONMENT_KEY),
QLatin1String(ProjectExplorer::Constants::CLEAR_SYSTEM_ENVIRONMENT_KEY));
const QLatin1String userEnvironmentChangesKey
= settingsKey(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY),
QLatin1String(ProjectExplorer::Constants::USER_ENVIRONMENT_CHANGES_KEY));
d->m_clearSystemConfigureEnvironment = map.value(clearSystemEnvironmentKey).toBool();
d->m_userConfigureEnvironmentChanges = EnvironmentItem::fromStringList(
map.value(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY)).toStringList());
map.value(userEnvironmentChangesKey).toStringList());
updateAndEmitConfigureEnvironmentChanged();

View File

@@ -96,14 +96,24 @@ Internal::PresetsData CMakeProject::combinePresets(Internal::PresetsData &cmakeP
for (const auto &p : presets)
presetsHash.insert(p.name, p);
auto resolveInherits = [](const auto &presetsHash, auto &presetsList) {
auto resolveInherits = [](auto &presetsHash, auto &presetsList) {
Utils::sort(presetsList, [](const auto &left, const auto &right) {
if (left.inherits) {
if (left.inherits.value().contains(right.name))
return false;
}
return true;
});
for (auto &p : presetsList) {
if (!p.inherits)
continue;
for (const QString &inheritFromName : p.inherits.value())
if (presetsHash.contains(inheritFromName))
for (const QString &inheritFromName : p.inherits.value()) {
if (presetsHash.contains(inheritFromName)) {
p.inheritFrom(presetsHash[inheritFromName]);
presetsHash[p.name] = p;
}
}
}
};

View File

@@ -164,8 +164,8 @@ void CompilationDatabaseTests::testFilterArguments()
{"RELATIVE_PLUGIN_PATH", "\"../lib/qtcreator/plugins\""},
{"QT_CREATOR", "1"}}));
QCOMPARE(testData.fileKind, CppEditor::ProjectFile::Kind::CXXSource);
QCOMPARE(testData.sysRoot.toString(), HostOsInfo::isWindowsHost() ? QString("C:\\sysroot\\embedded")
: QString("/opt/sysroot/embedded"));
QCOMPARE(testData.sysRoot.toUserOutput(), HostOsInfo::isWindowsHost()
? QString("C:\\sysroot\\embedded") : QString("/opt/sysroot/embedded"));
}
static QString kCmakeCommand

View File

@@ -752,7 +752,7 @@ void ExternalToolConfig::showInfoForItem(const QModelIndex &index)
static FilePath getUserFilePath(const QString &proposalFileName)
{
const FilePath resourceDir(ICore::userResourcePath());
const FilePath externalToolsDir = resourceDir / "externalTools";
const FilePath externalToolsDir = resourceDir / "externaltools";
if (!externalToolsDir.isDir())
externalToolsDir.createDir();

View File

@@ -79,7 +79,7 @@ int DocumentModelPrivate::rowCount(const QModelIndex &parent) const
return 0;
}
void DocumentModelPrivate::addEntry(DocumentModel::Entry *entry)
DocumentModel::Entry *DocumentModelPrivate::addEntry(DocumentModel::Entry *entry)
{
const Utils::FilePath filePath = entry->fileName();
@@ -95,9 +95,8 @@ void DocumentModelPrivate::addEntry(DocumentModel::Entry *entry)
this, [this, document = previousEntry->document] { itemChanged(document); });
}
delete entry;
entry = nullptr;
disambiguateDisplayNames(previousEntry);
return;
return nullptr;
}
auto positions = positionEntry(m_entries, entry);
@@ -115,6 +114,7 @@ void DocumentModelPrivate::addEntry(DocumentModel::Entry *entry)
itemChanged(document);
});
endInsertRows();
return entry;
}
bool DocumentModelPrivate::disambiguateDisplayNames(DocumentModel::Entry *entry)
@@ -411,8 +411,7 @@ DocumentModel::Entry *DocumentModelPrivate::addSuspendedDocument(const FilePath
entry->document->setPreferredDisplayName(displayName);
entry->document->setId(id);
entry->isSuspended = true;
d->addEntry(entry);
return entry;
return d->addEntry(entry);
}
DocumentModel::Entry *DocumentModelPrivate::firstSuspendedEntry()

View File

@@ -33,7 +33,7 @@ public:
Qt::DropActions supportedDragActions() const override;
QStringList mimeTypes() const override;
void addEntry(DocumentModel::Entry *entry);
DocumentModel::Entry *addEntry(DocumentModel::Entry *entry);
void removeDocument(int idx);
std::optional<int> indexOfFilePath(const Utils::FilePath &filePath) const;

View File

@@ -720,7 +720,9 @@ void ICore::raiseWindow(QWidget *widget)
if (!widget)
return;
QWidget *window = widget->window();
if (window && window == m_mainwindow) {
if (!window)
return;
if (window == m_mainwindow) {
m_mainwindow->raiseWindow();
} else {
window->raise();

View File

@@ -253,6 +253,12 @@ bool ClangdSettings::useClangd() const
void ClangdSettings::setUseClangd(bool use) { instance().m_data.useClangd = use; }
void ClangdSettings::setUseClangdAndSave(bool use)
{
setUseClangd(use);
instance().saveSettings();
}
bool ClangdSettings::hardwareFulfillsRequirements()
{
instance().m_data.haveCheckedHardwareReqirements = true;

View File

@@ -133,6 +133,7 @@ public:
static ClangdSettings &instance();
bool useClangd() const;
static void setUseClangd(bool use);
static void setUseClangdAndSave(bool use);
static bool hardwareFulfillsRequirements();
static bool haveCheckedHardwareRequirements();

View File

@@ -161,8 +161,8 @@ void CppCodeStylePreferencesWidget::setCodeStyle(CppCodeStylePreferences *codeSt
slotCurrentPreferencesChanged(currentPreferences);
});
setTabSettings(m_preferences->tabSettings());
setCodeStyleSettings(m_preferences->codeStyleSettings(), false);
setTabSettings(m_preferences->currentTabSettings());
setCodeStyleSettings(m_preferences->currentCodeStyleSettings(), false);
slotCurrentPreferencesChanged(m_preferences->currentPreferences(), false);
updatePreview();

View File

@@ -12,7 +12,6 @@
#include "cppeditordocument.h"
#include "cppeditorwidget.h"
#include "cppfilesettingspage.h"
#include "cpphighlighter.h"
#include "cppincludehierarchy.h"
#include "cppmodelmanager.h"
#include "cppoutline.h"
@@ -261,21 +260,6 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err
connect(openInNextSplitAction, &QAction::triggered,
this, [] { CppModelManager::switchHeaderSource(true); });
QAction * const showPreprocessedAction = new QAction(tr("Show Preprocessed Source"), this);
command = ActionManager::registerAction(showPreprocessedAction,
Constants::SHOW_PREPROCESSED_FILE, context);
mcpptools->addAction(command);
connect(showPreprocessedAction, &QAction::triggered,
this, [] { CppModelManager::showPreprocessedFile(false); });
QAction * const showPreprocessedInSplitAction = new QAction
(tr("Show Preprocessed Source in Next Split"), this);
command = ActionManager::registerAction(showPreprocessedInSplitAction,
Constants::SHOW_PREPROCESSED_FILE_SPLIT, context);
mcpptools->addAction(command);
connect(showPreprocessedInSplitAction, &QAction::triggered,
this, [] { CppModelManager::showPreprocessedFile(true); });
MacroExpander *expander = globalMacroExpander();
expander->registerVariable("Cpp:LicenseTemplate",
tr("The license template."),
@@ -316,9 +300,6 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err
contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST);
touchBar->addAction(cmd, Core::Constants::G_TOUCHBAR_NAVIGATION);
cmd = ActionManager::command(Constants::SHOW_PREPROCESSED_FILE);
contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST);
cmd = ActionManager::command(TextEditor::Constants::FOLLOW_SYMBOL_UNDER_CURSOR);
cmd->setTouchBarText(tr("Follow", "text on macOS touch bar"));
contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST);
@@ -398,6 +379,22 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err
contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST);
cppToolsMenu->addAction(cmd);
QAction * const showPreprocessedAction = new QAction(tr("Show Preprocessed Source"), this);
command = ActionManager::registerAction(showPreprocessedAction,
Constants::SHOW_PREPROCESSED_FILE, context);
mcpptools->addAction(command);
contextMenu->addAction(command, Constants::G_CONTEXT_FIRST);
connect(showPreprocessedAction, &QAction::triggered,
this, [] { CppModelManager::showPreprocessedFile(false); });
QAction * const showPreprocessedInSplitAction = new QAction
(tr("Show Preprocessed Source in Next Split"), this);
command = ActionManager::registerAction(showPreprocessedInSplitAction,
Constants::SHOW_PREPROCESSED_FILE_SPLIT, context);
mcpptools->addAction(command);
connect(showPreprocessedInSplitAction, &QAction::triggered,
this, [] { CppModelManager::showPreprocessedFile(true); });
d->m_openTypeHierarchyAction = new QAction(tr("Open Type Hierarchy"), this);
cmd = ActionManager::registerAction(d->m_openTypeHierarchyAction, Constants::OPEN_TYPE_HIERARCHY, context);
cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+Shift+T") : tr("Ctrl+Shift+T")));

View File

@@ -6,6 +6,7 @@
#include "cppeditorconstants.h"
#include <coreplugin/icore.h>
#include <utils/filepath.h>
#include <utils/mimeutils.h>
#include <QDebug>
@@ -125,6 +126,11 @@ bool ProjectFile::isHeader(ProjectFile::Kind kind)
}
}
bool ProjectFile::isHeader(const Utils::FilePath &fp)
{
return isHeader(classify(fp.toString()));
}
bool ProjectFile::isSource(ProjectFile::Kind kind)
{
switch (kind) {

View File

@@ -7,6 +7,8 @@
#include <QString>
namespace Utils { class FilePath; }
namespace CppEditor {
class CPPEDITOR_EXPORT ProjectFile
@@ -39,6 +41,7 @@ public:
static bool isSource(Kind kind);
static bool isHeader(Kind kind);
static bool isHeader(const Utils::FilePath &fp);
static bool isC(Kind kind);
static bool isCxx(Kind kind);
static bool isAmbiguousHeader(const QString &filePath);

View File

@@ -2871,6 +2871,56 @@ static void formatCdbBreakPointResponse(int modelId, const QString &responseId,
str << '\n';
}
// Helper to retrieve an int child from GDBMI
static inline std::optional<int> gdbmiChildToInt(const GdbMi &parent, const char *childName)
{
const GdbMi childBA = parent[childName];
if (childBA.isValid()) {
bool ok;
const int v = childBA.data().toInt(&ok);
if (ok)
return v;
}
return std::nullopt;
}
// Helper to retrieve an bool child from GDBMI
static inline std::optional<bool> gdbmiChildToBool(const GdbMi &parent, const char *childName)
{
const GdbMi childBA = parent[childName];
return childBA.isValid() ? std::make_optional(childBA.data() == "true") : std::nullopt;
}
// Parse extension command listing breakpoints.
// Note that not all fields are returned, since file, line, function are encoded
// in the expression (that is in addition deleted on resolving for a bp-type breakpoint).
BreakpointParameters CdbEngine::parseBreakPoint(const GdbMi &gdbmi)
{
BreakpointParameters result;
result.enabled = gdbmiChildToBool(gdbmi, "enabled").value_or(result.enabled);
result.pending = gdbmiChildToBool(gdbmi, "deferred").value_or(result.pending);
const GdbMi moduleG = gdbmi["module"];
if (moduleG.isValid())
result.module = moduleG.data();
const GdbMi sourceFileName = gdbmi["srcfile"];
if (sourceFileName.isValid()) {
NormalizedSourceFileName mappedFile = sourceMapNormalizeFileNameFromDebugger(
sourceFileName.data());
result.fileName = Utils::FilePath::fromUserInput(mappedFile.fileName);
const GdbMi lineNumber = gdbmi["srcline"];
if (lineNumber.isValid())
result.lineNumber = lineNumber.data().toULongLong(nullptr, 0);
}
const GdbMi addressG = gdbmi["address"];
if (addressG.isValid())
result.address = addressG.data().toULongLong(nullptr, 0);
if (const std::optional<int> ignoreCount = gdbmiChildToInt(gdbmi, "passcount"))
result.ignoreCount = *ignoreCount - 1;
result.threadSpec = gdbmiChildToInt(gdbmi, "thread").value_or(result.threadSpec);
return result;
}
void CdbEngine::handleBreakPoints(const DebuggerResponse &response)
{
if (debugBreakpoints) {
@@ -2896,8 +2946,7 @@ void CdbEngine::handleBreakPoints(const DebuggerResponse &response)
for (const GdbMi &breakPointG : response.data) {
// Might not be valid if there is not id
const QString responseId = breakPointG["id"].data();
BreakpointParameters reportedResponse;
parseBreakPoint(breakPointG, &reportedResponse);
BreakpointParameters reportedResponse = parseBreakPoint(breakPointG);
if (debugBreakpoints)
qDebug(" Parsed %s: pending=%d %s\n", qPrintable(responseId),
reportedResponse.pending,

View File

@@ -168,6 +168,7 @@ private:
unsigned parseStackTrace(const GdbMi &data, bool sourceStepInto);
void mergeStartParametersSourcePathMap();
void checkQtSdkPdbFiles(const QString &module);
BreakpointParameters parseBreakPoint(const GdbMi &gdbmi);
const QString m_tokenPrefix;
void handleSetupFailure(const QString &errorMessage);

View File

@@ -189,64 +189,6 @@ QString cdbClearBreakpointCommand(const Breakpoint &bp)
return "bc " + QString::number(firstBreakPoint) + '-' + QString::number(lastBreakPoint);
}
// Helper to retrieve an int child from GDBMI
static inline bool gdbmiChildToInt(const GdbMi &parent, const char *childName, int *target)
{
const GdbMi childBA = parent[childName];
if (childBA.isValid()) {
bool ok;
const int v = childBA.data().toInt(&ok);
if (ok) {
*target = v;
return true;
}
}
return false;
}
// Helper to retrieve an bool child from GDBMI
static inline bool gdbmiChildToBool(const GdbMi &parent, const char *childName, bool *target)
{
const GdbMi childBA = parent[childName];
if (childBA.isValid()) {
*target = childBA.data() == "true";
return true;
}
return false;
}
// Parse extension command listing breakpoints.
// Note that not all fields are returned, since file, line, function are encoded
// in the expression (that is in addition deleted on resolving for a bp-type breakpoint).
void parseBreakPoint(const GdbMi &gdbmi, BreakpointParameters *r,
QString *expression /* = 0 */)
{
gdbmiChildToBool(gdbmi, "enabled", &(r->enabled));
gdbmiChildToBool(gdbmi, "deferred", &(r->pending));
const GdbMi moduleG = gdbmi["module"];
if (moduleG.isValid())
r->module = moduleG.data();
const GdbMi sourceFileName = gdbmi["srcfile"];
if (sourceFileName.isValid()) {
r->fileName = Utils::FilePath::fromUserInput(
Utils::FileUtils::normalizedPathName(sourceFileName.data()));
const GdbMi lineNumber = gdbmi["srcline"];
if (lineNumber.isValid())
r->lineNumber = lineNumber.data().toULongLong(nullptr, 0);
}
if (expression) {
const GdbMi expressionG = gdbmi["expression"];
if (expressionG.isValid())
*expression = expressionG.data();
}
const GdbMi addressG = gdbmi["address"];
if (addressG.isValid())
r->address = addressG.data().toULongLong(nullptr, 0);
if (gdbmiChildToInt(gdbmi, "passcount", &(r->ignoreCount)))
r->ignoreCount--;
gdbmiChildToInt(gdbmi, "thread", &(r->threadSpec));
}
QString cdbWriteMemoryCommand(quint64 addr, const QByteArray &data)
{
QString cmd;

View File

@@ -38,10 +38,6 @@ QString cdbAddBreakpointCommand(const BreakpointParameters &d,
const QList<QPair<QString, QString> > &sourcePathMapping,
const QString &responseId = QString());
QString cdbClearBreakpointCommand(const Breakpoint &bp);
// Parse extension command listing breakpoints.
// Note that not all fields are returned, since file, line, function are encoded
// in the expression (that is in addition deleted on resolving for a bp-type breakpoint).
void parseBreakPoint(const GdbMi &gdbmi, BreakpointParameters *r, QString *expression = nullptr);
// Write memory (f ...).
QString cdbWriteMemoryCommand(quint64 addr, const QByteArray &data);

View File

@@ -249,8 +249,18 @@ void DebuggerKitAspect::fix(Kit *k)
setup(k);
return;
}
const Abi tcAbi = ToolChainKitAspect::targetAbi(k);
if (item->matchTarget(tcAbi) != DebuggerItem::DoesNotMatch)
Abi kitAbi;
if (ToolChainKitAspect::toolChains(k).isEmpty()) {
if (DeviceTypeKitAspect::deviceTypeId(k)
!= ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) {
return;
}
kitAbi = Abi(Abi::UnknownArchitecture, Abi::hostAbi().os());
} else {
kitAbi = ToolChainKitAspect::targetAbi(k);
}
if (item->matchTarget(kitAbi) != DebuggerItem::DoesNotMatch)
return;
k->setValue(DebuggerKitAspect::id(), QVariant());
setup(k);

View File

@@ -268,6 +268,7 @@ void ThreadsHandler::setCurrentThread(const Thread &thread)
m_currentThread = thread;
thread->update();
threadSwitcher()->setCurrentIndex(thread->index().row());
}
void ThreadsHandler::notifyGroupCreated(const QString &groupId, const QString &pid)

View File

@@ -221,8 +221,14 @@ CommandLine DockerProcessImpl::fullLocalCommandLine(bool interactive)
QStringList args;
if (!m_setup.m_workingDirectory.isEmpty()) {
QTC_CHECK(DeviceManager::deviceForPath(m_setup.m_workingDirectory) == m_device);
args.append({"cd", m_setup.m_workingDirectory.path()});
FilePath workingDir = m_setup.m_workingDirectory;
if (DeviceManager::deviceForPath(workingDir) != m_device) {
QTC_CHECK(m_device->ensureReachable(workingDir));
workingDir = workingDir.onDevice(m_device->rootPath());
}
args.append({"cd", workingDir.path()});
args.append("&&");
}

View File

@@ -419,7 +419,7 @@ void LanguageClientManager::openDocumentWithClient(TextEditor::TextDocument *doc
client->openDocument(document);
else
client->activateDocument(document);
} else if (Core::EditorManager::currentEditor()->document() == document) {
} else if (Core::EditorManager::currentDocument() == document) {
TextEditor::IOutlineWidgetFactory::updateOutline();
}
}

View File

@@ -63,7 +63,7 @@ constexpr auto armgcc_mimxrt1050_evk_freertos_json = R"(
"id": "ARMGCC_CMAKE_TOOLCHAIN_FILE",
"cmakeVar": "CMAKE_TOOLCHAIN_FILE",
"type": "file",
"defaultValue": "%{Qul_ROOT}//lib/cmake/Qul/toolchain/armgcc.cmake",
"defaultValue": "%{Qul_ROOT}/lib/cmake/Qul/toolchain/armgcc.cmake",
"visible": false,
"optional": false
}

View File

@@ -63,7 +63,7 @@ constexpr auto armgcc_mimxrt1064_evk_freertos_json = R"(
"id": "ARMGCC_CMAKE_TOOLCHAIN_FILE",
"cmakeVar": "CMAKE_TOOLCHAIN_FILE",
"type": "file",
"defaultValue": "%{Qul_ROOT}//lib/cmake/Qul/toolchain/armgcc.cmake",
"defaultValue": "%{Qul_ROOT}/lib/cmake/Qul/toolchain/armgcc.cmake",
"visible": false,
"optional": false
}

View File

@@ -63,7 +63,7 @@ constexpr auto armgcc_mimxrt1170_evk_freertos_json = R"(
"id": "ARMGCC_CMAKE_TOOLCHAIN_FILE",
"cmakeVar": "CMAKE_TOOLCHAIN_FILE",
"type": "file",
"defaultValue": "%{Qul_ROOT}//lib/cmake/Qul/toolchain/armgcc.cmake",
"defaultValue": "%{Qul_ROOT}/lib/cmake/Qul/toolchain/armgcc.cmake",
"visible": false,
"optional": false
}

View File

@@ -62,7 +62,7 @@ constexpr auto armgcc_stm32f769i_discovery_freertos_json = R"(
"id": "ARMGCC_CMAKE_TOOLCHAIN_FILE",
"cmakeVar": "CMAKE_TOOLCHAIN_FILE",
"type": "file",
"defaultValue": "%{Qul_ROOT}//lib/cmake/Qul/toolchain/armgcc.cmake",
"defaultValue": "%{Qul_ROOT}/lib/cmake/Qul/toolchain/armgcc.cmake",
"visible": false,
"optional": false
}

View File

@@ -62,7 +62,7 @@ constexpr auto armgcc_stm32h750b_discovery_baremetal_json = R"(
"id": "ARMGCC_CMAKE_TOOLCHAIN_FILE",
"cmakeVar": "CMAKE_TOOLCHAIN_FILE",
"type": "file",
"defaultValue": "%{Qul_ROOT}//lib/cmake/Qul/toolchain/armgcc.cmake",
"defaultValue": "%{Qul_ROOT}/lib/cmake/Qul/toolchain/armgcc.cmake",
"visible": false,
"optional": false
}

View File

@@ -14,6 +14,7 @@ namespace PerfProfiler {
class PERFPROFILER_EXPORT PerfRunConfigurationAspect :
public ProjectExplorer::GlobalOrProjectAspect
{
Q_OBJECT
public:
PerfRunConfigurationAspect(ProjectExplorer::Target *target);
};

View File

@@ -46,8 +46,6 @@ using namespace Utils;
const char BUILD_STEP_LIST_COUNT[] = "ProjectExplorer.BuildConfiguration.BuildStepListCount";
const char BUILD_STEP_LIST_PREFIX[] = "ProjectExplorer.BuildConfiguration.BuildStepList.";
const char CLEAR_SYSTEM_ENVIRONMENT_KEY[] = "ProjectExplorer.BuildConfiguration.ClearSystemEnvironment";
const char USER_ENVIRONMENT_CHANGES_KEY[] = "ProjectExplorer.BuildConfiguration.UserEnvironmentChanges";
const char CUSTOM_PARSERS_KEY[] = "ProjectExplorer.BuildConfiguration.CustomParsers";
const char PARSE_STD_OUT_KEY[] = "ProjectExplorer.BuildConfiguration.ParseStandardOutput";
@@ -378,8 +376,9 @@ QVariantMap BuildConfiguration::toMap() const
{
QVariantMap map = ProjectConfiguration::toMap();
map.insert(QLatin1String(CLEAR_SYSTEM_ENVIRONMENT_KEY), d->m_clearSystemEnvironment);
map.insert(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY), EnvironmentItem::toStringList(d->m_userEnvironmentChanges));
map.insert(QLatin1String(Constants::CLEAR_SYSTEM_ENVIRONMENT_KEY), d->m_clearSystemEnvironment);
map.insert(QLatin1String(Constants::USER_ENVIRONMENT_CHANGES_KEY),
EnvironmentItem::toStringList(d->m_userEnvironmentChanges));
map.insert(QLatin1String(BUILD_STEP_LIST_COUNT), 2);
map.insert(QLatin1String(BUILD_STEP_LIST_PREFIX) + QString::number(0), d->m_buildSteps.toMap());
@@ -393,8 +392,10 @@ QVariantMap BuildConfiguration::toMap() const
bool BuildConfiguration::fromMap(const QVariantMap &map)
{
d->m_clearSystemEnvironment = map.value(QLatin1String(CLEAR_SYSTEM_ENVIRONMENT_KEY)).toBool();
d->m_userEnvironmentChanges = EnvironmentItem::fromStringList(map.value(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY)).toStringList());
d->m_clearSystemEnvironment = map.value(QLatin1String(Constants::CLEAR_SYSTEM_ENVIRONMENT_KEY))
.toBool();
d->m_userEnvironmentChanges = EnvironmentItem::fromStringList(
map.value(QLatin1String(Constants::USER_ENVIRONMENT_CHANGES_KEY)).toStringList());
updateCacheAndEmitEnvironmentChanged();

View File

@@ -480,7 +480,8 @@ JsonWizardFactory *JsonWizardFactory::createWizardFactory(const QVariantMap &dat
if (!factory->initialize(data, baseDir, errorMessage)) {
delete factory;
factory = nullptr;
Core::MessageManager::writeDisrupting(*errorMessage);
if (verbose())
Core::MessageManager::writeDisrupting(*errorMessage);
}
return factory;
}

View File

@@ -4175,6 +4175,7 @@ void ProjectExplorerPluginPrivate::updateSessionMenu()
auto *ag = new QActionGroup(m_sessionMenu);
connect(ag, &QActionGroup::triggered, this, &ProjectExplorerPluginPrivate::setSession);
const QString activeSession = SessionManager::activeSession();
const bool isDefaultVirgin = SessionManager::isDefaultVirgin();
QStringList sessions = SessionManager::sessions();
std::sort(std::next(sessions.begin()), sessions.end(), [](const QString &s1, const QString &s2) {
@@ -4189,7 +4190,7 @@ void ProjectExplorerPluginPrivate::updateSessionMenu()
QAction *act = ag->addAction(actionText);
act->setData(session);
act->setCheckable(true);
if (session == activeSession)
if (session == activeSession && !isDefaultVirgin)
act->setChecked(true);
}
m_sessionMenu->addActions(ag->actions());
@@ -4198,9 +4199,7 @@ void ProjectExplorerPluginPrivate::updateSessionMenu()
void ProjectExplorerPluginPrivate::setSession(QAction *action)
{
QString session = action->data().toString();
if (session != SessionManager::activeSession())
SessionManager::loadSession(session);
SessionManager::loadSession(action->data().toString());
}
void ProjectExplorerPlugin::setProjectExplorerSettings(const ProjectExplorerSettings &pes)

View File

@@ -219,6 +219,8 @@ const char SETTINGS_MENU_HIDE_BUILD[] = "Menu/HideBuild";
const char SETTINGS_MENU_HIDE_DEBUG[] = "Menu/HideDebug";
const char SETTINGS_MENU_HIDE_ANALYZE[] = "Menu/HideAnalyze";
const char SESSION_TASKFILE_KEY[] = "TaskList.File";
const char CLEAR_SYSTEM_ENVIRONMENT_KEY[] = "ProjectExplorer.BuildConfiguration.ClearSystemEnvironment";
const char USER_ENVIRONMENT_CHANGES_KEY[] = "ProjectExplorer.BuildConfiguration.UserEnvironmentChanges";
// UI texts
PROJECTEXPLORER_EXPORT QString msgAutoDetected();

View File

@@ -479,10 +479,10 @@ function(get_and_add_as_subdirectory name repository git_tag build_dir source_di
)
execute_process(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" "${build_dir}/${name}"
WORKING_DIRECTORY "${build_dir}/${name}"
COMMAND_ERROR_IS_FATAL ANY
${QTC_COMMAND_ERROR_IS_FATAL}
)
execute_process(COMMAND "${CMAKE_COMMAND}" --build "${build_dir}/${name}"
COMMAND_ERROR_IS_FATAL ANY
${QTC_COMMAND_ERROR_IS_FATAL}
)
add_subdirectory(${source_dir}/${name}/${source_subdir} ${name})
endfunction()

View File

@@ -92,7 +92,7 @@ void SquishXmlOutputHandler::mergeResultFiles(const Utils::FilePaths &reportFile
// and finally write test tag (case name) - the prolog tag (for test case)
// will be written outside the if
const QXmlStreamAttributes testAttributes = reader.attributes();
QXmlStreamReader::TokenType token;
QXmlStreamReader::TokenType token = QXmlStreamReader::NoToken;
while (!reader.atEnd()) {
token = reader.readNext();
if (token != QXmlStreamReader::Characters)

View File

@@ -5887,7 +5887,7 @@ void TextEditorWidget::extraAreaMouseEvent(QMouseEvent *e)
{
QTextCursor cursor = cursorForPosition(QPoint(0, e->pos().y()));
int markWidth;
int markWidth = 0;
extraAreaWidth(&markWidth);
const bool inMarkArea = e->pos().x() <= markWidth && e->pos().x() >= 0;

View File

@@ -124,14 +124,13 @@ void UpdateInfoPlugin::startCheckForUpdates()
return; // do not trigger while update task is already running
QFutureInterface<void> futureIf;
FutureProgress *futureProgress
= ProgressManager::addTimedTask(futureIf,
tr("Checking for Updates"),
Id("UpdateInfo.CheckingForUpdates"),
60);
futureProgress->setKeepOnFinish(FutureProgress::KeepOnFinishTillUserInteraction);
futureProgress->setSubtitleVisibleInStatusBar(true);
connect(futureProgress, &FutureProgress::canceled, this, [this, futureIf]() mutable {
d->m_progress = ProgressManager::addTimedTask(futureIf,
tr("Checking for Updates"),
Id("UpdateInfo.CheckingForUpdates"),
60);
d->m_progress->setKeepOnFinish(FutureProgress::KeepOnFinishTillUserInteraction);
d->m_progress->setSubtitleVisibleInStatusBar(true);
connect(d->m_progress, &FutureProgress::canceled, this, [this, futureIf]() mutable {
futureIf.reportCanceled();
futureIf.reportFinished();
stopCheckForUpdates();

View File

@@ -4061,15 +4061,15 @@ void tst_Dumpers::dumper_data()
+ Check("list.0", "[0]", "1", "int")
+ Check("list.1", "[1]", "2", "int")
+ Check("list.2", "[2]", "3", "int")
+ Check("v3", "", "@QVariant (@QList<int>)") % Qt5
+ Check("v3", "", "@QVariant (@QList<int>)") % NeedsInferiorCall % Qt5
+ Check("v3.data", "<3 items>", TypePattern(".*QList<int>")) % NeedsInferiorCall % Qt5
+ Check("v3.data.0", "[0]", "1", "int") % NeedsInferiorCall % Qt5
+ Check("v3.data.1", "[1]", "2", "int") % NeedsInferiorCall % Qt5
+ Check("v3.data.2", "[2]", "3", "int") % NeedsInferiorCall % Qt5
+ Check("v3", "<3 items>", "@QVariant (@QList<int>)") % Qt6
+ Check("v3.0", "[0]", "1", "int") % NeedsInferiorCall % Qt6
+ Check("v3.1", "[1]", "2", "int") % NeedsInferiorCall % Qt6
+ Check("v3.2", "[2]", "3", "int") % NeedsInferiorCall % Qt6;
+ Check("v3.0", "[0]", "1", "int") % Qt6
+ Check("v3.1", "[1]", "2", "int") % Qt6
+ Check("v3.2", "[2]", "3", "int") % Qt6;
QTest::newRow("QVariant2")

View File

@@ -115,6 +115,14 @@ void tst_gdb::version_data()
QTest::newRow("Debian 7.12 git")
<< "GNU gdb (Debian 7.12-6) 7.12.0.20161007-git"
<< 71200 << 6 << false << false;
QTest::newRow("Debian 10.1 git")
<< "GNU gdb (Debian 10.1-1.7) 10.1.90.20210103-git"
<< 100100 << 1 << false << false;
QTest::newRow("Ubuntu 22.04")
<< "GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1"
<< 120100 << 0 << false << false;
}
static QString chopConst(QString type)

View File

@@ -43,7 +43,7 @@ function(download_jdk)
message("Downloading: ${jdk_url}")
file(DOWNLOAD ${jdk_url} ./jdk.zip SHOW_PROGRESS)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf ./jdk.zip)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf ./jdk.zip COMMAND_ERROR_IS_FATAL ANY)
endfunction()
function(download_android_commandline)
@@ -61,7 +61,7 @@ function(download_android_commandline)
file(DOWNLOAD ${android_cmdtools_url} ./android_commandline_tools.zip SHOW_PROGRESS)
file(MAKE_DIRECTORY android-sdk)
file(MAKE_DIRECTORY android-cmdlinetools)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf ../android_commandline_tools.zip WORKING_DIRECTORY android-cmdlinetools)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf ../android_commandline_tools.zip WORKING_DIRECTORY android-cmdlinetools COMMAND_ERROR_IS_FATAL ANY)
endfunction()
function(setup_android)
@@ -78,9 +78,11 @@ function(setup_android)
file(WRITE ${CMAKE_CURRENT_LIST_DIR}/accept_license.txt "y\ny\ny\ny\ny\ny\ny\ny\ny\ny\n")
execute_process(
INPUT_FILE ${CMAKE_CURRENT_LIST_DIR}/accept_license.txt
COMMAND ${sdkmanager} --licenses --sdk_root=${CMAKE_CURRENT_LIST_DIR}/android-sdk)
COMMAND ${sdkmanager} --licenses --sdk_root=${CMAKE_CURRENT_LIST_DIR}/android-sdk
COMMAND_ERROR_IS_FATAL ANY)
execute_process(
COMMAND ${sdkmanager} --update --sdk_root=${CMAKE_CURRENT_LIST_DIR}/android-sdk)
COMMAND ${sdkmanager} --update --sdk_root=${CMAKE_CURRENT_LIST_DIR}/android-sdk
COMMAND_ERROR_IS_FATAL ANY)
execute_process(
COMMAND ${sdkmanager}
"platforms;${ANDROID_PLATFORM}"
@@ -90,13 +92,15 @@ function(setup_android)
"cmdline-tools;latest"
"tools"
"emulator"
"ndk-bundle" --sdk_root=${CMAKE_CURRENT_LIST_DIR}/android-sdk)
"ndk-bundle" --sdk_root=${CMAKE_CURRENT_LIST_DIR}/android-sdk
COMMAND_ERROR_IS_FATAL ANY)
if (WIN32)
execute_process(
COMMAND ${sdkmanager}
"extras;google;usb_driver"
--sdk_root=${CMAKE_CURRENT_LIST_DIR}/android-sdk)
--sdk_root=${CMAKE_CURRENT_LIST_DIR}/android-sdk
COMMAND_ERROR_IS_FATAL ANY)
endif()
endfunction()