From cbf4e8af0ae7c9ab1739f3bee6c2ac8cf9d21d20 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 21 Oct 2020 07:04:37 +0200 Subject: [PATCH 01/13] QmlPuppet: Fix qbs build Amends 6b8d8e4. Change-Id: I1bac4049478b87e12d7e0ea16d5e7450745c2952 Reviewed-by: Christian Kandeler --- src/tools/qml2puppet/qml2puppet.qbs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/qml2puppet/qml2puppet.qbs b/src/tools/qml2puppet/qml2puppet.qbs index 63341b5dc28..f55104559c9 100644 --- a/src/tools/qml2puppet/qml2puppet.qbs +++ b/src/tools/qml2puppet/qml2puppet.qbs @@ -263,13 +263,13 @@ QtcTool { Group { name: "puppet2 Qt 5 compatibility sources" - condition: useQt5Compat + condition: product.useQt5Compat files: ["editor3d/qt5compat/qquick3darealight.cpp"] } Group { name: "puppet2 Qt 5 compatibility headers" - condition: useQt5Compat + condition: product.useQt5Compat files: ["editor3d/qt5compat/qquick3darealight_p.h"] fileTags: product.useQuick3d ? [] : ["unmocable"] overrideTags: false From ed292f3f9b59c23114f27a562a131a145bd67d82 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 14 Oct 2020 14:12:30 +0200 Subject: [PATCH 02/13] clangbackend: Categorize non-const pointer arguments as output arguments Fixes: QTCREATORBUG-24550 Change-Id: Iac4f3b133a632d7272bfe4253f8a0740e51b0952 Reviewed-by: Christian Stenger --- src/tools/clangbackend/source/clangtype.cpp | 13 ++++++++++++- tests/unit/unittest/cursor-test.cpp | 10 +++++----- tests/unit/unittest/tokenprocessor-test.cpp | 6 +++--- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/tools/clangbackend/source/clangtype.cpp b/src/tools/clangbackend/source/clangtype.cpp index af58f715959..9f9b8830e94 100644 --- a/src/tools/clangbackend/source/clangtype.cpp +++ b/src/tools/clangbackend/source/clangtype.cpp @@ -76,7 +76,18 @@ bool Type::isReferencingConstant() const bool Type::isOutputArgument() const { - return isLValueReference() && !pointeeType().isConstant(); + if (isLValueReference() && !pointeeType().isConstant()) + return true; + + // We consider a pointer an output argument if it is non-const at any level. + // This is consistent with how we categorize references in CppTools. + Type t = *this; + while (t.isPointer()) { + t = t.pointeeType(); + if (!t.isConstant()) + return true; + } + return false; } bool Type::isBuiltinType() const diff --git a/tests/unit/unittest/cursor-test.cpp b/tests/unit/unittest/cursor-test.cpp index 2fa4bff7098..521002f3d22 100644 --- a/tests/unit/unittest/cursor-test.cpp +++ b/tests/unit/unittest/cursor-test.cpp @@ -489,7 +489,7 @@ TEST_F(Cursor, HasOutputValues) auto outputArgumentLocations = callExpressionCursor.outputArgumentRanges(); - ASSERT_THAT(outputArgumentLocations.size(), 1); + ASSERT_THAT(outputArgumentLocations.size(), 2); ASSERT_THAT(outputArgumentLocations[0], outputArgumentExpectedSourceLocation); } @@ -744,13 +744,13 @@ TEST_F(Cursor, PointerIsNotRefencingConstant) ASSERT_FALSE(argument.isReferencingConstant()); } -TEST_F(Cursor, PointerIsNotOutputArgument) +TEST_F(Cursor, PointerIsOutputArgument) { auto callExpressionCursor = translationUnit.cursorAt(127, 13); auto argument = callExpressionCursor.type().argument(0); - ASSERT_FALSE(argument.isOutputArgument()); + ASSERT_TRUE(argument.isOutputArgument()); } TEST_F(Cursor, ConstantReferenceIsNotOutputArgument) @@ -771,13 +771,13 @@ TEST_F(Cursor, PointerToConstantIsNotOutputArgument) ASSERT_FALSE(argument.isOutputArgument()) << argument.isConstant() << argument.pointeeType().isConstant(); } -TEST_F(Cursor, ConstantPointerIsNotOutputArgument) +TEST_F(Cursor, ConstantPointerIsOutputArgument) { auto callExpressionCursor = translationUnit.cursorAt(128, 21); auto argument = callExpressionCursor.type().argument(0); - ASSERT_FALSE(argument.isOutputArgument()); + ASSERT_TRUE(argument.isOutputArgument()); } TEST_F(Cursor, ReferenceIsOutputArgument) diff --git a/tests/unit/unittest/tokenprocessor-test.cpp b/tests/unit/unittest/tokenprocessor-test.cpp index 37c76d8ce6d..f74fb0dbedd 100644 --- a/tests/unit/unittest/tokenprocessor-test.cpp +++ b/tests/unit/unittest/tokenprocessor-test.cpp @@ -1326,7 +1326,7 @@ TEST_F(TokenProcessor, NonConstPointerArgument) infos[1]; ASSERT_THAT(infos[2], - HasOnlyType(HighlightingType::LocalVariable)); + HasTwoTypes(HighlightingType::LocalVariable, HighlightingType::OutputArgument)); } TEST_F(TokenProcessor, PointerToConstArgument) @@ -1346,7 +1346,7 @@ TEST_F(TokenProcessor, ConstPointerArgument) infos[1]; ASSERT_THAT(infos[2], - HasOnlyType(HighlightingType::LocalVariable)); + HasTwoTypes(HighlightingType::LocalVariable, HighlightingType::OutputArgument)); } TEST_F(TokenProcessor, NonConstPointerGetterAsArgument) @@ -1400,7 +1400,7 @@ TEST_F(TokenProcessor, NonConstPointerArgumentAsExpression) infos[1]; ASSERT_THAT(infos[3], - HasOnlyType(HighlightingType::LocalVariable)); + HasTwoTypes(HighlightingType::LocalVariable, HighlightingType::OutputArgument)); } TEST_F(TokenProcessor, NonConstPointerArgumentAsInstanceWithMember) From 135e76f965618747b68ab1caae5768feda5fcee0 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 20 Oct 2020 12:49:12 +0200 Subject: [PATCH 03/13] CppEditor: Offer InsertDefsOperation quickfix for all classes The check whether there are unimplemented member functions takes quite long, so Creator would freeze for several seconds when right-clicking on the name of even a medium-sized class. Therefore, we offer the operation for all classes with member functions and move the expensive check into the perform() method. Change-Id: Ie19958ba8c53493be859f9982d7d5697e6e9d88b Reviewed-by: Christian Stenger --- src/plugins/cppeditor/cppquickfix_test.cpp | 17 +++++++++++++++++ src/plugins/cppeditor/cppquickfixes.cpp | 22 +++++++++++++--------- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/src/plugins/cppeditor/cppquickfix_test.cpp b/src/plugins/cppeditor/cppquickfix_test.cpp index 1dbfeafedf6..e5257df4c0c 100644 --- a/src/plugins/cppeditor/cppquickfix_test.cpp +++ b/src/plugins/cppeditor/cppquickfix_test.cpp @@ -3653,6 +3653,23 @@ void CppEditorPlugin::test_quickfix_InsertDefsFromDecls_data() } // namespace N)"; QTest::addRow("no candidates") + << QByteArrayList{origHeader, origHeader} + << QByteArrayList{origSource, origSource} + << int(InsertDefsFromDecls::Mode::Alternating); + + origHeader = R"( + namespace N { + class @C + { + public: + friend void ignoredFriend(); + void ignoredImplemented() {}; + + signals: + void ignoredSignal(); + }; + } // namespace N)"; + QTest::addRow("no member functions") << QByteArrayList{origHeader, ""} << QByteArrayList{origSource, ""} << int(InsertDefsFromDecls::Mode::Alternating); diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index 50d0da5aff8..2265d2ea5c7 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -3479,12 +3479,11 @@ public: m_classAST = path.at(path.size() - 2)->asClassSpecifier(); if (!m_classAST) return; - const Class * const theClass = m_classAST->symbol; if (!theClass) return; - // Collect all member functions without an implementation. + // Collect all member functions. for (auto it = theClass->memberBegin(); it != theClass->memberEnd(); ++it) { Symbol * const s = *it; if (!s->identifier() || !s->type() || !s->isDeclaration() || s->asFunction()) @@ -3492,8 +3491,6 @@ public: Function * const func = s->type()->asFunctionType(); if (!func || func->isSignal() || func->isFriend()) continue; - if (SymbolFinder().findMatchingDefinition(s, interface.snapshot())) - continue; m_declarations << s; } } @@ -3504,7 +3501,14 @@ public: private: void perform() override { - QTC_ASSERT(!m_declarations.isEmpty(), return); + QList unimplemented; + SymbolFinder symbolFinder; + for (Symbol * const s : qAsConst(m_declarations)) { + if (!symbolFinder.findMatchingDefinition(s, snapshot())) + unimplemented << s; + } + if (unimplemented.isEmpty()) + return; CppRefactoringChanges refactoring(snapshot()); const bool isHeaderFile = ProjectFile::isHeader(ProjectFile::classify(filePath().toString())); @@ -3512,7 +3516,7 @@ private: if (isHeaderFile) { InsertionPointLocator locator(refactoring); for (const InsertionLocation &location - : locator.methodDefinition(m_declarations.first(), false, {})) { + : locator.methodDefinition(unimplemented.first(), false, {})) { if (!location.isValid()) continue; const QString fileName = location.fileName(); @@ -3530,7 +3534,7 @@ private: MemberFunctionImplSettings settings; switch (m_mode) { case InsertDefsFromDecls::Mode::User: { - AddImplementationsDialog dlg(m_declarations, Utils::FilePath::fromString(cppFile)); + AddImplementationsDialog dlg(unimplemented, Utils::FilePath::fromString(cppFile)); if (dlg.exec() == QDialog::Accepted) settings = dlg.settings(); break; @@ -3540,7 +3544,7 @@ private: const auto incDefPos = [&defPos] { defPos = (defPos + 1) % (DefPosImplementationFile + 2); }; - for (Symbol * const func : qAsConst(m_declarations)) { + for (Symbol * const func : qAsConst(unimplemented)) { incDefPos(); if (defPos > DefPosImplementationFile) continue; @@ -3610,8 +3614,8 @@ private: } ClassSpecifierAST *m_classAST = nullptr; - QList m_declarations; InsertDefsFromDecls::Mode m_mode; + QList m_declarations; }; From b58ca33ff6627d146278d45a6df23a34172a73aa Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 12 Oct 2020 15:19:29 +0200 Subject: [PATCH 04/13] CppTools: Categorize the delete operator as a write access ... in the "Find Usages" results. Change-Id: Ib399bf762c717b7d4439be26b9180574aefce7e3 Reviewed-by: Christian Stenger --- src/libs/cplusplus/FindUsages.cpp | 2 ++ tests/auto/cplusplus/findusages/tst_findusages.cpp | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libs/cplusplus/FindUsages.cpp b/src/libs/cplusplus/FindUsages.cpp index bdd1381f379..1685368817c 100644 --- a/src/libs/cplusplus/FindUsages.cpp +++ b/src/libs/cplusplus/FindUsages.cpp @@ -348,6 +348,8 @@ Usage::Type FindUsages::getType(int line, int column, int tokenIndex) } if ((*it)->asCall()) return checkPotentialWrite(getUsageTypeForCall(it), it + 1); + if ((*it)->asDeleteExpression()) + return Usage::Type::Write; if (const auto binExpr = (*it)->asBinaryExpression()) { if (binExpr->left_expression == *(it - 1) && isAssignment(binExpr->binary_op_token)) return checkPotentialWrite(Usage::Type::Write, it + 1); diff --git a/tests/auto/cplusplus/findusages/tst_findusages.cpp b/tests/auto/cplusplus/findusages/tst_findusages.cpp index 185d5cc554b..d67033a905c 100644 --- a/tests/auto/cplusplus/findusages/tst_findusages.cpp +++ b/tests/auto/cplusplus/findusages/tst_findusages.cpp @@ -2081,6 +2081,7 @@ int main() s.n.constFunc(); s.n.nonConstFunc(); s.n.constFunc(s.value); + delete s.p; } )"; @@ -2165,7 +2166,7 @@ int main() QVERIFY(varS); QCOMPARE(varS->name()->identifier()->chars(), "s"); find(varS); - QCOMPARE(find.usages().size(), 30); + QCOMPARE(find.usages().size(), 31); QCOMPARE(find.usages().at(0).type, Usage::Type::Declaration); QCOMPARE(find.usages().at(1).type, Usage::Type::WritableRef); QCOMPARE(find.usages().at(2).type, Usage::Type::WritableRef); @@ -2184,6 +2185,7 @@ int main() QCOMPARE(find.usages().at(15).type, Usage::Type::WritableRef); QCOMPARE(find.usages().at(16).type, Usage::Type::Read); QCOMPARE(find.usages().at(17).type, Usage::Type::Read); + QCOMPARE(find.usages().at(18).type, Usage::Type::Write); // Direct access to struct variable QCOMPARE(find.usages().at(18).type, Usage::Type::Write); From c9d2a8d69e9eed398ccc6e4973aae0158b869be4 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 14 Oct 2020 17:36:26 +0200 Subject: [PATCH 05/13] AutoTest: Support QTest::addRow as well Fixes: QTCREATORBUG-24777 Change-Id: I33ac86a226036855a304b71e2e7ebfe8884d8dc3 Reviewed-by: David Schulz --- src/plugins/autotest/qtest/qttestvisitors.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/plugins/autotest/qtest/qttestvisitors.cpp b/src/plugins/autotest/qtest/qttestvisitors.cpp index 7b8374985bd..e1757e23f1d 100644 --- a/src/plugins/autotest/qtest/qttestvisitors.cpp +++ b/src/plugins/autotest/qtest/qttestvisitors.cpp @@ -226,6 +226,9 @@ bool TestDataFunctionVisitor::visit(CallAST *ast) bool ok = false; QString name = extractNameFromAST(stringLiteral, &ok); if (ok) { + // if it's a format string we skip as we cannot assure correct tag name + if (name.contains('%') && expressionListAST->next != nullptr) + return true; int line = 0; int column = 0; m_currentDoc->translationUnit()->getTokenStartPosition( @@ -279,10 +282,12 @@ bool TestDataFunctionVisitor::newRowCallFound(CallAST *ast, unsigned *firstToken return false; if (const auto qualifiedNameAST = exp->name->asQualifiedName()) { - found = m_overview.prettyName(qualifiedNameAST->name) == "QTest::newRow"; + const QString name = m_overview.prettyName(qualifiedNameAST->name); + found = (name == "QTest::newRow" || name == "QTest::addRow"); *firstToken = qualifiedNameAST->firstToken(); } else if (m_insideUsingQTest) { - found = m_overview.prettyName(exp->name->name) == "newRow"; + const QString name = m_overview.prettyName(exp->name->name); + found = (name == "newRow" || name == "addRow"); *firstToken = exp->name->firstToken(); } } From 3b611e07f78d52edde6ecf4ffee8d33fc07bc99a Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 15 Oct 2020 14:47:34 +0200 Subject: [PATCH 06/13] Debugger: prevent calling functions with gdb on windows and adjust tests accordingly Change-Id: I172e08cfccc248eea06a94208c9e8e312d69e334 Reviewed-by: Christian Stenger --- share/qtcreator/debugger/gdbbridge.py | 3 ++- share/qtcreator/debugger/qttypes.py | 15 +++------------ tests/auto/debugger/tst_dumpers.cpp | 24 ++++++++++++------------ 3 files changed, 17 insertions(+), 25 deletions(-) diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py index 5d32f8426c9..f5ee86c3497 100644 --- a/share/qtcreator/debugger/gdbbridge.py +++ b/share/qtcreator/debugger/gdbbridge.py @@ -1117,7 +1117,8 @@ class Dumper(DumperBase): self.qtCustomEventPltFunc = self.findSymbol(sym) sym = '_ZNK%s7QObject8propertyEPKc' % strns - self.qtPropertyFunc = self.findSymbol(sym) + if not self.isWindowsTarget(): # prevent calling the property function on windows + self.qtPropertyFunc = self.findSymbol(sym) def assignValue(self, args): typeName = self.hexdecode(args['type']) diff --git a/share/qtcreator/debugger/qttypes.py b/share/qtcreator/debugger/qttypes.py index aa3e9ecc0c3..5fd48d816ca 100644 --- a/share/qtcreator/debugger/qttypes.py +++ b/share/qtcreator/debugger/qttypes.py @@ -1982,18 +1982,9 @@ def qdump__QVariant(d, value): if d.isExpanded(): innerType = None with Children(d): - ev = d.parseAndEvaluate - p = None - if p is None: - # Without debug info. - symbol = d.mangleName(d.qtNamespace() + 'QMetaType::typeName') + 'i' - p = ev('((const char *(*)(int))%s)(%d)' % (symbol, variantType)) - #if p is None: - # p = ev('((const char *(*)(int))%sQMetaType::typeName)(%d)' % (ns, variantType)) - if p is None: - # LLDB on Linux - p = ev('((const char *(*)(int))QMetaType::typeName)(%d)' % variantType) - if p is None: + try: + p = d.call('const char *', value, 'typeName') + except: d.putSpecialValue('notcallable') return None ptr = p.pointer() diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index d1a70c2ba23..657dadb2d85 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -3992,22 +3992,22 @@ void tst_Dumpers::dumper_data() + Check("my.1.value", "<1 items>", "@QStringList") + Check("my.1.value.0", "[0]", "\"World\"", "@QString") //+ CheckType("v2", "@QVariant (MyType)") - + Check("v2.data.0.key", "1", "unsigned int") % NoCdbEngine - + Check("v2.data.0.value", "<1 items>", "@QStringList") % NoCdbEngine - + Check("v2.data.0.value.0", "[0]", "\"Hello\"", "@QString") % NoCdbEngine - + Check("v2.data.1.key", "3", "unsigned int") % NoCdbEngine - + Check("v2.data.1.value", "<1 items>", "@QStringList") % NoCdbEngine - + Check("v2.data.1.value.0", "[0]", "\"World\"", "@QString") % NoCdbEngine + + Check("v2.data.0.key", "1", "unsigned int") % NeedsInferiorCall + + Check("v2.data.0.value", "<1 items>", "@QStringList") % NeedsInferiorCall + + Check("v2.data.0.value.0", "[0]", "\"Hello\"", "@QString") % NeedsInferiorCall + + Check("v2.data.1.key", "3", "unsigned int") % NeedsInferiorCall + + Check("v2.data.1.value", "<1 items>", "@QStringList") % NeedsInferiorCall + + Check("v2.data.1.value.0", "[0]", "\"World\"", "@QString") % NeedsInferiorCall + Check("list", "<3 items>", "@QList") + Check("list.0", "[0]", "1", "int") + Check("list.1", "[1]", "2", "int") + Check("list.2", "[2]", "3", "int") //+ Check("v3", "", "@QVariant (@QList)") - + Check("v3.data", "<3 items>", TypePattern(".*QList")) % NoCdbEngine - + Check("v3.data.0", "[0]", "1", "int") % NoCdbEngine - + Check("v3.data.1", "[1]", "2", "int") % NoCdbEngine - + Check("v3.data.2", "[2]", "3", "int") % NoCdbEngine; + + Check("v3.data", "<3 items>", TypePattern(".*QList")) % NeedsInferiorCall + + Check("v3.data.0", "[0]", "1", "int") % NeedsInferiorCall + + Check("v3.data.1", "[1]", "2", "int") % NeedsInferiorCall + + Check("v3.data.2", "[2]", "3", "int") % NeedsInferiorCall; QTest::newRow("QVariant2") @@ -4221,8 +4221,8 @@ void tst_Dumpers::dumper_data() //+ Check("ha1.protocol", "IPv4Protocol", // "@QAbstractSocket::NetworkLayerProtocol") % LldbEngine + Check("ha1.scopeId", "\"\"", "@QString") - + Check("var", "", "@QVariant (@QHostAddress)") % NoCdbEngine - + Check("var.data", ValuePattern(".*127.0.0.1.*"), "@QHostAddress") % NoCdbEngine; + + Check("var", "", "@QVariant (@QHostAddress)") % NeedsInferiorCall + + Check("var.data", ValuePattern(".*127.0.0.1.*"), "@QHostAddress") % NeedsInferiorCall; QTest::newRow("QVariantList") From 79ed00e14dd12b0c3bd594bfb9109fff9c1b402b Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Wed, 21 Oct 2020 18:24:44 +0200 Subject: [PATCH 07/13] Update Qbs to HEAD of master Fixes issues when installing via cmake --install Change-Id: Ia4eb1ebabbdba24f15367710011da8400cd9706a Reviewed-by: Ivan Komissarov --- src/shared/qbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/qbs b/src/shared/qbs index d870a7a4535..6383cac9275 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit d870a7a4535e801e1161ececccd0d85dca0a3408 +Subproject commit 6383cac9275369220f7e547ed6ccd26e8f81dc31 From ee735e308eed9706ce126e291950cdbf2a39d841 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Wed, 21 Oct 2020 20:35:28 +0200 Subject: [PATCH 08/13] GitHub Actions: Set timeout for running tests Timeout of 5s for tests that do not have the TIMEOUT property, and 600s for the whole teset suite. Change-Id: Ie58f1ec2f657448a963bf51d6e93cad142603120 Reviewed-by: Cristian Adam --- .github/workflows/build_cmake.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index 7ab0201d974..cc9a25788f4 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -426,12 +426,13 @@ jobs: set(ENV{CTEST_OUTPUT_ON_FAILURE} "ON") execute_process( - COMMAND ctest -j ${N} + COMMAND ctest -j ${N} --timeout 5 WORKING_DIRECTORY build/build RESULT_VARIABLE result OUTPUT_VARIABLE output ERROR_VARIABLE output ECHO_OUTPUT_VARIABLE ECHO_ERROR_VARIABLE + TIMEOUT 600 ) if (NOT result EQUAL 0) string(REGEX MATCH "[0-9]+% tests.*[0-9.]+ sec.*$" test_results "${output}") From 73a26c003949a6bcbc30c7eb61b9f2942d5282e6 Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Wed, 21 Oct 2020 12:12:45 +0200 Subject: [PATCH 09/13] QmlDesigner: Update icon font * Add pin and unpin icons Change-Id: I42773d3f86f68d9bc638fa27500fb0b1b4e5d35d Reviewed-by: Brook Cronin Reviewed-by: Thomas Hartmann --- .../imports/StudioTheme/InternalConstants.qml | 56 +++++++++--------- .../imports/StudioTheme/icons.ttf | Bin 15012 -> 15516 bytes .../components/componentcore/theme.h | 2 + 3 files changed, 31 insertions(+), 27 deletions(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/InternalConstants.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/InternalConstants.qml index 928b8c4df74..d3fd86ca109 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/InternalConstants.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/InternalConstants.qml @@ -102,33 +102,35 @@ QtObject { readonly property string lockOn: "\u005F" readonly property string mergeCells: "\u0060" readonly property string minus: "\u0061" - readonly property string plus: "\u0062" - readonly property string redo: "\u0063" - readonly property string splitColumns: "\u0064" - readonly property string splitRows: "\u0065" - readonly property string startNode: "\u0066" - readonly property string testIcon: "\u0067" - readonly property string textAlignBottom: "\u0068" - readonly property string textAlignCenter: "\u0069" - readonly property string textAlignLeft: "\u006A" - readonly property string textAlignMiddle: "\u006B" - readonly property string textAlignRight: "\u006C" - readonly property string textAlignTop: "\u006D" - readonly property string textBulletList: "\u006E" - readonly property string textFullJustification: "\u006F" - readonly property string textNumberedList: "\u0070" - readonly property string tickIcon: "\u0071" - readonly property string triState: "\u0072" - readonly property string undo: "\u0073" - readonly property string upDownIcon: "\u0074" - readonly property string upDownSquare2: "\u0075" - readonly property string visibilityOff: "\u0076" - readonly property string visibilityOn: "\u0077" - readonly property string wildcard: "\u0078" - readonly property string zoomAll: "\u0079" - readonly property string zoomIn: "\u007A" - readonly property string zoomOut: "\u007B" - readonly property string zoomSelection: "\u007C" + readonly property string pin: "\u0062" + readonly property string plus: "\u0063" + readonly property string redo: "\u0064" + readonly property string splitColumns: "\u0065" + readonly property string splitRows: "\u0066" + readonly property string startNode: "\u0067" + readonly property string testIcon: "\u0068" + readonly property string textAlignBottom: "\u0069" + readonly property string textAlignCenter: "\u006A" + readonly property string textAlignLeft: "\u006B" + readonly property string textAlignMiddle: "\u006C" + readonly property string textAlignRight: "\u006D" + readonly property string textAlignTop: "\u006E" + readonly property string textBulletList: "\u006F" + readonly property string textFullJustification: "\u0070" + readonly property string textNumberedList: "\u0071" + readonly property string tickIcon: "\u0072" + readonly property string triState: "\u0073" + readonly property string undo: "\u0074" + readonly property string unpin: "\u0075" + readonly property string upDownIcon: "\u0076" + readonly property string upDownSquare2: "\u0077" + readonly property string visibilityOff: "\u0078" + readonly property string visibilityOn: "\u0079" + readonly property string wildcard: "\u007A" + readonly property string zoomAll: "\u007B" + readonly property string zoomIn: "\u007C" + readonly property string zoomOut: "\u007D" + readonly property string zoomSelection: "\u007E" readonly property font iconFont: Qt.font({ "family": controlIcons.name, diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/icons.ttf b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/icons.ttf index b8addaf83515a7e6a082be67af7de9c246399c30..a82278be1113bdc8f1d49731ce6920edf6c914e0 100644 GIT binary patch delta 1046 zcmZ2dI;XOpfsuiMftR6yftew|%`L=tVqDI51_ql31_lNh|6qNi$kvor1_s6m1_p+N zU_ zjB^141LF<`28L5P`N@g@MYuLFFfgBCU|=|sn^;l6u$o~J0|TQ40|SFXUSe))!IsKT z3=Bpo3=B-y3i69f6y_Px0ga_ zrtPJZ7;PC7C)+W`iq>?Z^JWa$% z#7`tkFosW_6@xN{1Hw8>pnMA&G^9zbHGa3Ke z!7U-+n6Ko>$i&F2Dagpm$0?F$ZqLo5%=qV@S@k~=CRG!`hg{-<0;?IN-Ff*1B@@i5(Nj-As0j;&P1QATNQO&CkfDByMJE z0``zT6Qe$(8XG?|ACs~YNLHSSQOpSBEdy3IzPt5Y^5Tp<|1L0cu_#N43o(9|W;XE@ zXDl_lW5UMF%Es(orRv1UA1_q`E1_nl_50V!|Nk>EGcZ^+FfcH1q~}zo z-N;dz&A`CY!N8!ykdd00B74>*ih+UQ4g&*&Sw==`eInPd|C1OP7)2Nu7*sNHODY5p zaQtInVBEpLz;G-lKRNN)`cF;_49q7O7#I%ZCRP+MtYlckz`$t1z`&r8mzbM+xZ&4Z z1_px;1_q|f1^LA#>HJfEGB6m&FfgzygFVN{z;H%q^{;q-o39Mq%r6)i7#MEP{L>4e znf~-nVzgz9pKQk%D_X;>@ZW+Vidlu>Bm)CjF9TE8`yNMGL@0r diff --git a/src/plugins/qmldesigner/components/componentcore/theme.h b/src/plugins/qmldesigner/components/componentcore/theme.h index 513965b18f4..2e3ab229d23 100644 --- a/src/plugins/qmldesigner/components/componentcore/theme.h +++ b/src/plugins/qmldesigner/components/componentcore/theme.h @@ -111,6 +111,7 @@ public: lockOn, mergeCells, minus, + pin, plus, redo, splitColumns, @@ -129,6 +130,7 @@ public: tickIcon, triState, undo, + unpin, upDownIcon, upDownSquare2, visibilityOff, From 860eeca6c581427958fa3315f4d6358182df19f1 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 22 Oct 2020 09:38:59 +0200 Subject: [PATCH 10/13] QMakePM: Restore old system() handling to old behavior Parsing qmake based projects without execution of system() may lead to inexact parse result and can end up with unusable projects. Amends dd62254. Change-Id: I7300a810c82959aab159d2492b4020998d26de38 Reviewed-by: Christian Kandeler --- src/plugins/qmakeprojectmanager/qmakesettings.cpp | 6 +++--- src/plugins/qmakeprojectmanager/qmakesettings.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/qmakeprojectmanager/qmakesettings.cpp b/src/plugins/qmakeprojectmanager/qmakesettings.cpp index b0edf3a404d..cd77fcf3e2d 100644 --- a/src/plugins/qmakeprojectmanager/qmakesettings.cpp +++ b/src/plugins/qmakeprojectmanager/qmakesettings.cpp @@ -92,7 +92,7 @@ void QmakeSettings::loadSettings() m_settings.warnAgainstUnalignedBuildDir = s->value( BUILD_DIR_WARNING_KEY, Utils::HostOsInfo::isWindowsHost()).toBool(); m_settings.alwaysRunQmake = s->value(ALWAYS_RUN_QMAKE_KEY, false).toBool(); - m_settings.runSystemFunction = s->value(RUN_SYSTEM_KEY, false).toBool(); + m_settings.runSystemFunction = s->value(RUN_SYSTEM_KEY, true).toBool(); } void QmakeSettings::storeSettings() const @@ -121,8 +121,8 @@ public: m_alwaysRunQmakeCheckbox.setChecked(QmakeSettings::alwaysRunQmake()); m_ignoreSystemCheckbox.setText(tr("Ignore qmake's system() function " "when parsing a project")); - m_ignoreSystemCheckbox.setToolTip(tr("Unchecking this option can help getting more exact " - "parsing results, but can have unwanted side effects.")); + m_ignoreSystemCheckbox.setToolTip(tr("Checking this option avoids unwanted side effects, " + "but may result in inexact parsing results.")); m_ignoreSystemCheckbox.setChecked(!QmakeSettings::runSystemFunction()); const auto layout = new QVBoxLayout(this); layout->addWidget(&m_warnAgainstUnalignedBuildDirCheckbox); diff --git a/src/plugins/qmakeprojectmanager/qmakesettings.h b/src/plugins/qmakeprojectmanager/qmakesettings.h index 0225a00bd7d..b64bb5087c8 100644 --- a/src/plugins/qmakeprojectmanager/qmakesettings.h +++ b/src/plugins/qmakeprojectmanager/qmakesettings.h @@ -37,7 +37,7 @@ class QmakeSettingsData { public: bool warnAgainstUnalignedBuildDir = false; bool alwaysRunQmake = false; - bool runSystemFunction = false; + bool runSystemFunction = true; }; class QmakeSettings : public QObject From 067cb61c7c8154c602b55b5eefe2482401fcee3f Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 22 Oct 2020 10:02:47 +0200 Subject: [PATCH 11/13] cmake build: Fix export name in case of branding We must use the same name everywhere for the export name, for simplicity stay with QtCreator, since this is not user-visible anyhow. Change-Id: I4f51982534662d46401dad1320eec3758eed055b Reviewed-by: Cristian Adam --- cmake/QtCreatorAPI.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/QtCreatorAPI.cmake b/cmake/QtCreatorAPI.cmake index 9bb27649591..9c2c582b933 100644 --- a/cmake/QtCreatorAPI.cmake +++ b/cmake/QtCreatorAPI.cmake @@ -214,7 +214,7 @@ function(add_qtc_library name) endif() install(TARGETS ${name} - EXPORT ${IDE_CASED_ID} + EXPORT QtCreator RUNTIME DESTINATION "${_DESTINATION}" ${COMPONENT_OPTION} @@ -460,7 +460,7 @@ function(add_qtc_plugin target_name) if (NOT _arg_SKIP_INSTALL) install(TARGETS ${target_name} - EXPORT ${IDE_CASED_ID} + EXPORT QtCreator RUNTIME DESTINATION "${plugin_dir}" OPTIONAL LIBRARY DESTINATION "${plugin_dir}" OPTIONAL ARCHIVE From e83e146d0814e0df5283e7374c3c1f3f127b0696 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 22 Oct 2020 10:54:39 +0200 Subject: [PATCH 12/13] cmake build: Install our special FindQt5.cmake Which handles the Qt5 vs Qt6 differences Change-Id: Ie2e4d1c9564cd1d88c912b23c08a721e9e4e1b90 Reviewed-by: Cristian Adam --- src/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index cc8a731820e..ce51c6ad53b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -87,6 +87,7 @@ install( ${PROJECT_SOURCE_DIR}/cmake/QtCreatorDocumentation.cmake ${PROJECT_SOURCE_DIR}/cmake/QtCreatorAPI.cmake ${PROJECT_SOURCE_DIR}/cmake/QtCreatorAPIInternal.cmake + ${PROJECT_SOURCE_DIR}/cmake/FindQt5.cmake ${CMAKE_BINARY_DIR}/cmake/QtCreatorConfig.cmake DESTINATION lib/cmake/QtCreator COMPONENT Devel EXCLUDE_FROM_ALL From c510cf79d8444ff9e098143cb7727a60025a41af Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 22 Oct 2020 13:19:12 +0200 Subject: [PATCH 13/13] cmake build: Add option for exporting plugins That can be used for external plugins. Just add the option "EXPORT" to your "add_qtc_plugin(MyPlugin ...." call. Other plugins can then do "find_package(QtCreatorMyPlugin)" and link against "QtCreator::MyPlugin". Supports both using a Devel install or using a build directory of the plugin that is depended on. Task-number: QTCREATORBUG-22803 Change-Id: I80724eca8c828d2d5be307d32f3125c4e3bd8b3a Reviewed-by: Cristian Adam --- cmake/Config.cmake.in | 5 +++++ cmake/QtCreatorAPI.cmake | 37 +++++++++++++++++++++++++++++++++++-- src/CMakeLists.txt | 2 ++ 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 cmake/Config.cmake.in diff --git a/cmake/Config.cmake.in b/cmake/Config.cmake.in new file mode 100644 index 00000000000..647a8462a91 --- /dev/null +++ b/cmake/Config.cmake.in @@ -0,0 +1,5 @@ +@PACKAGE_INIT@ + +if (NOT TARGET QtCreator::@target_name@) + include ("${CMAKE_CURRENT_LIST_DIR}/@export@Targets.cmake") +endif() diff --git a/cmake/QtCreatorAPI.cmake b/cmake/QtCreatorAPI.cmake index 9c2c582b933..2e1183c75ed 100644 --- a/cmake/QtCreatorAPI.cmake +++ b/cmake/QtCreatorAPI.cmake @@ -29,6 +29,9 @@ list(APPEND DEFAULT_DEFINES RELATIVE_DOC_PATH="${RELATIVE_DOC_PATH}" ) +# use CMAKE_CURRENT_FUNCTION_LIST_DIR when we can require CMake 3.17 +set(_THIS_MODULE_BASE_DIR "${CMAKE_CURRENT_LIST_DIR}") + option(BUILD_PLUGINS_BY_DEFAULT "Build plugins by default. This can be used to build all plugins by default, or none." ON) option(BUILD_EXECUTABLES_BY_DEFAULT "Build executables by default. This can be used to build all executables by default, or none." ON) option(BUILD_LIBRARIES_BY_DEFAULT "Build libraries by default. This can be used to build all libraries by default, or none." ON) @@ -264,7 +267,7 @@ endfunction(add_qtc_library) function(add_qtc_plugin target_name) cmake_parse_arguments(_arg - "EXPERIMENTAL;SKIP_DEBUG_CMAKE_FILE_CHECK;SKIP_INSTALL;INTERNAL_ONLY;SKIP_TRANSLATION" + "EXPERIMENTAL;SKIP_DEBUG_CMAKE_FILE_CHECK;SKIP_INSTALL;INTERNAL_ONLY;SKIP_TRANSLATION;EXPORT" "VERSION;COMPAT_VERSION;PLUGIN_JSON_IN;PLUGIN_PATH;PLUGIN_NAME;OUTPUT_NAME;BUILD_DEFAULT" "CONDITION;DEPENDS;PUBLIC_DEPENDS;DEFINES;PUBLIC_DEFINES;INCLUDES;PUBLIC_INCLUDES;SOURCES;EXPLICIT_MOC;SKIP_AUTOMOC;EXTRA_TRANSLATIONS;PLUGIN_DEPENDS;PLUGIN_RECOMMENDS;PROPERTIES" ${ARGN} @@ -459,8 +462,14 @@ function(add_qtc_plugin target_name) enable_pch(${target_name}) if (NOT _arg_SKIP_INSTALL) + if (_arg_EXPORT) + set(export QtCreator${target_name}) + else() + set(export QtCreator) + endif() + install(TARGETS ${target_name} - EXPORT QtCreator + EXPORT ${export} RUNTIME DESTINATION "${plugin_dir}" OPTIONAL LIBRARY DESTINATION "${plugin_dir}" OPTIONAL ARCHIVE @@ -468,6 +477,30 @@ function(add_qtc_plugin target_name) COMPONENT Devel EXCLUDE_FROM_ALL OPTIONAL ) + + if (_arg_EXPORT) + # export of external plugins + install(EXPORT ${export} + FILE ${export}Targets.cmake + DESTINATION lib/cmake/${export} + COMPONENT Devel EXCLUDE_FROM_ALL + NAMESPACE QtCreator:: + ) + include(CMakePackageConfigHelpers) + configure_package_config_file(${_THIS_MODULE_BASE_DIR}/Config.cmake.in + "${CMAKE_BINARY_DIR}/cmake/${export}Config.cmake" + INSTALL_DESTINATION lib/cmake/${export} + ) + install( + FILES ${CMAKE_BINARY_DIR}/cmake/${export}Config.cmake + DESTINATION lib/cmake/${export} + COMPONENT Devel EXCLUDE_FROM_ALL + ) + export(EXPORT ${export} + NAMESPACE QtCreator:: + FILE ${CMAKE_BINARY_DIR}/cmake/${export}Targets.cmake + ) + endif() get_target_property(target_suffix ${target_name} SUFFIX) get_target_property(target_prefix ${target_name} PREFIX) if (target_suffix STREQUAL "target_suffix-NOTFOUND") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ce51c6ad53b..dfc9c24cf7e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -76,6 +76,7 @@ file(COPY ${PROJECT_SOURCE_DIR}/cmake/QtCreatorAPI.cmake ${PROJECT_SOURCE_DIR}/cmake/QtCreatorAPIInternal.cmake ${PROJECT_SOURCE_DIR}/cmake/FindQt5.cmake + ${PROJECT_SOURCE_DIR}/cmake/Config.cmake.in DESTINATION ${CMAKE_BINARY_DIR}/cmake ) @@ -88,6 +89,7 @@ install( ${PROJECT_SOURCE_DIR}/cmake/QtCreatorAPI.cmake ${PROJECT_SOURCE_DIR}/cmake/QtCreatorAPIInternal.cmake ${PROJECT_SOURCE_DIR}/cmake/FindQt5.cmake + ${PROJECT_SOURCE_DIR}/cmake/Config.cmake.in ${CMAKE_BINARY_DIR}/cmake/QtCreatorConfig.cmake DESTINATION lib/cmake/QtCreator COMPONENT Devel EXCLUDE_FROM_ALL