Merge "Merge remote-tracking branch 'origin/7.0'"

This commit is contained in:
The Qt Project
2022-02-14 12:53:55 +00:00
37 changed files with 404 additions and 165 deletions

View File

@@ -7,7 +7,7 @@ on:
- 'doc/**'
env:
QT_VERSION: 6.2.1
QT_VERSION: 6.2.3
CLANG_VERSION: 130
ELFUTILS_VERSION: 0.175
CMAKE_VERSION: 3.21.1
@@ -31,12 +31,12 @@ jobs:
environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat",
is_msvc: true
}
- {
name: "Windows Latest MinGW", artifact: "Windows-MinGW",
os: windows-latest,
cc: "gcc", cxx: "g++",
is_msvc: false
}
# - {
# name: "Windows Latest MinGW", artifact: "Windows-MinGW",
# os: windows-latest,
# cc: "gcc", cxx: "g++",
# is_msvc: false
# }
- {
name: "Ubuntu Latest GCC", artifact: "Linux",
os: ubuntu-latest,
@@ -123,22 +123,22 @@ jobs:
if ("x${{ matrix.config.environment_script }}" STREQUAL "x")
set(qt_package_arch_suffix "win64_mingw81")
set(qt_dir_prefix "${qt_version}/mingw81_64")
set(qt_package_suffix "-Windows-Windows_10-Mingw-Windows-Windows_10-X86_64")
set(qt_package_suffix "-Windows-Windows_10_21H2-Mingw-Windows-Windows_10_21H2-X86_64")
elseif ("${{ matrix.config.environment_script }}" MATCHES "vcvars64.bat")
set(qt_package_arch_suffix "win64_msvc2019_64")
set(qt_dir_prefix "${qt_version}/msvc2019_64")
set(qt_package_suffix "-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64")
set(qt_package_suffix "-Windows-Windows_10_21H2-MSVC2019-Windows-Windows_10_21H2-X86_64")
endif()
elseif ("${{ runner.os }}" STREQUAL "Linux")
set(url_os "linux_x64")
set(qt_package_arch_suffix "gcc_64")
set(qt_dir_prefix "${qt_version}/gcc_64")
set(qt_package_suffix "-Linux-RHEL_8_2-GCC-Linux-RHEL_8_2-X86_64")
set(qt_package_suffix "-Linux-RHEL_8_4-GCC-Linux-RHEL_8_4-X86_64")
elseif ("${{ runner.os }}" STREQUAL "macOS")
set(url_os "mac_x64")
set(qt_package_arch_suffix "clang_64")
set(qt_dir_prefix "${qt_version}/macos")
set(qt_package_suffix "-MacOS-MacOS_11_00-Clang-MacOS-MacOS_11_00-X86_64-ARM64")
set(qt_package_suffix "-MacOS-MacOS_12-Clang-MacOS-MacOS_12-X86_64-ARM64")
endif()
set(qt_base_url "https://\${qt_mirror}/online/qtsdkrepository/${url_os}/desktop/qt6_${qt_version_dotless}")
@@ -673,10 +673,10 @@ jobs:
name: "Windows Latest MSVC", artifact: "Windows-MSVC",
os: ubuntu-latest
}
- {
name: "Windows Latest MinGW", artifact: "Windows-MinGW",
os: ubuntu-latest
}
# - {
# name: "Windows Latest MinGW", artifact: "Windows-MinGW",
# os: ubuntu-latest
# }
- {
name: "Ubuntu Latest GCC", artifact: "Linux",
os: ubuntu-latest

View File

@@ -7,7 +7,7 @@ instructions:
variableValue: "RelWithDebInfo"
- type: EnvironmentVariable
variableName: QTC_QT_BASE_URL
variableValue: "http://ci-files02-hki.intra.qt.io/packages/jenkins/archive/qt/6.2/6.2.0-final-released/"
variableValue: "http://ci-files02-hki.intra.qt.io/packages/jenkins/archive/qt/6.2/6.2.3-final-released/Qt6.2.3"
- type: EnvironmentVariable
variableName: QTC_QT_MODULES
variableValue: "qt5compat qtbase qtdeclarative qtimageformats qtquick3d qtquickcontrols2 qtquicktimeline qtserialport qtshadertools qtsvg qttools qttranslations"

View File

@@ -32,7 +32,7 @@ instructions:
property: host.os
in_values: [MacOS, Linux, Windows]
- type: ExecuteCommand
command: "python -u {{.AgentWorkingDir}}/build/qtsdk/packaging-tools/install_qt.py --qt-path {{.AgentWorkingDir}}/build/qt5_install_dir --temp-path {{.AgentWorkingDir}}/build/qt_temp --base-url {{.Env.QTC_QT_BASE_URL}} --base-url-postfix=-Linux-RHEL_8_2-GCC-Linux-RHEL_8_2-X86_64.7z --icu7z http://master.qt.io/development_releases/prebuilt/icu/prebuilt/56.1/icu-linux-g++-Rhel7.2-x64.7z {{.Env.QTC_QT_MODULES}}"
command: "python -u {{.AgentWorkingDir}}/build/qtsdk/packaging-tools/install_qt.py --qt-path {{.AgentWorkingDir}}/build/qt5_install_dir --temp-path {{.AgentWorkingDir}}/build/qt_temp --base-url {{.Env.QTC_QT_BASE_URL}} --base-url-postfix=-Linux-RHEL_8_4-GCC-Linux-RHEL_8_4-X86_64.7z --icu7z http://master.qt.io/development_releases/prebuilt/icu/prebuilt/56.1/icu-linux-g++-Rhel7.2-x64.7z {{.Env.QTC_QT_MODULES}}"
executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution
maxTimeInSeconds: 3600
maxTimeBetweenOutput: 360
@@ -42,7 +42,7 @@ instructions:
property: host.os
equals_value: Linux
- type: ExecuteCommand
command: "python -u {{.AgentWorkingDir}}/build/qtsdk/packaging-tools/install_qt.py --qt-path {{.AgentWorkingDir}}/build/qt5_install_dir --temp-path {{.AgentWorkingDir}}/build/qt_temp --base-url {{.Env.QTC_QT_BASE_URL}} --base-url-postfix=-MacOS-MacOS_11_00-Clang-MacOS-MacOS_11_00-X86_64-ARM64.7z {{.Env.QTC_QT_MODULES}}"
command: "python -u {{.AgentWorkingDir}}/build/qtsdk/packaging-tools/install_qt.py --qt-path {{.AgentWorkingDir}}/build/qt5_install_dir --temp-path {{.AgentWorkingDir}}/build/qt_temp --base-url {{.Env.QTC_QT_BASE_URL}} --base-url-postfix=-MacOS-MacOS_12-Clang-MacOS-MacOS_12-X86_64-ARM64.7z {{.Env.QTC_QT_MODULES}}"
executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution
maxTimeInSeconds: 3600
maxTimeBetweenOutput: 360

View File

@@ -179,6 +179,8 @@ QImage Quick3DNodeInstance::renderPreviewImage(const QSize &previewImageSize) co
return transparentImage;
}
}
#else
Q_UNUSED(previewImageSize)
#endif
return {};
}

