From fdad6496f4f6034f77108d43cf8531651f36ae46 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 14 Dec 2022 14:53:52 +0100 Subject: [PATCH 01/36] Fix language selection box When Qt Creator is installed in a path with underscore. Amends 451d02c88d3aca4a1c1d6487b2ecaaac848e5c90 which changed the pattern matching from file name only to the whole path. Fixes: QTCREATORBUG-28591 Change-Id: Ice6a7cb34fd2bb98c384a3b7cb573614bb7a43b6 Reviewed-by: Marcus Tillmanns --- src/plugins/coreplugin/generalsettings.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/coreplugin/generalsettings.cpp b/src/plugins/coreplugin/generalsettings.cpp index 2e9d3fa884e..9cc5889e7fa 100644 --- a/src/plugins/coreplugin/generalsettings.cpp +++ b/src/plugins/coreplugin/generalsettings.cpp @@ -163,10 +163,10 @@ void GeneralSettingsWidget::fillLanguageBox() const QStringList(QLatin1String("qtcreator*.qm"))); for (const FilePath &languageFile : languageFiles) { - const QString path = languageFile.path(); - int start = path.indexOf('_') + 1; - int end = path.lastIndexOf('.'); - const QString locale = path.mid(start, end-start); + const QString name = languageFile.fileName(); + int start = name.indexOf('_') + 1; + int end = name.lastIndexOf('.'); + const QString locale = name.mid(start, end - start); // no need to show a language that creator will not load anyway if (hasQmFilesForLocale(locale, creatorTrPath.toString())) { QLocale tmpLocale(locale); From d0046ec4358585aa8bdf2ee13d61b0329c06e334 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 12 Dec 2022 15:25:09 +0100 Subject: [PATCH 02/36] ProjectExplorer: Consider the form "-D key=value" ... when filtering compiler options for MSVC macro extractions. Otherwise we end up with a stray command line argument, breaking the call to cl.exe. Fixes: QTCREATORBUG-28016 Change-Id: I29979a4b968d2056a0feba61fee01d5ddc9aa28f Reviewed-by: Reviewed-by: Christian Stenger --- src/plugins/projectexplorer/msvctoolchain.cpp | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index 468c408adf5..cd3d4afb561 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -621,15 +621,22 @@ Macros MsvcToolChain::msvcPredefinedMacros(const QStringList &cxxflags, Macros predefinedMacros; QStringList toProcess; - for (const QString &arg : cxxflags) { - if (arg.startsWith("/D") || arg.startsWith("-D")) { - const QString define = arg.mid(2); - predefinedMacros.append(Macro::fromKeyValue(define)); - } else if (arg.startsWith("/U") || arg.startsWith("-U")) { - predefinedMacros.append( - {arg.mid(2).toLocal8Bit(), ProjectExplorer::MacroType::Undefine}); + for (auto arg = cxxflags.begin(); arg != cxxflags.end(); ++arg) { + if (arg->startsWith("/D") || arg->startsWith("-D")) { + if (arg->length() > 2) + predefinedMacros.append(Macro::fromKeyValue(arg->mid(2))); + else if (std::next(arg) != cxxflags.end()) + predefinedMacros.append(Macro::fromKeyValue(*++arg)); + } else if (arg->startsWith("/U") || arg->startsWith("-U")) { + if (arg->length() > 2) { + predefinedMacros.append({arg->mid(2).toLocal8Bit(), + MacroType::Undefine}); + } else if (std::next(arg) != cxxflags.end()) { + predefinedMacros.append({(++arg)->toLocal8Bit(), + MacroType::Undefine}); + } } else { - toProcess.append(arg); + toProcess.append(*arg); } } From bbd5d6c7aed1b98e5405d39ad42e928a00409b05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= Date: Wed, 14 Dec 2022 17:12:43 +0100 Subject: [PATCH 03/36] SquishTests: Update FindToolBar ...as seen in tst_CSUP05 Change-Id: I1736a4ec9c69a3db3fc98ea1234b0363ceeaef41 Reviewed-by: Reviewed-by: Christian Stenger --- src/plugins/coreplugin/find/findtoolbar.cpp | 1 + tests/system/objects.map | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugins/coreplugin/find/findtoolbar.cpp b/src/plugins/coreplugin/find/findtoolbar.cpp index ab207391bdb..6db9774afee 100644 --- a/src/plugins/coreplugin/find/findtoolbar.cpp +++ b/src/plugins/coreplugin/find/findtoolbar.cpp @@ -78,6 +78,7 @@ FindToolBar::FindToolBar(CurrentDocumentFind *currentDocumentFind) m_horizontalSpacer = new QSpacerItem(40, 0, QSizePolicy::Expanding, QSizePolicy::Minimum); m_close = new QToolButton; + m_close->setObjectName("closeFindToolBarButton"); auto findButtonsWidget = new QWidget; diff --git a/tests/system/objects.map b/tests/system/objects.map index 074275eba8c..1ba56ea1cfd 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -2,7 +2,7 @@ :*Qt Creator.Cancel Build_QToolButton {text='Cancel Build' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator.Clear_QToolButton {text='Clear' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator.Continue_Core::Internal::FancyToolButton {name='Debug.Button' toolTip?='Continue *' type='Core::Internal::FancyToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} -:*Qt Creator.Find_Find::Internal::FindToolBar {name='Core__Internal__FindWidget' type='Core::Internal::FindToolBar' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Find'} +:*Qt Creator.Find_Find::Internal::FindToolBar {type='Core::Internal::FindToolBar' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Find'} :*Qt Creator.FormEditorStack_Designer::Internal::FormEditorStack {name='FormEditorStack' type='Designer::Internal::FormEditorStack' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator.Interrupt_Core::Internal::FancyToolButton {name='Debug.Button' toolTip='Interrupt' type='Core::Internal::FancyToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator.ProjectSelectorDockWidget_QDockWidget {name='ProjectSelectorDockWidget' type='QDockWidget' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} @@ -118,7 +118,7 @@ :QML Debugging_QMessageBox {text='The option will only take effect if the project is recompiled. Do you want to recompile now?' type='QMessageBox' unnamed='1' visible='1'} :Qt Creator.Add Bookmark_QToolButton {text='Add Bookmark' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.CloseDoc_QToolButton {toolTip?='Close Document *' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} -:Qt Creator.CloseFind_QToolButton {name='close' type='QToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} +:Qt Creator.CloseFind_QToolButton {name='closeFindToolBarButton' type='QToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.Compile Output_Core::OutputWindow {type='Core::OutputWindow' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Compile Output'} :Qt Creator.Configure Project_QPushButton {text='Configure Project' type='QPushButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.DebugModeWidget_QSplitter {name='DebugModeWidget' type='QSplitter' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} @@ -132,8 +132,8 @@ :Qt Creator.QML debugging and profiling:_QLabel {text='QML debugging and profiling:' type='QLabel' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.QtCreator.MenuBar_QMenuBar {name='QtCreator.MenuBar' type='QMenuBar' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.ReRun_QToolButton {toolTip='Re-run this run-configuration.' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} -:Qt Creator.Replace All_QToolButton {name='replaceAllButton' text='Replace All' type='QToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} -:Qt Creator.Replace_QToolButton {name='replaceButton' text='Replace' type='QToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} +:Qt Creator.Replace All_QToolButton {text='Replace All' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} +:Qt Creator.Replace_QToolButton {text='Replace' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.Stop_QToolButton {text='Stop' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.Timeline_QDockWidget {container=':Qt Creator.DebugModeWidget_QSplitter' name='QmlProfiler.Timeline.DockDockWidget' type='QDockWidget' visible='1'} :Qt Creator.Timeline_QTabBar {aboveWidget=':Qt Creator.Timeline_QDockWidget' container=':Qt Creator.DebugModeWidget_QSplitter' type='QTabBar' unnamed='1' visible='1'} From 7b073efe4aa94827e4d17c8dc8d21437f690a805 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= Date: Wed, 14 Dec 2022 22:24:56 +0100 Subject: [PATCH 04/36] SquishTests: Update tst_QMLS04 Change-Id: I383e8f652ae233df7ed5bef93dcaa9a43fe95f0e Reviewed-by: Christian Stenger --- src/plugins/qmljseditor/qmljscomponentnamedialog.cpp | 1 + tests/system/objects.map | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmljseditor/qmljscomponentnamedialog.cpp b/src/plugins/qmljseditor/qmljscomponentnamedialog.cpp index 6953e992b9e..c94fbebe433 100644 --- a/src/plugins/qmljseditor/qmljscomponentnamedialog.cpp +++ b/src/plugins/qmljseditor/qmljscomponentnamedialog.cpp @@ -24,6 +24,7 @@ ComponentNameDialog::ComponentNameDialog(QWidget *parent) : { setWindowTitle(Tr::tr("Move Component into Separate File")); m_componentNameEdit = new Utils::ClassNameValidatingLineEdit; + m_componentNameEdit->setObjectName("componentNameEdit"); m_componentNameEdit->setPlaceholderText(Tr::tr("Component Name")); m_messageLabel = new QLabel; m_pathEdit = new Utils::PathChooser; diff --git a/tests/system/objects.map b/tests/system/objects.map index 1ba56ea1cfd..09ef2505423 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -61,7 +61,7 @@ :Dialog.OK_QPushButton {text='OK' type='QPushButton' unnamed='1' visible='1' window=':Dialog_QmlJSEditor::Internal::ComponentNameDialog'} :Dialog.componentNameEdit_QLineEdit {name='componentNameEdit' type='Utils::ClassNameValidatingLineEdit' visible='1' window=':Dialog_QmlJSEditor::Internal::ComponentNameDialog'} :Dialog_Debugger::Internal::SymbolPathsDialog {name='Debugger__Internal__SymbolPathsDialog' type='Debugger::Internal::SymbolPathsDialog' visible='1' windowTitle='Dialog'} -:Dialog_QmlJSEditor::Internal::ComponentNameDialog {name='QmlJSEditor__Internal__ComponentNameDialog' type='QmlJSEditor::Internal::ComponentNameDialog' visible='1' windowTitle='Move Component into Separate File'} +:Dialog_QmlJSEditor::Internal::ComponentNameDialog {type='QmlJSEditor::Internal::ComponentNameDialog' unnamed='1' visible='1' windowTitle='Move Component into Separate File'} :Events.QmlProfilerEventsTable_QmlProfiler::Internal::QmlProfilerStatisticsMainView {container=':Qt Creator.Events_QDockWidget' name='QmlProfilerEventsTable' type='QmlProfiler::Internal::QmlProfilerStatisticsMainView' visible='1'} :Failed to start application_QMessageBox {type='QMessageBox' unnamed='1' visible='1' windowTitle='Failed to start application'} :File has been removed.Close_QPushButton {text='Close' type='QPushButton' unnamed='1' visible='1' window=':File has been removed_QMessageBox'} From 3874ac236d1bd14f6904c03e63e88f065c6fe62e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= Date: Wed, 14 Dec 2022 22:54:07 +0100 Subject: [PATCH 05/36] SquishTests: Stabilize tst_codepasting Avoid "Error in type() invocation: Could not activate toplevel-window for widget" Change-Id: Ib68a975724ad3824800bdcb542916b6644f1dc7f Reviewed-by: Reviewed-by: Christian Stenger --- tests/system/suite_tools/tst_codepasting/test.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/system/suite_tools/tst_codepasting/test.py b/tests/system/suite_tools/tst_codepasting/test.py index 1275052156c..fd389490eaf 100644 --- a/tests/system/suite_tools/tst_codepasting/test.py +++ b/tests/system/suite_tools/tst_codepasting/test.py @@ -53,6 +53,8 @@ def pasteFile(sourceFile, protocol): typeLines(editor, "// tst_codepasting %s" % datetime.utcnow()) sourceText = editor.plainText invokeMenuItem("Tools", "Code Pasting", "Paste Snippet...") + pasteView = waitForObject(":Send to Codepaster_CodePaster::PasteView") + waitFor("pasteView.isActiveWindow") selectFromCombo(":Send to Codepaster.protocolBox_QComboBox", protocol) pasteEditor = waitForObject(":stackedWidget.plainTextEdit_QPlainTextEdit") test.compare(pasteEditor.plainText, sourceText, "Verify that dialog shows text from the editor") From 75c43f926b95cb7ac546ec8929e6e759320e7d89 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 15 Dec 2022 08:25:56 +0100 Subject: [PATCH 06/36] Squish: Stabilize invoking context menu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Try a second time if the wanted menu item is not active when triggering the context menu the first time. Change-Id: I742db645542e6775baaa77fbdb1fd5a8e9a120f2 Reviewed-by: Robert Löhning --- tests/system/shared/editor_utils.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/system/shared/editor_utils.py b/tests/system/shared/editor_utils.py index 4aa008515eb..60ed802745d 100644 --- a/tests/system/shared/editor_utils.py +++ b/tests/system/shared/editor_utils.py @@ -336,9 +336,16 @@ def validateSearchResult(expectedCount): # this function invokes context menu and command from it def invokeContextMenuItem(editorArea, command1, command2 = None): - ctxtMenu = openContextMenuOnTextCursorPosition(editorArea) - snooze(1) - item1 = waitForObjectItem(objectMap.realName(ctxtMenu), command1, 2000) + for _ in range(2): + ctxtMenu = openContextMenuOnTextCursorPosition(editorArea) + snooze(1) + try: + item1 = waitForObjectItem(objectMap.realName(ctxtMenu), command1, 2000) + break + except: + test.warning("Context menu item not ready (%s) - trying once more." % command1) + type(editorArea, "") + if command2 and platform.system() == 'Darwin': mouseMove(item1) activateItem(item1) From 445c3624ff32978493e4aefa3e0b02755d491f72 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 14 Dec 2022 13:23:12 +0100 Subject: [PATCH 07/36] QMakePM: fix potential crash when accessing deleted members Fixes: QTCREATORBUG-28370 Change-Id: I1767678221afc0d1a99194bce2d987a226998da5 Reviewed-by: Alessandro Portale --- src/plugins/qmakeprojectmanager/qmakestep.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/qmakeprojectmanager/qmakestep.cpp b/src/plugins/qmakeprojectmanager/qmakestep.cpp index 0a075eb3234..fdb22b22b16 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakestep.cpp @@ -552,6 +552,11 @@ QWidget *QMakeStep::createConfigWidget() BuildManager::buildLists({bc->cleanSteps()}); }); + connect(widget, &QObject::destroyed, this, [this] { + abisLabel = nullptr; + abisListWidget = nullptr; + }); + VariableChooser::addSupportForChildWidgets(widget, macroExpander()); return widget; From 01dc87b10001141b1516fe24316a02254b6e6f40 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 15 Dec 2022 12:35:45 +0100 Subject: [PATCH 08/36] CMake build: Add hint for installing libdw-dev for elfutils to the CMake output when elfutils is not found Change-Id: I7ecc83ddadb0ce4bd4f8f9695cbf58443d71ff98 Reviewed-by: hjk Reviewed-by: --- cmake/Findelfutils.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/Findelfutils.cmake b/cmake/Findelfutils.cmake index ce6ed8d16c9..71463403315 100644 --- a/cmake/Findelfutils.cmake +++ b/cmake/Findelfutils.cmake @@ -60,6 +60,8 @@ if(elfutils_FOUND) endif() endif() endforeach() +else() + message(STATUS " (set ELFUTILS_INSTALL_DIR, or install libdw-dev on a Debian-like system)") endif() mark_as_advanced(ELFUTILS_INCLUDE_DIR ELFUTILS_LIB_elf ELFUTILS_LIB_dw) From 698a49597214005a25db3244b28bfef5bfecf3fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= Date: Thu, 15 Dec 2022 10:54:08 +0100 Subject: [PATCH 09/36] SquishTests: Use existing function saveAndExit() Change-Id: I2e10de8b454a69b3e4ade7520b4fa00415bcde42 Reviewed-by: Reviewed-by: Christian Stenger --- tests/system/shared/build_utils.py | 3 +-- tests/system/shared/editor_utils.py | 3 +-- tests/system/suite_QMLS/tst_QMLS02/test.py | 4 +--- tests/system/suite_QMLS/tst_QMLS04/test.py | 7 ++----- tests/system/suite_QMLS/tst_QMLS08/test.py | 7 ++----- tests/system/suite_editors/tst_generic_highlighter/test.py | 3 +-- tests/system/suite_editors/tst_rename_macros/test.py | 4 +--- tests/system/suite_qtquick/tst_qml_outline/test.py | 3 +-- tests/system/suite_tools/tst_designer_autocomplete/test.py | 3 +-- tests/system/suite_tools/tst_designer_goto_slot/test.py | 3 +-- 10 files changed, 12 insertions(+), 28 deletions(-) diff --git a/tests/system/shared/build_utils.py b/tests/system/shared/build_utils.py index 5d422f8ef08..05afc9c493f 100644 --- a/tests/system/shared/build_utils.py +++ b/tests/system/shared/build_utils.py @@ -209,8 +209,7 @@ def runVerify(): availableConfigs = iterateBuildConfigs() if not availableConfigs: test.fatal("Haven't found build configurations, quitting") - invokeMenuItem("File", "Save All") - invokeMenuItem("File", "Exit") + saveAndExit() for kit, config in availableConfigs: selectBuildConfig(kit, config) test.log("Using build config '%s'" % config) diff --git a/tests/system/shared/editor_utils.py b/tests/system/shared/editor_utils.py index 60ed802745d..57a60fd6a97 100644 --- a/tests/system/shared/editor_utils.py +++ b/tests/system/shared/editor_utils.py @@ -400,8 +400,7 @@ def openDocument(treeElement): def earlyExit(details="No additional information"): test.fail("Something went wrong running this test", details) - invokeMenuItem("File", "Save All") - invokeMenuItem("File", "Exit") + saveAndExit() def openDocumentPlaceCursor(doc, line, additionalFunction=None): cppEditorStr = ":Qt Creator_CppEditor::Internal::CPPEditorWidget" diff --git a/tests/system/suite_QMLS/tst_QMLS02/test.py b/tests/system/suite_QMLS/tst_QMLS02/test.py index cc931ae3239..c4bfdfd9efe 100644 --- a/tests/system/suite_QMLS/tst_QMLS02/test.py +++ b/tests/system/suite_QMLS/tst_QMLS02/test.py @@ -42,7 +42,5 @@ def main(): # wait for issues test.verify(waitFor("issuesModel.rowCount() == 0", 3000), "Verifying if error was properly cleared after code fix") - #save and exit - invokeMenuItem("File", "Save All") - invokeMenuItem("File", "Exit") + saveAndExit() diff --git a/tests/system/suite_QMLS/tst_QMLS04/test.py b/tests/system/suite_QMLS/tst_QMLS04/test.py index 63db543bcba..2c42c178cc0 100644 --- a/tests/system/suite_QMLS/tst_QMLS04/test.py +++ b/tests/system/suite_QMLS/tst_QMLS04/test.py @@ -46,16 +46,13 @@ def main(): waitForObjectItem(":Qt Creator_Utils::NavigationTreeView", addBranchWildcardToRoot(myCompTE), 1000) except: test.fail("Refactoring failed - file MyComponent.qml was not generated properly in project explorer") - #save and exit - invokeMenuItem("File", "Save All") - invokeMenuItem("File", "Exit") + saveAndExit() return test.passes("Refactoring - file MyComponent.qml was generated properly in project explorer") # open MyComponent.qml file for verification if not openDocument(myCompTE): test.fatal("Could not open MyComponent.qml.") - invokeMenuItem("File", "Save All") - invokeMenuItem("File", "Exit") + saveAndExit() return editorArea = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget") codeText = str(editorArea.plainText) diff --git a/tests/system/suite_QMLS/tst_QMLS08/test.py b/tests/system/suite_QMLS/tst_QMLS08/test.py index 21def06251d..7b7cca9979b 100644 --- a/tests/system/suite_QMLS/tst_QMLS08/test.py +++ b/tests/system/suite_QMLS/tst_QMLS08/test.py @@ -19,8 +19,7 @@ def verifyNextLineIndented(editorArea, expectedIndentation): def verifyIndentation(editorArea): #verify indentation if not placeCursorToLine(editorArea, "id: wdw"): - invokeMenuItem("File", "Save All") - invokeMenuItem("File", "Exit") + saveAndExit() return False type(editorArea, "") expectedIndentations = [1,1,1,2,2,2,2,3,3,3,4,3,3,2,1] @@ -58,6 +57,4 @@ def main(): # verify invoked indentation if not verifyIndentation(editorArea): return - # save and exit - invokeMenuItem("File", "Save All") - invokeMenuItem("File", "Exit") + saveAndExit() diff --git a/tests/system/suite_editors/tst_generic_highlighter/test.py b/tests/system/suite_editors/tst_generic_highlighter/test.py index f1f154376ec..490c6021681 100644 --- a/tests/system/suite_editors/tst_generic_highlighter/test.py +++ b/tests/system/suite_editors/tst_generic_highlighter/test.py @@ -196,9 +196,8 @@ def main(): if current.endswith(".lhs"): type(editor, ">") type(editor, "") + saveAndExit() - invokeMenuItem("File", "Save All") - invokeMenuItem("File", "Exit") def init(): syntaxDirectory = __highlighterDefinitionsDirectory__() diff --git a/tests/system/suite_editors/tst_rename_macros/test.py b/tests/system/suite_editors/tst_rename_macros/test.py index cfa29e49863..6d329e44667 100644 --- a/tests/system/suite_editors/tst_rename_macros/test.py +++ b/tests/system/suite_editors/tst_rename_macros/test.py @@ -24,9 +24,7 @@ def main(): expectedHeaderName=headerName) if not testRenameMacroAfterSourceMoving(): return - # save and exit - invokeMenuItem("File", "Save All") - invokeMenuItem("File", "Exit") + saveAndExit() def testRenameMacroAfterSourceModification(): def __deleteAnyClass__(): diff --git a/tests/system/suite_qtquick/tst_qml_outline/test.py b/tests/system/suite_qtquick/tst_qml_outline/test.py index ddf4d368af5..63de1001e1b 100644 --- a/tests/system/suite_qtquick/tst_qml_outline/test.py +++ b/tests/system/suite_qtquick/tst_qml_outline/test.py @@ -21,8 +21,7 @@ def main(): qmlFiles = [treebase + "focus\\.qml", treebase + "Core.ListMenu\\.qml"] checkOutlineFor(qmlFiles) testModify() - invokeMenuItem("File", "Save All") - invokeMenuItem("File", "Exit") + saveAndExit() def checkOutlineFor(qmlFiles): for qmlFile in qmlFiles: diff --git a/tests/system/suite_tools/tst_designer_autocomplete/test.py b/tests/system/suite_tools/tst_designer_autocomplete/test.py index 229420a8b8c..903ca01156a 100644 --- a/tests/system/suite_tools/tst_designer_autocomplete/test.py +++ b/tests/system/suite_tools/tst_designer_autocomplete/test.py @@ -46,5 +46,4 @@ def main(): 'Comparing line "%s" to expected "%s"' % (lineUnderCursor(editor), "ui->%s" % buttonName)) type(editor, "") # Delete line selectFromLocator("mainwindow.ui") - invokeMenuItem("File", "Save All") - invokeMenuItem("File", "Exit") + saveAndExit() diff --git a/tests/system/suite_tools/tst_designer_goto_slot/test.py b/tests/system/suite_tools/tst_designer_goto_slot/test.py index cb3c9eb743f..c43846d7f8c 100644 --- a/tests/system/suite_tools/tst_designer_goto_slot/test.py +++ b/tests/system/suite_tools/tst_designer_goto_slot/test.py @@ -33,5 +33,4 @@ def main(): type(editor, "") test.verify(waitFor('str(lineUnderCursor(editor)).strip() == con[3]', 1000), 'Comparing line "%s" to expected "%s"' % (lineUnderCursor(editor), con[3])) - invokeMenuItem("File", "Save All") - invokeMenuItem("File", "Exit") + saveAndExit() From 1faae7dec412b947f8a0a03c18b50e16eab83f4f Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 15 Dec 2022 16:00:03 +0100 Subject: [PATCH 10/36] Bump version to 9.0.2 Change-Id: Ibc35cf8f8b388438d34c3b824c9eb97d9eefb9ea Reviewed-by: Eike Ziller --- cmake/QtCreatorIDEBranding.cmake | 4 ++-- qbs/modules/qtc/qtc.qbs | 4 ++-- qtcreator_ide_branding.pri | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmake/QtCreatorIDEBranding.cmake b/cmake/QtCreatorIDEBranding.cmake index e7f7b39cadc..c8b0ff78d5b 100644 --- a/cmake/QtCreatorIDEBranding.cmake +++ b/cmake/QtCreatorIDEBranding.cmake @@ -1,6 +1,6 @@ -set(IDE_VERSION "9.0.1") # The IDE version. +set(IDE_VERSION "9.0.2") # The IDE version. set(IDE_VERSION_COMPAT "9.0.0") # The IDE Compatibility version. -set(IDE_VERSION_DISPLAY "9.0.1") # The IDE display version. +set(IDE_VERSION_DISPLAY "9.0.2") # The IDE display version. set(IDE_COPYRIGHT_YEAR "2022") # The IDE current copyright year. set(IDE_SETTINGSVARIANT "QtProject") # The IDE settings variation. diff --git a/qbs/modules/qtc/qtc.qbs b/qbs/modules/qtc/qtc.qbs index 527bfe5e6dd..f7948de85b1 100644 --- a/qbs/modules/qtc/qtc.qbs +++ b/qbs/modules/qtc/qtc.qbs @@ -6,10 +6,10 @@ import qbs.Utilities Module { Depends { name: "cpp"; required: false } - property string qtcreator_display_version: '9.0.1' + property string qtcreator_display_version: '9.0.2' property string ide_version_major: '9' property string ide_version_minor: '0' - property string ide_version_release: '1' + property string ide_version_release: '2' property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.' + ide_version_release diff --git a/qtcreator_ide_branding.pri b/qtcreator_ide_branding.pri index f03edd9f28a..f0f86fcf4fe 100644 --- a/qtcreator_ide_branding.pri +++ b/qtcreator_ide_branding.pri @@ -1,6 +1,6 @@ -QTCREATOR_VERSION = 9.0.1 +QTCREATOR_VERSION = 9.0.2 QTCREATOR_COMPAT_VERSION = 9.0.0 -QTCREATOR_DISPLAY_VERSION = 9.0.1 +QTCREATOR_DISPLAY_VERSION = 9.0.2 QTCREATOR_COPYRIGHT_YEAR = 2022 IDE_DISPLAY_NAME = Qt Creator From c8e120123671bfe25fb508508f796714e2b42622 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Fri, 16 Dec 2022 06:03:09 +0100 Subject: [PATCH 11/36] LanguageClient: Do not send out invalid errors An error is expected to contain an error message so add one that misses one. Additionally assert when trying to set an error to a response that is invalid (does not contain message or code.) Fixes: QTCREATORBUG-28598 Fixes: QTCREATORBUG-27856 Change-Id: I0631433d847610531758d297a93a5c7cdfdc6c1d Reviewed-by: Christian Stenger --- src/libs/languageserverprotocol/jsonrpcmessages.h | 5 ++++- src/plugins/languageclient/client.cpp | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libs/languageserverprotocol/jsonrpcmessages.h b/src/libs/languageserverprotocol/jsonrpcmessages.h index ebf51b4c14c..c33e46422ca 100644 --- a/src/libs/languageserverprotocol/jsonrpcmessages.h +++ b/src/libs/languageserverprotocol/jsonrpcmessages.h @@ -290,7 +290,10 @@ public: return val.isUndefined() ? std::nullopt : std::make_optional(fromJsonValue(val)); } void setError(const Error &error) - { m_jsonObject.insert(errorKey, QJsonValue(error)); } + { + QTC_CHECK(error.isValid()); + m_jsonObject.insert(errorKey, QJsonValue(error)); + } void clearError() { m_jsonObject.remove(errorKey); } bool isValid(QString *errorMessage) const override diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index 5c99329675a..aca6ab50098 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -1891,6 +1891,7 @@ void ClientPrivate::handleMethod(const QString &method, const MessageId &id, con Response response(id); ResponseError error; error.setCode(ResponseError::MethodNotFound); + error.setMessage(QString("The client cannot handle the method '%1'.").arg(method)); response.setError(error); sendResponse(response); } From f87fccafc181db7844a95367f0253a0da1e230f5 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Fri, 16 Dec 2022 10:54:21 +0100 Subject: [PATCH 12/36] TextEditor: prevent shaping text for indent depth painting QTextLines cursorToX indirectly calls shapeText which is not for free. We just want to have the x position for the line so there is no need to shape the complete text to get the position of the first cursor. Change-Id: I0ae636ed8250385b7ac77c6f37d45922bbf2e9bf Reviewed-by: Marcus Tillmanns --- src/plugins/texteditor/texteditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 285a13a588a..b9fda49c2ed 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -4475,7 +4475,7 @@ void TextEditorWidgetPrivate::paintIndentDepth(PaintEventData &data, const QTextLine textLine = blockData.layout->lineAt(0); const QRectF rect = textLine.naturalTextRect(); - qreal x = textLine.cursorToX(0) + data.offset.x() + qMax(0, q->cursorWidth() - 1) + qreal x = textLine.x() + data.offset.x() + qMax(0, q->cursorWidth() - 1) + horizontalAdvance * m_visualIndentOffset; int paintColumn = 0; From 1eb73e4eb31e6b8c8e6d1c38b588c2dba6762d0a Mon Sep 17 00:00:00 2001 From: David Schulz Date: Fri, 16 Dec 2022 12:10:29 +0100 Subject: [PATCH 13/36] Editor: prevent validating line number in unwrapped editor Checking whether a position is inside the first line is also not for free. Only check the line number of a cursor position if we expect the editor to have multiple lines per block or in other words line wrapping is enabled. Change-Id: I0e3cb1fbd11c250677f7c11d1a5c780f60085ec2 Reviewed-by: Marcus Tillmanns --- src/plugins/texteditor/texteditor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index b9fda49c2ed..d6bce9d5a0b 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -4483,8 +4483,10 @@ void TextEditorWidgetPrivate::paintIndentDepth(PaintEventData &data, while (paintColumn < depth) { if (x >= 0) { int paintPosition = tabSettings.positionAtColumn(text, paintColumn); - if (blockData.layout->lineForTextPosition(paintPosition).lineNumber() != 0) + if (q->lineWrapMode() == QPlainTextEdit::WidgetWidth + && blockData.layout->lineForTextPosition(paintPosition).lineNumber() != 0) { break; + } const QPointF top(x, blockData.boundingRect.top()); const QPointF bottom(x, blockData.boundingRect.top() + rect.height()); const QLineF line(top, bottom); From 994626d1f6d4decffadae4c5557b457bbc2463ea Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 16 Dec 2022 10:40:42 +0100 Subject: [PATCH 14/36] README.md: Add/correct instructions for building perfparser Change-Id: I7dbdc9a34fb3297957cdb93a6f042c4fb6282eea Reviewed-by: hjk --- README.md | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 50dd9152a0b..9930da2356d 100644 --- a/README.md +++ b/README.md @@ -157,15 +157,21 @@ like Qt and LLVM, additionally run cmake --install . --prefix /path/to/qtcreator_install --component Dependencies -### Performance Analyzer +### Perf Profiler Support -If you have not installed Qt with the Maintenance Tool, you must -either set the path to the `perfparser` executable as a value of -the `PERFPROFILER_PARSER_FILEPATH` environment variable or copy -the executable to from the Qt Creator installation directory to -the build directory. That is, copy it from -`/path/to/qtcreator_install/Tools/QtCreator/libexec/qtcreator/` to -/path/to/qtcreator_buid/libexec/qtcreator/`. +Support for the [perf](https://perf.wiki.kernel.org/index.php/Main_Page) profiler +requires the `perfparser` tool that is part of the Qt Creator source package, and also +part of the Qt Creator Git repository in form of a submodule in `src/tools/perfparser`. + +Compilation of `perfparser` requires ELF and DWARF development packages. +You can either download and extract a prebuilt package from +https://download.qt.io/development_releases/prebuilt/elfutils/ and add the +directory to the `CMAKE_PREFIX_PATH` when configuring Qt Creator, +or install the `libdw-dev` package on Debian-style Linux systems. + +You can also point Qt Creator to a separate installation of `perfparser` by +setting the `PERFPROFILER_PARSER_FILEPATH` environment variable to the full +path to the executable. ## Getting LLVM/Clang for the Clang Code Model From 3904539e0d7fad334b0360018ca3326640fc3903 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii Date: Fri, 16 Dec 2022 10:31:20 +0100 Subject: [PATCH 15/36] ClangFormat: Fix crash when m_fileName is empty Fixes: QTCREATORBUG-28600 Change-Id: I3e0d64eb892daa5c63abe7ec81b258bf96fcdb1b Reviewed-by: hjk --- src/plugins/clangformat/clangformatbaseindenter.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/clangformat/clangformatbaseindenter.cpp b/src/plugins/clangformat/clangformatbaseindenter.cpp index 6072082c8c7..47791c27de7 100644 --- a/src/plugins/clangformat/clangformatbaseindenter.cpp +++ b/src/plugins/clangformat/clangformatbaseindenter.cpp @@ -464,10 +464,9 @@ Utils::Text::Replacements ClangFormatBaseIndenter::replacements(QByteArray buffe bool secondTry) const { QTC_ASSERT(replacementsToKeep != ReplacementsToKeep::All, return Utils::Text::Replacements()); + QTC_ASSERT(!m_fileName.isEmpty(), return {}); - clang::format::FormatStyle style = styleForFile(); QByteArray originalBuffer = buffer; - int utf8Offset = Utils::Text::utf8NthLineOffset(m_doc, buffer, startBlock.blockNumber() + 1); QTC_ASSERT(utf8Offset >= 0, return Utils::Text::Replacements();); int utf8Length = selectedLines(m_doc, startBlock, endBlock).toUtf8().size(); @@ -476,6 +475,7 @@ Utils::Text::Replacements ClangFormatBaseIndenter::replacements(QByteArray buffe if (replacementsToKeep == ReplacementsToKeep::IndentAndBefore) rangeStart = formattingRangeStart(startBlock, buffer, lastSaveRevision()); + clang::format::FormatStyle style = styleForFile(); adjustFormatStyleForLineBreak(style, replacementsToKeep); if (replacementsToKeep == ReplacementsToKeep::OnlyIndent) { CharacterContext currentCharContext = CharacterContext::Unknown; @@ -527,6 +527,7 @@ Utils::Text::Replacements ClangFormatBaseIndenter::replacements(QByteArray buffe Utils::Text::Replacements ClangFormatBaseIndenter::format( const TextEditor::RangesInLines &rangesInLines) { + QTC_ASSERT(!m_fileName.isEmpty(), return {}); if (rangesInLines.empty()) return Utils::Text::Replacements(); From 456b8b69f9a0b6d8367a3ce1909df4cadd96cdc1 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 15 Dec 2022 12:43:13 +0100 Subject: [PATCH 16/36] build_plugins.py: Create signed package for plugins On macOS if SIGNING_IDENTITY is given. Creates an extra -signed.7z, to not interfere with existing build setups. Change-Id: I8ec7f5cbeb14fb749d5d62398916629b83bdb833 Reviewed-by: Reviewed-by: Christian Stenger --- scripts/build_plugin.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/scripts/build_plugin.py b/scripts/build_plugin.py index 4e142bcd1e0..df06908c9d3 100755 --- a/scripts/build_plugin.py +++ b/scripts/build_plugin.py @@ -39,6 +39,13 @@ def get_arguments(): action='store_true', default=False) parser.add_argument('--build-type', help='Build type to pass to CMake (defaults to RelWithDebInfo)', default='RelWithDebInfo') + # zipping + parser.add_argument('--zip-threads', help='Sets number of threads to use for 7z. Use "+" for turning threads on ' + 'without a specific number of threads. This is directly passed to the "-mmt" option of 7z.', + default='2') + # signing + parser.add_argument('--keychain-unlock-script', + help='Path to script for unlocking the keychain used for signing (macOS)') args = parser.parse_args() args.with_debug_info = args.build_type == 'RelWithDebInfo' return args @@ -144,6 +151,21 @@ def package(args, paths): common.check_print_call(['7z', 'a', '-mmt2', os.path.join(paths.result, args.name + '-debug.7z'), '*'], paths.debug_install) + if common.is_mac_platform() and common.codesign_call(): + if args.keychain_unlock_script: + common.check_print_call([args.keychain_unlock_script], paths.install) + if os.environ.get('SIGNING_IDENTITY'): + signed_install_path = paths.install + '-signed' + common.copytree(paths.install, signed_install_path, symlinks=True) + apps = [d for d in os.listdir(signed_install_path) if d.endswith('.app')] + if apps: + app = apps[0] + common.conditional_sign_recursive(os.path.join(signed_install_path, app), + lambda ff: ff.endswith('.dylib')) + common.check_print_call(['7z', 'a', '-mmt' + args.zip_threads, + os.path.join(paths.result, args.name + '-signed.7z'), + app], + signed_install_path) def get_paths(args): Paths = collections.namedtuple('Paths', From 70b33886843cde31ee4d6a46cad010e81885ae70 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Fri, 16 Dec 2022 14:32:54 +0100 Subject: [PATCH 17/36] CMakePM: Allow relative compiler paths for presets You can have a preset with the PATH environment variable modified and with CMAKE_C|XX_COMPILER CMake variables only as "gcc.exe" and "g++.exe" Qt Creator now will search in PATH after the compiler file names and work as expected. Fixes: QTCREATORBUG-28602 Change-Id: I8520f6fcf5e542600fab08228d04d3709d3a8e8f Reviewed-by: Eike Ziller Reviewed-by: Qt CI Bot --- .../cmakeprojectimporter.cpp | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp index f8f536e22db..fe9487bbaf6 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp @@ -441,6 +441,28 @@ static QString extractVisualStudioPlatformFromConfig(const CMakeConfig &config) return platform; } +void updateCompilerPaths(CMakeConfig &config, const Environment &env) +{ + auto updateRelativePath = [&config, env](const QByteArray &key) { + FilePath pathValue = config.filePathValueOf(key); + + if (pathValue.isAbsolutePath() || pathValue.isEmpty()) + return; + + pathValue = env.searchInPath(pathValue.fileName()); + + auto it = std::find_if(config.begin(), config.end(), [&key](const CMakeConfigItem &item) { + return item.key == key; + }); + QTC_ASSERT(it != config.end(), return); + + it->value = pathValue.path().toUtf8(); + }; + + updateRelativePath("CMAKE_C_COMPILER"); + updateRelativePath("CMAKE_CXX_COMPILER"); +} + QList CMakeProjectImporter::examineDirectory(const FilePath &importPath, QString *warningMessage) const { @@ -518,6 +540,7 @@ QList CMakeProjectImporter::examineDirectory(const FilePath &importPath, } } else { config = cache; + updateCompilerPaths(config, env); config << CMakeConfigItem("CMAKE_COMMAND", CMakeConfigItem::PATH, configurePreset.cmakeExecutable.value().toUtf8()); From 77dfa71f0618278ff974d0f274bb87fc36c91077 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 16 Dec 2022 11:23:54 +0100 Subject: [PATCH 18/36] Deploying Qt: Clean up .cpp.o(bj) files when deploying Qt These files are required when building against some static libraries that Qt ships. Since we don't link against these libraries, we used to remove them when we install Qt, but starting with Qt 6.5 some of these files are required by the Qt CMake files, and configuration would fail. So, we now have to remove them when deploying Qt, instead of already when installing Qt. Change-Id: Ie38ab3735b86df0372b946d6a808007b5ec84b88 Reviewed-by: Reviewed-by: Tim Jenssen --- scripts/deployqt.py | 7 +++++-- scripts/deployqtHelper_mac.sh | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/deployqt.py b/scripts/deployqt.py index 50eb3eb1253..05113e43e77 100755 --- a/scripts/deployqt.py +++ b/scripts/deployqt.py @@ -110,9 +110,12 @@ def is_ignored_windows_file(use_debug, basepath, filename): return False def ignored_qt_lib_files(path, filenames): + # Qt ships some unneeded object files in the qml plugins + # On Windows we also do not want to ship the wrong debug/release .dlls or .lib files etc if not common.is_windows_platform(): - return [] - return [fn for fn in filenames if is_ignored_windows_file(debug_build, path, fn)] + return [fn for fn in filenames if fn.endswith('.cpp.o')] + return [fn for fn in filenames + if fn.endswith('.cpp.obj') or is_ignored_windows_file(debug_build, path, fn)] def copy_qt_libs(target_qt_prefix_path, qt_bin_dir, qt_libs_dir, qt_plugin_dir, qt_qml_dir, plugins): print("copying Qt libraries...") diff --git a/scripts/deployqtHelper_mac.sh b/scripts/deployqtHelper_mac.sh index a4afd7f20a5..b33795ae4a7 100755 --- a/scripts/deployqtHelper_mac.sh +++ b/scripts/deployqtHelper_mac.sh @@ -145,6 +145,9 @@ if [ ! -d "$app_path/Contents/Frameworks/QtCore.framework" ]; then fi +# clean up unneeded object files that are part of Qt for some static libraries +find "$app_path" -ipath "*/objects-*" -delete + # clean up after macdeployqt # it deploys some plugins (and libs for these) that interfere with what we want echo "Cleaning up after macdeployqt..." From 0e063ecfca92525c685555dc26278131042dfa35 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Thu, 15 Dec 2022 16:59:19 +0100 Subject: [PATCH 19/36] Doc: Add second level to online sidebar TOC Change-Id: I55e36278ff907e6625f49b4987e2786b8e5f7f97 Reviewed-by: hjk Reviewed-by: Eike Ziller --- doc/qtcreator/config/style/qt5-sidebar.html | 113 ++++++++++++++++++-- 1 file changed, 103 insertions(+), 10 deletions(-) diff --git a/doc/qtcreator/config/style/qt5-sidebar.html b/doc/qtcreator/config/style/qt5-sidebar.html index 0069cb97090..e38e76483a8 100644 --- a/doc/qtcreator/config/style/qt5-sidebar.html +++ b/doc/qtcreator/config/style/qt5-sidebar.html @@ -1,17 +1,110 @@ +
+ +
+ + + + + + + From 01a4f47781686a497745db0ffd0f4d65daff0ff2 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 23 Dec 2022 09:03:22 +0100 Subject: [PATCH 20/36] Build: Disable cpack for commercial sources There isn't a single license that could be used, so to support this, it would need to be chosen somehow. Just disable for now, because otherwise CMake configuration breaks. Fixes: QTCREATORBUG-28603 Change-Id: I26a01d6ab317ffeb212d6e5517100eaf07963377 Reviewed-by: Cristian Adam --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5067c46ebd7..33563c04ac3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -171,7 +171,8 @@ feature_summary(INCLUDE_QUIET_PACKAGES WHAT ENABLED_FEATURES DISABLED_FEATURES ) -if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) - # Only for non super repo builds +if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR + AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.GPL3-EXCEPT") + # Only for opensource, non-super-repo builds add_subdirectory(packaging) endif() From 803fb4ce77d5b75a9cb542e6bd160f5396269d65 Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Wed, 21 Dec 2022 16:46:11 +0100 Subject: [PATCH 21/36] Replace ANDROID_NATIVE_API_LEVEL with ANDROID_PLATFORM ANDROID_NATIVE_API_LEVEL is not handled by the android toolchain files starting the NDK version r23b. We should set ANDROID_PLATFORM instead, to specify the NDK platform version, that exists in all NDK versions supported by Qt. Also the ANDROID_PLATFORM variable expects the 'android-xx' format as a value, so avoid cutting the 'android-' prefix when adding the value to the CMake configure string. Fixes: QTCREATORBUG-28624 Change-Id: Idd4ba472e46982162e5ad74e9fc6868e50e3b434 Reviewed-by: Reviewed-by: Assam Boudjelthia --- src/plugins/android/androidbuildapkstep.cpp | 2 +- src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/android/androidbuildapkstep.cpp b/src/plugins/android/androidbuildapkstep.cpp index 918a4e39770..4d03613bed1 100644 --- a/src/plugins/android/androidbuildapkstep.cpp +++ b/src/plugins/android/androidbuildapkstep.cpp @@ -917,7 +917,7 @@ QVariant AndroidBuildApkStep::data(Utils::Id id) const if (id == Constants::AndroidNdkPlatform) { if (auto qtVersion = QtKitAspect::qtVersion(kit())) return AndroidConfigurations::currentConfig() - .bestNdkPlatformMatch(AndroidManager::minimumSDK(target()), qtVersion).mid(8); + .bestNdkPlatformMatch(AndroidManager::minimumSDK(target()), qtVersion); return {}; } if (id == Constants::NdkLocation) { diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 4b6ab55d4df..1823462382c 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -1477,7 +1477,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id) if (DeviceTypeKitAspect::deviceTypeId(k) == Android::Constants::ANDROID_DEVICE_TYPE) { buildSteps()->appendStep(Android::Constants::ANDROID_BUILD_APK_ID); const auto &bs = buildSteps()->steps().constLast(); - cmd.addArg("-DANDROID_NATIVE_API_LEVEL:STRING=" + cmd.addArg("-DANDROID_PLATFORM:STRING=" + bs->data(Android::Constants::AndroidNdkPlatform).toString()); auto ndkLocation = bs->data(Android::Constants::NdkLocation).value(); cmd.addArg("-DANDROID_NDK:PATH=" + ndkLocation.path()); From 5c34e9922e49e4da225d4b7774b2e66518316087 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Tue, 27 Dec 2022 13:20:46 +0100 Subject: [PATCH 22/36] Doc: Describe "rr" and "sr" locator filters Change-Id: Id16d7da1dd5f6b53173625deb2dbe9bf1151e651 Reviewed-by: Eike Ziller --- doc/qtcreator/src/editors/creator-locator.qdoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/qtcreator/src/editors/creator-locator.qdoc b/doc/qtcreator/src/editors/creator-locator.qdoc index 83bb4ff131a..c375a31d404 100644 --- a/doc/qtcreator/src/editors/creator-locator.qdoc +++ b/doc/qtcreator/src/editors/creator-locator.qdoc @@ -151,6 +151,8 @@ \li Opening the CMakeLists.txt file for the current run configuration in the editor (\c {cmo}). This is the same build target as when you select \uicontrol Build > \uicontrol {Build for Run Configuration}. + \li Running a particular run configuration (\c {rr} \e {}) + \li Switching to a particular run configuration (\c {sr} \e {}) \endif \endlist From a3c1b35475965f78bd39e050ae5dbcfcab582ae3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= Date: Mon, 19 Dec 2022 16:23:49 +0100 Subject: [PATCH 23/36] SquishTests: Update tst_designer_autocomplete ui_mainwindow.h is being created on first build. While there seems to be some workaround for qmake-based projects, cmake-based projects can't be parsed properly before the file was written. Change-Id: I0e9802f79b60d7d07ed92ca0ae9b93e53249b61f Reviewed-by: Reviewed-by: Christian Stenger --- tests/system/suite_tools/tst_designer_autocomplete/test.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/system/suite_tools/tst_designer_autocomplete/test.py b/tests/system/suite_tools/tst_designer_autocomplete/test.py index 903ca01156a..f9e6b0bdc05 100644 --- a/tests/system/suite_tools/tst_designer_autocomplete/test.py +++ b/tests/system/suite_tools/tst_designer_autocomplete/test.py @@ -7,7 +7,9 @@ def main(): startQC() if not startedWithoutPluginError(): return - createProject_Qt_GUI(tempDir(), "DesignerTestApp") + projectName = "DesignerTestApp" + createProject_Qt_GUI(tempDir(), projectName) + invokeMenuItem('Build', 'Build Project "%s"' % projectName) selectFromLocator("mainwindow.ui") dragAndDrop(waitForObject("{container=':qdesigner_internal::WidgetBoxCategoryListView'" "text='Push Button' type='QModelIndex'}"), 5, 5, From bd679b61d119ab516c907e134dfb146fd609fcab Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 2 Jan 2023 15:00:55 +0100 Subject: [PATCH 24/36] German translation: Fix error message when installing plugin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit %1 resolves to "Qt Creator" or "Design Studio", and the message means that no plugin for that application was found in the extracted zip. Change-Id: I1f07a3557bdac7dcabf26206aa12fabac0ca272d Reviewed-by: Reviewed-by: Robert Löhning --- share/qtcreator/translations/qtcreator_de.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/qtcreator/translations/qtcreator_de.ts b/share/qtcreator/translations/qtcreator_de.ts index eeb1f1091f4..fa440e48882 100644 --- a/share/qtcreator/translations/qtcreator_de.ts +++ b/share/qtcreator/translations/qtcreator_de.ts @@ -48247,7 +48247,7 @@ Useful if build directory is corrupted or when rebuilding with a newer version o Did not find %1 plugin. - Konnte das Plugin %1 nicht finden. + Konnte kein %1 Plugin finden. Install Location From f0dba78f4837b33dd83450e841b39aaa233da301 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Mon, 2 Jan 2023 12:22:42 +0100 Subject: [PATCH 25/36] Editor: fix crashing on updating snippet selections The final selection is not tracked in m_selections and needs to be handled explicitly. Also add an assert preventing unconditionally accessing an out of bounds element of m_selections. Fixes: QTCREATORBUG-28631 Change-Id: I1898418b1126bdaffccbdf0e483e2c659d191917 Reviewed-by: Reviewed-by: Eike Ziller --- src/plugins/texteditor/snippets/snippetoverlay.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/texteditor/snippets/snippetoverlay.cpp b/src/plugins/texteditor/snippets/snippetoverlay.cpp index 6824c0470ac..f7b3cf80c91 100644 --- a/src/plugins/texteditor/snippets/snippetoverlay.cpp +++ b/src/plugins/texteditor/snippets/snippetoverlay.cpp @@ -38,8 +38,13 @@ void SnippetOverlay::setFinalSelection(const QTextCursor &cursor, const QColor & void SnippetOverlay::updateEquivalentSelections(const QTextCursor &cursor) { const int ¤tIndex = indexForCursor(cursor); + if (currentIndex == m_finalSelectionIndex) { + accept(); + return; + } if (currentIndex < 0) return; + QTC_ASSERT(currentIndex < m_selections.size(), return); const QString ¤tText = cursorForIndex(currentIndex).selectedText(); const QList &equivalents = m_variables.value(m_selections[currentIndex].variableIndex); for (int i : equivalents) { From 5344bec59b344bcb46a040e8b6dbe6e263705503 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 6 Oct 2022 15:59:51 +0200 Subject: [PATCH 26/36] Add support for plugin paths set by the installer This is important on macOS, where we cannot install optional plugins into the app bundle, because that would break code signing. Instead the install settings in the signed bundle sets a custom plugin path outside the bundle, and the installer puts optional plugins there. Task-number: QTCREATORBUG-26705 Change-Id: I8b36752471d16dfc5828e87e20254f39ab985ca2 Reviewed-by: David Schulz Reviewed-by: Qt CI Bot --- src/app/main.cpp | 45 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/src/app/main.cpp b/src/app/main.cpp index bdd80ed34e2..74d1ccec9e6 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -217,16 +217,37 @@ static inline QStringList getPluginPaths() return rc; } -static void setupInstallSettings(QString &installSettingspath) +// Returns plugin path that is set in install settings. +// The installer (or rather the packaging) can write that to load optional plugins from +// outside the application bundle on macOS, because installing optional plugins into +// the application bundle would break code signing. +static QStringList getInstallPluginPaths() +{ + // uses SystemScope because this really must be an "installation" setting + QSettings installSettings(QSettings::IniFormat, + QSettings::SystemScope, + QLatin1String(Core::Constants::IDE_SETTINGSVARIANT_STR), + QLatin1String(Core::Constants::IDE_CASED_ID)); + return Utils::transform(installSettings.value("Settings/InstallPluginPaths").toStringList(), + [](const QString &path) -> QString { + if (QDir::isRelativePath(path)) + return applicationDirPath() + '/' + path; + return path; + }); +} + +static void setupInstallSettings(QString &installSettingspath, bool redirect = true) { if (!installSettingspath.isEmpty() && !QFileInfo(installSettingspath).isDir()) { displayError(QString("-installsettingspath \"%0\" needs to be the path where a %1/%2.ini exist.").arg(installSettingspath, QLatin1String(Core::Constants::IDE_SETTINGSVARIANT_STR), QLatin1String(Core::Constants::IDE_CASED_ID))); installSettingspath.clear(); } - static const char kInstallSettingsKey[] = "Settings/InstallSettings"; - QSettings::setPath(QSettings::IniFormat, QSettings::SystemScope, - installSettingspath.isEmpty() ? resourcePath() : installSettingspath); + QSettings::setPath(QSettings::IniFormat, + QSettings::SystemScope, + installSettingspath.isEmpty() ? resourcePath() : installSettingspath); + if (!redirect) // ignore redirection via Settings/InstallSettings + return; // Check if the default install settings contain a setting for the actual install settings. // This can be an absolute path, or a path relative to applicationDirPath(). @@ -236,6 +257,7 @@ static void setupInstallSettings(QString &installSettingspath) // yet a second time. So try this a few times. // (Only the first time with QSettings::UserScope, to allow setting the install settings path // in the user settings.) + static const char kInstallSettingsKey[] = "Settings/InstallSettings"; QSettings::Scope scope = QSettings::UserScope; int count = 0; bool containsInstallSettingsKey = false; @@ -542,9 +564,11 @@ int main(int argc, char **argv) // Must be done before any QSettings class is created QSettings::setDefaultFormat(QSettings::IniFormat); - setupInstallSettings(options.installSettingsPath); - // plugin manager takes control of this settings object + // HiDPI variables need to be set before creating QApplication. + // Since we do not have a QApplication yet, we cannot rely on QApplication::applicationDirPath() + // though. So we set up install settings with a educated guess here, and re-setup it later. + setupInstallSettings(options.installSettingsPath); setHighDpiEnvironmentVariable(); SharedTools::QtSingleApplication::setAttribute(Qt::AA_ShareOpenGLContexts); @@ -563,7 +587,11 @@ int main(int argc, char **argv) const QStringList pluginArguments = app.arguments(); - /*Initialize global settings and resetup install settings with QApplication::applicationDirPath */ + // Re-setup install settings with QApplication::applicationDirPath() available, but + // first read install plugin paths from original install settings, without redirection + setupInstallSettings(options.installSettingsPath, /*redirect=*/false); + const QStringList installPluginPaths = getInstallPluginPaths(); + // Re-setup install settings for real setupInstallSettings(options.installSettingsPath); Utils::QtcSettings *settings = createUserSettings(); Utils::QtcSettings *globalSettings @@ -645,7 +673,8 @@ int main(int argc, char **argv) QNetworkProxyFactory::setUseSystemConfiguration(true); // Load - const QStringList pluginPaths = getPluginPaths() + options.customPluginPaths; + const QStringList pluginPaths = getPluginPaths() + installPluginPaths + + options.customPluginPaths; PluginManager::setPluginPaths(pluginPaths); QMap foundAppOptions; if (pluginArguments.size() > 1) { From 38a6ab6cd6e53b33142e2a0d1ebd1dcc799bee7a Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 4 Jan 2023 08:19:47 +0100 Subject: [PATCH 27/36] AdvancedDockingSystem: Fix file licenses Amends a7956df3ca which accidentally dropped the (L)GPL part. Change-Id: I22e3f5cdb12b15ee777524cac04aa888606026c3 Reviewed-by: Eike Ziller --- src/libs/advanceddockingsystem/ads_globals.cpp | 2 +- src/libs/advanceddockingsystem/ads_globals.h | 2 +- src/libs/advanceddockingsystem/dockareatabbar.cpp | 2 +- src/libs/advanceddockingsystem/dockareatabbar.h | 2 +- src/libs/advanceddockingsystem/dockareatitlebar.cpp | 2 +- src/libs/advanceddockingsystem/dockareatitlebar.h | 2 +- src/libs/advanceddockingsystem/dockareawidget.cpp | 2 +- src/libs/advanceddockingsystem/dockareawidget.h | 2 +- src/libs/advanceddockingsystem/dockcomponentsfactory.cpp | 2 +- src/libs/advanceddockingsystem/dockcomponentsfactory.h | 2 +- src/libs/advanceddockingsystem/dockcontainerwidget.cpp | 2 +- src/libs/advanceddockingsystem/dockcontainerwidget.h | 2 +- src/libs/advanceddockingsystem/dockfocuscontroller.cpp | 2 +- src/libs/advanceddockingsystem/dockfocuscontroller.h | 2 +- src/libs/advanceddockingsystem/dockingstatereader.cpp | 2 +- src/libs/advanceddockingsystem/dockingstatereader.h | 2 +- src/libs/advanceddockingsystem/dockmanager.cpp | 2 +- src/libs/advanceddockingsystem/dockmanager.h | 2 +- src/libs/advanceddockingsystem/dockoverlay.cpp | 2 +- src/libs/advanceddockingsystem/dockoverlay.h | 2 +- src/libs/advanceddockingsystem/docksplitter.cpp | 2 +- src/libs/advanceddockingsystem/docksplitter.h | 2 +- src/libs/advanceddockingsystem/dockwidget.cpp | 2 +- src/libs/advanceddockingsystem/dockwidget.h | 2 +- src/libs/advanceddockingsystem/dockwidgettab.cpp | 2 +- src/libs/advanceddockingsystem/dockwidgettab.h | 2 +- src/libs/advanceddockingsystem/elidinglabel.cpp | 2 +- src/libs/advanceddockingsystem/elidinglabel.h | 2 +- src/libs/advanceddockingsystem/floatingdockcontainer.cpp | 2 +- src/libs/advanceddockingsystem/floatingdockcontainer.h | 2 +- src/libs/advanceddockingsystem/floatingdragpreview.cpp | 2 +- src/libs/advanceddockingsystem/floatingdragpreview.h | 2 +- src/libs/advanceddockingsystem/iconprovider.cpp | 2 +- src/libs/advanceddockingsystem/iconprovider.h | 2 +- src/libs/advanceddockingsystem/workspacedialog.cpp | 2 +- src/libs/advanceddockingsystem/workspacedialog.h | 2 +- src/libs/advanceddockingsystem/workspacemodel.cpp | 2 +- src/libs/advanceddockingsystem/workspacemodel.h | 2 +- src/libs/advanceddockingsystem/workspaceview.cpp | 2 +- src/libs/advanceddockingsystem/workspaceview.h | 2 +- 40 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/libs/advanceddockingsystem/ads_globals.cpp b/src/libs/advanceddockingsystem/ads_globals.cpp index 1dbd1f7c056..252a31f9d30 100644 --- a/src/libs/advanceddockingsystem/ads_globals.cpp +++ b/src/libs/advanceddockingsystem/ads_globals.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "ads_globals.h" diff --git a/src/libs/advanceddockingsystem/ads_globals.h b/src/libs/advanceddockingsystem/ads_globals.h index 07246cfc535..d2f882d8e71 100644 --- a/src/libs/advanceddockingsystem/ads_globals.h +++ b/src/libs/advanceddockingsystem/ads_globals.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/dockareatabbar.cpp b/src/libs/advanceddockingsystem/dockareatabbar.cpp index 06b067168f6..ec1bf782ff0 100644 --- a/src/libs/advanceddockingsystem/dockareatabbar.cpp +++ b/src/libs/advanceddockingsystem/dockareatabbar.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "dockareatabbar.h" diff --git a/src/libs/advanceddockingsystem/dockareatabbar.h b/src/libs/advanceddockingsystem/dockareatabbar.h index eb7d1fc1853..956300e07f0 100644 --- a/src/libs/advanceddockingsystem/dockareatabbar.h +++ b/src/libs/advanceddockingsystem/dockareatabbar.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/dockareatitlebar.cpp b/src/libs/advanceddockingsystem/dockareatitlebar.cpp index 039b33eaaf4..ace2c4e1211 100644 --- a/src/libs/advanceddockingsystem/dockareatitlebar.cpp +++ b/src/libs/advanceddockingsystem/dockareatitlebar.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "dockareatitlebar.h" diff --git a/src/libs/advanceddockingsystem/dockareatitlebar.h b/src/libs/advanceddockingsystem/dockareatitlebar.h index 61190000f04..888e3736af7 100644 --- a/src/libs/advanceddockingsystem/dockareatitlebar.h +++ b/src/libs/advanceddockingsystem/dockareatitlebar.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/dockareawidget.cpp b/src/libs/advanceddockingsystem/dockareawidget.cpp index 4c00839c0e0..b4c21f71198 100644 --- a/src/libs/advanceddockingsystem/dockareawidget.cpp +++ b/src/libs/advanceddockingsystem/dockareawidget.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "dockareawidget.h" diff --git a/src/libs/advanceddockingsystem/dockareawidget.h b/src/libs/advanceddockingsystem/dockareawidget.h index 02b536a8f6a..a0482136bf5 100644 --- a/src/libs/advanceddockingsystem/dockareawidget.h +++ b/src/libs/advanceddockingsystem/dockareawidget.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/dockcomponentsfactory.cpp b/src/libs/advanceddockingsystem/dockcomponentsfactory.cpp index ca2222e1251..76afb45d2c9 100644 --- a/src/libs/advanceddockingsystem/dockcomponentsfactory.cpp +++ b/src/libs/advanceddockingsystem/dockcomponentsfactory.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "dockcomponentsfactory.h" diff --git a/src/libs/advanceddockingsystem/dockcomponentsfactory.h b/src/libs/advanceddockingsystem/dockcomponentsfactory.h index 2c02d1d1320..ce5c656ac04 100644 --- a/src/libs/advanceddockingsystem/dockcomponentsfactory.h +++ b/src/libs/advanceddockingsystem/dockcomponentsfactory.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/dockcontainerwidget.cpp b/src/libs/advanceddockingsystem/dockcontainerwidget.cpp index eff53f33186..0f8f683ddec 100644 --- a/src/libs/advanceddockingsystem/dockcontainerwidget.cpp +++ b/src/libs/advanceddockingsystem/dockcontainerwidget.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "dockcontainerwidget.h" diff --git a/src/libs/advanceddockingsystem/dockcontainerwidget.h b/src/libs/advanceddockingsystem/dockcontainerwidget.h index 0738a39f09f..5020b98bf13 100644 --- a/src/libs/advanceddockingsystem/dockcontainerwidget.h +++ b/src/libs/advanceddockingsystem/dockcontainerwidget.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/dockfocuscontroller.cpp b/src/libs/advanceddockingsystem/dockfocuscontroller.cpp index 176632beadb..79b6c6cad29 100644 --- a/src/libs/advanceddockingsystem/dockfocuscontroller.cpp +++ b/src/libs/advanceddockingsystem/dockfocuscontroller.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "dockfocuscontroller.h" diff --git a/src/libs/advanceddockingsystem/dockfocuscontroller.h b/src/libs/advanceddockingsystem/dockfocuscontroller.h index b06b1fec6ec..c108d0d5591 100644 --- a/src/libs/advanceddockingsystem/dockfocuscontroller.h +++ b/src/libs/advanceddockingsystem/dockfocuscontroller.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/dockingstatereader.cpp b/src/libs/advanceddockingsystem/dockingstatereader.cpp index 3d0628751c8..f5db34c6c0d 100644 --- a/src/libs/advanceddockingsystem/dockingstatereader.cpp +++ b/src/libs/advanceddockingsystem/dockingstatereader.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "dockingstatereader.h" diff --git a/src/libs/advanceddockingsystem/dockingstatereader.h b/src/libs/advanceddockingsystem/dockingstatereader.h index 5dd892386cd..99198332dc2 100644 --- a/src/libs/advanceddockingsystem/dockingstatereader.h +++ b/src/libs/advanceddockingsystem/dockingstatereader.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/dockmanager.cpp b/src/libs/advanceddockingsystem/dockmanager.cpp index 5771241dc33..b470a50140a 100644 --- a/src/libs/advanceddockingsystem/dockmanager.cpp +++ b/src/libs/advanceddockingsystem/dockmanager.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "dockmanager.h" diff --git a/src/libs/advanceddockingsystem/dockmanager.h b/src/libs/advanceddockingsystem/dockmanager.h index ada8960a05f..9dbfc30cda3 100644 --- a/src/libs/advanceddockingsystem/dockmanager.h +++ b/src/libs/advanceddockingsystem/dockmanager.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/dockoverlay.cpp b/src/libs/advanceddockingsystem/dockoverlay.cpp index 7b680abea90..3a3e9b5b0b0 100644 --- a/src/libs/advanceddockingsystem/dockoverlay.cpp +++ b/src/libs/advanceddockingsystem/dockoverlay.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "dockoverlay.h" diff --git a/src/libs/advanceddockingsystem/dockoverlay.h b/src/libs/advanceddockingsystem/dockoverlay.h index 2d388fedfcc..abdee68b5d2 100644 --- a/src/libs/advanceddockingsystem/dockoverlay.h +++ b/src/libs/advanceddockingsystem/dockoverlay.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/docksplitter.cpp b/src/libs/advanceddockingsystem/docksplitter.cpp index 1d345e565c8..e8537dbd775 100644 --- a/src/libs/advanceddockingsystem/docksplitter.cpp +++ b/src/libs/advanceddockingsystem/docksplitter.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "docksplitter.h" diff --git a/src/libs/advanceddockingsystem/docksplitter.h b/src/libs/advanceddockingsystem/docksplitter.h index 3d145fa1db3..8dffc234ad4 100644 --- a/src/libs/advanceddockingsystem/docksplitter.h +++ b/src/libs/advanceddockingsystem/docksplitter.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/dockwidget.cpp b/src/libs/advanceddockingsystem/dockwidget.cpp index 33ffe36b847..b39c58f4c2d 100644 --- a/src/libs/advanceddockingsystem/dockwidget.cpp +++ b/src/libs/advanceddockingsystem/dockwidget.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "dockwidget.h" diff --git a/src/libs/advanceddockingsystem/dockwidget.h b/src/libs/advanceddockingsystem/dockwidget.h index 9565faef36c..7820b88d17d 100644 --- a/src/libs/advanceddockingsystem/dockwidget.h +++ b/src/libs/advanceddockingsystem/dockwidget.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/dockwidgettab.cpp b/src/libs/advanceddockingsystem/dockwidgettab.cpp index 69bed0c7dc8..a3fd47d3901 100644 --- a/src/libs/advanceddockingsystem/dockwidgettab.cpp +++ b/src/libs/advanceddockingsystem/dockwidgettab.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "dockwidgettab.h" diff --git a/src/libs/advanceddockingsystem/dockwidgettab.h b/src/libs/advanceddockingsystem/dockwidgettab.h index 48103ebc122..49909c6374b 100644 --- a/src/libs/advanceddockingsystem/dockwidgettab.h +++ b/src/libs/advanceddockingsystem/dockwidgettab.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/elidinglabel.cpp b/src/libs/advanceddockingsystem/elidinglabel.cpp index 01cadb4de33..1942b5b1878 100644 --- a/src/libs/advanceddockingsystem/elidinglabel.cpp +++ b/src/libs/advanceddockingsystem/elidinglabel.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "elidinglabel.h" diff --git a/src/libs/advanceddockingsystem/elidinglabel.h b/src/libs/advanceddockingsystem/elidinglabel.h index 4e34c606194..8ee2e9bf8af 100644 --- a/src/libs/advanceddockingsystem/elidinglabel.h +++ b/src/libs/advanceddockingsystem/elidinglabel.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/floatingdockcontainer.cpp b/src/libs/advanceddockingsystem/floatingdockcontainer.cpp index 16909e351cb..4b8ae0913dd 100644 --- a/src/libs/advanceddockingsystem/floatingdockcontainer.cpp +++ b/src/libs/advanceddockingsystem/floatingdockcontainer.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "floatingdockcontainer.h" diff --git a/src/libs/advanceddockingsystem/floatingdockcontainer.h b/src/libs/advanceddockingsystem/floatingdockcontainer.h index c7827349486..e19ce428492 100644 --- a/src/libs/advanceddockingsystem/floatingdockcontainer.h +++ b/src/libs/advanceddockingsystem/floatingdockcontainer.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/floatingdragpreview.cpp b/src/libs/advanceddockingsystem/floatingdragpreview.cpp index 3d4f12ee436..f427ab85edf 100644 --- a/src/libs/advanceddockingsystem/floatingdragpreview.cpp +++ b/src/libs/advanceddockingsystem/floatingdragpreview.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "floatingdragpreview.h" diff --git a/src/libs/advanceddockingsystem/floatingdragpreview.h b/src/libs/advanceddockingsystem/floatingdragpreview.h index f7150fdc10f..ed578da993a 100644 --- a/src/libs/advanceddockingsystem/floatingdragpreview.h +++ b/src/libs/advanceddockingsystem/floatingdragpreview.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/iconprovider.cpp b/src/libs/advanceddockingsystem/iconprovider.cpp index 9b8a5ba8138..b1db84c56ff 100644 --- a/src/libs/advanceddockingsystem/iconprovider.cpp +++ b/src/libs/advanceddockingsystem/iconprovider.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "iconprovider.h" diff --git a/src/libs/advanceddockingsystem/iconprovider.h b/src/libs/advanceddockingsystem/iconprovider.h index 8e02348b895..ec72121ae9a 100644 --- a/src/libs/advanceddockingsystem/iconprovider.h +++ b/src/libs/advanceddockingsystem/iconprovider.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/workspacedialog.cpp b/src/libs/advanceddockingsystem/workspacedialog.cpp index 6594e05d7ca..0c6bd548768 100644 --- a/src/libs/advanceddockingsystem/workspacedialog.cpp +++ b/src/libs/advanceddockingsystem/workspacedialog.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "workspacedialog.h" diff --git a/src/libs/advanceddockingsystem/workspacedialog.h b/src/libs/advanceddockingsystem/workspacedialog.h index 3a6f1f27b1b..a0880429dcb 100644 --- a/src/libs/advanceddockingsystem/workspacedialog.h +++ b/src/libs/advanceddockingsystem/workspacedialog.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/workspacemodel.cpp b/src/libs/advanceddockingsystem/workspacemodel.cpp index af3823f4148..a92b3079e66 100644 --- a/src/libs/advanceddockingsystem/workspacemodel.cpp +++ b/src/libs/advanceddockingsystem/workspacemodel.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "workspacemodel.h" diff --git a/src/libs/advanceddockingsystem/workspacemodel.h b/src/libs/advanceddockingsystem/workspacemodel.h index c7e6cfe1308..38386ad348b 100644 --- a/src/libs/advanceddockingsystem/workspacemodel.h +++ b/src/libs/advanceddockingsystem/workspacemodel.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/workspaceview.cpp b/src/libs/advanceddockingsystem/workspaceview.cpp index 41d0dfb28ab..be3ee1fbb94 100644 --- a/src/libs/advanceddockingsystem/workspaceview.cpp +++ b/src/libs/advanceddockingsystem/workspaceview.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "workspaceview.h" diff --git a/src/libs/advanceddockingsystem/workspaceview.h b/src/libs/advanceddockingsystem/workspaceview.h index 615678512fc..a2bef81e771 100644 --- a/src/libs/advanceddockingsystem/workspaceview.h +++ b/src/libs/advanceddockingsystem/workspaceview.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once From fffd732edc49adc328470cf37a4e18ab5a78be47 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 4 Jan 2023 08:33:14 +0100 Subject: [PATCH 28/36] GLSL: Fix file licenses Amends a7956df3ca which accidentally dropped the (L)GPL part. Change-Id: I75ab5013925bac6563a782c5e19676d39accc1e0 Reviewed-by: Eike Ziller --- src/libs/glsl/glslparsertable.cpp | 2 +- src/libs/glsl/glslparsertable_p.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/glsl/glslparsertable.cpp b/src/libs/glsl/glslparsertable.cpp index dce78522eb4..485b3b20943 100644 --- a/src/libs/glsl/glslparsertable.cpp +++ b/src/libs/glsl/glslparsertable.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later // This file was generated by qlalr - DO NOT EDIT! #include "glslparsertable_p.h" diff --git a/src/libs/glsl/glslparsertable_p.h b/src/libs/glsl/glslparsertable_p.h index a9a3e5408b5..dc409144583 100644 --- a/src/libs/glsl/glslparsertable_p.h +++ b/src/libs/glsl/glslparsertable_p.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later // // W A R N I N G From 0a74a1e99e37e6685e627577dd52d4f06e3c2832 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 23 Dec 2022 11:32:27 +0100 Subject: [PATCH 29/36] Properly support relative paths in Link with Qt UI Relative paths are resolved based on the applicationDirPath, so reflect that in the path chooser too. Also, do not resolve relative paths in the path chooser to absolute paths when writing to the settings. Change-Id: Iaeffa2cad1e145adbbc5c918b5f8ff14f6f2b31e Reviewed-by: Reviewed-by: David Schulz Reviewed-by: Qt CI Bot --- src/plugins/qtsupport/qtoptionspage.cpp | 38 ++++++++++++++----------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp index f1cbc250b3b..b1f3c129712 100644 --- a/src/plugins/qtsupport/qtoptionspage.cpp +++ b/src/plugins/qtsupport/qtoptionspage.cpp @@ -930,29 +930,32 @@ static QStringList qtversionFilesToCheck() return Utils::transform(kSubdirsToCheck, [](const QString &dir) { return qtVersionsFile(dir); }); } -static std::optional settingsDirForQtDir(const QString &qtDir) +static std::optional settingsDirForQtDir(const FilePath &baseDirectory, + const FilePath &qtDir) { - const QStringList dirsToCheck = Utils::transform(kSubdirsToCheck, [qtDir](const QString &dir) { - return QString(qtDir + '/' + dir); + const FilePaths dirsToCheck = Utils::transform(kSubdirsToCheck, [qtDir](const QString &dir) { + return qtDir / dir; }); - const QString validDir = Utils::findOrDefault(dirsToCheck, [](const QString &dir) { - return QFile::exists(settingsFile(dir)) || QFile::exists(qtVersionsFile(dir)); + const FilePath validDir = Utils::findOrDefault(dirsToCheck, [baseDirectory](const FilePath &dir) { + return QFile::exists(settingsFile(baseDirectory.resolvePath(dir).toString())) + || QFile::exists(qtVersionsFile(baseDirectory.resolvePath(dir).toString())); }); if (!validDir.isEmpty()) return validDir; return {}; } -static bool validateQtInstallDir(FancyLineEdit *input, QString *errorString) +static bool validateQtInstallDir(PathChooser *input, QString *errorString) { - const QString qtDir = input->text(); - if (!settingsDirForQtDir(qtDir)) { + const FilePath qtDir = input->rawFilePath(); + if (!settingsDirForQtDir(input->baseDirectory(), qtDir)) { if (errorString) { const QStringList filesToCheck = settingsFilesToCheck() + qtversionFilesToCheck(); - *errorString = "" + Tr::tr( - "Qt installation information was not found in \"%1\". " - "Choose a directory that contains one of the files %2") - .arg(qtDir, "
" + filesToCheck.join('\n') + "
"); + *errorString = "" + + Tr::tr("Qt installation information was not found in \"%1\". " + "Choose a directory that contains one of the files %2") + .arg(qtDir.toUserOutput(), + "
" + filesToCheck.join('\n') + "
"); } return false; } @@ -988,13 +991,14 @@ void QtOptionsPageWidget::linkWithQt() auto pathInput = new PathChooser; pathLayout->addWidget(pathInput); pathInput->setExpectedKind(PathChooser::ExistingDirectory); + pathInput->setBaseDirectory(FilePath::fromString(QCoreApplication::applicationDirPath())); pathInput->setPromptDialogTitle(title); pathInput->setMacroExpander(nullptr); pathInput->setValidationFunction([pathInput](FancyLineEdit *input, QString *errorString) { if (pathInput->defaultValidationFunction() && !pathInput->defaultValidationFunction()(input, errorString)) return false; - return validateQtInstallDir(input, errorString); + return validateQtInstallDir(pathInput, errorString); }); const std::optional currentLink = currentlyLinkedQtDir(nullptr); pathInput->setFilePath(currentLink ? *currentLink : defaultQtInstallationPath()); @@ -1027,10 +1031,12 @@ void QtOptionsPageWidget::linkWithQt() dialog.exec(); if (dialog.result() == QDialog::Accepted) { - const std::optional settingsDir = settingsDirForQtDir(pathInput->rawFilePath().toString()); + const std::optional settingsDir = settingsDirForQtDir(pathInput->baseDirectory(), + pathInput->rawFilePath()); if (QTC_GUARD(settingsDir)) { - QSettings(settingsFile(Core::ICore::resourcePath().toString()), QSettings::IniFormat) - .setValue(kInstallSettingsKey, *settingsDir); + QSettings settings(settingsFile(Core::ICore::resourcePath().toString()), + QSettings::IniFormat); + settings.setValue(kInstallSettingsKey, settingsDir->toVariant()); askForRestart = true; } } From ce1a547b6cbfd875d2996ee71b9aa8f7327262aa Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii Date: Mon, 2 Jan 2023 11:43:18 +0100 Subject: [PATCH 30/36] CodeStyle: Fix preview update Fixes: QTCREATORBUG-28621 Change-Id: I66a66d9c16933ebd8197f9e286e72dce7a621933 Reviewed-by: Reviewed-by: David Schulz --- .../cppeditor/cppcodestylesettingspage.cpp | 31 ++++++++++++++----- .../cppeditor/cppcodestylesettingspage.h | 4 ++- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/src/plugins/cppeditor/cppcodestylesettingspage.cpp b/src/plugins/cppeditor/cppcodestylesettingspage.cpp index 67a785809d5..3fc0a3ba875 100644 --- a/src/plugins/cppeditor/cppcodestylesettingspage.cpp +++ b/src/plugins/cppeditor/cppcodestylesettingspage.cpp @@ -165,6 +165,9 @@ void CppCodeStylePreferencesWidget::setCodeStyle(CppCodeStylePreferences *codeSt setCodeStyleSettings(m_preferences->currentCodeStyleSettings(), false); slotCurrentPreferencesChanged(m_preferences->currentPreferences(), false); + m_originalCppCodeStyleSettings = cppCodeStyleSettings(); + m_originalTabSettings = tabSettings(); + updatePreview(); } @@ -253,6 +256,12 @@ void CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged() if (m_blockUpdates) return; + if (m_preferences) { + auto current = qobject_cast(m_preferences->currentPreferences()); + if (current) + current->setCodeStyleSettings(cppCodeStyleSettings()); + } + emit codeStyleSettingsChanged(cppCodeStyleSettings()); updatePreview(); } @@ -262,6 +271,12 @@ void CppCodeStylePreferencesWidget::slotTabSettingsChanged(const TabSettings &se if (m_blockUpdates) return; + if (m_preferences) { + auto current = qobject_cast(m_preferences->currentPreferences()); + if (current) + current->setTabSettings(settings); + } + emit tabSettingsChanged(settings); updatePreview(); } @@ -344,19 +359,21 @@ void CppCodeStylePreferencesWidget::addTab(CppCodeStyleWidget *page, QString tab void CppCodeStylePreferencesWidget::apply() { - if (m_preferences) { - auto current = qobject_cast(m_preferences->currentPreferences()); - if (current) { - current->setTabSettings(tabSettings()); - current->setCodeStyleSettings(cppCodeStyleSettings()); - } - } + m_originalTabSettings = tabSettings(); + m_originalCppCodeStyleSettings = cppCodeStyleSettings(); emit applyEmitted(); } void CppCodeStylePreferencesWidget::finish() { + if (m_preferences) { + auto current = qobject_cast(m_preferences->currentDelegate()); + if (current) { + current->setCodeStyleSettings(m_originalCppCodeStyleSettings); + current->setTabSettings(m_originalTabSettings); + } + } emit finishEmitted(); } diff --git a/src/plugins/cppeditor/cppcodestylesettingspage.h b/src/plugins/cppeditor/cppcodestylesettingspage.h index 844cfc0337e..01a7860a190 100644 --- a/src/plugins/cppeditor/cppcodestylesettingspage.h +++ b/src/plugins/cppeditor/cppcodestylesettingspage.h @@ -8,13 +8,13 @@ #include #include +#include #include #include namespace TextEditor { class FontSettings; - class TabSettings; class SnippetEditorWidget; class CodeStyleEditor; class CodeStyleEditorWidget; @@ -72,6 +72,8 @@ private: CppCodeStylePreferences *m_preferences = nullptr; Ui::CppCodeStyleSettingsPage *m_ui; QList m_previews; + CppCodeStyleSettings m_originalCppCodeStyleSettings; + TextEditor::TabSettings m_originalTabSettings; bool m_blockUpdates = false; signals: void codeStyleSettingsChanged(const CppEditor::CppCodeStyleSettings &); From adc874f6902efd3cda953d21905e495119247104 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 5 Jan 2023 11:40:25 +0100 Subject: [PATCH 31/36] COIN/GitHub: Use Qt 6.4.2 Change-Id: Ia66ce7e0a8ebf988c1af9888ddb7e9461f0cac05 Reviewed-by: Reviewed-by: Qt CI Bot Reviewed-by: Cristian Adam Reviewed-by: David Schulz --- .github/workflows/build_cmake.yml | 5 +++-- coin/instructions/common_environment.yaml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index d695061f95d..e430f35ebde 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -7,7 +7,8 @@ on: - 'doc/**' env: - QT_VERSION: 6.4.0 + QT_VERSION: 6.4.2 + MACOS_DEPLOYMENT_TARGET: 10.14 CLANG_VERSION: 15.0.0 ELFUTILS_VERSION: 0.175 CMAKE_VERSION: 3.21.1 @@ -489,7 +490,7 @@ jobs: run: | set(ENV{CC} ${{ matrix.config.cc }}) set(ENV{CXX} ${{ matrix.config.cxx }}) - set(ENV{MACOSX_DEPLOYMENT_TARGET} "10.13") + set(ENV{MACOSX_DEPLOYMENT_TARGET} "${{ env.MACOS_DEPLOYMENT_TARGET }}") if ("${{ runner.os }}" STREQUAL "Windows" AND NOT "x${{ matrix.config.environment_script }}" STREQUAL "x") execute_process( diff --git a/coin/instructions/common_environment.yaml b/coin/instructions/common_environment.yaml index 5843ca790b0..33557ea11d5 100644 --- a/coin/instructions/common_environment.yaml +++ b/coin/instructions/common_environment.yaml @@ -10,7 +10,7 @@ instructions: variableValue: http://master.qt.io/development_releases/prebuilt/libclang/libclang-release_15.0.0-based - type: EnvironmentVariable variableName: QTC_QT_BASE_URL - variableValue: "http://ci-files02-hki.intra.qt.io/packages/jenkins/archive/qt/6.4/6.4.0-released/Qt" + variableValue: "http://ci-files02-hki.intra.qt.io/packages/jenkins/archive/qt/6.4/6.4.2-released/Qt" - type: EnvironmentVariable variableName: QTC_QT_MODULES variableValue: "qt5compat qtbase qtdeclarative qtimageformats qtquick3d qtquickcontrols2 qtquicktimeline qtserialport qtshadertools qtsvg qttools qttranslations qtwebengine" From c7bb5fcc37edcc2ae7de8c0377bbd517936325fa Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 6 Jan 2023 09:14:09 +0100 Subject: [PATCH 32/36] Debugger: Remove spurious waring Task-number: QTCREATORBUG-27160 Change-Id: Ie69c60688249efcd4d2c2330d6555cf7f708edd2 Reviewed-by: Eike Ziller --- share/qtcreator/debugger/dumper.py | 1 - 1 file changed, 1 deletion(-) diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py index 8beba72113a..85deeba1c82 100644 --- a/share/qtcreator/debugger/dumper.py +++ b/share/qtcreator/debugger/dumper.py @@ -239,7 +239,6 @@ class DumperBase(): def setFallbackQtVersion(self, args): version = int(args.get('version', self.fallbackQtVersion)) - DumperBase.warn("got fallback qt version 0x%x" % version) self.fallbackQtVersion = version def resetPerStepCaches(self): From a3153c535d7e9e64fab530d86e64ab76ef4988e0 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Fri, 16 Dec 2022 19:20:33 +0100 Subject: [PATCH 33/36] CMakePM: Add default kit configuration hashing This adds a QTC_KIT_DEFAULT_CONFIG_HASH variable containing the hash of all the default Qt Creator CMake kit variables: * CMAKE_C_COMPILER * CMAKE_CXX_COMPILER * QT_QMAKE_EXECUTABLE * CMAKE_PREFIX_PATH This way when a CMake preset changes any of these CMake variables a new Kit will be created. Otherwise a previous kit containing different values will be used. Fixes: QTCREATORBUG-28609 Change-Id: I77b67e9c8fa15dc3ff2f22c5b63d4ca1c7670fdc Reviewed-by: Reviewed-by: Alessandro Portale --- .../cmakekitinformation.cpp | 39 +++++++++++++++++++ .../cmakeprojectmanager/cmakekitinformation.h | 4 ++ .../cmakeprojectimporter.cpp | 34 ++++++++++------ 3 files changed, 66 insertions(+), 11 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp index 32a00daf5b0..6e7638e2d03 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp @@ -39,6 +39,7 @@ #include #include +#include #include #include #include @@ -875,6 +876,7 @@ const char CMAKE_CXX_TOOLCHAIN_KEY[] = "CMAKE_CXX_COMPILER"; const char CMAKE_QMAKE_KEY[] = "QT_QMAKE_EXECUTABLE"; const char CMAKE_PREFIX_PATH_KEY[] = "CMAKE_PREFIX_PATH"; const char QTC_CMAKE_PRESET_KEY[] = "QTC_CMAKE_PRESET"; +const char QTC_KIT_DEFAULT_CONFIG_HASH[] = "QTC_KIT_DEFAULT_CONFIG_HASH"; class CMakeConfigurationKitAspectWidget final : public KitAspectWidget { @@ -1135,6 +1137,43 @@ CMakeConfigItem CMakeConfigurationKitAspect::cmakePresetConfigItem(const Project }); } +void CMakeConfigurationKitAspect::setKitDefaultConfigHash(ProjectExplorer::Kit *k) +{ + const CMakeConfig defaultConfigExpanded + = Utils::transform(defaultConfiguration(k).toList(), [k](const CMakeConfigItem &item) { + CMakeConfigItem expanded(item); + expanded.value = item.expandedValue(k).toUtf8(); + return expanded; + }); + const QByteArray kitHash = computeDefaultConfigHash(defaultConfigExpanded); + + CMakeConfig config = configuration(k); + config.append(CMakeConfigItem(QTC_KIT_DEFAULT_CONFIG_HASH, CMakeConfigItem::INTERNAL, kitHash)); + + setConfiguration(k, config); +} + +CMakeConfigItem CMakeConfigurationKitAspect::kitDefaultConfigHashItem(const ProjectExplorer::Kit *k) +{ + const CMakeConfig config = configuration(k); + return Utils::findOrDefault(config, [](const CMakeConfigItem &item) { + return item.key == QTC_KIT_DEFAULT_CONFIG_HASH; + }); +} + +QByteArray CMakeConfigurationKitAspect::computeDefaultConfigHash(const CMakeConfig &config) +{ + const CMakeConfig defaultConfig = defaultConfiguration(nullptr); + const QByteArray configValues = std::accumulate(defaultConfig.begin(), + defaultConfig.end(), + QByteArray(), + [config](QByteArray &sum, + const CMakeConfigItem &item) { + return sum += config.valueOf(item.key); + }); + return QCryptographicHash::hash(configValues, QCryptographicHash::Md5).toHex(); +} + QVariant CMakeConfigurationKitAspect::defaultValue(const Kit *k) const { // FIXME: Convert preload scripts diff --git a/src/plugins/cmakeprojectmanager/cmakekitinformation.h b/src/plugins/cmakeprojectmanager/cmakekitinformation.h index da2435664b3..25b7b7f3f7d 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitinformation.h +++ b/src/plugins/cmakeprojectmanager/cmakekitinformation.h @@ -91,6 +91,10 @@ public: static void setCMakePreset(ProjectExplorer::Kit *k, const QString &presetName); static CMakeConfigItem cmakePresetConfigItem(const ProjectExplorer::Kit *k); + static void setKitDefaultConfigHash(ProjectExplorer::Kit *k); + static CMakeConfigItem kitDefaultConfigHashItem(const ProjectExplorer::Kit *k); + static QByteArray computeDefaultConfigHash(const CMakeConfig &config); + // KitAspect interface ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const final; void setup(ProjectExplorer::Kit *k) final; diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp index fe9487bbaf6..b2e0e6f12df 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp @@ -46,6 +46,7 @@ struct DirectoryData QString cmakePresetDisplayname; QString cmakePreset; + QByteArray cmakePresetDefaultConfigHash; // Kit Stuff FilePath cmakeBinary; @@ -549,6 +550,8 @@ QList CMakeProjectImporter::examineDirectory(const FilePath &importPath, CMakeConfigItem::STRING, configurePreset.generator.value().toUtf8()); } + data->cmakePresetDefaultConfigHash = CMakeConfigurationKitAspect::computeDefaultConfigHash( + config); const FilePath qmake = qmakeFromCMakeCache(config); if (!qmake.isEmpty()) @@ -685,8 +688,16 @@ bool CMakeProjectImporter::matchKit(void *directoryData, const Kit *k) const bool haveCMakePreset = false; if (!data->cmakePreset.isEmpty()) { - auto presetConfigItem = CMakeConfigurationKitAspect::cmakePresetConfigItem(k); - if (data->cmakePreset != presetConfigItem.expandedValue(k)) + const auto presetConfigItem = CMakeConfigurationKitAspect::cmakePresetConfigItem(k); + const auto kitConfigHashItem = CMakeConfigurationKitAspect::kitDefaultConfigHashItem(k); + + const QString presetName = presetConfigItem.expandedValue(k); + const bool haveSameKitConfigHash = kitConfigHashItem.isNull() + ? true + : data->cmakePresetDefaultConfigHash + == kitConfigHashItem.value; + + if (data->cmakePreset != presetName || !haveSameKitConfigHash) return false; ensureBuildDirectory(*data, k); @@ -724,15 +735,6 @@ Kit *CMakeProjectImporter::createKit(void *directoryData) const CMakeGeneratorKitAspect::setPlatform(k, data->platform); CMakeGeneratorKitAspect::setToolset(k, data->toolset); - if (!data->cmakePresetDisplayname.isEmpty()) { - k->setUnexpandedDisplayName( - QString("%1 (CMake preset)").arg(data->cmakePresetDisplayname)); - - CMakeConfigurationKitAspect::setCMakePreset(k, data->cmakePreset); - } - if (!data->cmakePreset.isEmpty()) - ensureBuildDirectory(*data, k); - SysRootKitAspect::setSysRoot(k, data->sysroot); for (const ToolChainDescription &cmtcd : data->toolChains) { @@ -747,6 +749,16 @@ Kit *CMakeProjectImporter::createKit(void *directoryData) const ToolChainKitAspect::setToolChain(k, tcd.tcs.at(0)); } + if (!data->cmakePresetDisplayname.isEmpty()) { + k->setUnexpandedDisplayName( + QString("%1 (CMake preset)").arg(data->cmakePresetDisplayname)); + + CMakeConfigurationKitAspect::setCMakePreset(k, data->cmakePreset); + CMakeConfigurationKitAspect::setKitDefaultConfigHash(k); + } + if (!data->cmakePreset.isEmpty()) + ensureBuildDirectory(*data, k); + qCInfo(cmInputLog) << "Temporary Kit created."; }); } From 6e7c257a8cfec316fc863119716f4ea7dd66e831 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 10 Jan 2023 09:35:17 +0100 Subject: [PATCH 34/36] AutoTest: Fix checked state for QtTest Data functions and special functions may get handled as normal test functions which obviously fails when executing tests. Change-Id: I630fedcdbcc7577c1896f8cccbe77008a623900f Reviewed-by: David Schulz --- src/plugins/autotest/qtest/qttesttreeitem.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/plugins/autotest/qtest/qttesttreeitem.cpp b/src/plugins/autotest/qtest/qttesttreeitem.cpp index 08ab4f52fc7..222680d4cf1 100644 --- a/src/plugins/autotest/qtest/qttesttreeitem.cpp +++ b/src/plugins/autotest/qtest/qttesttreeitem.cpp @@ -85,6 +85,13 @@ Qt::ItemFlags QtTestTreeItem::flags(int column) const Qt::CheckState QtTestTreeItem::checked() const { + switch (type()) { + case TestDataFunction: + case TestSpecialFunction: + return Qt::Unchecked; + default: + break; + } return m_multiTest ? Qt::Unchecked : TestTreeItem::checked(); } From 7684571e108f5d7a803944a1cd78f17b61a29c35 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 10 Jan 2023 09:36:43 +0100 Subject: [PATCH 35/36] AutoTest: Fix handling of data tags with spaces Change-Id: Ie725d8bf67b6a143f52c84b902b69a077a55a2bc Reviewed-by: David Schulz --- src/plugins/autotest/qtest/qttesttreeitem.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/plugins/autotest/qtest/qttesttreeitem.cpp b/src/plugins/autotest/qtest/qttesttreeitem.cpp index 222680d4cf1..dcada43181f 100644 --- a/src/plugins/autotest/qtest/qttesttreeitem.cpp +++ b/src/plugins/autotest/qtest/qttesttreeitem.cpp @@ -15,6 +15,13 @@ namespace Autotest { namespace Internal { +static QString functionWithDataTagAsArg(const QString &func, const QString &dataTag) +{ + if (dataTag.contains(' ')) + return '"' + func + ':' + dataTag + '"'; + return func + ':' + dataTag; +} + QtTestTreeItem::QtTestTreeItem(ITestFramework *testFramework, const QString &name, const Utils::FilePath &filePath, TestTreeItem::Type type) : TestTreeItem(testFramework, name, filePath, type) @@ -140,9 +147,8 @@ ITestConfiguration *QtTestTreeItem::testConfiguration() const const TestTreeItem *parent = function ? function->parentItem() : nullptr; if (!parent) return nullptr; - const QString functionWithTag = function->name() + ':' + name(); config = new QtTestConfiguration(framework()); - config->setTestCases(QStringList(functionWithTag)); + config->setTestCases(QStringList(functionWithDataTagAsArg(function->name(), name()))); config->setProjectFile(parent->proFile()); config->setProject(project); break; @@ -185,7 +191,7 @@ static void fillTestConfigurationsFromCheckState(const TestTreeItem *item, const QString funcName = grandChild->name(); grandChild->forFirstLevelChildren([&testCases, &funcName](ITestTreeItem *dataTag) { if (dataTag->checked() == Qt::Checked) - testCases << funcName + ':' + dataTag->name(); + testCases << functionWithDataTagAsArg(funcName, dataTag->name()); }); } }); @@ -217,7 +223,7 @@ static void collectFailedTestInfo(TestTreeItem *item, QListforFirstLevelChildren([&testCases, func](ITestTreeItem *dataTag) { if (dataTag->data(0, FailedRole).toBool()) - testCases << func->name() + ':' + dataTag->name(); + testCases << functionWithDataTagAsArg(func->name(), dataTag->name()); }); } }); From c2788b0f053015f08aa979c93ab920303a28ebd6 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Tue, 10 Jan 2023 12:44:33 +0100 Subject: [PATCH 36/36] Debugger: Add missing space Change-Id: Ibb8623392c1b0e759df198fab87a6059558236e9 Reviewed-by: David Schulz --- src/plugins/debugger/debuggeractions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp index 0dec35b3fd4..eb1ebb2ee3c 100644 --- a/src/plugins/debugger/debuggeractions.cpp +++ b/src/plugins/debugger/debuggeractions.cpp @@ -159,7 +159,7 @@ DebuggerSettings::DebuggerSettings() cdbBreakPointCorrection.setSettingsKey(cdbSettingsGroup, "BreakpointCorrection"); cdbBreakPointCorrection.setDefaultValue(true); cdbBreakPointCorrection.setToolTip("

" + Tr::tr( - "Attempts to correct the location of a breakpoint based on file and line number should" + "Attempts to correct the location of a breakpoint based on file and line number should " "it be in a comment or in a line for which no code is generated. " "The correction is based on the code model.") + "

"); cdbBreakPointCorrection.setLabelText(Tr::tr("Correct breakpoint location"));