From ba20c9134a162d9ee10e70cb02b45e12d667d09e Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Wed, 15 Jan 2020 08:49:01 +0200 Subject: [PATCH 01/12] QmlPuppet: Fix GCC warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit qt5informationnodeinstanceserver.cpp:115:71: warning: narrowing conversion of ‘keyEvent->QKeyEvent::modifiers().QFlags::operator QFlags::Int()’ from ‘QFlags::Int’ {aka ‘unsigned int’} to ‘int’ [-Wnarrowing] 115 | QPair data = {keyEvent->key(), keyEvent->modifiers()}; | ^ Change-Id: I2f97e9ce11202cee386c2c6b4902c689e3411e30 Reviewed-by: hjk --- .../qml2puppet/instances/qt5informationnodeinstanceserver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp index b9bc5e8a3ff..84e8bbd0056 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp @@ -105,7 +105,7 @@ bool Qt5InformationNodeInstanceServer::eventFilter(QObject *, QEvent *event) case QEvent::KeyPress: { QKeyEvent *keyEvent = static_cast(event); - QPair data = {keyEvent->key(), keyEvent->modifiers()}; + QPair data = {keyEvent->key(), keyEvent->modifiers()}; nodeInstanceClient()->handlePuppetToCreatorCommand({PuppetToCreatorCommand::Key_Pressed, QVariant::fromValue(data)}); } break; From 833d278dcee03016aa559fb61fb944f3f6b2d088 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Wed, 15 Jan 2020 10:09:13 +0200 Subject: [PATCH 02/12] QmlPuppet: Fix MSVC warning implicit conversion changes signedness: 'QFlags::Int' (aka 'int') to 'const unsigned int' Change-Id: I3d906ca079f3f25ceb1e3b8010f0540ae0236081 Reviewed-by: hjk --- .../qml2puppet/instances/qt5informationnodeinstanceserver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp index 84e8bbd0056..47216fc87f6 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp @@ -105,7 +105,7 @@ bool Qt5InformationNodeInstanceServer::eventFilter(QObject *, QEvent *event) case QEvent::KeyPress: { QKeyEvent *keyEvent = static_cast(event); - QPair data = {keyEvent->key(), keyEvent->modifiers()}; + QPair data = {keyEvent->key(), int(keyEvent->modifiers())}; nodeInstanceClient()->handlePuppetToCreatorCommand({PuppetToCreatorCommand::Key_Pressed, QVariant::fromValue(data)}); } break; From 82d830e5d80aa0dce5538dd3f87d69e7a1269de0 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 14 Jan 2020 15:09:10 +0100 Subject: [PATCH 03/12] iOS: Guard against failure to retrieve device UID It should not happen, but if it happens, Qt Creator should not crash. Task-number: QTCREATORBUG-23460 Change-Id: Id25b53ff24d7e1726efc344dc6318c32073ee75c Reviewed-by: Vikas Pachdha --- src/plugins/ios/iosdevice.cpp | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/src/plugins/ios/iosdevice.cpp b/src/plugins/ios/iosdevice.cpp index e3438ffb718..e341c625160 100644 --- a/src/plugins/ios/iosdevice.cpp +++ b/src/plugins/ios/iosdevice.cpp @@ -356,9 +356,14 @@ void deviceConnectedCallback(void *refCon, io_iterator_t iterator) usbDevice, CFSTR(kUSBSerialNumberString), kCFAllocatorDefault, 0)); - QString uid = CFStringRef2QString(cfUid); - CFRelease(cfUid); - IosDeviceManager::instance()->deviceConnected(uid, name); + if (cfUid) { + QString uid = CFStringRef2QString(cfUid); + CFRelease(cfUid); + qCDebug(detectLog) << "device UID is" << uid; + IosDeviceManager::instance()->deviceConnected(uid, name); + } else { + qCDebug(detectLog) << "failed to retrieve device's UID"; + } // Done with this USB device; release the reference added by IOIteratorNext kr = IOObjectRelease(usbDevice); @@ -385,18 +390,22 @@ void deviceDisconnectedCallback(void *refCon, io_iterator_t iterator) // Get the USB device's name. kr = IORegistryEntryGetName(usbDevice, deviceName); - if (KERN_SUCCESS != kr) - deviceName[0] = '\0'; - qCDebug(detectLog) << "ios device " << deviceName << " in deviceDisconnectedCallback"; + QString name; + if (KERN_SUCCESS == kr) + name = QString::fromLocal8Bit(deviceName); + qCDebug(detectLog) << "ios device " << name << " in deviceDisconnectedCallback"; - { - CFStringRef cfUid = static_cast(IORegistryEntryCreateCFProperty( - usbDevice, - CFSTR(kUSBSerialNumberString), - kCFAllocatorDefault, 0)); + CFStringRef cfUid = static_cast( + IORegistryEntryCreateCFProperty(usbDevice, + CFSTR(kUSBSerialNumberString), + kCFAllocatorDefault, + 0)); + if (cfUid) { QString uid = CFStringRef2QString(cfUid); CFRelease(cfUid); IosDeviceManager::instance()->deviceDisconnected(uid); + } else { + qCDebug(detectLog) << "failed to retrieve device's UID"; } // Done with this USB device; release the reference added by IOIteratorNext From 0908447e4f45c52650478d2710043ace6037243c Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 15 Jan 2020 07:47:29 +0100 Subject: [PATCH 04/12] More changes for 4.11.1 And make subheadings better readable in pure text by using underline-style headings for first two levels. Change-Id: I9986e884db882000d670afc728a9728495308d15 Reviewed-by: Leena Miettinen --- dist/changes-4.11.1.md | 55 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 48 insertions(+), 7 deletions(-) diff --git a/dist/changes-4.11.1.md b/dist/changes-4.11.1.md index f2718ca6bcb..8f2635897b3 100644 --- a/dist/changes-4.11.1.md +++ b/dist/changes-4.11.1.md @@ -1,4 +1,5 @@ -# Qt Creator 4.11.1 +Qt Creator 4.11.1 +================= Qt Creator version 4.11.1 contains bug fixes. @@ -9,7 +10,8 @@ you can check out from the public Git repository. For example: git clone git://code.qt.io/qt-creator/qt-creator.git git log --cherry-pick --pretty=oneline origin/v4.11.0..v4.11.1 -## Editing +Editing +------- * Fixed `Visualize Whitespace` for editors without specialized highlighter definition (QTCREATORBUG-23040) @@ -18,29 +20,42 @@ you can check out from the public Git repository. For example: * Fixed wrong warnings about C++98 incompatibility with MSVC (QTCREATORBUG-23118) * Fixed accidentally added internal include paths from GCC (QTCREATORBUG-23330) +* Fixed `Convert to Stack Variable` and `Convert to Pointer` (QTCREATORBUG-23181) ### FakeVim * Fixed goto next and previous split (QTCREATORBUG-22397) * Fixed indentation of continuation lines (QTCREATORBUG-20876) -## Projects +Projects +-------- * Fixed crash when closing application output +* Fixed crash when compiler detection fails (QTCREATORBUG-23442) ### CMake * Fixed subdirectory structure in project tree (QTCREATORBUG-23372) -## Qt Quick Designer +Debugging +--------- + +* Fixed crash with `Switch to previous mode on debugger exit` when debugging fails + (QTCREATORBUG-23415) +* Fixed high CPU usage with LLDB (QTCREATORBUG-23311) + +Qt Quick Designer +----------------- * Fixed removing single signals from Connection (QDS-1333) -## Test Integration +Test Integration +---------------- * Fixed stopping tests when debugging (QTCREATORBUG-23298) -## Platforms +Platforms +--------- ### Windows @@ -54,4 +69,30 @@ you can check out from the public Git repository. For example: * Fixed deployment of Qt examples (QTCREATORBUG-22592) -## Credits for these changes go to: +Credits for these changes go to: +-------------------------------- + +Aleksei German +Alessandro Portale +Andre Hartmann +Andrzej Ostruszka +André Pönitz +BogDan Vatra +Christian Kandeler +Christian Stenger +Cristian Adam +David Schulz +Eike Ziller +Friedemann Kleint +Henning Gruendl +Jaroslaw Kobus +Leena Miettinen +Mahmoud Badri +Marius Sincovici +Miikka Heikkinen +Nikolai Kosjar +Richard Weickelt +Robert Löhning +Thomas Hartmann +Tim Jenssen +Tobias Hunger From e8a5dcee4921f5c4d40279fae01345f2a3a378fe Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 15 Jan 2020 12:44:58 +0100 Subject: [PATCH 05/12] SSH device: Ensure ConsoleProcess respects terminal settings Fixes: QTCREATORBUG-23470 Change-Id: I0ac67226ee482814cdde44e518651e672be4e0eb Reviewed-by: hjk --- src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp b/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp index 56fd1b9503d..786b0cf019b 100644 --- a/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp +++ b/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp @@ -28,6 +28,7 @@ #include "idevice.h" #include "../runcontrol.h" +#include #include #include #include @@ -201,6 +202,7 @@ void SshDeviceProcess::handleConnected() connect(&d->consoleProcess, &ConsoleProcess::stubStopped, this, [this] { handleProcessFinished(d->consoleProcess.errorString()); }); d->consoleProcess.setAbortOnMetaChars(false); + d->consoleProcess.setSettings(Core::ICore::settings()); d->consoleProcess.setCommand(d->process->fullLocalCommandLine()); d->consoleProcess.start(); } else { From 5872c60a45df6d26c90a1db2d8c4e672ade2a5b3 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Thu, 16 Jan 2020 10:18:07 +0200 Subject: [PATCH 06/12] Dumper: Fix syntax error Change-Id: I8e611b1cb358872d9e0c7302ed8a4d3e0b7d9f3c Reviewed-by: Christian Stenger --- share/qtcreator/debugger/dumper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py index 3ebdedbd2e9..8ce967d3a55 100644 --- a/share/qtcreator/debugger/dumper.py +++ b/share/qtcreator/debugger/dumper.py @@ -3400,7 +3400,7 @@ class DumperBase: return res return thing if len(fields) != len(result): - error('STRUCT ERROR: %s %s' (fields, result)) + error('STRUCT ERROR: %s %s' % (fields, result)) return tuple(map(structFixer, fields, result)) def checkPointer(self, p, align = 1): From 5f8fe92105444ca3d49d263d4960ce9957fdbbc4 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Tue, 14 Jan 2020 14:45:08 +0100 Subject: [PATCH 07/12] Doc: Describe collecting LTTng data and converting it into CTF ...for viewing in the Chrome Trace Format Visualizer. Based on a QtWS19 talk by Milian Wolff: https://resources.qt.io/qt-world-summit-2019/lttng-for-full-stack-tracing Fixes: QTCREATORBUG-23471 Change-Id: I173aa68e7198c7f13aecb73f28000af02d7ec0ed Reviewed-by: Milian Wolff --- doc/src/analyze/creator-ctf-visualizer.qdoc | 129 +++++++++++++++++++- doc/src/qtquick/qtquick-profiler.qdoc | 7 +- 2 files changed, 134 insertions(+), 2 deletions(-) diff --git a/doc/src/analyze/creator-ctf-visualizer.qdoc b/doc/src/analyze/creator-ctf-visualizer.qdoc index 20362accbef..e9680897d3a 100644 --- a/doc/src/analyze/creator-ctf-visualizer.qdoc +++ b/doc/src/analyze/creator-ctf-visualizer.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -37,6 +37,19 @@ \title Visualizing Chrome Trace Events + You can use \e {full stack tracing} to trace from the top level QML or + JavaScript down to the C++ and all the way to the kernel space. This + enables you to measure the performance of an application and to check + whether it is CPU or I/O bound or influenced by other applications + running on the same system. Tracing provides insight into what a system is + doing and why an application is performing in a particular way. It indicates + how the hardware is utilized and what the kernel and application are doing. + + Tracing information can also provide you additional insight into the data + collected by \l{Profiling QML Applications}{QML Profiler}. For example, you + could check why a trivial binding evaluation is taking so long. This might + be caused by C++ being executed or the disk I/O being slow. + Several tracing tools (such as \c {chrome://about}) can generate information about Chrome trace events in Chrome Trace Format (CTF). You can open CTF files in \QC for viewing. This is especially useful when viewing trace files @@ -110,4 +123,118 @@ stack (called \c self). This allows you to examine which functions you need to optimize. A high number of occurrences might indicate that a function is triggered unnecessarily or takes very long to execute. + + \section1 Collecting LTTng Data + + LTTng is a tracing toolkit for Linux that you can apply on embedded Linux + systems to find out how to optimize the startup time of an application. + + Since Qt 5.13, Qt provides a set of kernel trace points and a tracing + subsystem for custom user space trace points. + + \section2 Configuring the Kernel + + To use LTTng, you have to set the following configuration options for the + kernel before building it: + + \list + \li \c CONFIG_HIGH_RES_TIMERS + \li \c CONFIG_KALLSYMS + \li \c CONFIG_MODULES + \li \c CONFIG_TRACEPOINTS + \endlist + + We recommend that you set the following additional options: + + \list + \li \c CONFIG_EVENT_TRACING + \li \c CONFIG_HAVE_SYSCALL_TRACEPOINTS + \li \c CONFIG_KALLSYMS_ALL + \endlist + + In Yocto, you can activate the above options in \uicontrol Menu > + \uicontrol Config > \uicontrol {Kernel Hacking} > \uicontrol Tracers. + + \section2 Installing LTTng + + After you build the kernel and deploy it on your device, you'll need to + install the following LTTng packages on your device: + + \list + \li \c lttng-tools to control the tracing session + \li \c lttng-modules for kernel trace points + \li \c lttng-ust for user space trace points + \endlist + + In Yocto, you just need to enable + \c {EXTRA_IMAGE_FEATURES += "tools profile"}. + + \section2 Building Qt with Tracepoints + + Trace points are continuously being added to Qt versions. To use them, you + need to build Qt yourself with the \c {configure -trace lttng} option. + + \section2 Recording Events + + To create a session, you call the \c {lttng create} command. Then you + call \c {lttng enable-channel kernel -k} to enable the kernel channel. + Within the kernel channel, you specify the appropriate trace points as + \c {kernel_events} and call \c {lttng enable-event} to enable them. + Finally, you call \c {lttng start} to start tracing. + + You call \c {lttng stop} to stop tracing. You can use \c sleep to set the + length of the session. After stopping, you can call \c {lttng destroy} to + destroy the session. + + You can write and run scripts that contain the above commands to start and + stop full-stack tracing. You can use \c systemd to execute the scripts. + + \section2 Enabling Trace Points + + Data is recorded according to the trace points that you enable in the LTTng + session. Usually, it is useful to enable scheduler switch, syscall, and Qt + trace points. + + \section3 Scheduler Switch Trace Points + + Scheduler switch trace points are reached when an application is switched + out due to predemption, for example, when another process gets the chance + to run on the CPU core. Enable scheduler schwitch trace points to record + the thread that is currently running and the process it belongs to, as + well as the time when the process started and stopped. + + \section3 Syscall Trace Points + + Syscall trace points help you to understand why a scheduler switch happened. + The following are examples of syscalls to trace: + + \list + \li \c openat and \c close map file descriptors to file names + \li \c mmap maps page faults to files + \li \c read and \c write are triggered by I/O operations + \li \c nanosleep, \c futex, and \c poll explain scheduler switches + \li \c ioctl controls the GPU and display + \endlist + + \section1 Converting LTTng Data to CTF + + The \l{https://github.com/KDAB/ctf2ctf}{ctf2ctf} tool uses \c babeltrace to + parse binary Common Trace Format (CTF) and converts it to Chrome Trace + Format (CTF). It performs the following custom tasks to make the recording + more human-readable: + + \list + \li Map file descriptors to file names + \li Map page faults to file names + \li Annotate interrupts and block devices with names + \li Convert UTF-16 QString data to UTF-8 strings + \li Count memory page allocations + \endlist + + To generate JSON files that contain the trace data in Chrome Trace Format, + enter the following command on the command line: + + \code + ctf2ctf -o trace.json path/to/lttng trace/ + \endcode */ diff --git a/doc/src/qtquick/qtquick-profiler.qdoc b/doc/src/qtquick/qtquick-profiler.qdoc index fef88195d72..7b8936b911e 100644 --- a/doc/src/qtquick/qtquick-profiler.qdoc +++ b/doc/src/qtquick/qtquick-profiler.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -74,6 +74,11 @@ large, unexplained gaps in the timeline, check your custom QQuickItem implementations. You can use \l{Using Valgrind Code Analysis Tools} {Valgrind} or other general purpose profilers to analyze C++ code. + + You can use \e {full stack tracing} to trace from the top level QML or + JavaScript down to the C++ and all the way to the kernel space. You can + view the collected data in the \l{Visualizing Chrome Trace Events} + {Chrome Trace Format Viewer}. \endif \section1 Using QML Profiler From 92a39e8d86862fba847791954c6d54b91d4d779e Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 16 Jan 2020 10:32:05 +0100 Subject: [PATCH 08/12] iOS: Fix retrieving USB serial number with macOS 10.15 SDK When building without explicit compatibility with oder macOS versions (-mmacosx-version-min), the Apple headers use a different value for the constant that is used to retrieve the USB serial number, and that just doesn't work for some reason. Make sure we use a value for the constant that works in all cases. Fixes: QTCREATORBUG-23460 Change-Id: Ie7de52a49a41c2ad33b2a6d2410414a9f1f05b1e Reviewed-by: Cristian Adam --- src/plugins/ios/iosdevice.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/plugins/ios/iosdevice.cpp b/src/plugins/ios/iosdevice.cpp index e341c625160..1dae70200bc 100644 --- a/src/plugins/ios/iosdevice.cpp +++ b/src/plugins/ios/iosdevice.cpp @@ -42,6 +42,16 @@ #include #include #include + +// Work around issue with not being able to retrieve USB serial number. +// See QTCREATORBUG-23460. +// For an unclear reason USBSpec.h in macOS SDK 10.15 uses a different value if +// MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_14, which just does not work. +#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_14 +#undef kUSBSerialNumberString +#define kUSBSerialNumberString "USB Serial Number" +#endif + #endif #include From db39b76c4c6caea88b9e84ee213a0d70406977da Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 16 Jan 2020 10:54:08 +0100 Subject: [PATCH 09/12] Add .tag file for COIN When COIN retrieves sources, it writes the commit SHA there Change-Id: Ibe9c1c3594e9b5451211b0ec1598c4a8ca1c54fd Reviewed-by: Antti Kokko --- .gitattributes | 3 +++ .tag | 1 + 2 files changed, 4 insertions(+) create mode 100644 .tag diff --git a/.gitattributes b/.gitattributes index e87bab18ac8..0d3537f28e0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,4 @@ dist/clang/patches/*.patch -diff -merge -text +.tag export-subst +.gitattributes export-ignore +.gitignore export-ignore diff --git a/.tag b/.tag new file mode 100644 index 00000000000..6828f88dcb0 --- /dev/null +++ b/.tag @@ -0,0 +1 @@ +$Format:%H$ From 81dfdea37c162c774e38c6f2746ca2bc59169eeb Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Thu, 16 Jan 2020 09:55:16 +0100 Subject: [PATCH 10/12] Welcome: Fix links to Qt Widgets and Qt Quick tutorials ...in Tutorials tab. The source files were moved to Qt Widgets module. This means that the links will be broken if you are using a Qt Creator version earlier than where this fix lands with only Qt versions registered, where the docs are still in qtdoc. Fixes: QTCREATORBUG-23486 Change-Id: I75b4e8fc475be648790d13466a37250cd649adc9 Reviewed-by: Friedemann Kleint --- src/plugins/qtsupport/qtcreator_tutorials.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/qtsupport/qtcreator_tutorials.xml b/src/plugins/qtsupport/qtcreator_tutorials.xml index 4a54c4c2747..a694d4cd6f9 100644 --- a/src/plugins/qtsupport/qtcreator_tutorials.xml +++ b/src/plugins/qtsupport/qtcreator_tutorials.xml @@ -9,7 +9,7 @@ qt creator,qt designer,widgets,c++,text,help - + qt,qt creator,qt designer,widgets,c++,help @@ -21,9 +21,9 @@ qt creator,qt quick designer,qml,android,ios,controls,help - - - qt quick,qml,c++,help + + + qt quick,controls,tumbler,help From f1b2120ccb43e22586072b257c0fa9b2c247f4d4 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 17 Jan 2020 11:32:19 +0100 Subject: [PATCH 11/12] QbsProjectManager: Fix setting qbs.architecture for Android - Use values that qbs understands. - Make sure qbs.architecture(s) is set also with no Qt present. This was broken in 6b31f9cf23. Fixes: QTCREATORBUG-23489 Change-Id: If7bf8862b850defa04e8f45eace99e08388d780f Reviewed-by: BogDan Vatra --- src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp index cfb7b639911..75a80aee7ab 100644 --- a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp +++ b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp @@ -295,13 +295,13 @@ QVariantMap DefaultPropertyProvider::autoGeneratedProperties(const ProjectExplor data.insert("Android.ndk.ndkDir", ndkDir); } } - data.remove(QBS_ARCHITECTURES); - data.remove(QBS_ARCHITECTURE); QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitAspect::qtVersion(k); if (qtVersion) { + data.remove(QBS_ARCHITECTURES); + data.remove(QBS_ARCHITECTURE); QStringList abis; for (const auto &abi : qtVersion->qtAbis()) - abis << abi.param(); + abis << architecture(abi); if (abis.size() == 1) data.insert(QLatin1String(QBS_ARCHITECTURE), abis.first()); else From 07544d4e0721e1ddbed3d310e6d250333c2b1fb5 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 17 Jan 2020 13:00:13 +0100 Subject: [PATCH 12/12] Android: Fix crash when Kit has no Qt Change-Id: I419bbb68d1d39fa88ca02fb644218ea78216c1ad Reviewed-by: BogDan Vatra --- src/plugins/android/androiddeployqtstep.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/plugins/android/androiddeployqtstep.cpp b/src/plugins/android/androiddeployqtstep.cpp index 451fb48ba56..ad8a550ceb7 100644 --- a/src/plugins/android/androiddeployqtstep.cpp +++ b/src/plugins/android/androiddeployqtstep.cpp @@ -143,7 +143,8 @@ AndroidDeployQtStep::AndroidDeployQtStep(ProjectExplorer::BuildStepList *parent) : ProjectExplorer::BuildStep(parent, stepId()) { setImmutable(true); - m_uninstallPreviousPackage = QtSupport::QtKitAspect::qtVersion(target()->kit())->qtVersion() < QtSupport::QtVersionNumber(5, 4, 0); + const QtSupport::BaseQtVersion * const qt = QtSupport::QtKitAspect::qtVersion(target()->kit()); + m_uninstallPreviousPackage = qt && qt->qtVersion() < QtSupport::QtVersionNumber(5, 4, 0); //: AndroidDeployQtStep default display name setDefaultDisplayName(tr("Deploy to Android device")); @@ -163,6 +164,10 @@ Core::Id AndroidDeployQtStep::stepId() bool AndroidDeployQtStep::init() { + QtSupport::BaseQtVersion *version = QtSupport::QtKitAspect::qtVersion(target()->kit()); + if (!version) // TODO: Add error message + return false; + m_androiddeployqtArgs = CommandLine(); m_androidABIs = AndroidManager::applicationAbis(target()); @@ -214,10 +219,6 @@ bool AndroidDeployQtStep::init() emit addOutput(tr("Deploying to %1").arg(m_serialNumber), OutputFormat::Stdout); - QtSupport::BaseQtVersion *version = QtSupport::QtKitAspect::qtVersion(target()->kit()); - if (!version) - return false; - m_uninstallPreviousPackageRun = m_uninstallPreviousPackage; if (m_uninstallPreviousPackageRun) m_manifestName = AndroidManager::manifestPath(target()); @@ -615,7 +616,8 @@ void AndroidDeployQtStep::setUninstallPreviousPackage(bool uninstall) AndroidDeployQtStep::UninstallType AndroidDeployQtStep::uninstallPreviousPackage() { - if (QtSupport::QtKitAspect::qtVersion(target()->kit())->qtVersion() < QtSupport::QtVersionNumber(5, 4, 0)) + const QtSupport::BaseQtVersion * const qt = QtSupport::QtKitAspect::qtVersion(target()->kit()); + if (qt && qt->qtVersion() < QtSupport::QtVersionNumber(5, 4, 0)) return ForceUnintall; return m_uninstallPreviousPackage ? Uninstall : Keep; }