View File

@@ -96,90 +96,93 @@ QtObject {
readonly property string distributeSpacingVertical: "\u005B"
readonly property string distributeTop: "\u005C"
readonly property string download: "\u005D"
readonly property string edit: "\u005E"
readonly property string eyeDropper: "\u005F"
readonly property string favorite: "\u0060"
readonly property string flowAction: "\u0061"
readonly property string flowTransition: "\u0062"
readonly property string fontStyleBold: "\u0063"
readonly property string fontStyleItalic: "\u0064"
readonly property string fontStyleStrikethrough: "\u0065"
readonly property string fontStyleUnderline: "\u0066"
readonly property string gradient: "\u0067"
readonly property string gridView: "\u0068"
readonly property string idAliasOff: "\u0069"
readonly property string idAliasOn: "\u006A"
readonly property string infinity: "\u006B"
readonly property string keyframe: "\u006C"
readonly property string linkTriangle: "\u006D"
readonly property string linked: "\u006E"
readonly property string listView: "\u006F"
readonly property string lockOff: "\u0070"
readonly property string lockOn: "\u0071"
readonly property string mergeCells: "\u0072"
readonly property string minus: "\u0073"
readonly property string mirror: "\u0074"
readonly property string orientation: "\u0075"
readonly property string paddingEdge: "\u0076"
readonly property string paddingFrame: "\u0077"
readonly property string pasteStyle: "\u0078"
readonly property string pause: "\u0079"
readonly property string pin: "\u007A"
readonly property string play: "\u007B"
readonly property string plus: "\u007C"
readonly property string promote: "\u007D"
readonly property string readOnly: "\u007E"
readonly property string redo: "\u007F"
readonly property string rotationFill: "\u0080"
readonly property string rotationOutline: "\u0081"
readonly property string search: "\u0082"
readonly property string sectionToggle: "\u0083"
readonly property string splitColumns: "\u0084"
readonly property string splitRows: "\u0085"
readonly property string startNode: "\u0086"
readonly property string testIcon: "\u0087"
readonly property string textAlignBottom: "\u0088"
readonly property string textAlignCenter: "\u0089"
readonly property string textAlignJustified: "\u008A"
readonly property string textAlignLeft: "\u008B"
readonly property string textAlignMiddle: "\u008C"
readonly property string textAlignRight: "\u008D"
readonly property string textAlignTop: "\u008E"
readonly property string textBulletList: "\u008F"
readonly property string textFullJustification: "\u0090"
readonly property string textNumberedList: "\u0091"
readonly property string tickIcon: "\u0092"
readonly property string translationCreateFiles: "\u0093"
readonly property string translationCreateReport: "\u0094"
readonly property string translationExport: "\u0095"
readonly property string translationImport: "\u0096"
readonly property string translationSelectLanguages: "\u0097"
readonly property string translationTest: "\u0098"
readonly property string transparent: "\u0099"
readonly property string triState: "\u009A"
readonly property string triangleArcA: "\u009B"
readonly property string triangleArcB: "\u009D"
readonly property string triangleCornerA: "\u009E"
readonly property string triangleCornerB: "\u009F"
readonly property string unLinked: "\u00A0"
readonly property string undo: "\u00A1"
readonly property string unpin: "\u00A2"
readonly property string upDownIcon: "\u00A3"
readonly property string upDownSquare2: "\u00A4"
readonly property string visibilityOff: "\u00A5"
readonly property string visibilityOn: "\u00A6"
readonly property string wildcard: "\u00A7"
readonly property string wizardsAutomotive: "\u00A8"
readonly property string wizardsDesktop: "\u00A9"
readonly property string wizardsGeneric: "\u00AA"
readonly property string wizardsMcuEmpty: "\u00AB"
readonly property string wizardsMcuGraph: "\u00AC"
readonly property string wizardsMobile: "\u00AE"
readonly property string wizardsUnknown: "\u00AF"
readonly property string zoomAll: "\u00B0"
readonly property string zoomIn: "\u00B1"
readonly property string zoomOut: "\u00B2"
readonly property string zoomSelection: "\u00B3"
readonly property string downloadUnavailable: "\u005E"
readonly property string downloadUpdate: "\u005F"
readonly property string downloaded: "\u0060"
readonly property string edit: "\u0061"
readonly property string eyeDropper: "\u0062"
readonly property string favorite: "\u0063"
readonly property string flowAction: "\u0064"
readonly property string flowTransition: "\u0065"
readonly property string fontStyleBold: "\u0066"
readonly property string fontStyleItalic: "\u0067"
readonly property string fontStyleStrikethrough: "\u0068"
readonly property string fontStyleUnderline: "\u0069"
readonly property string gradient: "\u006A"
readonly property string gridView: "\u006B"
readonly property string idAliasOff: "\u006C"
readonly property string idAliasOn: "\u006D"
readonly property string infinity: "\u006E"
readonly property string keyframe: "\u006F"
readonly property string linkTriangle: "\u0070"
readonly property string linked: "\u0071"
readonly property string listView: "\u0072"
readonly property string lockOff: "\u0073"
readonly property string lockOn: "\u0074"
readonly property string mergeCells: "\u0075"
readonly property string minus: "\u0076"
readonly property string mirror: "\u0077"
readonly property string orientation: "\u0078"
readonly property string paddingEdge: "\u0079"
readonly property string paddingFrame: "\u007A"
readonly property string pasteStyle: "\u007B"
readonly property string pause: "\u007C"
readonly property string pin: "\u007D"
readonly property string play: "\u007E"
readonly property string plus: "\u007F"
readonly property string promote: "\u0080"
readonly property string readOnly: "\u0081"
readonly property string redo: "\u0082"
readonly property string rotationFill: "\u0083"
readonly property string rotationOutline: "\u0084"
readonly property string search: "\u0085"
readonly property string sectionToggle: "\u0086"
readonly property string splitColumns: "\u0087"
readonly property string splitRows: "\u0088"
readonly property string startNode: "\u0089"
readonly property string testIcon: "\u008A"
readonly property string textAlignBottom: "\u008B"
readonly property string textAlignCenter: "\u008C"
readonly property string textAlignJustified: "\u008D"
readonly property string textAlignLeft: "\u008E"
readonly property string textAlignMiddle: "\u008F"
readonly property string textAlignRight: "\u0090"
readonly property string textAlignTop: "\u0091"
readonly property string textBulletList: "\u0092"
readonly property string textFullJustification: "\u0093"
readonly property string textNumberedList: "\u0094"
readonly property string tickIcon: "\u0095"
readonly property string translationCreateFiles: "\u0096"
readonly property string translationCreateReport: "\u0097"
readonly property string translationExport: "\u0098"
readonly property string translationImport: "\u0099"
readonly property string translationSelectLanguages: "\u009A"
readonly property string translationTest: "\u009B"
readonly property string transparent: "\u009D"
readonly property string triState: "\u009E"
readonly property string triangleArcA: "\u009F"
readonly property string triangleArcB: "\u00A0"
readonly property string triangleCornerA: "\u00A1"
readonly property string triangleCornerB: "\u00A2"
readonly property string unLinked: "\u00A3"
readonly property string undo: "\u00A4"
readonly property string unpin: "\u00A5"
readonly property string upDownIcon: "\u00A6"
readonly property string upDownSquare2: "\u00A7"
readonly property string visibilityOff: "\u00A8"
readonly property string visibilityOn: "\u00A9"
readonly property string wildcard: "\u00AA"
readonly property string wizardsAutomotive: "\u00AB"
readonly property string wizardsDesktop: "\u00AC"
readonly property string wizardsGeneric: "\u00AE"
readonly property string wizardsMcuEmpty: "\u00AF"
readonly property string wizardsMcuGraph: "\u00B0"
readonly property string wizardsMobile: "\u00B1"
readonly property string wizardsUnknown: "\u00B2"
readonly property string zoomAll: "\u00B3"
readonly property string zoomIn: "\u00B4"
readonly property string zoomOut: "\u00B5"
readonly property string zoomSelection: "\u00B6"
readonly property font iconFont: Qt.font({
"family": controlIcons.name,

View File

@@ -211,6 +211,10 @@ QtObject {
property string themePanelBackground: Theme.color(Theme.DSpanelBackground)
property string themeGreenLight: Theme.color(Theme.DSgreenLight)
property string themeAmberLight: Theme.color(Theme.DSamberLight)
property string themeRedLight: Theme.color(Theme.DSredLight)
property string themeInteraction: Theme.color(Theme.DSinteraction)
property string themeError: Theme.color(Theme.DSerrorColor)
property string themeWarning: Theme.color(Theme.DSwarningColor)

View File

@@ -30,6 +30,10 @@ DSsubPanelBackground=ff1c1c1c
DSthumbnailBackground=ff232323
DSthumbnailLabelBackground=ff2b2a2a
DSgreenLight=ff5cdc68
DSamberLight=ffffbf00
DSredLight=ffff0401
DSinteraction=ff2aafd3
DSerrorColor=ffdf3a3a
DSwarningColor=warning

View File

@@ -21,6 +21,10 @@ DSsubPanelBackground=ffEFEFEF
DSthumbnailBackground=ffE8E8E8
DSthumbnailLabelBackground=ffDDDDDD
DSgreenLight=ff5cdc68
DSamberLight=ffffbf00
DSredLight=ffff0401
DSinteraction=ff2aafd3
DSerrorColor=ffdf3a3a
DSwarningColor=warning

View File

@@ -35,6 +35,10 @@ DSsubPanelBackground=ffEFEFEF
DSthumbnailBackground=ffE8E8E8
DSthumbnailLabelBackground=ffDDDDDD
DSgreenLight=ff5cdc68
DSamberLight=ffffbf00
DSredLight=ffff0401
DSinteraction=ff2aafd3
DSerrorColor=ffdf3a3a
DSwarningColor=warning

View File

@@ -32,6 +32,10 @@ DSsubPanelBackground=ff1c1c1c
DSthumbnailBackground=ff232323
DSthumbnailLabelBackground=ff2b2a2a
DSgreenLight=ff5cdc68
DSamberLight=ffffbf00
DSredLight=ffff0401
DSinteraction=ff2aafd3
DSerrorColor=ffdf3a3a
DSwarningColor=warning

View File

@@ -34,6 +34,10 @@ DSsubPanelBackground=ff1c1c1c
DSthumbnailBackground=ff232323
DSthumbnailLabelBackground=ff2b2a2a
DSgreenLight=ff5cdc68
DSamberLight=ffffbf00
DSredLight=ffff0401
DSinteraction=ff2aafd3
DSerrorColor=ffdf3a3a
DSwarningColor=warning

View File

@@ -30,6 +30,10 @@ DSsubPanelBackground=ffEFEFEF
DSthumbnailBackground=ffE8E8E8
DSthumbnailLabelBackground=ffDDDDDD
DSgreenLight=ff5cdc68
DSamberLight=ffffbf00
DSredLight=ffff0401
DSinteraction=ff2aafd3
DSerrorColor=ffdf3a3a
DSwarningColor=warning

View File

@@ -28,6 +28,10 @@ DSsubPanelBackground=ff1c1c1c
DSthumbnailBackground=ff232323
DSthumbnailLabelBackground=ff2b2a2a
DSgreenLight=ff5cdc68
DSamberLight=ffffbf00
DSredLight=ffff0401
DSinteraction=ff2aafd3
DSerrorColor=ffdf3a3a
DSwarningColor=warning

View File

@@ -62,6 +62,8 @@ Project {
"format.cpp",
"format.h",
"format_p.h",
"highlightingdata.cpp",
"highlightingdata_p.hpp",
"htmlhighlighter.cpp",
"htmlhighlighter.h",
"keywordlist.cpp",

View File

@@ -1333,7 +1333,17 @@ static bool isIntegerValue(const Value *value)
if (value->asNumberValue() || value->asIntValue())
return true;
if (auto obj = value->asObjectValue())
return obj->className() == "Number";
return obj->className() == "Number" || obj->className() == "int";
return false;
}
static bool isStringValue(const Value *value)
{
if (value->asStringValue())
return true;
if (auto obj = value->asObjectValue())
return obj->className() == "QString" || obj->className() == "string";
return false;
}
@@ -1349,6 +1359,8 @@ static bool strictCompareConstant(const Value *lhs, const Value *rhs)
return false;
if (isIntegerValue(lhs) && isIntegerValue(rhs))
return false;
if (isStringValue(lhs) && isStringValue(rhs))
return false;
if (lhs->asBooleanValue() && !rhs->asBooleanValue())
return true;
if (lhs->asNumberValue() && !rhs->asNumberValue())

View File

@@ -432,6 +432,10 @@ public:
DSsubPanelBackground,
DSthumbnailBackground,
DSthumbnailLabelBackground,
DSgreenLight,
DSamberLight,
DSredLight,
};
enum Gradient {

View File

@@ -2649,7 +2649,8 @@ static QList<BlockRange> cleanupDisabledCode(HighlightingResults &results, const
int rangeStartPos = -1;
for (auto it = results.begin(); it != results.end();) {
const bool wasIfdefedOut = rangeStartPos != -1;
if (it->textStyles.mainStyle != C_DISABLED_CODE) {
const bool isIfDefedOut = it->textStyles.mainStyle == C_DISABLED_CODE;
if (!isIfDefedOut) {
if (wasIfdefedOut) {
const QTextBlock block = doc->findBlockByNumber(it->line - 1);
ifdefedOutRanges << BlockRange(rangeStartPos, block.position());
@@ -2661,19 +2662,28 @@ static QList<BlockRange> cleanupDisabledCode(HighlightingResults &results, const
if (!wasIfdefedOut)
rangeStartPos = doc->findBlockByNumber(it->line - 1).position();
const int pos = Utils::Text::positionInText(doc, it->line, it->column);
const QStringView content = subViewLen(docContent, pos, it->length).trimmed();
if (!content.startsWith(QLatin1String("#if"))
&& !content.startsWith(QLatin1String("#elif"))
&& !content.startsWith(QLatin1String("#else"))
&& !content.startsWith(QLatin1String("#endif"))) {
static const QStringList ppSuffixes{"if", "ifdef", "elif", "else", "endif"};
const QList<QStringView> contentList = content.split(' ', Qt::SkipEmptyParts);
if (contentList.size() < 2 || contentList.first() != QLatin1String("#")
|| !ppSuffixes.contains(contentList.at(1))) {
++it;
continue;
}
// Does the current line contain a potential "ifdefed-out switcher"?
// If not, no state change is possible and we continue with the next line.
const auto isPreprocessorControlStatement = [&] {
const int pos = Utils::Text::positionInText(doc, it->line, it->column);
const QStringView content = subViewLen(docContent, pos, it->length).trimmed();
if (content.isEmpty() || content.first() != '#')
return false;
int offset = 1;
while (offset < content.size() && content.at(offset).isSpace())
++offset;
if (offset == content.size())
return false;
const QStringView ppDirective = content.mid(offset);
return ppDirective.startsWith(QLatin1String("if"))
|| ppDirective.startsWith(QLatin1String("elif"))
|| ppDirective.startsWith(QLatin1String("else"))
|| ppDirective.startsWith(QLatin1String("endif"));
};
if (!isPreprocessorControlStatement()) {
++it;
continue;
}
if (!wasIfdefedOut) {
@@ -2700,6 +2710,12 @@ static QList<BlockRange> cleanupDisabledCode(HighlightingResults &results, const
if (rangeStartPos != -1)
ifdefedOutRanges << BlockRange(rangeStartPos, doc->characterCount());
qCDebug(clangdLogHighlight) << "found" << ifdefedOutRanges.size() << "ifdefed-out ranges";
if (clangdLogHighlight().isDebugEnabled()) {
for (const BlockRange &r : qAsConst(ifdefedOutRanges))
qCDebug(clangdLogHighlight) << r.first() << r.last();
}
return ifdefedOutRanges;
}
@@ -2741,10 +2757,22 @@ static void semanticHighlighter(QFutureInterface<HighlightingResult> &future,
// where the user sees that it's being written.
if (it->kind() == "CXXOperatorCall") {
const QList<AstNode> children = it->children().value_or(QList<AstNode>());
// Child 1 is the call itself, Child 2 is the named entity on which the call happens
// (a lambda or a class instance), after that follow the actual call arguments.
if (children.size() < 2)
return false;
if (!children.last().range().contains(range))
// The call itself is never modifiable.
if (children.first().range() == range)
return false;
// The callable is never displayed as an output parameter.
// TODO: A good argument can be made to display objects on which a non-const
// operator or function is called as output parameters.
if (children.at(1).range() == range)
return false;
QList<AstNode> firstChildTree{children.first()};
while (!firstChildTree.isEmpty()) {
const AstNode n = firstChildTree.takeFirst();
@@ -2859,13 +2887,13 @@ static void semanticHighlighter(QFutureInterface<HighlightingResult> &future,
auto results = QtConcurrent::blockingMapped<HighlightingResults>(tokens, toResult);
const QList<BlockRange> ifdefedOutBlocks = cleanupDisabledCode(results, &doc, docContents);
QMetaObject::invokeMethod(textDocument, [textDocument, ifdefedOutBlocks, docRevision] {
if (textDocument && textDocument->document()->revision() == docRevision)
textDocument->setIfdefedOutBlocks(ifdefedOutBlocks);
}, Qt::QueuedConnection);
ExtraHighlightingResultsCollector(future, results, filePath, ast, &doc, docContents).collect();
if (!future.isCanceled()) {
qCDebug(clangdLog) << "reporting" << results.size() << "highlighting results";
QMetaObject::invokeMethod(textDocument, [textDocument, ifdefedOutBlocks, docRevision] {
if (textDocument && textDocument->document()->revision() == docRevision)
textDocument->setIfdefedOutBlocks(ifdefedOutBlocks);
}, Qt::QueuedConnection);
QList<Range> virtualRanges;
for (const HighlightingResult &r : results) {
if (r.textStyles.mainStyle != C_VIRTUAL_METHOD)
@@ -2880,8 +2908,7 @@ static void semanticHighlighter(QFutureInterface<HighlightingResult> &future,
client->setVirtualRanges(filePath, virtualRanges, docRevision);
}
}, Qt::QueuedConnection);
future.reportResults(QVector<HighlightingResult>(results.cbegin(),
results.cend()));
future.reportResults(QVector<HighlightingResult>(results.cbegin(), results.cend()));
}
future.reportFinished();
}

View File

@@ -1285,6 +1285,14 @@ void ClangdTestHighlighting::test_data()
<< QList<int>{C_LOCAL} << 0;
QTest::newRow("const member as function argument") << 868 << 32 << 868 << 43
<< QList<int>{C_FIELD} << 0;
QTest::newRow("lambda call without arguments (const var)") << 887 << 5 << 887 << 12
<< QList<int>{C_LOCAL} << 0;
QTest::newRow("lambda call without arguments (non-const var)") << 889 << 5 << 889 << 12
<< QList<int>{C_LOCAL} << 0;
QTest::newRow("non-const operator()") << 898 << 5 << 898 << 7
<< QList<int>{C_LOCAL} << 0;
QTest::newRow("const operator()") << 903 << 5 << 903 << 7
<< QList<int>{C_LOCAL} << 0;
}
void ClangdTestHighlighting::test()

View File

@@ -880,3 +880,25 @@ void constMemberAsFunctionArg()
#if 0
#define BAR
# endif
void lambdaCall()
{
const auto lambda1 = [] {};
lambda1();
auto lambda2 = [] {};
lambda2();
}
void callOperators()
{
struct Callable1 {
void operator()() {};
};
Callable1 c1;
c1();
struct Callable2 {
void operator()() const {};
};
Callable2 c2;
c2();
}

View File

@@ -488,14 +488,14 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
if (m_buildConfiguration->isEnabled())
setError(QString());
});
connect(this, &QObject::destroyed, this, [this](const QObject *obj) {
connect(this, &QObject::destroyed, this, [this] {
updateInitialCMakeArguments();
});
connect(bc->aspect<InitialCMakeArgumentsAspect>(),
&Utils::BaseAspect::labelLinkActivated,
this,
[this](const QString &link) {
[this](const QString &) {
const CMakeTool *tool = CMakeKitAspect::cmakeTool(
m_buildConfiguration->target()->kit());
CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake.1.html#options");
@@ -503,7 +503,7 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
connect(bc->aspect<AdditionalCMakeOptionsAspect>(),
&Utils::BaseAspect::labelLinkActivated,
this,
[this](const QString &link) {
[this](const QString &) {
const CMakeTool *tool = CMakeKitAspect::cmakeTool(
m_buildConfiguration->target()->kit());
CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake.1.html#options");
@@ -527,7 +527,7 @@ void CMakeBuildSettingsWidget::batchEditConfiguration()
"To set or change a variable, use -D&lt;variable&gt;:&lt;type&gt;=&lt;value&gt;.<br/>"
"&lt;type&gt; can have one of the following values: FILEPATH, PATH, BOOL, INTERNAL, or STRING.<br/>"
"To unset a variable, use -U&lt;variable&gt;.<br/>"));
connect(label, &QLabel::linkActivated, this, [this](const QString &link) {
connect(label, &QLabel::linkActivated, this, [this](const QString &) {
const CMakeTool *tool = CMakeKitAspect::cmakeTool(m_buildConfiguration->target()->kit());
CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake-variables.7.html");
});

View File

@@ -353,7 +353,7 @@ public:
m_changeButton(createSubWidget<QPushButton>())
{
const CMakeTool *tool = CMakeKitAspect::cmakeTool(kit);
connect(this, &KitAspectWidget::labelLinkActivated, this, [=](const QString &link) {
connect(this, &KitAspectWidget::labelLinkActivated, this, [=](const QString &) {
CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake-generators.7.html");
});
@@ -972,7 +972,7 @@ private:
"To set a variable, use -D&lt;variable&gt;:&lt;type&gt;=&lt;value&gt;.<br/>"
"&lt;type&gt; can have one of the following values: FILEPATH, PATH, "
"BOOL, INTERNAL, or STRING."));
connect(editorLabel, &QLabel::linkActivated, this, [=](const QString &link) {
connect(editorLabel, &QLabel::linkActivated, this, [=](const QString &) {
CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake-variables.7.html");
});
m_editor->setMinimumSize(800, 200);
@@ -984,7 +984,7 @@ private:
m_additionalEditor = new QLineEdit;
auto additionalLabel = new QLabel(m_dialog);
additionalLabel->setText(tr("Additional CMake <a href=\"options\">options</a>:"));
connect(additionalLabel, &QLabel::linkActivated, this, [=](const QString &link) {
connect(additionalLabel, &QLabel::linkActivated, this, [=](const QString &) {
CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake.1.html#options");
});

View File

@@ -70,7 +70,7 @@ static void showOutputPane(Flag flags)
m_messageOutputWindow->flash();
break;
case Core::Flag::Disrupt:
m_messageOutputWindow->popup(IOutputPane::ModeSwitch);
m_messageOutputWindow->popup(IOutputPane::ModeSwitch | IOutputPane::WithFocus);
break;
}
}

View File

@@ -329,7 +329,7 @@ void CodePasterPluginPrivate::finishPost(const QString &link)
if (m_settings.displayOutput.value())
MessageManager::writeDisrupting(link);
else
MessageManager::writeSilently(link);
MessageManager::writeFlashing(link);
}
// Extract the characters that can be used for a file name from a title

View File

@@ -208,6 +208,6 @@ void FileShareProtocol::paste(
return;
}
Core::MessageManager::writeSilently(tr("Pasted: %1").arg(saver.filePath().toUserOutput()));
emit pasteDone(saver.filePath().toUserOutput());
}
} // namespace CodePaster

View File

@@ -1030,6 +1030,7 @@ FilePath DockerDevice::mapToLocalAccess(const FilePath &filePath) const
return FilePath::fromString(d->m_mergedDir + '/' + path);
#else
QTC_CHECK(false);
Q_UNUSED(filePath)
return {};
#endif
}
@@ -1047,6 +1048,7 @@ FilePath DockerDevice::mapFromLocalAccess(const QString &filePath) const
QTC_ASSERT(filePath.startsWith(d->m_mergedDir), return FilePath::fromString(filePath));
return mapToGlobalPath(FilePath::fromString(filePath.mid(d->m_mergedDir.size())));
#else
Q_UNUSED(filePath)
QTC_CHECK(false);
return {};
#endif

View File

@@ -104,6 +104,9 @@ public:
distributeSpacingVertical,
distributeTop,
download,
downloadUnavailable,
downloadUpdate,
downloaded,
edit,
eyeDropper,
favorite,

View File

@@ -484,7 +484,7 @@ void FormEditorView::customNotification(const AbstractView * /*view*/, const QSt
void FormEditorView::currentStateChanged(const ModelNode & /*node*/)
{
temporaryBlockView(100);
temporaryBlockView();
}
AbstractFormEditorTool *FormEditorView::currentTool() const

View File

@@ -147,7 +147,7 @@ private:
void setupFormEditorItemTree(const QmlItemNode &qmlItemNode);
void removeNodeFromScene(const QmlItemNode &qmlItemNode);
void createFormEditorWidget();
void temporaryBlockView(int duration = 1000);
void temporaryBlockView(int duration = 100);
void resetNodeInstanceView();
void addOrRemoveFormEditorItem(const ModelNode &node);
void checkRootModelNode();

View File

@@ -161,6 +161,8 @@ ItemLibraryWidget::ItemLibraryWidget(AsynchronousImageCache &imageCache,
, m_itemsWidget(new QQuickWidget(this))
, m_imageCache{imageCache}
{
Q_UNUSED(asynchronousFontImageCache)
m_compressionTimer.setInterval(200);
m_compressionTimer.setSingleShot(true);
ItemLibraryModel::registerQmlTypes();

View File

@@ -865,7 +865,7 @@ ModelNode RewriterView::nodeAtTextCursorPositionHelper(const ModelNode &root, in
for (const myPair &pair : data) {
ModelNode node = pair.first;
i++;
if (i >= data.size()) {
if (i >= int(data.size())) {
lastNode = node;
break;
}

View File

@@ -41,6 +41,8 @@
#include <QQuickItem>
#include <QQuickWidget>
#include <algorithm>
using namespace Utils;
ExampleCheckout::ExampleCheckout(QObject *) {}
@@ -137,11 +139,11 @@ FileDownloader::~FileDownloader()
void FileDownloader::start()
{
m_tempFile.setFileName(QDir::tempPath() + "/" + name() + ".XXXXXX" + ".zip");
m_tempFile.open(QIODevice::WriteOnly);
auto request = QNetworkRequest(m_url);
request.setAttribute(QNetworkRequest::RedirectPolicyAttribute, true);
request.setAttribute(QNetworkRequest::RedirectPolicyAttribute,
QNetworkRequest::UserVerifiedRedirectPolicy);
QNetworkReply *reply = Utils::NetworkAccessManager::instance()->get(request);
QNetworkReply::connect(reply, &QNetworkReply::readyRead, [this, reply]() {
@@ -159,20 +161,20 @@ void FileDownloader::start()
emit progressChanged();
});
QNetworkReply::connect(reply, &QNetworkReply::redirected, [reply](const QUrl &url) {
emit reply->redirectAllowed();
});
QNetworkReply::connect(reply, &QNetworkReply::finished, [this, reply]() {
if (reply->error()) {
m_tempFile.remove();
if (m_url != reply->url()) {
m_url = reply->url();
start();
} else {
qDebug() << Q_FUNC_INFO << m_url << reply->errorString();
emit downloadFailed();
}
qDebug() << Q_FUNC_INFO << m_url << reply->errorString();
emit downloadFailed();
} else {
m_tempFile.flush();
m_tempFile.close();
m_finished = true;
emit tempFileChanged();
emit finishedChanged();
}
});
@@ -181,8 +183,9 @@ void FileDownloader::start()
void FileDownloader::setUrl(const QUrl &url)
{
m_url = url;
emit nameChanged();
probeUrl();
}
QUrl FileDownloader::url() const
@@ -222,16 +225,71 @@ QString FileDownloader::tempFile() const
return QFileInfo(m_tempFile).canonicalFilePath();
}
QDateTime FileDownloader::lastModified() const
{
return m_lastModified;
}
bool FileDownloader::available() const
{
return m_available;
}
void FileDownloader::probeUrl()
{
auto request = QNetworkRequest(m_url);
request.setAttribute(QNetworkRequest::RedirectPolicyAttribute,
QNetworkRequest::UserVerifiedRedirectPolicy);
QNetworkReply *reply = Utils::NetworkAccessManager::instance()->head(request);
QNetworkReply::connect(reply, &QNetworkReply::redirected, [reply](const QUrl &url) {
emit reply->redirectAllowed();
});
QNetworkReply::connect(reply, &QNetworkReply::finished, [this, reply]() {
if (reply->error())
return;
m_lastModified = reply->header(QNetworkRequest::LastModifiedHeader).toDateTime();
emit lastModifiedChanged();
m_available = true;
emit availableChanged();
});
QNetworkReply::connect(reply,
&QNetworkReply::errorOccurred,
[this, reply](QNetworkReply::NetworkError code) {
// QNetworkReply::HostNotFoundError
// QNetworkReply::ContentNotFoundError
m_available = false;
emit availableChanged();
});
}
FileExtractor::FileExtractor(QObject *parent)
: QObject(parent)
{
if (Core::DocumentManager::instance())
m_targetPath = Core::DocumentManager::projectsDirectory();
m_targetPath = Utils::FilePath::fromString(
QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation));
if (!m_targetPath.isEmpty())
m_targetPath = m_targetPath.pathAppended("QtDesignStudio");
else
m_targetPath = "/temp/";
m_timer.setInterval(500);
m_timer.setInterval(100);
m_timer.setSingleShot(false);
QObject::connect(this, &FileExtractor::targetFolderExistsChanged, [this]() {
if (targetFolderExists()) {
m_birthTime = QFileInfo(m_targetPath.toString() + "/" + m_archiveName).birthTime();
} else
m_birthTime = QDateTime();
emit birthTimeChanged();
});
}
FileExtractor::~FileExtractor() {}
@@ -297,8 +355,17 @@ QString FileExtractor::count() const
bool FileExtractor::targetFolderExists() const
{
const QString targetFolder = m_targetPath.toString() + "/" + m_archiveName;
return QFileInfo(targetFolder).exists();
return QFileInfo::exists(m_targetPath.toString() + "/" + m_archiveName);
}
int FileExtractor::progress() const
{
return m_progress;
}
QDateTime FileExtractor::birthTime() const
{
return m_birthTime;
}
QString FileExtractor::archiveName() const
@@ -320,8 +387,9 @@ void FileExtractor::extract()
m_timer.start();
const QString targetFolder = m_targetPath.toString() + "/" + m_archiveName;
qint64 bytesBefore = QStorageInfo(m_targetPath.toFileInfo().dir()).bytesAvailable();
qint64 compressedSize = QFileInfo(m_sourceFile.toString()).size();
QTimer::connect(&m_timer, &QTimer::timeout, [this, bytesBefore, targetFolder]() {
QTimer::connect(&m_timer, &QTimer::timeout, [this, bytesBefore, targetFolder, compressedSize]() {
static QHash<QString, int> hash;
QDirIterator it(targetFolder, {"*.*"}, QDir::Files, QDirIterator::Subdirectories);
@@ -336,9 +404,15 @@ void FileExtractor::extract()
count++;
}
m_size = QString::number(bytesBefore
- QStorageInfo(m_targetPath.toFileInfo().dir()).bytesAvailable());
qint64 currentSize = bytesBefore
- QStorageInfo(m_targetPath.toFileInfo().dir()).bytesAvailable();
// We can not get the uncompressed size of the archive yet, that is why we use an
// approximation. We assume a 50% compression rate.
m_progress = std::min(100ll, currentSize * 100 / compressedSize * 2);
emit progressChanged();
m_size = QString::number(currentSize);
m_count = QString::number(count);
emit sizeChanged();
});
@@ -351,6 +425,11 @@ void FileExtractor::extract()
QObject::connect(archive, &Utils::Archive::finished, [this](bool ret) {
m_finished = ret;
m_timer.stop();
m_progress = 100;
emit progressChanged();
emit targetFolderExistsChanged();
emit finishedChanged();
QTC_ASSERT(ret, ;);
});

View File

@@ -78,6 +78,8 @@ class FileExtractor : public QObject
Q_PROPERTY(QString sourceFile READ sourceFile WRITE setSourceFile)
Q_PROPERTY(bool finished READ finished NOTIFY finishedChanged)
Q_PROPERTY(bool targetFolderExists READ targetFolderExists NOTIFY targetFolderExistsChanged)
Q_PROPERTY(int progress READ progress NOTIFY progressChanged)
Q_PROPERTY(QDateTime birthTime READ birthTime NOTIFY birthTimeChanged)
public:
explicit FileExtractor(QObject *parent = nullptr);
@@ -94,6 +96,8 @@ public:
QString size() const;
QString count() const;
bool targetFolderExists() const;
int progress() const;
QDateTime birthTime() const;
QString sourceFile() const;
QString archiveName() const;
@@ -108,6 +112,8 @@ signals:
void currentFileChanged();
void sizeChanged();
void targetFolderExistsChanged();
void progressChanged();
void birthTimeChanged();
private:
Utils::FilePath m_targetPath;
@@ -119,6 +125,8 @@ private:
QString m_size;
QString m_count;
QString m_archiveName;
int m_progress = 0;
QDateTime m_birthTime;
};
class FileDownloader : public QObject
@@ -131,7 +139,9 @@ class FileDownloader : public QObject
Q_PROPERTY(QString name READ name NOTIFY nameChanged)
Q_PROPERTY(QString completeBaseName READ completeBaseName NOTIFY nameChanged)
Q_PROPERTY(int progress READ progress NOTIFY progressChanged)
Q_PROPERTY(QString tempFile READ tempFile NOTIFY finishedChanged)
Q_PROPERTY(QString tempFile READ tempFile NOTIFY tempFileChanged)
Q_PROPERTY(QDateTime lastModified READ lastModified NOTIFY lastModifiedChanged)
Q_PROPERTY(bool available READ available NOTIFY availableChanged)
public:
explicit FileDownloader(QObject *parent = nullptr);
@@ -147,6 +157,8 @@ public:
QString completeBaseName() const;
int progress() const;
QString tempFile() const;
QDateTime lastModified() const;
bool available() const;
Q_INVOKABLE void start();
@@ -155,12 +167,19 @@ signals:
void errorChanged();
void nameChanged();
void progressChanged();
void tempFileChanged();
void downloadFailed();
void lastModifiedChanged();
void availableChanged();
private:
void probeUrl();
QUrl m_url;
bool m_finished = false;
bool m_error = false;
int m_progress = 0;
QFile m_tempFile;
QDateTime m_lastModified;
bool m_available;
};

View File

@@ -58,7 +58,7 @@ QStringList RecentPresetsStore::addRecentToExisting(const RecentPreset &preset,
Utils::erase_one(recents, preset);
Utils::prepend(recents, preset);
if (recents.size() > m_max)
if (int(recents.size()) > m_max)
recents.pop_back();
return encodeRecentPresets(recents);

View File

@@ -232,6 +232,28 @@ public:
QDesktopServices::openUrl(QUrl("qthelp://org.qt-project.qtcreator/doc/index.html"));
}
Q_INVOKABLE void openExample(const QString &examplePath,
const QString &exampleName,
const QString &formFile,
const QString &explicitQmlproject)
{
const QString exampleFolder = examplePath + "/" + exampleName + "/";
QString projectFile = exampleFolder + exampleName + ".qmlproject";
if (!explicitQmlproject.isEmpty())
projectFile = exampleFolder + explicitQmlproject;
ProjectExplorer::ProjectExplorerPlugin::openProjectWelcomePage(projectFile);
const QString qmlFile = QFileInfo(projectFile).dir().absolutePath() + "/" + formFile;
// This timer should be replaced with a signal send from project loading
QTimer::singleShot(1000, [qmlFile](){
Core::EditorManager::openEditor(Utils::FilePath::fromString(qmlFile));
});
}
Q_INVOKABLE void openExample(const QString &example,
const QString &formFile,
const QString &url,
@@ -272,6 +294,7 @@ public:
Core::EditorManager::openEditor(qmlFile);
}
public slots:
void resetProjects();
@@ -465,7 +488,7 @@ QVariant ProjectModel::data(const QModelIndex &index, int role) const
case FilePathRole:
return data.first;
case PrettyFilePathRole:
return Utils::withTildeHomePath(data.first);
return Utils::withTildeHomePath(QFileInfo(data.first).dir().absolutePath());
case PreviewUrl:
return QVariant(QStringLiteral("image://project_preview/") + appQmlFile(data.first));
case TagData:

View File

@@ -6,16 +6,15 @@ Limitations:
- Kits themselves need to be fixed up manually.
- Shared mounts are restricted to locations on the host system
that can end up on the same absolute location in the container
- Windows host: Mounted drives cannot be used as shared mounts
What works:
- Qmake in path is found
- CMake in path is found
- Toolchain autodection finds gcc
- Gdb in path is found
- Toolchain autodection finds gcc and clang
- Gdb and lldb in path are found
- Building in the container with qmake works
- Building in the container with cmake works
- Running locally or in a compatible docker container works
@@ -30,7 +29,7 @@ For testing:
running ./build.sh. This builds a docker image containing a Desktop Qt
build setup (including compiler etc) and second docker image container
containing a run environment without the build tools, but e.g. with gdb
for debugger testing
for debugger testing and a third containing clang and lldb
- or -

View File

@@ -254,9 +254,9 @@ void tst_CodeSize::codesize()
<< "\nExtra CXX Flags: " << c.extraCxxFlags.data();
#ifdef Q_OS_WIN
# ifdef Q_CC_MSVC
QString arguments = "release\\" + c.file + ".obj";
QString arguments = QString("release\\" + c.file + ".obj");
# else
QString arguments = "release\\" + c.file + ".o";
QString arguments = QString("release\\" + c.file + ".o");
# endif
#else
QString arguments = QString(c.file + ".o");