From ae26a16a85d0438369259742b781af15bffa45f4 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 11 May 2018 16:20:44 +0200 Subject: [PATCH 1/9] QbsProjectManager: Fix the "Enable QML debugging" checkbox Once it was enabled, the value passed to qbs would never get reset. Task-number: QTCREATORBUG-20377 Change-Id: I366cba77ef56d81dcdaf619c697c60396eeec651 Reviewed-by: Joerg Bornemann --- src/plugins/qbsprojectmanager/qbsbuildstep.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp index ffe80df75f4..c01db641e3f 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp @@ -207,6 +207,8 @@ QVariantMap QbsBuildStep::qbsConfiguration(VariableHandling variableHandling) co config.insert(Constants::QBS_FORCE_PROBES_KEY, m_forceProbes); if (m_enableQmlDebugging) config.insert(Constants::QBS_CONFIG_QUICK_DEBUG_KEY, true); + else + config.remove(Constants::QBS_CONFIG_QUICK_DEBUG_KEY); if (variableHandling == ExpandVariables) { const Utils::MacroExpander *expander = Utils::globalMacroExpander(); for (auto it = config.begin(), end = config.end(); it != end; ++it) { From 1fce7ff4f5244dfb98a5b0a333c52ecaba7e59c4 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 4 May 2018 12:42:48 +0200 Subject: [PATCH 2/9] Fix code signature on macOS We build packages with extra debug info, but sign the application before removing the debug info for the release package. We have to codesign (potentially again) between copying and packaging. Task-number: QTCREATORBUG-20370 Change-Id: I5549ca5045eb995e5a61794473c2d0180b778711 Reviewed-by: Tim Jenssen --- scripts/common.py | 10 ++++++++++ scripts/createDistPackage.py | 7 ++++++- scripts/makedmg.py | 6 +++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/scripts/common.py b/scripts/common.py index b8f640377ec..91ff78ad4ef 100644 --- a/scripts/common.py +++ b/scripts/common.py @@ -177,3 +177,13 @@ def is_debug(path, filenames): def is_not_debug(path, filenames): files = [fn for fn in filenames if os.path.isfile(os.path.join(path, fn))] return [fn for fn in files if not is_debug_file(os.path.join(path, fn))] + +def codesign(app_path): + signing_identity = os.environ.get('SIGNING_IDENTITY') + if is_mac_platform() and signing_identity: + codesign_call = ['codesign', '--force', '--deep', '-s', signing_identity, '-v'] + signing_flags = os.environ.get('SIGNING_FLAGS') + if signing_flags: + codesign_call.extend(signing_flags.split()) + codesign_call.append(app_path) + subprocess.check_call(codesign_call) diff --git a/scripts/createDistPackage.py b/scripts/createDistPackage.py index 2b0c38ea5f4..a2bdf1bd193 100755 --- a/scripts/createDistPackage.py +++ b/scripts/createDistPackage.py @@ -33,7 +33,8 @@ import tempfile import common def parse_arguments(): - parser = argparse.ArgumentParser(description="Create Qt Creator package, filtering out debug information files.") + parser = argparse.ArgumentParser(description="Create Qt Creator package, filtering out debug information files.", + epilog="To sign the contents before packaging on macOS, set the SIGNING_IDENTITY and optionally the SIGNING_FLAGS environment variables.") parser.add_argument('--7z', help='path to 7z binary', default='7z.exe' if common.is_windows_platform() else '7z', metavar='<7z_binary>', dest='sevenzip') @@ -52,6 +53,10 @@ def main(): try: common.copytree(arguments.source_directory, tempdir, symlinks=True, ignore=(common.is_not_debug if arguments.debug else common.is_debug)) + # on macOS we might have to codesign (again) to account for removed debug info + if not arguments.debug: + common.codesign(tempdir) + # package zip_source = os.path.join(tempdir, '*') if arguments.exclude_toplevel else tempdir subprocess.check_call([arguments.sevenzip, 'a', '-mx9', arguments.target_archive, zip_source]) diff --git a/scripts/makedmg.py b/scripts/makedmg.py index 33721f90a72..7911a1be000 100755 --- a/scripts/makedmg.py +++ b/scripts/makedmg.py @@ -34,7 +34,8 @@ import time import common def parse_arguments(): - parser = argparse.ArgumentParser(description='Create Qt Creator disk image, filtering out debug information files.') + parser = argparse.ArgumentParser(description='Create Qt Creator disk image, filtering out debug information files.', + epilog="To sign the contents before packaging on macOS, set the SIGNING_IDENTITY and optionally the SIGNING_FLAGS environment variables.") parser.add_argument('target_diskimage', help='output .dmg file to create') parser.add_argument('dmg_volumename', help='volume name to use for the disk image') parser.add_argument('source_directory', help='directory with the Qt Creator sources') @@ -47,6 +48,9 @@ def main(): tempdir = os.path.join(tempdir_base, os.path.basename(arguments.binary_directory)) try: common.copytree(arguments.binary_directory, tempdir, symlinks=True, ignore=common.is_debug) + if common.is_mac_platform(): + app_path = [app for app in os.listdir(tempdir) if app.endswith('.app')][0] + common.codesign(os.path.join(tempdir, app_path)) os.symlink('/Applications', os.path.join(tempdir, 'Applications')) shutil.copy(os.path.join(arguments.source_directory, 'LICENSE.GPL3-EXCEPT'), tempdir) dmg_cmd = ['hdiutil', 'create', '-srcfolder', tempdir, '-volname', arguments.dmg_volumename, From 607a3dd678841d9fcb45849d4945724ca13955ca Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Thu, 10 May 2018 11:15:13 +0200 Subject: [PATCH 3/9] QtOutputFormatter: Handle QML output with braces For example the function f: function f() { console.assert(false, "console.assert() did not pass"); } gives the following output: console.assert() did not pass f (qrc:/main.qml:19) onClicked (qrc:/main.qml:14) which was not handled correctly previously because of the closing brace. Task-number: QTCREATORBUG-20406 Change-Id: I0d63393027cfdb72629007bd9b273b5bb83d392f Reviewed-by: Tobias Hunger --- src/plugins/qtsupport/qtoutputformatter.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/qtsupport/qtoutputformatter.cpp b/src/plugins/qtsupport/qtoutputformatter.cpp index 08a817dadca..67984fce30e 100644 --- a/src/plugins/qtsupport/qtoutputformatter.cpp +++ b/src/plugins/qtsupport/qtoutputformatter.cpp @@ -57,7 +57,7 @@ public: : qmlError(QLatin1String("(" QML_URL_REGEXP // url ":\\d+" // colon, line "(?::\\d+)?)" // colon, column (optional) - "[: \t]")) // colon, space or tab + "[: \t)]")) // colon, space, tab or brace , qtError(QLatin1String("Object::.*in (.*:\\d+)")) , qtAssert(QLatin1String("ASSERT: .* in file (.+, line \\d+)")) , qtAssertX(QLatin1String("ASSERT failure in .*: \".*\", file (.+, line \\d+)")) @@ -353,6 +353,11 @@ void QtSupportPlugin::testQtOutputFormatter_data() << 0 << 18 << QString::fromLatin1("qrc:///main.qml:20") << QString::fromLatin1("/main.qml") << 20 << -1; + QTest::newRow("onClicked (qrc:/main.qml:20)") + << QString::fromLatin1("onClicked (qrc:/main.qml:20)") + << 11 << 27 << QString::fromLatin1("qrc:/main.qml:20") + << QString::fromLatin1("/main.qml") << 20 << -1; + QTest::newRow("file:///main.qml:20") << QString::fromLatin1("file:///main.qml:20 Unexpected token `identifier'") << 0 << 19 << QString::fromLatin1("file:///main.qml:20") From a86eda329e7b47b75222434884e40e925b599b82 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 14 May 2018 15:30:35 +0200 Subject: [PATCH 4/9] Qnx: Fix persisting of deploy steps While the deploy steps re-used from RemoteLinux were created ok when creating a new QnxDeployConfiguration, they did not survive a restart (or rather a toMap/fromMap cycle, as the restoring insisted on having a RemoteLinuxDeployConfiguration). Since sharing DeployConfiguration*Factory*s is not yet possible, this patch here creates additional DeployConfigurationFactories creating the same steps, but insisting on a QnxDeployConfiguration parent. Task-number: QTCREATORBUG-20248 Change-Id: I70666f79993a1332cd1959ab5e3665797d2401ca Reviewed-by: Christian Kandeler Reviewed-by: Alessandro Portale Reviewed-by: Eike Ziller --- .../devicesupport/devicecheckbuildstep.cpp | 4 ++-- .../devicesupport/devicecheckbuildstep.h | 2 +- src/plugins/qnx/qnxplugin.cpp | 24 +++++++++++++++++++ 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.cpp b/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.cpp index 2d6164c9ae1..f90f9843c2c 100644 --- a/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.cpp @@ -38,7 +38,7 @@ using namespace ProjectExplorer; DeviceCheckBuildStep::DeviceCheckBuildStep(BuildStepList *bsl) : BuildStep(bsl, stepId()) { - setDefaultDisplayName(stepDisplayName()); + setDefaultDisplayName(displayName()); } bool DeviceCheckBuildStep::init(QList &earlierSteps) @@ -92,7 +92,7 @@ Core::Id DeviceCheckBuildStep::stepId() return "ProjectExplorer.DeviceCheckBuildStep"; } -QString DeviceCheckBuildStep::stepDisplayName() +QString DeviceCheckBuildStep::displayName() { return tr("Check for a configured device"); } diff --git a/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.h b/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.h index 7886a9e8abc..8a114e1e6c4 100644 --- a/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.h +++ b/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.h @@ -45,7 +45,7 @@ public: BuildStepConfigWidget *createConfigWidget() override; static Core::Id stepId(); - static QString stepDisplayName(); + static QString displayName(); }; } // namespace ProjectExplorer diff --git a/src/plugins/qnx/qnxplugin.cpp b/src/plugins/qnx/qnxplugin.cpp index c5fb91e2bdf..408f96b338f 100644 --- a/src/plugins/qnx/qnxplugin.cpp +++ b/src/plugins/qnx/qnxplugin.cpp @@ -46,6 +46,7 @@ #include #include +#include #include #include #include @@ -57,6 +58,9 @@ #include #include +#include +#include + #include #include @@ -67,6 +71,19 @@ using namespace ProjectExplorer; namespace Qnx { namespace Internal { +template +class GenericQnxDeployStepFactory : public BuildStepFactory +{ +public: + GenericQnxDeployStepFactory() + { + registerStep(Step::stepId()); + setDisplayName(Step::displayName()); + setSupportedConfiguration(Constants::QNX_QNX_DEPLOYCONFIGURATION_ID); + setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY); + } +}; + bool QnxPlugin::initialize(const QStringList &arguments, QString *errorString) { Q_UNUSED(arguments) @@ -80,6 +97,13 @@ bool QnxPlugin::initialize(const QStringList &arguments, QString *errorString) addAutoReleasedObject(new QnxRunConfigurationFactory); addAutoReleasedObject(new QnxSettingsPage); + addAutoReleasedObject(new GenericQnxDeployStepFactory + ); + addAutoReleasedObject(new GenericQnxDeployStepFactory + ); + addAutoReleasedObject(new GenericQnxDeployStepFactory + ); + auto constraint = [](RunConfiguration *runConfig) { if (!runConfig->isEnabled() || !runConfig->id().name().startsWith(Constants::QNX_QNX_RUNCONFIGURATION_PREFIX)) { From e3fb05739714da5858f675c1276eebe53c32a108 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 15 May 2018 08:58:01 +0200 Subject: [PATCH 5/9] Valgrind: Add clear button to callgrind tool Callgrind runs can spread TextMarks across files. Only way to get rid of them would be to start a new analyze and stop it before it can add new TextMarks. Be user-friendly and allow clearing the data including the TextMarks explicitly. Change-Id: If8d5c5f789414709a110249377ce907466c0fdf1 Reviewed-by: Leena Miettinen Reviewed-by: hjk --- src/plugins/valgrind/callgrindtool.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp index 294e28e665d..2903b3cae56 100644 --- a/src/plugins/valgrind/callgrindtool.cpp +++ b/src/plugins/valgrind/callgrindtool.cpp @@ -217,6 +217,7 @@ public: QAction *m_dumpAction = nullptr; QAction *m_resetAction = nullptr; QAction *m_pauseAction = nullptr; + QAction *m_discardAction = nullptr; QString m_toggleCollectFunction; bool m_toolBusy = false; @@ -392,6 +393,15 @@ CallgrindTool::CallgrindTool() action->setToolTip(tr("Pause event logging. No events are counted which will speed up program execution during profiling.")); connect(action, &QAction::toggled, this, &CallgrindTool::pauseToggled); + // discard data action + m_discardAction = action = new QAction(this); + action->setIcon(Utils::Icons::CLEAN_TOOLBAR.icon()); + action->setToolTip(tr("Discard Data")); + connect(action, &QAction::triggered, this, [this](bool) { + clearTextMarks(); + doClear(true); + }); + // navigation // go back m_goBack = action = new QAction(this); @@ -421,6 +431,7 @@ CallgrindTool::CallgrindTool() toolbar.addAction(m_dumpAction); toolbar.addAction(m_resetAction); toolbar.addAction(m_pauseAction); + toolbar.addAction(m_discardAction); toolbar.addAction(m_goBack); toolbar.addAction(m_goNext); toolbar.addWidget(new Utils::StyledSeparator); From f7895e272b4555ce1963790b9db1eea91bf359fb Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 11 May 2018 14:09:41 +0200 Subject: [PATCH 6/9] QML Debugger: Don't hang if there are no scopes to be retrieved Qt 5.11.0 contains an optimization that does away with call contexts for simple inline bindings. Also, it doesn't report QML contexts as scopes in the "frame" and "backtrace" commands. Therefore, in those cases "this" is the only thing to be retrieved. Check if we are done when "this" has been retrieved and no scopes have been found. Change-Id: I9e0f545777bc38333938b65a934d42701ec4f807 Task-number: QTBUG-68218 Reviewed-by: Eike Ziller Reviewed-by: hjk --- src/plugins/debugger/qml/qmlengine.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index 96007d1bcb6..214313773f8 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -2167,6 +2167,10 @@ void QmlEnginePrivate::handleFrame(const QVariantMap &response) watchHandler->insertItem(item); evaluate(exp, -1, [this, iname, exp](const QVariantMap &response) { handleEvaluateExpression(response, iname, exp); + + // If there are no scopes, "this" may be the only thing to look up. + if (currentFrameScopes.isEmpty()) + checkForFinishedUpdate(); }); } From 5912a93fd5669e7e7d11f3deddf16fab85f2ed50 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 15 May 2018 17:22:14 +0200 Subject: [PATCH 7/9] QmlDesigner: Disable shortcut if document did not change Change-Id: I95f67379d507ab599d2435cc042f96fc28d8d7cd Reviewed-by: Alessandro Portale --- .../qmldesigner/designercore/model/texttomodelmerger.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp index c08f595dbb1..9066a65d7e1 100644 --- a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp +++ b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp @@ -977,10 +977,12 @@ bool TextToModelMerger::load(const QString &data, DifferenceHandler &differenceH QList warnings; if (Document::MutablePtr doc = createParsedDocument(url, data, &errors)) { + /* We cannot do this since changes to other documents do have side effects on the current document if (m_document && (m_document->fingerprint() == doc->fingerprint())) { setActive(false); return true; } + */ snapshot.insert(doc); m_document = doc; From 23ac1d18e1be8d898adf44dde745ba7c259beb3c Mon Sep 17 00:00:00 2001 From: Vikas Pachdha Date: Tue, 15 May 2018 12:39:41 +0200 Subject: [PATCH 8/9] Android: Fix the android include path Task-number: QTCREATORBUG-20340 Change-Id: Ie1d7c15bf8b38b5141868149684e026ba9666630 Reviewed-by: Alex Blasche Reviewed-by: Ivan Donchevskii --- src/plugins/android/androidtoolchain.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/android/androidtoolchain.cpp b/src/plugins/android/androidtoolchain.cpp index 9d3b8db27bf..da75a80deef 100644 --- a/src/plugins/android/androidtoolchain.cpp +++ b/src/plugins/android/androidtoolchain.cpp @@ -116,7 +116,9 @@ static void addSystemHeaderPaths(QList &paths, const Utils::FileName ndkPath = AndroidConfigurations::currentConfig().ndkLocation(); // Get short version (for example 4.9) - const QString clangVersion = version.left(version.lastIndexOf('.')); + auto versionNumber = QVersionNumber::fromString(version); + const QString clangVersion = QString("%1.%2") + .arg(versionNumber.majorVersion()).arg(versionNumber.minorVersion()); Utils::FileName stdcppPath = ndkPath; stdcppPath.appendPath("sources/cxx-stl/gnu-libstdc++/" + clangVersion); Utils::FileName includePath = stdcppPath; From 5cd1bb6f73bcf2fbe5d514d69cec372a672afdd8 Mon Sep 17 00:00:00 2001 From: Vikas Pachdha Date: Mon, 14 May 2018 16:16:03 +0200 Subject: [PATCH 9/9] iOS: Fix incorrect device type in run configuration Task-number: QTCREATORBUG-20413 Change-Id: I5b96273161401e83567da80770f0f1c3482b7311 Reviewed-by: hjk Reviewed-by: Eike Ziller --- src/plugins/ios/iosrunconfiguration.cpp | 24 ++++++++++++++++-------- src/plugins/ios/iosrunconfiguration.h | 2 ++ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/plugins/ios/iosrunconfiguration.cpp b/src/plugins/ios/iosrunconfiguration.cpp index 10370dd8dbe..092500de6d4 100644 --- a/src/plugins/ios/iosrunconfiguration.cpp +++ b/src/plugins/ios/iosrunconfiguration.cpp @@ -108,10 +108,19 @@ IosRunConfiguration::IosRunConfiguration(Target *target, Core::Id id) void IosRunConfiguration::deviceChanges() { + updateDeviceType(); updateDisplayNames(); updateEnabledState(); } +void IosRunConfiguration::updateDeviceType() +{ + if (DeviceTypeKitInformation::deviceTypeId(target()->kit()) == Constants::IOS_DEVICE_TYPE) + m_deviceType = IosDeviceType(IosDeviceType::IosDevice); + else if (m_deviceType.type == IosDeviceType::IosDevice) + m_deviceType = IosDeviceType(IosDeviceType::SimulatedDevice); +} + QWidget *IosRunConfiguration::createConfigurationWidget() { return new IosRunConfigurationWidget(this); @@ -119,10 +128,6 @@ QWidget *IosRunConfiguration::createConfigurationWidget() void IosRunConfiguration::updateDisplayNames() { - if (DeviceTypeKitInformation::deviceTypeId(target()->kit()) == Constants::IOS_DEVICE_TYPE) - m_deviceType = IosDeviceType(IosDeviceType::IosDevice); - else if (m_deviceType.type == IosDeviceType::IosDevice) - m_deviceType = IosDeviceType(IosDeviceType::SimulatedDevice); IDevice::ConstPtr dev = DeviceKitInformation::device(target()->kit()); const QString devName = dev.isNull() ? IosDevice::name() : dev->displayName(); setDefaultDisplayName(tr("Run on %1").arg(devName)); @@ -235,10 +240,7 @@ bool IosRunConfiguration::fromMap(const QVariantMap &map) bool deviceTypeIsInt; map.value(deviceTypeKey).toInt(&deviceTypeIsInt); if (deviceTypeIsInt || !m_deviceType.fromMap(map.value(deviceTypeKey).toMap())) { - if (DeviceTypeKitInformation::deviceTypeId(target()->kit()) == Constants::IOS_DEVICE_TYPE) - m_deviceType = IosDeviceType(IosDeviceType::IosDevice); - else - m_deviceType = IosDeviceType(IosDeviceType::SimulatedDevice); + updateDeviceType(); } updateDisplayNames(); @@ -332,6 +334,12 @@ void IosRunConfiguration::setDeviceType(const IosDeviceType &deviceType) m_deviceType = deviceType; } +void IosRunConfiguration::doAdditionalSetup(const RunConfigurationCreationInfo &) +{ + updateDeviceType(); + updateDisplayNames(); +} + IosRunConfigurationWidget::IosRunConfigurationWidget(IosRunConfiguration *runConfiguration) : m_runConfiguration(runConfiguration) { diff --git a/src/plugins/ios/iosrunconfiguration.h b/src/plugins/ios/iosrunconfiguration.h index 6bb07db6d2b..817ed7db5f0 100644 --- a/src/plugins/ios/iosrunconfiguration.h +++ b/src/plugins/ios/iosrunconfiguration.h @@ -57,6 +57,7 @@ public: IosDeviceType deviceType() const; void setDeviceType(const IosDeviceType &deviceType); + void doAdditionalSetup(const ProjectExplorer::RunConfigurationCreationInfo &) override; bool fromMap(const QVariantMap &map) override; QVariantMap toMap() const override; @@ -66,6 +67,7 @@ signals: private: void deviceChanges(); friend class IosRunConfigurationWidget; + void updateDeviceType(); void updateDisplayNames(); void updateEnabledState() final; bool canRunForNode(const ProjectExplorer::Node *node) const final;