From 24767dfb0de8b46f79fc69d3d2d3ee95c159206a Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 4 Apr 2024 14:09:58 +0200 Subject: [PATCH 01/11] Examples: Fix which category gets two columns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It was giving the first category _alphabetically_ two columns. Which was correct a while ago, but since we have a separate category order defined, it should give the first category in that order two columns instead. Fixes: QTCREATORBUG-30634 Change-Id: Ie89c84f31617a9f90fe18b66bcea352ae3ea56d5 Reviewed-by: Kai Köhne --- src/plugins/qtsupport/examplesparser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/qtsupport/examplesparser.cpp b/src/plugins/qtsupport/examplesparser.cpp index 678a3a3139d..a335773b3ef 100644 --- a/src/plugins/qtsupport/examplesparser.cpp +++ b/src/plugins/qtsupport/examplesparser.cpp @@ -373,9 +373,9 @@ QList>> getCategories(const QList< // order "known" categories as wanted, others come afterwards const int defaultIndex = defaultOrder.indexOf(it->first); const int priority = defaultIndex >= 0 ? defaultIndex : (index + defaultOrderSize); - const std::optional maxRows = restrictRows - ? std::make_optional(index == 0 ? 2 : 1) - : std::nullopt; + const std::optional maxRows = restrictRows ? std::make_optional( + defaultIndex == 0 ? 2 : 1) + : std::nullopt; categories.append({{it->first, priority, maxRows}, it->second}); ++index; } From 41eeb5a273d64aedfb110fee1dd445dd66e927bd Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 3 Apr 2024 19:16:37 +0200 Subject: [PATCH 02/11] Core: Fix QGroupBox frame drawing for Qt >= 6.6.3, dark themes Since QStyle::subControlRect() used to return bogus rectangles for SC_GroupBoxFrame, and therefore, as workaround, ManhattanStyle calculated the position of the QGroupBox frame itself via code copied from QFusionStyle. 6.6.3 fixes the SC_GroupBoxFrame issue, but in turn, the old workaround fails. Therefore, this change uses old calculation when running with older Qt and the newer one with Qt >= 6.6.3. Fixes: QTCREATORBUG-30632 Change-Id: Ie9c6c078ba9bd0e7012192e9d887a702e307d294 Reviewed-by: Marcus Tillmanns --- src/plugins/coreplugin/manhattanstyle.cpp | 40 ++++++++++++++++------- 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp index 4aa3c6464d5..37bdbc6ae78 100644 --- a/src/plugins/coreplugin/manhattanstyle.cpp +++ b/src/plugins/coreplugin/manhattanstyle.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -488,21 +489,36 @@ static void drawPrimitiveTweakedForDarkTheme(QStyle::PrimitiveElement element, break; } case QStyle::PE_FrameGroupBox: { - // Snippet from QFusionStyle::drawPrimitive - BEGIN - static const int groupBoxTopMargin = 3; + QRect groupBoxFrame = option->rect; int topMargin = 0; - auto control = dynamic_cast(widget); - if (control && !control->isCheckable() && control->title().isEmpty()) { - // Shrinking the topMargin if Not checkable AND title is empty - topMargin = groupBoxTopMargin; - } else { - const int exclusiveIndicatorHeight = widget ? widget->style()->pixelMetric(QStyle::PM_ExclusiveIndicatorHeight) : 0; - topMargin = qMax(exclusiveIndicatorHeight, - option->fontMetrics.height()) + groupBoxTopMargin; + if (widget) { + // Before Qt 6.6.3, QStyle::subControlRect() returned wrong QRect for SC_GroupBoxFrame + static const bool validSCRect = QLibraryInfo::version() >= QVersionNumber(6, 6, 3); + if (validSCRect) { + QStyleOptionGroupBox opt; + opt.initFrom(widget); + const QStyle *style = widget->style(); + groupBoxFrame = style->subControlRect(QStyle::CC_GroupBox, &opt, + QStyle::SC_GroupBoxFrame, widget); + topMargin = 1; // Tweak to resemble the pre-6.6.3 frame + } else { + // Snippet from pre-6.6.3 FusionStyle::drawPrimitive - BEGIN + static const int groupBoxTopMargin = 3; + auto control = dynamic_cast(widget); + if (!control->isCheckable() && control->title().isEmpty()) { + // Shrinking the topMargin if Not checkable AND title is empty + topMargin = groupBoxTopMargin; + } else { + const int exclusiveIndicatorHeight = + widget->style()->pixelMetric(QStyle::PM_ExclusiveIndicatorHeight); + topMargin = qMax(exclusiveIndicatorHeight, + option->fontMetrics.height()) + groupBoxTopMargin; + } + // Snippet from pre-6.6.3 QFusionStyle::drawPrimitive - END + } } - // Snippet from QFusionStyle::drawPrimitive - END - const QRectF frameRectF = QRectF(option->rect).adjusted(0.5, topMargin + 0.5, -0.5, -0.5); + const QRectF frameRectF = QRectF(groupBoxFrame).adjusted(0.5, topMargin + 0.5, -0.5, -0.5); painter->setPen(framePen); if (isEnabled) painter->setOpacity(0.5); From 5b24cb5609545403a730ceec6359862b9d6b2a23 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 5 Apr 2024 10:46:55 +0200 Subject: [PATCH 03/11] TextEditor: Remove non-exported include from public header The header from KSyntaxHighlighting is not exported to the dev packages, so separate plugins using the syntax highlighter fail to compile. The include is not even used in that file anymore though, so just remove it. Change-Id: Iff9be4e35c1edb5492707b00a5afae96d85db16a Reviewed-by: Qt CI Bot Reviewed-by: Artem Sokolovskii --- src/plugins/texteditor/syntaxhighlighter.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/plugins/texteditor/syntaxhighlighter.h b/src/plugins/texteditor/syntaxhighlighter.h index 6b07d333f33..13d595d82f4 100644 --- a/src/plugins/texteditor/syntaxhighlighter.h +++ b/src/plugins/texteditor/syntaxhighlighter.h @@ -8,8 +8,6 @@ #include #include -#include - #include #include From f88ca7be285f06eb78f423192e608168ca1cad3e Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 5 Apr 2024 12:42:58 +0200 Subject: [PATCH 04/11] Bump version to 13.0.1 Change-Id: I1269daf9f87b95af0814d1b06c93e947a0555675 Reviewed-by: Eike Ziller --- cmake/QtCreatorIDEBranding.cmake | 4 ++-- qbs/modules/qtc/qtc.qbs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake/QtCreatorIDEBranding.cmake b/cmake/QtCreatorIDEBranding.cmake index 801573093da..1310d12dfb2 100644 --- a/cmake/QtCreatorIDEBranding.cmake +++ b/cmake/QtCreatorIDEBranding.cmake @@ -1,6 +1,6 @@ -set(IDE_VERSION "13.0.0") # The IDE version. +set(IDE_VERSION "13.0.1") # The IDE version. set(IDE_VERSION_COMPAT "13.0.0") # The IDE Compatibility version. -set(IDE_VERSION_DISPLAY "13.0.0") # The IDE display version. +set(IDE_VERSION_DISPLAY "13.0.1") # The IDE display version. set(IDE_COPYRIGHT_YEAR "2024") # 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 bfc2cae516d..d51678e415b 100644 --- a/qbs/modules/qtc/qtc.qbs +++ b/qbs/modules/qtc/qtc.qbs @@ -4,10 +4,10 @@ import qbs.FileInfo import qbs.Utilities Module { - property string qtcreator_display_version: '13.0.0' + property string qtcreator_display_version: '13.0.1' property string ide_version_major: '13' property string ide_version_minor: '0' - property string ide_version_release: '0' + property string ide_version_release: '1' property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.' + ide_version_release From ae58ce9132575256d033ee385c2ed7897f37dc46 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 4 Apr 2024 15:49:25 +0200 Subject: [PATCH 05/11] German translation: Use consistent translation for expand (tree) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTCREATORBUG-29370 Change-Id: I937b2b824fb07d49b18e1d3a345294cd71e5ab6a 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 016b1faf771..28c3e2c44ce 100644 --- a/share/qtcreator/translations/qtcreator_de.ts +++ b/share/qtcreator/translations/qtcreator_de.ts @@ -39335,7 +39335,7 @@ Bitte versuchen Sie es erneut. Expand - Erweitern + Aufklappen Ctrl+T From 338510af2b2d9746820039c024cc5f1be1b156c9 Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Tue, 26 Dec 2023 14:45:10 +0200 Subject: [PATCH 06/11] FileIteratorWrapper: simplify constructor The other two parameters, QDir::Filter and nameFilters string list, can be retrieved from the baseIterator. Change-Id: Id33a95f3b490e8f5846e9728fc66da0df5195be9 Reviewed-by: Marcus Tillmanns (cherry picked from commit 2f78fd4358f0126ac25a17ceeff259c7f53db0de) --- src/libs/utils/fsengine/fileiteratordevicesappender.h | 6 ++---- src/libs/utils/fsengine/rootinjectfsengine.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/libs/utils/fsengine/fileiteratordevicesappender.h b/src/libs/utils/fsengine/fileiteratordevicesappender.h index a28f1190806..28c308ddabc 100644 --- a/src/libs/utils/fsengine/fileiteratordevicesappender.h +++ b/src/libs/utils/fsengine/fileiteratordevicesappender.h @@ -36,10 +36,8 @@ class FileIteratorWrapper : public QAbstractFileEngineIterator }; public: - FileIteratorWrapper(std::unique_ptr &&baseIterator, - QDir::Filters filters, - const QStringList &filterNames) - : QAbstractFileEngineIterator(filters, filterNames) + FileIteratorWrapper(std::unique_ptr &&baseIterator) + : QAbstractFileEngineIterator(baseIterator->filters(), baseIterator->nameFilters()) , m_baseIterator(std::move(baseIterator)) {} diff --git a/src/libs/utils/fsengine/rootinjectfsengine.h b/src/libs/utils/fsengine/rootinjectfsengine.h index 6e40f5f742b..d57747dab96 100644 --- a/src/libs/utils/fsengine/rootinjectfsengine.h +++ b/src/libs/utils/fsengine/rootinjectfsengine.h @@ -20,7 +20,7 @@ public: { std::unique_ptr baseIterator( QFSFileEngine::beginEntryList(filters, filterNames)); - return new FileIteratorWrapper(std::move(baseIterator), filters, filterNames); + return new FileIteratorWrapper(std::move(baseIterator)); } }; From da914980145bb104e4e948d54090e60e0bcae4e6 Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Wed, 6 Mar 2024 20:09:08 +0200 Subject: [PATCH 07/11] FileIteratorWrapper: remove redundant if statement Change-Id: I5b9a50802adc3d2cfc48748235a7cd6ee01fa5a4 Reviewed-by: Marcus Tillmanns (cherry picked from commit 5760654674bb5a864a6b5ce9032ae9ed5df5a9ad) --- src/libs/utils/fsengine/fileiteratordevicesappender.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/libs/utils/fsengine/fileiteratordevicesappender.h b/src/libs/utils/fsengine/fileiteratordevicesappender.h index 28c308ddabc..329d76613e8 100644 --- a/src/libs/utils/fsengine/fileiteratordevicesappender.h +++ b/src/libs/utils/fsengine/fileiteratordevicesappender.h @@ -106,9 +106,6 @@ private: void checkStatus() const { - if (m_status == State::NotIteratingRoot) { - return; - } if (m_status == State::IteratingRoot) { if (m_baseIterator->hasNext() == false) { m_status = State::BaseIteratorEnd; From 28c67fca0f5e7a575c49688ad1172b3373aa1227 Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Wed, 6 Mar 2024 20:25:46 +0200 Subject: [PATCH 08/11] FileIteratorWrapper: fix typo in "__qtc__devices__" It should be what FilePath::specialRootName() returns, "__qtc_devices__". Looks like nothing used the string retured by next() so this didn't cause issues before. Change-Id: Ib9c48d8ea032b1ca7d9ec08003f9d51c5a2ae528 Reviewed-by: Marcus Tillmanns (cherry picked from commit 71e6916b37ed2dd269c97197d0a6d5bb43402882) --- src/libs/utils/fsengine/fileiteratordevicesappender.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/utils/fsengine/fileiteratordevicesappender.h b/src/libs/utils/fsengine/fileiteratordevicesappender.h index 329d76613e8..77864117f46 100644 --- a/src/libs/utils/fsengine/fileiteratordevicesappender.h +++ b/src/libs/utils/fsengine/fileiteratordevicesappender.h @@ -52,7 +52,7 @@ public: if (m_status == State::BaseIteratorEnd) { m_status = State::Ended; - return "__qtc__devices__"; + return FilePath::specialRootName(); } return m_baseIterator->next(); From 1e05c45d8f6e2480d153c076db19650f7fe1dcb3 Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Wed, 6 Mar 2024 15:48:07 +0200 Subject: [PATCH 09/11] FileIteratorWrapper: refactor setPath() Only call setPath() in hasNext(), the latter is called before any other member method, and setPath() is guarded by a bool to only run a single time. Split some code to a helper function, which will be reused when porting to new QAFEngine API. Change-Id: Ibda0ede18593a3a20729b31e03e994ad2de126de Reviewed-by: Marcus Tillmanns (cherry picked from commit ad446d56897549b2cddb7b42ce7cbd6641a3c59b) --- .../fsengine/fileiteratordevicesappender.h | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/libs/utils/fsengine/fileiteratordevicesappender.h b/src/libs/utils/fsengine/fileiteratordevicesappender.h index 77864117f46..0ce327690f2 100644 --- a/src/libs/utils/fsengine/fileiteratordevicesappender.h +++ b/src/libs/utils/fsengine/fileiteratordevicesappender.h @@ -47,7 +47,6 @@ public: if (m_status == State::Ended) return QString(); - setPath(); checkStatus(); if (m_status == State::BaseIteratorEnd) { @@ -75,7 +74,6 @@ public: if (m_status == State::Ended) return FilePath::specialRootPath(); - setPath(); checkStatus(); return m_baseIterator->currentFileName(); } @@ -83,22 +81,26 @@ public: { if (m_status == State::Ended) return QFileInfo(FilePath::specialRootPath()); - setPath(); checkStatus(); return m_baseIterator->currentFileInfo(); } private: + QString setStatus() const + { + // path() can be "/somedir/.." so we need to clean it first. + // We only need QDir::cleanPath here, as the path is always + // a fs engine path and will not contain scheme:// etc. + QString p = QDir::cleanPath(path()); + if (p.compare(HostOsInfo::root().path(), Qt::CaseInsensitive) == 0) + m_status = State::IteratingRoot; + return p; + } + void setPath() const { if (!m_hasSetPath) { - // path() can be "/somedir/.." so we need to clean it first. - // We only need QDir::cleanPath here, as the path is always - // a fs engine path and will not contain scheme:// etc. - const QString p = QDir::cleanPath(path()); - if (p.compare(HostOsInfo::root().path(), Qt::CaseInsensitive) == 0) - m_status = State::IteratingRoot; - + const QString &p = setStatus(); ((*m_baseIterator).*get(QAFEITag()))(p); m_hasSetPath = true; } From 5b870f101ed90105d6f0966227835c01c579c9e4 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 2 Apr 2024 11:07:56 +0200 Subject: [PATCH 10/11] SquishTests: Adapt key sequence MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The key sequence used by the test can interfere with other shortcuts or special handling provided by the OS itself (e.g. Ctrl+Alt can be understood as AltGr on Windows and treated differently). Current approach modifies the detected key on Win11, so move over to another key sequence which may likely be usable cross platform for some time. Change-Id: I33e981215ef09fc62c4c2913b3a72b43f39f8684 Reviewed-by: Robert Löhning --- tests/system/suite_HELP/tst_HELP02/test.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/system/suite_HELP/tst_HELP02/test.py b/tests/system/suite_HELP/tst_HELP02/test.py index 9c5104087e0..31a3e7c2de4 100644 --- a/tests/system/suite_HELP/tst_HELP02/test.py +++ b/tests/system/suite_HELP/tst_HELP02/test.py @@ -4,11 +4,11 @@ source("../../shared/qtcreator.py") if platform.system() == 'Darwin': - keysToType = '' - expectedKeys = 'Cmd+Opt+A' + keysToType = '' + expectedKeys = 'Cmd+Opt+V' else: - keysToType = '' - expectedKeys = 'Ctrl+Alt+A' + keysToType = '' + expectedKeys = 'Ctrl+Alt+V' # test Qt Creator version information from file and dialog From c25c54d454f06a7998707d8604b5fecf034874f5 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Tue, 26 Mar 2024 13:40:44 +0100 Subject: [PATCH 11/11] Doc: Update info about using Qt Quick modules with plugins - Some steps are not needed when developing with Qt 6.2 or later. - Removed obsolete information. Task-number: QDS-11794 Change-Id: Ifbfc0bacd50557892ac82658379098123f463a2b Reviewed-by: Ulf Hermann Reviewed-by: Sami Shalayel Reviewed-by: --- .../qtquick/qtquick-modules-with-plugins.qdoc | 55 ++++++++++--------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/doc/qtcreator/src/qtquick/qtquick-modules-with-plugins.qdoc b/doc/qtcreator/src/qtquick/qtquick-modules-with-plugins.qdoc index abaf7cca359..9f0f661d4fa 100644 --- a/doc/qtcreator/src/qtquick/qtquick-modules-with-plugins.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-modules-with-plugins.qdoc @@ -36,22 +36,25 @@ \list 1 \li Create custom components and place all the \c .qml files in a - directory dedicated to your module. For example: + directory dedicated to your module. For example, \c {imports\asset_imports}. - \li For Qt Quick UI Prototype projects (.qmlproject), specify the path to + \if defined(qtcreator) + \li For Qt Quick UI Prototype projects (.qmlproject), specify the path to the directory that has the module in the .qmlproject file of the application where you want to use the module - as a value of the \c importPaths variable. For example + as a value of the \c importPaths variable. For example, \c{importPaths: [ "imports", "asset_imports" ]}. - + \else + \li Specify the path to the directory that has the module in the + .qmlproject file of the application where you want to use the module + as a value of the \c importPaths variable. For example, + \c{importPaths: [ "imports", "asset_imports" ]}. + \endif \li Create a \c qmldir file for your module and place it in the module directory. For more information, see \l {Module Definition qmldir Files}. - \li Create a \c qmltypes file, as instructed in - \l {Generating Type Description Files}. - \li Create a directory named \c designer in your module directory. \li Create a \c .metainfo file for your module and place it in the @@ -66,23 +69,29 @@ \if defined(qtcreator) \li Import the module into the project, as instructed in \l {Importing QML Modules}. - \endlist - - \note If \QC cannot find the new QML module, build the project - and then go to \uicontrol {Tools} > \uicontrol {QML/JS} > - \uicontrol {Reset Code Model} to reset the code model. - \else \li Build your module using the same Qt version and compiler as \QDS. - For more information, see \l {Running QML Modules in Design Mode}. + + Your module and components should now appear in \uicontrol Components. + \endif + \endlist - Your module should now appear in \uicontrol Components. Your components - should appear in a subsection of \uicontrol Components if a valid - \c .metainfo file is in place. + \note If \QC cannot find the new QML module, build the project + and then go to \uicontrol {Tools} > \uicontrol {QML/JS} > + \uicontrol {Reset Code Model} to reset the code model. + \if defined(qtdesignstudio) + For more information about how to show the \uicontrol {Tools} menu, see + \l{Customizing the Menu}. \endif - \section1 Generating Type Description Files + \if defined(qtcreator) + \section1 Developing with Qt 6.1 or Earlier + + Since Qt 6.2, CMake generates the \c qmltypes and \c qmldir files + automatically. + + \section2 Generating Type Description Files When \l{Defining QML Types from C++}{registering QML types}, make sure that the QML module has a \c{plugins.qmltypes} file. Ideally, it should be located @@ -115,6 +124,7 @@ \endcode The import path affects all the targets built by the CMake project. + \endif \if defined(qtdesignstudio) \section1 Running QML Modules in Design Mode @@ -138,15 +148,6 @@ in the \uicontrol Design mode. You can use the value of the \c QML_PUPPET_MODE environment variable to check whether the plugin is currently being run by an application or edited in the \uicontrol Design mode. - - If you want to use a different module in the \uicontrol Design mode - than in your actual application for example to mockup C++ items, - you can use \c{QML_DESIGNER_IMPORT_PATH} - in the \c{.pro} file (for qmake projects), or declare and set the property - \c qmlDesignerImportPaths in your product (for Qbs projects). - Modules in the import paths defined in \c{QML_DESIGNER_IMPORT_PATH} will be - used only in the \uicontrol Design mode. - For an example, see \l {Qt Quick Controls - Contact List}. \endif \sa {Resetting the Code Model}