From 85f79179113276b2b1b22cc1e67a3dbc54864f90 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 29 Jan 2024 09:39:20 +0100 Subject: [PATCH 1/7] Ios: Only ever show a single dialog for developer mode It can happen that this is triggered twice for the same device, or for other devices when the dialog is still open. This looks funny and is not necessary, so avoid it. Task-number: QTBUG-121557 Change-Id: I0329104b3825b68b565ca1f8e00d785952c9d767 Reviewed-by: Alexandru Croitor --- src/plugins/ios/iosdevice.cpp | 48 ++++++++++++++++++++--------------- src/plugins/ios/iosdevice.h | 2 ++ 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/src/plugins/ios/iosdevice.cpp b/src/plugins/ios/iosdevice.cpp index f76f41db976..85ff89bf4b5 100644 --- a/src/plugins/ios/iosdevice.cpp +++ b/src/plugins/ios/iosdevice.cpp @@ -10,6 +10,7 @@ #include "iostr.h" #include +#include #include #include @@ -302,26 +303,33 @@ void IosDeviceManager::deviceInfo(IosToolHandler *, const QString &uid, bool shouldIgnore = newDev->m_ignoreDevice; newDev->m_ignoreDevice = true; if (devStatus == QLatin1String("*off*")) { - if (!shouldIgnore && !IosConfigurations::ignoreAllDevices()) { - QMessageBox mBox; - mBox.setText(Tr::tr("An iOS device in user mode has been detected.")); - mBox.setInformativeText(Tr::tr("Do you want to see how to set it up for development?")); - mBox.setStandardButtons(QMessageBox::NoAll | QMessageBox::No | QMessageBox::Yes); - mBox.setDefaultButton(QMessageBox::Yes); - int ret = mBox.exec(); - switch (ret) { - case QMessageBox::Yes: - Core::HelpManager::showHelpUrl( - QLatin1String("qthelp://org.qt-project.qtcreator/doc/creator-developing-ios.html")); - break; - case QMessageBox::No: - break; - case QMessageBox::NoAll: - IosConfigurations::setIgnoreAllDevices(true); - break; - default: - break; - } + if (!m_devModeDialog && !shouldIgnore && !IosConfigurations::ignoreAllDevices()) { + m_devModeDialog = new QMessageBox(Core::ICore::dialogParent()); + m_devModeDialog->setText( + Tr::tr("An iOS device in user mode has been detected.")); + m_devModeDialog->setInformativeText( + Tr::tr("Do you want to see how to set it up for development?")); + m_devModeDialog->setStandardButtons(QMessageBox::NoAll | QMessageBox::No + | QMessageBox::Yes); + m_devModeDialog->setDefaultButton(QMessageBox::Yes); + m_devModeDialog->setAttribute(Qt::WA_DeleteOnClose); + connect(m_devModeDialog, &QDialog::finished, this, [](int result) { + switch (result) { + case QMessageBox::Yes: + Core::HelpManager::showHelpUrl( + QLatin1String("qthelp://org.qt-project.qtcreator/doc/" + "creator-developing-ios.html")); + break; + case QMessageBox::No: + break; + case QMessageBox::NoAll: + IosConfigurations::setIgnoreAllDevices(true); + break; + default: + break; + } + }); + m_devModeDialog->show(); } } if (!m_userModeDeviceIds.contains(uid)) diff --git a/src/plugins/ios/iosdevice.h b/src/plugins/ios/iosdevice.h index 24bee023de7..b5e8d55c6e2 100644 --- a/src/plugins/ios/iosdevice.h +++ b/src/plugins/ios/iosdevice.h @@ -8,6 +8,7 @@ #include #include +#include #include namespace Ios { @@ -83,6 +84,7 @@ private: IosDeviceManager(QObject *parent = nullptr); QTimer m_userModeDevicesTimer; QStringList m_userModeDeviceIds; + QPointer m_devModeDialog; }; } // namespace Internal From f00513835ba68c2e883f05fb65851d2e2564f0e0 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Mon, 29 Jan 2024 23:02:15 +0100 Subject: [PATCH 2/7] CMakePM: Allow preset name changing for Reload CMake Presets Fixes: QTCREATORBUG-30237 Change-Id: I9d2f90d9637b91845dfe0ab619c83ff60dbd986a Reviewed-by: Reviewed-by: Alessandro Portale --- .../cmakeprojectmanager/cmakeprojectimporter.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp index b8748bc6f98..97299ca6915 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp @@ -138,6 +138,11 @@ static QString fileNameToPresetName(const QString &fileName) return name; } +static QString displayPresetName(const QString &presetName) +{ + return QString("%1 (CMake preset)").arg(presetName); +} + FilePaths CMakeProjectImporter::importCandidates() { FilePaths candidates; @@ -966,6 +971,9 @@ bool CMakeProjectImporter::matchKit(void *directoryData, const Kit *k) const if (data->cmakePreset != presetName) return false; + if (!k->unexpandedDisplayName().contains(displayPresetName(data->cmakePresetDisplayname))) + return false; + ensureBuildDirectory(*data, k); haveCMakePreset = true; } @@ -1008,8 +1016,7 @@ Kit *CMakeProjectImporter::createKit(void *directoryData) const } if (!data->cmakePresetDisplayname.isEmpty()) { - k->setUnexpandedDisplayName( - QString("%1 (CMake preset)").arg(data->cmakePresetDisplayname)); + k->setUnexpandedDisplayName(displayPresetName(data->cmakePresetDisplayname)); CMakeConfigurationKitAspect::setCMakePreset(k, data->cmakePreset); } From 40dbd63e73b759c6a1788a200214d0b61f2771bd Mon Sep 17 00:00:00 2001 From: David Schulz Date: Tue, 30 Jan 2024 14:44:24 +0100 Subject: [PATCH 3/7] ClangTools: Fix leaking text marks Amends e7781e2a99bce1981ab4efab97e5df14b142238c Change-Id: Ibb2da756023d985786ffab3fbbfae7d1bee5c346 Reviewed-by: Jarek Kobus --- src/plugins/clangtools/documentclangtoolrunner.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/clangtools/documentclangtoolrunner.cpp b/src/plugins/clangtools/documentclangtoolrunner.cpp index 5906cbc4e32..9e8a96e4ceb 100644 --- a/src/plugins/clangtools/documentclangtoolrunner.cpp +++ b/src/plugins/clangtools/documentclangtoolrunner.cpp @@ -60,7 +60,10 @@ DocumentClangToolRunner::DocumentClangToolRunner(IDocument *document) run(); } -DocumentClangToolRunner::~DocumentClangToolRunner() = default; +DocumentClangToolRunner::~DocumentClangToolRunner() +{ + qDeleteAll(m_marks); +} FilePath DocumentClangToolRunner::filePath() const { From 7bc5ab5e48e28e48210833f4b38e7cacd472079c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sivert=20Kr=C3=B8vel?= Date: Tue, 30 Jan 2024 12:16:36 +0100 Subject: [PATCH 4/7] McuSupport: Comment out Spark properties in template projects MCU tooling is more strict about QmlProject properties from Qt for MCUs 2.7, so leaving these properties in would trigger several warnings Change-Id: Ia251f74180493b6ff115218a237994886cf65379 Reviewed-by: Reviewed-by: Yasser Grimes Reviewed-by: Alessandro Portale --- .../wizards/qmlproject-empty/project.qmlproject.tpl | 12 ++++++------ .../wizards/qmlproject/project.qmlproject.tpl | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/plugins/mcusupport/wizards/qmlproject-empty/project.qmlproject.tpl b/src/plugins/mcusupport/wizards/qmlproject-empty/project.qmlproject.tpl index ab85861a5ec..c69a7d22f55 100644 --- a/src/plugins/mcusupport/wizards/qmlproject-empty/project.qmlproject.tpl +++ b/src/plugins/mcusupport/wizards/qmlproject-empty/project.qmlproject.tpl @@ -33,12 +33,12 @@ Project { // Font properties for "Spark" // These properties are in effect only if the "Spark" font engine is used - complexTextRendering: true // Set this to false if complex scripts are not needed (Arabic scripts, Indic scripts, etc.) - fontCachePriming: false // Set to true to decrease application startup time. Only applies to fonts configured with unicode ranges (font.unicodeCoverage). - fontCacheSize: 0 // If this is needed, use a suitable number. Setting this to a sensible value will improve performance, the global default is 104800. - fontHeapSize: -1 // Set to sufficient value to improve performance. -1 means no restrictions to heap allocation. - fontHeapPrealloc: true - fontCachePrealloc: true + // complexTextRendering: true // Set this to false if complex scripts are not needed (Arabic scripts, Indic scripts, etc.) + // fontCachePriming: false // Set to true to decrease application startup time. Only applies to fonts configured with unicode ranges (font.unicodeCoverage). + // fontCacheSize: 0 // If this is needed, use a suitable number. Setting this to a sensible value will improve performance, the global default is 104800. + // fontHeapSize: -1 // Set to sufficient value to improve performance. -1 means no restrictions to heap allocation. + // fontHeapPrealloc: true + // fontCachePrealloc: true } QmlFiles { diff --git a/src/plugins/mcusupport/wizards/qmlproject/project.qmlproject.tpl b/src/plugins/mcusupport/wizards/qmlproject/project.qmlproject.tpl index 0c879ccfb0d..8fb9526a968 100644 --- a/src/plugins/mcusupport/wizards/qmlproject/project.qmlproject.tpl +++ b/src/plugins/mcusupport/wizards/qmlproject/project.qmlproject.tpl @@ -34,12 +34,12 @@ Project { // Font properties for "Spark" // These properties are in effect only if the "Spark" font engine is used - complexTextRendering: true // Set this to false if complex scripts are not needed (Arabic scripts, Indic scripts, etc.) - fontCachePriming: false // Set to true to decrease application startup time. Only applies to fonts configured with unicode ranges (font.unicodeCoverage). - fontCacheSize: 0 // If this is needed, use a suitable number. Setting this to a sensible value will improve performance, the global default is 104800. - fontHeapSize: -1 // Set to sufficient value to improve performance. -1 means no restrictions to heap allocation. - fontHeapPrealloc: true - fontCachePrealloc: true + // complexTextRendering: true // Set this to false if complex scripts are not needed (Arabic scripts, Indic scripts, etc.) + // fontCachePriming: false // Set to true to decrease application startup time. Only applies to fonts configured with unicode ranges (font.unicodeCoverage). + // fontCacheSize: 0 // If this is needed, use a suitable number. Setting this to a sensible value will improve performance, the global default is 104800. + // fontHeapSize: -1 // Set to sufficient value to improve performance. -1 means no restrictions to heap allocation. + // fontHeapPrealloc: true + // fontCachePrealloc: true } /* QML files */ From d93e95c94224c7eac5a2c6f3383b224ca15327e1 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 2 Feb 2024 09:07:29 +0100 Subject: [PATCH 5/7] iOS: Fix missing include MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Breaks the build with Qt 6.7 Change-Id: Ie3e940a26cbd982f7781cfe478b59fc44785efe2 Reviewed-by: Reviewed-by: Tor Arne Vestbø --- src/plugins/ios/iosdevice.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/ios/iosdevice.h b/src/plugins/ios/iosdevice.h index b5e8d55c6e2..7d8c692e10e 100644 --- a/src/plugins/ios/iosdevice.h +++ b/src/plugins/ios/iosdevice.h @@ -9,6 +9,7 @@ #include #include +#include #include namespace Ios { From 9296a7fb9ce0c57fe7033fb53e31da7a0e88f889 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Mon, 5 Feb 2024 05:32:14 +0100 Subject: [PATCH 6/7] TextEditor: fix crash on activating bookmark in deleted file since 23908b283e429a65d937231d59375c72ac1b62f3 bookmarks are opened on double click. But double click also emits an activated. and both signals are connected to gotoBookmark, so this slot got triggered twice. This is problematic when the bookmark is not reachable anymore since the first execution of gotoBookmark deletes unreachable bookmarks, and the second execution has only a nullptr and passes it to functions not checking this pointer. Fixes: QTCREATORBUG-30283 Change-Id: Ia57d0469840d467af31fa5c89745c2ad33aa7e3f Reviewed-by: Xavier BESSON (Personal) Reviewed-by: Christian Stenger --- src/plugins/texteditor/bookmarkmanager.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/texteditor/bookmarkmanager.cpp b/src/plugins/texteditor/bookmarkmanager.cpp index ae21a75be88..2e95f7213c2 100644 --- a/src/plugins/texteditor/bookmarkmanager.cpp +++ b/src/plugins/texteditor/bookmarkmanager.cpp @@ -306,9 +306,10 @@ void BookmarkView::removeAll() void BookmarkView::gotoBookmark(const QModelIndex &index) { - Bookmark *bk = m_manager->bookmarkForIndex(index); - if (!m_manager->gotoBookmark(bk)) - m_manager->deleteBookmark(bk); + if (Bookmark *bk = m_manager->bookmarkForIndex(index)) { + if (!m_manager->gotoBookmark(bk)) + m_manager->deleteBookmark(bk); + } } //// From a45f058a37bc1fc3890095d8e29aa83929c627a7 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Mon, 5 Feb 2024 05:34:42 +0100 Subject: [PATCH 7/7] TextEditor: Assert on nullptr bookmarks passed to gotoBookmark Task-number: QTCREATORBUG-30283 Change-Id: I1c49e57bbde098c1dda949d15d03d27349b9ce69 Reviewed-by: Eike Ziller --- src/plugins/texteditor/bookmarkmanager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/texteditor/bookmarkmanager.cpp b/src/plugins/texteditor/bookmarkmanager.cpp index 2e95f7213c2..62aeb2f01c8 100644 --- a/src/plugins/texteditor/bookmarkmanager.cpp +++ b/src/plugins/texteditor/bookmarkmanager.cpp @@ -553,6 +553,7 @@ Bookmark *BookmarkManager::bookmarkForIndex(const QModelIndex &index) const bool BookmarkManager::gotoBookmark(const Bookmark *bookmark) const { + QTC_ASSERT(bookmark, return false); if (IEditor *editor = EditorManager::openEditorAt( Utils::Link(bookmark->filePath(), bookmark->lineNumber()))) { return editor->currentLine() == bookmark->lineNumber();