diff --git a/dist/changes-4.11.2.md b/dist/changes-4.11.2.md new file mode 100644 index 00000000000..0e0ba506a42 --- /dev/null +++ b/dist/changes-4.11.2.md @@ -0,0 +1,54 @@ +Qt Creator 4.11.2 +================= + +Qt Creator version 4.11.2 contains bug fixes. + +The most important changes are listed in this document. For a complete +list of changes, see the Git log for the Qt Creator sources that +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.1..v4.11.2 + +Editing +------- + +* Improved performance of highlighting (QTCREATORBUG-23281) +* Fixed that `Rewrap Paragraph` split on non-breaking space (QTCREATORBUG-23643) +* Fixed freeze with block selection (QTCREATORBUG-23622) +* Fixed high CPU usage after scrolling horizontally (QTCREATORBUG-23647) +* Fixed scroll position after splitting if text cursor is not visible +* Fixed position of markers in scrollbar for long documents (QTCREATORBUG-23660) + +### Python + +* Fixed warnings in files generated by Python file wizard + +### Language Client + +* Fixed issue with server restart after server crash (QTCREATORBUG-23648) + +Projects +-------- + +* Fixed wrong default project for adding files via wizards (QTCREATORBUG-23603) + +Platforms +--------- + +### macOS + +* Fixed issues with notarization of binary package + +Credits for these changes go to: +-------------------------------- + +André Pönitz +Andy Shaw +Christian Kandeler +David Schulz +Eike Ziller +Leena Miettinen +Orgad Shaneh +Richard Weickelt +Tobias Hunger diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py index 4d2e9680cce..bcaf8ed314c 100644 --- a/share/qtcreator/debugger/gdbbridge.py +++ b/share/qtcreator/debugger/gdbbridge.py @@ -744,6 +744,8 @@ class Dumper(DumperBase): return None def callHelper(self, rettype, value, function, args): + if self.isWindowsTarget(): + raise Exception("gdb crashes when calling functions on Windows") # args is a tuple. arg = '' for i in range(len(args)): diff --git a/share/qtcreator/debugger/qttypes.py b/share/qtcreator/debugger/qttypes.py index f28abcd8edb..8a33e3306e7 100644 --- a/share/qtcreator/debugger/qttypes.py +++ b/share/qtcreator/debugger/qttypes.py @@ -494,7 +494,10 @@ def qdump__QDir(d, value): with Children(d): if not d.isMsvcTarget(): ns = d.qtNamespace() - d.call('int', value, 'count') # Fill cache. + try: + d.call('int', value, 'count') # Fill cache. + except: + pass #d.putCallItem('absolutePath', '@QString', value, 'absolutePath') #d.putCallItem('canonicalPath', '@QString', value, 'canonicalPath') with SubItem(d, 'absolutePath'): @@ -1083,9 +1086,6 @@ qqLocalesCount = None def qdump__QLocale(d, value): - if d.isMsvcTarget(): # as long as this dumper relies on calling functions skip it for cdb - return - # Check for uninitialized 'index' variable. Retrieve size of # QLocale data array from variable in qlocale.cpp. # Default is 368 in Qt 4.8, 438 in Qt 5.0.1, the last one @@ -1119,7 +1119,10 @@ def qdump__QLocale(d, value): = d.split('2s{short}2s' + '{QChar}{QChar}{short}{QChar}{QChar}' + '{QChar}{QChar}{QChar}', data) - d.putStringValue(d.call('const char *', value, 'name')) + try: + d.putStringValue(d.call('const char *', value, 'name')) + except: + pass d.putNumChild(1) if d.isExpanded(): with Children(d): diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/CameraFrustum.qml b/share/qtcreator/qml/qmlpuppet/mockfiles/CameraFrustum.qml index f038b9b74d3..0ba02e362b9 100644 --- a/share/qtcreator/qml/qmlpuppet/mockfiles/CameraFrustum.qml +++ b/share/qtcreator/qml/qmlpuppet/mockfiles/CameraFrustum.qml @@ -50,7 +50,7 @@ Model { id: defaultMaterial emissiveColor: cameraFrustum.selected ? "#FF0000" : "#555555" lighting: DefaultMaterial.NoLighting - cullingMode: Material.DisableCulling + cullMode: Material.NoCulling } ] diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/EditView3D.qml b/share/qtcreator/qml/qmlpuppet/mockfiles/EditView3D.qml index 4710f3b87bc..8fab6ff0e42 100644 --- a/share/qtcreator/qml/qmlpuppet/mockfiles/EditView3D.qml +++ b/share/qtcreator/qml/qmlpuppet/mockfiles/EditView3D.qml @@ -65,15 +65,8 @@ Item { onGlobalOrientationChanged: _generalHelper.storeToolState(sceneId, "globalOrientation", globalOrientation) onActiveSceneChanged: updateActiveScene() - function updateActiveScene() + function createEditView() { - if (editView) { - // Destroy is async, so make sure we don't get any more updates for the old editView - _generalHelper.enableItemUpdate(editView, false); - editView.destroy(); - } - - // importScene cannot be updated after initial set, so we need to reconstruct entire View3D var component = Qt.createComponent("SceneView3D.qml"); if (component.status === Component.Ready) { editView = component.createObject(viewRect, @@ -87,7 +80,21 @@ Item { editView.cameraZoomFactor = Qt.binding(function() {return cameraControl._zoomFactor;}); selectionBoxes.length = 0; + return true; + } + return false; + } + function updateActiveScene() + { + if (editView) { + // Destroy is async, so make sure we don't get any more updates for the old editView + _generalHelper.enableItemUpdate(editView, false); + editView.destroy(); + } + + // importScene cannot be updated after initial set, so we need to reconstruct entire View3D + if (createEditView()) { if (activeScene) { var toolStates = _generalHelper.getToolStates(sceneId); if (Object.keys(toolStates).length > 0) @@ -381,10 +388,11 @@ Item { } } - // Work-around the fact that the projection matrix for the camera is not calculated until - // the first frame is rendered, so any initial calls to mapFrom3DScene() will fail. Component.onCompleted: { + createEditView(); selectObjects([]); + // Work-around the fact that the projection matrix for the camera is not calculated until + // the first frame is rendered, so any initial calls to mapFrom3DScene() will fail. _generalHelper.requestOverlayUpdate(); } @@ -396,10 +404,10 @@ Item { PerspectiveCamera { id: overlayPerspectiveCamera - clipFar: viewRoot.editView ? viewRoot.editView.perpectiveCamera.clipFar : 1000 - clipNear: viewRoot.editView ? viewRoot.editView.perpectiveCamera.clipNear : 1 - position: viewRoot.editView ? viewRoot.editView.perpectiveCamera.position : Qt.vector3d(0, 0, 0) - rotation: viewRoot.editView ? viewRoot.editView.perpectiveCamera.rotation : Qt.quaternion(1, 0, 0, 0) + clipFar: viewRoot.editView ? viewRoot.editView.perspectiveCamera.clipFar : 1000 + clipNear: viewRoot.editView ? viewRoot.editView.perspectiveCamera.clipNear : 1 + position: viewRoot.editView ? viewRoot.editView.perspectiveCamera.position : Qt.vector3d(0, 0, 0) + rotation: viewRoot.editView ? viewRoot.editView.perspectiveCamera.rotation : Qt.quaternion(1, 0, 0, 0) } OrthographicCamera { @@ -495,7 +503,7 @@ Item { DefaultMaterial { id: lineMat lighting: DefaultMaterial.NoLighting - cullingMode: Material.DisableCulling + cullMode: Material.NoCulling emissiveColor: pivotLine.color } ] @@ -538,7 +546,7 @@ Item { View3D { id: overlayView anchors.fill: parent - camera: usePerspective ? overlayPerspectiveCamera : overlayOrthoCamera + camera: viewRoot.usePerspective ? overlayPerspectiveCamera : overlayOrthoCamera importScene: overlayScene z: 2 } diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/HelperGrid.qml b/share/qtcreator/qml/qmlpuppet/mockfiles/HelperGrid.qml index 38ea65034b6..70e6e82ee32 100644 --- a/share/qtcreator/qml/qmlpuppet/mockfiles/HelperGrid.qml +++ b/share/qtcreator/qml/qmlpuppet/mockfiles/HelperGrid.qml @@ -49,7 +49,7 @@ Node { id: mainGridMaterial emissiveColor: "#aaaaaa" lighting: DefaultMaterial.NoLighting - cullingMode: Material.DisableCulling + cullMode: Material.NoCulling } ] } @@ -67,7 +67,7 @@ Node { id: subGridMaterial emissiveColor: mainGridMaterial.emissiveColor lighting: DefaultMaterial.NoLighting - cullingMode: Material.DisableCulling + cullMode: Material.NoCulling } ] } @@ -84,7 +84,7 @@ Node { id: vCenterLineMaterial emissiveColor: "#00a1d2" lighting: DefaultMaterial.NoLighting - cullingMode: Material.DisableCulling + cullMode: Material.NoCulling } ] } @@ -101,7 +101,7 @@ Node { id: hCenterLineMaterial emissiveColor: "#cb211a" lighting: DefaultMaterial.NoLighting - cullingMode: Material.DisableCulling + cullMode: Material.NoCulling } ] } diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/Line3D.qml b/share/qtcreator/qml/qmlpuppet/mockfiles/Line3D.qml index b4b911a51de..79718d042f2 100644 --- a/share/qtcreator/qml/qmlpuppet/mockfiles/Line3D.qml +++ b/share/qtcreator/qml/qmlpuppet/mockfiles/Line3D.qml @@ -43,7 +43,7 @@ Node { DefaultMaterial { id: lineMat lighting: DefaultMaterial.NoLighting - cullingMode: Material.DisableCulling + cullMode: Material.NoCulling } ] } diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/PlanarDraggable.qml b/share/qtcreator/qml/qmlpuppet/mockfiles/PlanarDraggable.qml index 6dce8e52086..9015a127d95 100644 --- a/share/qtcreator/qml/qmlpuppet/mockfiles/PlanarDraggable.qml +++ b/share/qtcreator/qml/qmlpuppet/mockfiles/PlanarDraggable.qml @@ -54,7 +54,7 @@ Model { id: gizmoMaterial emissiveColor: "white" lighting: DefaultMaterial.NoLighting - cullingMode: Material.DisableCulling + cullMode: Material.NoCulling } materials: gizmoMaterial diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/SceneView3D.qml b/share/qtcreator/qml/qmlpuppet/mockfiles/SceneView3D.qml index e44e9d95128..72608d20b8f 100644 --- a/share/qtcreator/qml/qmlpuppet/mockfiles/SceneView3D.qml +++ b/share/qtcreator/qml/qmlpuppet/mockfiles/SceneView3D.qml @@ -33,7 +33,7 @@ View3D { property bool usePerspective: false property bool showSceneLight: false property alias sceneHelpers: sceneHelpers - property alias perpectiveCamera: scenePerspectiveCamera + property alias perspectiveCamera: scenePerspectiveCamera property alias orthoCamera: sceneOrthoCamera property double cameraZoomFactor: .55; diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/SelectionBox.qml b/share/qtcreator/qml/qmlpuppet/mockfiles/SelectionBox.qml index 256cefa97b3..739c7a6d34b 100644 --- a/share/qtcreator/qml/qmlpuppet/mockfiles/SelectionBox.qml +++ b/share/qtcreator/qml/qmlpuppet/mockfiles/SelectionBox.qml @@ -58,7 +58,7 @@ Node { DefaultMaterial { emissiveColor: "#fff600" lighting: DefaultMaterial.NoLighting - cullingMode: Material.DisableCulling + cullMode: Material.NoCulling } ] } diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp index eaea9911dbf..83fd85202af 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp @@ -818,6 +818,14 @@ void Qt5InformationNodeInstanceServer::setup3DEditView(const QListm_modeChangeState = value; + } + + bool DockManager::isModeChangeState() const + { + return d->m_modeChangeState; + } + bool DockManager::write(const QString &workspace, const QByteArray &data, QString *errorString) const { Utils::FilePath filename = workspaceNameToFileName(workspace); @@ -895,7 +909,13 @@ namespace ADS // Copy all missing workspace presets over to the local workspace folder QDir presetsDir(d->m_workspacePresetsPath); - QDir workspaceDir(QFileInfo(d->m_settings->fileName()).path() + QLatin1String("/workspaces")); + QDir workspaceDir(QFileInfo(d->m_settings->fileName()).path() + QLatin1Char('/') + m_dirName); + // Try do create the 'workspaces' directory if it doesn't exist already + workspaceDir.mkpath(workspaceDir.absolutePath()); + if (!workspaceDir.exists()) { + qCInfo(adsLog) << QString("Could not make directory '%1')").arg(workspaceDir.absolutePath()); + return; + } for (const auto &preset : presets) { QString filename = preset; @@ -906,7 +926,10 @@ namespace ADS QFile file(filePath); if (file.exists()) { - file.copy(workspaceDir.filePath(filename)); + if (!file.copy(workspaceDir.filePath(filename))) { + qCInfo(adsLog) << QString("Could not copy '%1' to '%2' error: %3").arg( + filePath, workspaceDir.filePath(filename), file.errorString()); + } d->m_workspaceListDirty = true; } } diff --git a/src/libs/advanceddockingsystem/dockmanager.h b/src/libs/advanceddockingsystem/dockmanager.h index e52646437f9..506335714e0 100644 --- a/src/libs/advanceddockingsystem/dockmanager.h +++ b/src/libs/advanceddockingsystem/dockmanager.h @@ -151,8 +151,8 @@ public: using Super = DockContainerWidget; /** - * These global configuration flags configure some global dock manager - * settings. + * These global configuration flags configure some global dock manager settings. + * Set the dock manager flags, before you create the dock manager instance. */ enum eConfigFlag { ActiveTabHasCloseButton @@ -238,12 +238,14 @@ public: /** * Sets the global configuration flags for the whole docking system. - * Call this function before you create your first dock widget. + * Call this function before you create the dock manager and before + * your create the first dock widget. */ static void setConfigFlags(const ConfigFlags flags); /** * Set a certain config flag + * \see setConfigFlags() */ static void setConfigFlag(eConfigFlag flag, bool on = true); @@ -473,6 +475,9 @@ public: bool isWorkspacePreset(const QString &workspace) const; + void setModeChangeState(bool value); + bool isModeChangeState() const; + signals: void aboutToUnloadWorkspace(QString workspaceName); void aboutToLoadWorkspace(QString workspaceName); diff --git a/src/libs/advanceddockingsystem/floatingdragpreview.cpp b/src/libs/advanceddockingsystem/floatingdragpreview.cpp index 33e0a5ac346..5732ae408e3 100644 --- a/src/libs/advanceddockingsystem/floatingdragpreview.cpp +++ b/src/libs/advanceddockingsystem/floatingdragpreview.cpp @@ -68,6 +68,7 @@ namespace ADS DockContainerWidget *m_dropContainer = nullptr; bool m_hidden = false; QPixmap m_contentPreviewPixmap; + bool m_canceled = false; /** * Private data constructor @@ -86,6 +87,7 @@ namespace ADS */ void cancelDragging() { + m_canceled = true; emit q->draggingCanceled(); m_dockManager->containerOverlay()->hideOverlay(); m_dockManager->dockAreaOverlay()->hideOverlay(); @@ -149,6 +151,12 @@ namespace ADS } } else { dockAreaOverlay->hideOverlay(); + // If there is only one single visible dock area in a container, then + // it does not make sense to show a dock overlay because the dock area + // would be removed and inserted at the same position + if (visibleDockAreas <= 1) + containerOverlay->hide(); + if (dockArea == m_contentSourceArea && InvalidDockWidgetArea == containerDropArea) m_dropContainer = nullptr; } @@ -195,9 +203,9 @@ namespace ADS &QApplication::applicationStateChanged, this, &FloatingDragPreview::onApplicationStateChanged); - // The focused object will receive key press events and therefore we install - // the event filter on it to receive escape key press for drag canceling - QApplication::focusObject()->installEventFilter(this); + // The only safe way to receive escape key presses is to install an event + // filter for the application object + QApplication::instance()->installEventFilter(this); } FloatingDragPreview::FloatingDragPreview(DockWidget *content) @@ -329,7 +337,7 @@ namespace ADS bool FloatingDragPreview::eventFilter(QObject *watched, QEvent *event) { - if (event->type() == QEvent::KeyPress) { + if (!d->m_canceled && event->type() == QEvent::KeyPress) { QKeyEvent *keyEvent = static_cast(event); if (keyEvent->key() == Qt::Key_Escape) { watched->removeEventFilter(this); diff --git a/src/libs/advanceddockingsystem/workspacemodel.cpp b/src/libs/advanceddockingsystem/workspacemodel.cpp index 08d12966734..04ff7b4c757 100644 --- a/src/libs/advanceddockingsystem/workspacemodel.cpp +++ b/src/libs/advanceddockingsystem/workspacemodel.cpp @@ -166,7 +166,14 @@ QHash WorkspaceModel::roleNames() const {PresetWorkspaceRole, "presetWorkspace"}, {LastWorkspaceRole, "activeWorkspace"}, {ActiveWorkspaceRole, "lastWorkspace"}}; + +#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) + auto defaultRoles = QAbstractTableModel::roleNames(); + defaultRoles.insert(extraRoles); + return defaultRoles; +#else return QAbstractTableModel::roleNames().unite(extraRoles); +#endif } void WorkspaceModel::sort(int column, Qt::SortOrder order) diff --git a/src/plugins/autotest/boost/boosttesttreeitem.cpp b/src/plugins/autotest/boost/boosttesttreeitem.cpp index f82ff942bba..995331f625a 100644 --- a/src/plugins/autotest/boost/boosttesttreeitem.cpp +++ b/src/plugins/autotest/boost/boosttesttreeitem.cpp @@ -337,6 +337,9 @@ bool BoostTestTreeItem::enabled() const if (m_state & Disabled) return false; + if (type() == Root) + return true; + const TestTreeItem *parent = parentItem(); if (parent && parent->type() == TestSuite) // take test suites into account return static_cast(parent)->enabled(); diff --git a/src/plugins/coreplugin/dialogs/newdialog.cpp b/src/plugins/coreplugin/dialogs/newdialog.cpp index 8cb8f1770e8..eed2fd91e21 100644 --- a/src/plugins/coreplugin/dialogs/newdialog.cpp +++ b/src/plugins/coreplugin/dialogs/newdialog.cpp @@ -198,7 +198,7 @@ NewDialog::NewDialog(QWidget *parent) : m_ui->templateCategoryView->setModel(m_filterProxyModel); m_ui->templateCategoryView->setEditTriggers(QAbstractItemView::NoEditTriggers); - m_ui->templateCategoryView->setItemDelegate(new FancyTopLevelDelegate); + m_ui->templateCategoryView->setItemDelegate(new FancyTopLevelDelegate(this)); m_ui->templatesView->setModel(m_filterProxyModel); m_ui->templatesView->setIconSize(QSize(ICON_SIZE, ICON_SIZE)); diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp index aa60cf34570..b55b885615d 100644 --- a/src/plugins/coreplugin/manhattanstyle.cpp +++ b/src/plugins/coreplugin/manhattanstyle.cpp @@ -857,7 +857,11 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt } } break; - + case CE_ToolButtonLabel: + // Directly use QCommonStyle to circumvent funny painting in QMacStyle + // which ignores the palette and adds an alpha + QCommonStyle::drawControl(element, option, painter, widget); + break; default: QProxyStyle::drawControl(element, option, painter, widget); break; diff --git a/src/plugins/cpptools/compileroptionsbuilder.cpp b/src/plugins/cpptools/compileroptionsbuilder.cpp index fcce3d6cc5c..e559a8400cf 100644 --- a/src/plugins/cpptools/compileroptionsbuilder.cpp +++ b/src/plugins/cpptools/compileroptionsbuilder.cpp @@ -341,19 +341,17 @@ void CompilerOptionsBuilder::addHeaderPathOptions() void CompilerOptionsBuilder::addPrecompiledHeaderOptions(UsePrecompiledHeaders usePrecompiledHeaders) { for (const QString &pchFile : m_projectPart.precompiledHeaders) { - // Bail if build system precomiple header artifacts exists + // Bail if build system precompiled header artifacts exists. // Clang cannot handle foreign PCH files. - if (QFile::exists(pchFile + ".gch") || QFile::exists(pchFile + ".pch")) { + if (QFile::exists(pchFile + ".gch") || QFile::exists(pchFile + ".pch")) usePrecompiledHeaders = UsePrecompiledHeaders::No; - // In case of Clang compilers, remove the pch-inclusion arguments - remove({"-Xclang", "-include-pch", "-Xclang", pchFile + ".gch"}); - remove({"-Xclang", "-include-pch", "-Xclang", pchFile + ".pch"}); - } - if (usePrecompiledHeaders == UsePrecompiledHeaders::No) { // CMake PCH will already have force included the header file in // command line options, remove it if exists. + // In case of Clang compilers, also remove the pch-inclusion arguments. + remove({"-Xclang", "-include-pch", "-Xclang", pchFile + ".gch"}); + remove({"-Xclang", "-include-pch", "-Xclang", pchFile + ".pch"}); remove({isClStyle() ? QLatin1String(includeFileOptionCl) : QLatin1String(includeFileOptionGcc), pchFile}); } else if (QFile::exists(pchFile)) { diff --git a/src/plugins/debugger/disassembleragent.cpp b/src/plugins/debugger/disassembleragent.cpp index 0c41c1475d5..97e08b47fe7 100644 --- a/src/plugins/debugger/disassembleragent.cpp +++ b/src/plugins/debugger/disassembleragent.cpp @@ -238,8 +238,8 @@ void DisassemblerAgent::setLocation(const Location &loc) // Refresh when not displaying a function and there is not sufficient // context left past the address. if (d->cache.at(index).first.endAddress - loc.address() < 24) { - index = -1; d->cache.removeAt(index); + index = -1; } } if (index != -1) { diff --git a/src/plugins/mcusupport/mcusupportoptions.cpp b/src/plugins/mcusupport/mcusupportoptions.cpp index d13e2e018d8..a9839965416 100644 --- a/src/plugins/mcusupport/mcusupportoptions.cpp +++ b/src/plugins/mcusupport/mcusupportoptions.cpp @@ -462,11 +462,10 @@ McuSupportOptions::McuSupportOptions(QObject *parent) McuPackage* seggerJLinkPackage = createSeggerJLinkPackage(); QVector stmEvalPackages = { - armGccPackage, stm32CubeProgrammerPackage, qtForMCUsSdkPackage}; + armGccPackage, stm32CubeProgrammerPackage}; QVector nxpEvalPackages = { - armGccPackage, seggerJLinkPackage, qtForMCUsSdkPackage}; - QVector desktopPackages = { - qtForMCUsSdkPackage}; + armGccPackage, seggerJLinkPackage}; + QVector desktopPackages = {}; packages = { armGccPackage, stm32CubeFwF7SdkPackage, stm32CubeProgrammerPackage, evkbImxrt1050SdkPackage, seggerJLinkPackage, qtForMCUsSdkPackage}; @@ -564,13 +563,20 @@ static void setKitDevice(ProjectExplorer::Kit *k) ProjectExplorer::DeviceTypeKitAspect::setDeviceTypeId(k, Constants::DEVICE_TYPE); } -static void setKitEnvironment(ProjectExplorer::Kit *k, const McuTarget* mcuTarget) +static void setKitEnvironment(ProjectExplorer::Kit *k, const McuTarget* mcuTarget, + McuPackage *qtForMCUsSdkPackage) { using namespace ProjectExplorer; Utils::EnvironmentItems changes; QStringList pathAdditions; - for (auto package : mcuTarget->packages()) { + + QVector packagesIncludingSdk; + packagesIncludingSdk.reserve(mcuTarget->packages().size() + 1); + packagesIncludingSdk.append(mcuTarget->packages()); + packagesIncludingSdk.append(qtForMCUsSdkPackage); + + for (auto package : packagesIncludingSdk) { if (package->addToPath()) pathAdditions.append(QDir::toNativeSeparators(package->path())); if (!package->environmentVariableName().isEmpty()) @@ -646,7 +652,7 @@ ProjectExplorer::Kit *McuSupportOptions::newKit(const McuTarget *mcuTarget) setKitDebugger(k, mcuTarget->toolChainPackage()); setKitDevice(k); } - setKitEnvironment(k, mcuTarget); + setKitEnvironment(k, mcuTarget, qtForMCUsSdkPackage); setKitCMakeOptions(k, mcuTarget, qtForMCUsSdkPackage->path()); k->setup(); diff --git a/src/plugins/mcusupport/mcusupportoptionspage.cpp b/src/plugins/mcusupport/mcusupportoptionspage.cpp index 5d72fd819df..a991af60ece 100644 --- a/src/plugins/mcusupport/mcusupportoptionspage.cpp +++ b/src/plugins/mcusupport/mcusupportoptionspage.cpp @@ -48,11 +48,6 @@ namespace McuSupport { namespace Internal { -static bool cMakeAvailable() -{ - return !CMakeProjectManager::CMakeToolManager::cmakeTools().isEmpty(); -} - class McuSupportOptionsWidget : public Core::IOptionsPageWidget { Q_DECLARE_TR_FUNCTIONS(McuSupport::Internal::McuSupportOptionsWidget) @@ -74,48 +69,77 @@ private: QMap m_packageWidgets; QMap m_mcuTargetPacketWidgets; QFormLayout *m_packagesLayout = nullptr; - Utils::InfoLabel *m_infoLabel = nullptr; - QComboBox *m_mcuTargetComboBox = nullptr; + QGroupBox *m_qtForMCUsSdkGroupBox = nullptr; + QGroupBox *m_packagesGroupBox = nullptr; + QGroupBox *m_mcuTargetsGroupBox = nullptr; + QComboBox *m_mcuTargetsComboBox = nullptr; + QGroupBox *m_kitCreationGroupBox = nullptr; + Utils::InfoLabel *m_kitCreationInfoLabel = nullptr; + Utils::InfoLabel *m_statusInfoLabel = nullptr; }; McuSupportOptionsWidget::McuSupportOptionsWidget() { auto mainLayout = new QVBoxLayout(this); - auto mcuTargetChooserlayout = new QHBoxLayout; - auto mcuTargetChooserLabel = new QLabel(tr("Target:")); - mcuTargetChooserlayout->addWidget(mcuTargetChooserLabel); - m_mcuTargetComboBox = new QComboBox; - mcuTargetChooserLabel->setBuddy(m_mcuTargetComboBox); - mcuTargetChooserLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); - m_mcuTargetComboBox->addItems( - Utils::transform(m_options.mcuTargets, [this](McuTarget *t){ - return m_options.kitName(t); - })); - mcuTargetChooserlayout->addWidget(m_mcuTargetComboBox); - mainLayout->addLayout(mcuTargetChooserlayout); + { + m_statusInfoLabel = new Utils::InfoLabel; + m_statusInfoLabel->setElideMode(Qt::ElideNone); + m_statusInfoLabel->setOpenExternalLinks(false); + mainLayout->addWidget(m_statusInfoLabel); + connect(m_statusInfoLabel, &QLabel::linkActivated, this, []{ + Core::ICore::showOptionsDialog( + CMakeProjectManager::Constants::CMAKE_SETTINGSPAGE_ID, + Core::ICore::mainWindow()); + }); + } - auto m_packagesGroupBox = new QGroupBox(tr("Packages")); - mainLayout->addWidget(m_packagesGroupBox); - m_packagesLayout = new QFormLayout; - m_packagesGroupBox->setLayout(m_packagesLayout); + { + m_qtForMCUsSdkGroupBox = new QGroupBox(m_options.qtForMCUsSdkPackage->label()); + m_qtForMCUsSdkGroupBox->setFlat(true); + auto layout = new QVBoxLayout(m_qtForMCUsSdkGroupBox); + layout->addWidget(m_options.qtForMCUsSdkPackage->widget()); + mainLayout->addWidget(m_qtForMCUsSdkGroupBox); + } + + { + m_mcuTargetsGroupBox = new QGroupBox(tr("Targets supported by the %1") + .arg(m_qtForMCUsSdkGroupBox->title())); + m_mcuTargetsGroupBox->setFlat(true); + mainLayout->addWidget(m_mcuTargetsGroupBox); + m_mcuTargetsComboBox = new QComboBox; + m_mcuTargetsComboBox->addItems( + Utils::transform(m_options.mcuTargets, [this](McuTarget *t){ + return m_options.kitName(t); + })); + auto layout = new QVBoxLayout(m_mcuTargetsGroupBox); + layout->addWidget(m_mcuTargetsComboBox); + connect(m_mcuTargetsComboBox, &QComboBox::currentTextChanged, + this, &McuSupportOptionsWidget::showMcuTargetPackages); + } + + { + m_packagesGroupBox = new QGroupBox(tr("Requirements")); + m_packagesGroupBox->setFlat(true); + mainLayout->addWidget(m_packagesGroupBox); + m_packagesLayout = new QFormLayout; + m_packagesGroupBox->setLayout(m_packagesLayout); + } + + { + m_kitCreationGroupBox = new QGroupBox(tr("Create a Kit")); + m_kitCreationGroupBox->setFlat(true); + mainLayout->addWidget(m_kitCreationGroupBox); + m_kitCreationInfoLabel = new Utils::InfoLabel; + m_kitCreationInfoLabel->setElideMode(Qt::ElideNone); + m_kitCreationInfoLabel->setWordWrap(true); + auto layout = new QVBoxLayout(m_kitCreationGroupBox); + layout->addWidget(m_kitCreationInfoLabel); + } mainLayout->addStretch(); - m_infoLabel = new Utils::InfoLabel; - m_infoLabel->setOpenExternalLinks(false); - m_infoLabel->setElideMode(Qt::ElideNone); - m_infoLabel->setWordWrap(true); - mainLayout->addWidget(m_infoLabel); - connect(&m_options, &McuSupportOptions::changed, this, &McuSupportOptionsWidget::updateStatus); - connect(m_mcuTargetComboBox, &QComboBox::currentTextChanged, - this, &McuSupportOptionsWidget::showMcuTargetPackages); - connect(m_infoLabel, &QLabel::linkActivated, this, []{ - Core::ICore::showOptionsDialog( - CMakeProjectManager::Constants::CMAKE_SETTINGSPAGE_ID, - Core::ICore::mainWindow()); - }); showMcuTargetPackages(); } @@ -126,21 +150,41 @@ void McuSupportOptionsWidget::updateStatus() if (!mcuTarget) return; - m_infoLabel->setType(cMakeAvailable() && mcuTarget->isValid() - ? Utils::InfoLabel::Ok : Utils::InfoLabel::NotOk); + const bool cMakeAvailable = !CMakeProjectManager::CMakeToolManager::cmakeTools().isEmpty(); - QStringList errorStrings; - if (!mcuTarget->isValid()) - errorStrings << "Provide the package paths in order to create a kit for your target."; - if (!cMakeAvailable()) - errorStrings << "No CMake tool was detected. Add a CMake tool in the " - "CMake options and press Apply."; + // Page elements + { + m_qtForMCUsSdkGroupBox->setVisible(cMakeAvailable); + const bool ready = cMakeAvailable && + m_options.qtForMCUsSdkPackage->status() == McuPackage::ValidPackage; + m_mcuTargetsGroupBox->setVisible(ready); + m_packagesGroupBox->setVisible(ready && !mcuTarget->packages().isEmpty()); + m_kitCreationGroupBox->setVisible(ready); + } - m_infoLabel->setText(errorStrings.isEmpty() - ? QString::fromLatin1("A kit %1 for the selected target can be generated. " - "Press Apply to generate it.").arg(m_options.kitName( - mcuTarget)) - : errorStrings.join("
")); + // Kit creation status + { + const bool mcuTargetValid = mcuTarget->isValid(); + m_kitCreationInfoLabel->setType(mcuTargetValid ? Utils::InfoLabel::Ok + : Utils::InfoLabel::NotOk); + m_kitCreationInfoLabel->setText( + mcuTargetValid ? QString::fromLatin1( + "A kit %1 for the selected target can be " + "generated. Press Apply to generate it.") + .arg(m_options.kitName(mcuTarget)) + : "Provide the package paths in order to create a kit " + "for your target."); + } + + // Status label in the bottom + { + m_statusInfoLabel->setVisible(!cMakeAvailable); + if (m_statusInfoLabel->isVisible()) { + m_statusInfoLabel->setType(Utils::InfoLabel::NotOk); + m_statusInfoLabel->setText("No CMake tool was detected. Add a CMake tool in the " + "CMake options and press Apply."); + } + } } void McuSupportOptionsWidget::showMcuTargetPackages() @@ -168,7 +212,7 @@ void McuSupportOptionsWidget::showMcuTargetPackages() McuTarget *McuSupportOptionsWidget::currentMcuTarget() const { - const int mcuTargetIndex = m_mcuTargetComboBox->currentIndex(); + const int mcuTargetIndex = m_mcuTargetsComboBox->currentIndex(); return m_options.mcuTargets.isEmpty() ? nullptr : m_options.mcuTargets.at(mcuTargetIndex); } @@ -185,7 +229,7 @@ void McuSupportOptionsWidget::apply() QTC_ASSERT(m_options.qtForMCUsSdkPackage, return); - if (!isVisible() || !cMakeAvailable()) + if (!isVisible()) return; const McuTarget *mcuTarget = currentMcuTarget(); diff --git a/src/plugins/projectexplorer/jsonwizard/jsonsummarypage.cpp b/src/plugins/projectexplorer/jsonwizard/jsonsummarypage.cpp index e750dd59ea5..ab99fa4de97 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonsummarypage.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonsummarypage.cpp @@ -49,6 +49,7 @@ static char KEY_SELECTED_PROJECT[] = "SelectedProject"; static char KEY_SELECTED_NODE[] = "SelectedFolderNode"; static char KEY_IS_SUBPROJECT[] = "IsSubproject"; static char KEY_VERSIONCONTROL[] = "VersionControl"; +static char KEY_QT_KEYWORDS_ENABLED[] = "QtKeywordsEnabled"; namespace ProjectExplorer { @@ -105,6 +106,7 @@ void JsonSummaryPage::initializePage() m_wizard->setValue(QLatin1String(KEY_SELECTED_NODE), QVariant()); m_wizard->setValue(QLatin1String(KEY_IS_SUBPROJECT), false); m_wizard->setValue(QLatin1String(KEY_VERSIONCONTROL), QString()); + m_wizard->setValue(QLatin1String(KEY_QT_KEYWORDS_ENABLED), false); connect(m_wizard, &JsonWizard::filesReady, this, &JsonSummaryPage::triggerCommit); connect(m_wizard, &JsonWizard::filesReady, this, &JsonSummaryPage::addToProject); @@ -270,7 +272,7 @@ void JsonSummaryPage::updateProjectData(FolderNode *node) projectNode = projectNode->parentProjectNode(); } } - m_wizard->setValue("QtKeywordsEnabled", qtKeyWordsEnabled); + m_wizard->setValue(QLatin1String(KEY_QT_KEYWORDS_ENABLED), qtKeyWordsEnabled); updateFileList(); } diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp index eb841cbc672..5103f04bef6 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.cpp +++ b/src/plugins/qbsprojectmanager/qbsproject.cpp @@ -886,7 +886,9 @@ static RawProjectParts generateProjectParts( rpp.setFlagsForC({cToolChain.get(), cFlags}); rpp.setFlagsForCxx({cxxToolChain.get(), cxxFlags}); - rpp.setMacros(transform(arrayToStringList(props.value("cpp.defines")), + const QStringList defines = arrayToStringList(props.value("cpp.defines")) + + arrayToStringList(props.value("cpp.platformDefines")); + rpp.setMacros(transform(defines, [](const QString &s) { return Macro::fromKeyValue(s); })); ProjectExplorer::HeaderPaths grpHeaderPaths; diff --git a/src/plugins/qbsprojectmanager/qbssession.cpp b/src/plugins/qbsprojectmanager/qbssession.cpp index 5ba4b84c5a8..14cdea8095f 100644 --- a/src/plugins/qbsprojectmanager/qbssession.cpp +++ b/src/plugins/qbsprojectmanager/qbssession.cpp @@ -392,6 +392,7 @@ void QbsSession::insertRequestedModuleProperties(QJsonObject &request) "cpp.minimumDarwinVersionCompilerFlag", "cpp.platformCommonCompilerFlags", "cpp.platformDriverFlags", + "cpp.platformDefines", "cpp.positionIndependentCode", "cpp.systemFrameworkPaths", "cpp.systemIncludePaths", diff --git a/src/plugins/qmldesigner/components/connectioneditor/connectionviewwidget.cpp b/src/plugins/qmldesigner/components/connectioneditor/connectionviewwidget.cpp index 30aaf2b0045..ae4532f1f13 100644 --- a/src/plugins/qmldesigner/components/connectioneditor/connectionviewwidget.cpp +++ b/src/plugins/qmldesigner/components/connectioneditor/connectionviewwidget.cpp @@ -85,7 +85,7 @@ ConnectionViewWidget::ConnectionViewWidget(QWidget *parent) : ui->setupUi(this); QStyle *style = QStyleFactory::create("fusion"); - setStyle(style); + ui->stackedWidget->setStyle(style); //ui->tabWidget->tabBar()->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); @@ -96,6 +96,11 @@ ConnectionViewWidget::ConnectionViewWidget(QWidget *parent) : ui->tabBar->addTab(tr("Bindings", "Title of connection view")); ui->tabBar->addTab(tr("Properties", "Title of dynamic properties view")); + const QList buttons = createToolBarWidgets(); + + for (auto toolButton : buttons) + ui->toolBar->addWidget(toolButton); + auto settings = QmlDesignerPlugin::instance()->settings(); if (!settings.value(DesignerSettingsKey::STANDALONE_MODE).toBool()) diff --git a/src/plugins/qmldesigner/components/connectioneditor/connectionviewwidget.ui b/src/plugins/qmldesigner/components/connectioneditor/connectionviewwidget.ui index 18df078ec6b..1828811abf4 100644 --- a/src/plugins/qmldesigner/components/connectioneditor/connectionviewwidget.ui +++ b/src/plugins/qmldesigner/components/connectioneditor/connectionviewwidget.ui @@ -29,6 +29,9 @@ 0 + + + @@ -51,10 +54,7 @@ - - - - + 3 @@ -255,10 +255,14 @@ + + + stackedWidget tabBar widgetSpacer + toolBar diff --git a/src/plugins/qmldesigner/components/navigator/navigatorview.cpp b/src/plugins/qmldesigner/components/navigator/navigatorview.cpp index 8da3cc9bba0..7401e5e3704 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatorview.cpp +++ b/src/plugins/qmldesigner/components/navigator/navigatorview.cpp @@ -72,57 +72,9 @@ namespace QmlDesigner { NavigatorView::NavigatorView(QObject* parent) : AbstractView(parent), - m_blockSelectionChangedSignal(false), - m_widget(new NavigatorWidget(this)), - m_treeModel(new NavigatorTreeModel(this)) + m_blockSelectionChangedSignal(false) { -#ifndef QMLDESIGNER_TEST - auto navigatorContext = new Internal::NavigatorContext(m_widget.data()); - Core::ICore::addContextObject(navigatorContext); -#endif - m_treeModel->setView(this); - m_widget->setTreeModel(m_treeModel.data()); - m_currentModelInterface = m_treeModel; - - connect(treeWidget()->selectionModel(), &QItemSelectionModel::selectionChanged, this, &NavigatorView::changeSelection); - - connect(m_widget.data(), &NavigatorWidget::leftButtonClicked, this, &NavigatorView::leftButtonClicked); - connect(m_widget.data(), &NavigatorWidget::rightButtonClicked, this, &NavigatorView::rightButtonClicked); - connect(m_widget.data(), &NavigatorWidget::downButtonClicked, this, &NavigatorView::downButtonClicked); - connect(m_widget.data(), &NavigatorWidget::upButtonClicked, this, &NavigatorView::upButtonClicked); - connect(m_widget.data(), &NavigatorWidget::filterToggled, this, &NavigatorView::filterToggled); - -#ifndef QMLDESIGNER_TEST - auto idDelegate = new NameItemDelegate(this); - IconCheckboxItemDelegate *showDelegate = - new IconCheckboxItemDelegate(this, - Utils::Icons::EYE_OPEN_TOOLBAR.icon(), - Utils::Icons::EYE_CLOSED_TOOLBAR.icon()); - - IconCheckboxItemDelegate *exportDelegate = - new IconCheckboxItemDelegate(this, - Icons::EXPORT_CHECKED.icon(), - Icons::EXPORT_UNCHECKED.icon()); - -#ifdef _LOCK_ITEMS_ - IconCheckboxItemDelegate *lockDelegate = - new IconCheckboxItemDelegate(this, - Utils::Icons::LOCKED_TOOLBAR.icon(), - Utils::Icons::UNLOCKED_TOOLBAR.icon()); -#endif - - - treeWidget()->setItemDelegateForColumn(0, idDelegate); -#ifdef _LOCK_ITEMS_ - treeWidget()->setItemDelegateForColumn(1,lockDelegate); - treeWidget()->setItemDelegateForColumn(2,showDelegate); -#else - treeWidget()->setItemDelegateForColumn(1, exportDelegate); - treeWidget()->setItemDelegateForColumn(2, showDelegate); -#endif - -#endif //QMLDESIGNER_TEST } NavigatorView::~NavigatorView() @@ -138,6 +90,9 @@ bool NavigatorView::hasWidget() const WidgetInfo NavigatorView::widgetInfo() { + if (!m_widget) + setupWidget(); + return createWidgetInfo(m_widget.data(), new WidgetInfo::ToolBarWidgetDefaultFactory(m_widget.data()), QStringLiteral("Navigator"), @@ -519,4 +474,58 @@ void NavigatorView::reparentAndCatch(NodeAbstractProperty property, const ModelN } } +void NavigatorView::setupWidget() +{ + m_widget = new NavigatorWidget(this); + m_treeModel = new NavigatorTreeModel(this); + +#ifndef QMLDESIGNER_TEST + auto navigatorContext = new Internal::NavigatorContext(m_widget.data()); + Core::ICore::addContextObject(navigatorContext); +#endif + + m_treeModel->setView(this); + m_widget->setTreeModel(m_treeModel.data()); + m_currentModelInterface = m_treeModel; + + connect(treeWidget()->selectionModel(), &QItemSelectionModel::selectionChanged, this, &NavigatorView::changeSelection); + + connect(m_widget.data(), &NavigatorWidget::leftButtonClicked, this, &NavigatorView::leftButtonClicked); + connect(m_widget.data(), &NavigatorWidget::rightButtonClicked, this, &NavigatorView::rightButtonClicked); + connect(m_widget.data(), &NavigatorWidget::downButtonClicked, this, &NavigatorView::downButtonClicked); + connect(m_widget.data(), &NavigatorWidget::upButtonClicked, this, &NavigatorView::upButtonClicked); + connect(m_widget.data(), &NavigatorWidget::filterToggled, this, &NavigatorView::filterToggled); + +#ifndef QMLDESIGNER_TEST + auto idDelegate = new NameItemDelegate(this); + IconCheckboxItemDelegate *showDelegate = + new IconCheckboxItemDelegate(this, + Utils::Icons::EYE_OPEN_TOOLBAR.icon(), + Utils::Icons::EYE_CLOSED_TOOLBAR.icon()); + + IconCheckboxItemDelegate *exportDelegate = + new IconCheckboxItemDelegate(this, + Icons::EXPORT_CHECKED.icon(), + Icons::EXPORT_UNCHECKED.icon()); + +#ifdef _LOCK_ITEMS_ + IconCheckboxItemDelegate *lockDelegate = + new IconCheckboxItemDelegate(this, + Utils::Icons::LOCKED_TOOLBAR.icon(), + Utils::Icons::UNLOCKED_TOOLBAR.icon()); +#endif + + + treeWidget()->setItemDelegateForColumn(0, idDelegate); +#ifdef _LOCK_ITEMS_ + treeWidget()->setItemDelegateForColumn(1,lockDelegate); + treeWidget()->setItemDelegateForColumn(2,showDelegate); +#else + treeWidget()->setItemDelegateForColumn(1, exportDelegate); + treeWidget()->setItemDelegateForColumn(2, showDelegate); +#endif + +#endif //QMLDESIGNER_TEST +} + } // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/components/navigator/navigatorview.h b/src/plugins/qmldesigner/components/navigator/navigatorview.h index 057e83a74de..852dddc70fc 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatorview.h +++ b/src/plugins/qmldesigner/components/navigator/navigatorview.h @@ -110,6 +110,7 @@ protected: //functions bool blockSelectionChangedSignal(bool block); void expandRecursively(const QModelIndex &index); void reparentAndCatch(NodeAbstractProperty property, const ModelNode &modelNode); + void setupWidget(); private: bool m_blockSelectionChangedSignal; diff --git a/src/plugins/qmldesigner/components/navigator/navigatorwidget.cpp b/src/plugins/qmldesigner/components/navigator/navigatorwidget.cpp index 0d2417e3944..5c326f65faf 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatorwidget.cpp +++ b/src/plugins/qmldesigner/components/navigator/navigatorwidget.cpp @@ -61,6 +61,11 @@ NavigatorWidget::NavigatorWidget(NavigatorView *view) layout->setSpacing(0); layout->setContentsMargins(0, 0, 0, 0); + QWidget *toolBar = createToolBar(); + + toolBar->setParent(this); + layout->addWidget(toolBar); + layout->addWidget(m_treeView); setLayout(layout); @@ -124,8 +129,10 @@ QList NavigatorWidget::createToolBarWidgets() auto filterMenu = new QMenu(filter); auto objectAction = new QAction(tr("Show only visible items."), nullptr); objectAction->setCheckable(true); - objectAction->setChecked( - DesignerSettings::getValue(DesignerSettingsKey::NAVIGATOR_SHOW_ONLY_VISIBLE_ITEMS).toBool()); + + bool filterFlag = DesignerSettings::getValue(DesignerSettingsKey::NAVIGATOR_SHOW_ONLY_VISIBLE_ITEMS).toBool(); + objectAction->setChecked(filterFlag); + connect(objectAction, &QAction::toggled, this, &NavigatorWidget::filterToggled); filterMenu->addAction(objectAction); filter->setMenu(filterMenu); @@ -134,6 +141,17 @@ QList NavigatorWidget::createToolBarWidgets() return buttons; } +QToolBar *NavigatorWidget::createToolBar() +{ + const QList buttons = createToolBarWidgets(); + + auto toolBar = new QToolBar(); + for (auto toolButton : buttons) + toolBar->addWidget(toolButton); + + return toolBar; +} + void NavigatorWidget::contextHelp(const Core::IContext::HelpCallback &callback) const { if (navigatorView()) diff --git a/src/plugins/qmldesigner/components/navigator/navigatorwidget.h b/src/plugins/qmldesigner/components/navigator/navigatorwidget.h index f02f0b52807..b6240aa3bb9 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatorwidget.h +++ b/src/plugins/qmldesigner/components/navigator/navigatorwidget.h @@ -32,6 +32,7 @@ #include "navigatortreeview.h" +QT_FORWARD_DECLARE_CLASS(QToolBar) QT_FORWARD_DECLARE_CLASS(QToolButton) QT_FORWARD_DECLARE_CLASS(QAbstractItemModel) @@ -48,6 +49,7 @@ public: void setTreeModel(QAbstractItemModel *model); QTreeView *treeView() const; QList createToolBarWidgets(); + QToolBar *createToolBar(); void contextHelp(const Core::IContext::HelpCallback &callback) const; void disableNavigator(); diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp b/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp index d5e21ebe945..f2a83d05182 100644 --- a/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp +++ b/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp @@ -130,6 +130,17 @@ QVariant StatesEditorModel::data(const QModelIndex &index, int role) const return QString(); } + case IsDefault: { + QmlModelState modelState(stateNode); + if (modelState.isValid()) + return modelState.isDefault(); + return false; + } + + case ModelHasDefaultState: { + return hasDefaultState(); + } + } return QVariant(); @@ -142,7 +153,9 @@ QHash StatesEditorModel::roleNames() const {StateImageSourceRole, "stateImageSource"}, {InternalNodeId, "internalNodeId"}, {HasWhenCondition, "hasWhenCondition"}, - {WhenConditionString, "whenConditionString"} + {WhenConditionString, "whenConditionString"}, + {IsDefault, "isDefault"}, + {ModelHasDefaultState, "modelHasDefaultState"} }; return roleNames; } @@ -221,4 +234,19 @@ QVariant StatesEditorModel::stateModelNode() return QVariant::fromValue(m_statesEditorView->currentStateNode()); } +void StatesEditorModel::setStateAsDefault(int internalNodeId) +{ + m_statesEditorView->setStateAsDefault(internalNodeId); +} + +void StatesEditorModel::resetDefaultState() +{ + m_statesEditorView->resetDefaultState(); +} + +bool StatesEditorModel::hasDefaultState() const +{ + return m_statesEditorView->hasDefaultState(); +} + } // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.h b/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.h index 40cad6efefc..97c4c6a9ec5 100644 --- a/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.h +++ b/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.h @@ -42,7 +42,9 @@ class StatesEditorModel : public QAbstractListModel StateImageSourceRole = Qt::UserRole, InternalNodeId, HasWhenCondition, - WhenConditionString + WhenConditionString, + IsDefault, + ModelHasDefaultState }; public: @@ -62,6 +64,9 @@ public: Q_INVOKABLE void resetWhenCondition(int internalNodeId); Q_INVOKABLE QStringList autoComplete(const QString &text, int pos, bool explicitComplete); Q_INVOKABLE QVariant stateModelNode(); + Q_INVOKABLE void setStateAsDefault(int internalNodeId); + Q_INVOKABLE void resetDefaultState(); + Q_INVOKABLE bool hasDefaultState() const; void reset(); diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp index 001a5a902c5..37693158f17 100644 --- a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp +++ b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp @@ -304,6 +304,50 @@ void StatesEditorView::resetWhenCondition(int internalNodeId) m_block = false; } +void StatesEditorView::setStateAsDefault(int internalNodeId) +{ + if (m_block) + return; + + m_block = true; + + if (hasModelNodeForInternalId(internalNodeId)) { + QmlModelState state(modelNodeForInternalId(internalNodeId)); + try { + if (state.isValid()) + state.setAsDefault(); + + } catch (const RewritingException &e) { + e.showException(); + } + } + + m_block = false; +} + +void StatesEditorView::resetDefaultState() +{ + if (m_block) + return; + + m_block = true; + + try { + if (rootModelNode().hasProperty("state")) + rootModelNode().removeProperty("state"); + + } catch (const RewritingException &e) { + e.showException(); + } + + m_block = false; +} + +bool StatesEditorView::hasDefaultState() const +{ + return rootModelNode().hasProperty("state"); +} + void StatesEditorView::modelAttached(Model *model) { if (model == AbstractView::model()) diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.h b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.h index 572b4548921..66ab998e041 100644 --- a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.h +++ b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.h @@ -44,6 +44,9 @@ public: void renameState(int internalNodeId,const QString &newName); void setWhenCondition(int internalNodeId, const QString &condition); void resetWhenCondition(int internalNodeId); + void setStateAsDefault(int internalNodeId); + void resetDefaultState(); + bool hasDefaultState() const; bool validStateName(const QString &name) const; QString currentStateName() const; void setCurrentState(const QmlModelState &state); diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.cpp b/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.cpp index 940535165a8..5d693f54225 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.cpp @@ -103,10 +103,10 @@ QAction *createAction(const Core::Id &id, TimelineToolBar::TimelineToolBar(QWidget *parent) : QToolBar(parent) , m_grp() - , m_dialog(Core::ICore::dialogParent()) + , m_dialog(new AnimationCurveDialog(Core::ICore::dialogParent())) , m_curveModel(new AnimationCurveEditorModel(0., 500.)) { - m_dialog.setModel(m_curveModel); + m_dialog->setModel(m_curveModel); connect(m_curveModel, &AnimationCurveEditorModel::currentFrameChanged, this, @@ -248,9 +248,9 @@ void TimelineToolBar::openAnimationCurveEditor() timeline = tlv->timelineForState(tlv->currentState()); } - m_dialog.refresh(); + m_dialog->refresh(); m_curveModel->setTimeline(timeline); - m_dialog.show(); + m_dialog->show(); } void TimelineToolBar::updateCurve(DesignTools::PropertyTreeItem *item) diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.h b/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.h index a95af873daf..6f275484b4a 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.h +++ b/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.h @@ -105,7 +105,7 @@ private: QList m_grp; - AnimationCurveDialog m_dialog; + AnimationCurveDialog *m_dialog = nullptr; AnimationCurveEditorModel *m_curveModel = nullptr; diff --git a/src/plugins/qmldesigner/designercore/include/qmlstate.h b/src/plugins/qmldesigner/designercore/include/qmlstate.h index 23213428492..156e441615f 100644 --- a/src/plugins/qmldesigner/designercore/include/qmlstate.h +++ b/src/plugins/qmldesigner/designercore/include/qmlstate.h @@ -69,6 +69,9 @@ public: static ModelNode createQmlState(AbstractView *view, const PropertyListType &propertyList); + void setAsDefault(); + bool isDefault() const; + protected: void addChangeSetIfNotExists(const ModelNode &node); static QmlModelState createBaseState(const AbstractView *view); diff --git a/src/plugins/qmldesigner/designercore/model/qmlstate.cpp b/src/plugins/qmldesigner/designercore/model/qmlstate.cpp index 2961951ef88..e23a87b3ef3 100644 --- a/src/plugins/qmldesigner/designercore/model/qmlstate.cpp +++ b/src/plugins/qmldesigner/designercore/model/qmlstate.cpp @@ -289,6 +289,24 @@ ModelNode QmlModelState::createQmlState(AbstractView *view, const PropertyListTy return view->createModelNode("QtQuick.State", 1, 0, propertyList); } +void QmlModelState::setAsDefault() +{ + if ((!isBaseState()) && (modelNode().isValid())) { + view()->rootModelNode().variantProperty("state").setValue(name()); + } +} + +bool QmlModelState::isDefault() const +{ + if ((!isBaseState()) && (modelNode().isValid())) { + if (view()->rootModelNode().hasProperty("state")) { + return (view()->rootModelNode().variantProperty("state").value() == name()); + } + } + + return false; +} + QmlModelState QmlModelState::createBaseState(const AbstractView *view) { QmlModelState qmlModelState(view->rootModelNode()); diff --git a/src/plugins/qmldesigner/designmodewidget.cpp b/src/plugins/qmldesigner/designmodewidget.cpp index 424c008231e..01385895227 100644 --- a/src/plugins/qmldesigner/designmodewidget.cpp +++ b/src/plugins/qmldesigner/designmodewidget.cpp @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -242,18 +243,25 @@ void DesignModeWidget::setup() m_dockManager->setStyleSheet(Theme::replaceCssColors(sheet)); // Setup Actions and Menus - Core::ActionContainer *mwindow = Core::ActionManager::actionContainer(Core::Constants::M_WINDOW); + Core::ActionContainer *mview = Core::ActionManager::actionContainer(Core::Constants::M_VIEW); // Window > Views Core::ActionContainer *mviews = Core::ActionManager::createMenu(Core::Constants::M_VIEW_VIEWS); mviews->menu()->addSeparator(); // Window > Workspaces Core::ActionContainer *mworkspaces = Core::ActionManager::createMenu(QmlDesigner::Constants::M_WINDOW_WORKSPACES); - mwindow->addMenu(mworkspaces, Core::Constants::G_VIEW_VIEWS); + mview->addMenu(mworkspaces, Core::Constants::G_VIEW_VIEWS); mworkspaces->menu()->setTitle(tr("&Workspaces")); - mworkspaces->setOnAllDisabledBehavior(Core::ActionContainer::Show); // TODO what does it exactly do?! - - // Connect opening of the 'window' menu with creation of the workspaces menu - connect(mwindow->menu(), &QMenu::aboutToShow, this, &DesignModeWidget::aboutToShowWorkspaces); + mworkspaces->setOnAllDisabledBehavior(Core::ActionContainer::Show); + // Connect opening of the 'workspaces' menu with creation of the workspaces menu + connect(mworkspaces->menu(), &QMenu::aboutToShow, this, &DesignModeWidget::aboutToShowWorkspaces); + // Disable workspace menu when context is different to C_DESIGN_MODE + connect(Core::ICore::instance(), &Core::ICore::contextChanged, + this, [mworkspaces](const Core::Context &context){ + if (context.contains(Core::Constants::C_DESIGN_MODE)) + mworkspaces->menu()->setEnabled(true); + else + mworkspaces->menu()->setEnabled(false); + }); // Create a DockWidget for each QWidget and add them to the DockManager const Core::Context designContext(Core::Constants::C_DESIGN_MODE); @@ -374,6 +382,23 @@ void DesignModeWidget::setup() setupNavigatorHistory(currentDesignDocument()->textEditor()); m_dockManager->initialize(); + + connect(Core::ModeManager::instance(), &Core::ModeManager::currentModeChanged, + this, [this](Core::Id mode, Core::Id oldMode) { + if (mode == Core::Constants::MODE_DESIGN) { + m_dockManager->reloadActiveWorkspace(); + m_dockManager->setModeChangeState(false); + } + + if (oldMode == Core::Constants::MODE_DESIGN + && mode != Core::Constants::MODE_DESIGN) { + m_dockManager->save(); + m_dockManager->setModeChangeState(true); + for (auto floatingWidget : m_dockManager->floatingWidgets()) + floatingWidget->hide(); + } + }); + viewManager().enableWidgets(); readSettings(); show(); diff --git a/tests/system/README b/tests/system/README index 57816f235bf..05fe472d5ad 100644 --- a/tests/system/README +++ b/tests/system/README @@ -30,24 +30,24 @@ locations. On Linux/macOS this is ~/Qt5.x.1 and on Windows this is C:\Qt\Qt5.x.1 use installations of the official opensource Qt packages. Just install the Qt version for the respective toolchain with the components (if available): - (Desktop) , e.g. Desktop gcc 64-bit -- Qt Quick Controls +- Qt Quick Controls (if available) - Qt Script The exact versions and toolchains are: Linux: Qt 5.4.1 (gcc) -Qt 5.6.1-1 (gcc) Qt 5.10.1 (gcc) +Qt 5.14.1 (gcc) macOS: -Qt 5.6.1-1 (clang) Qt 5.10.1 (clang) +Qt 5.14.1 (clang) Windows: Qt 5.4.1 (gcc) -Qt 5.6.1-1 (MSVC2013, 32 bit) Qt 5.10.1 (MSVC2015, 32 bit) +Qt 5.14.1 (MSVC2017, 64 bit) Fourth - you'll have to provide some additional repositories. These additional repositories are located inside ~/squish-data or C:\Users\\squish-data (depending on the OS you're on). diff --git a/tests/system/settings/mac/QtProject/qtcreator/profiles.xml b/tests/system/settings/mac/QtProject/qtcreator/profiles.xml index f64b5ba0550..cf36fa263fc 100644 --- a/tests/system/settings/mac/QtProject/qtcreator/profiles.xml +++ b/tests/system/settings/mac/QtProject/qtcreator/profiles.xml @@ -49,7 +49,7 @@ :///DESKTOP/// {fc5f34fd-e703-4f4c-85ce-ea5bf5869e6a} - Desktop 5.6.1 default + Desktop 5.14.1 default false diff --git a/tests/system/settings/mac/QtProject/qtcreator/qtversion.xml b/tests/system/settings/mac/QtProject/qtcreator/qtversion.xml index f9a0babe523..6521f404a1a 100644 --- a/tests/system/settings/mac/QtProject/qtcreator/qtversion.xml +++ b/tests/system/settings/mac/QtProject/qtcreator/qtversion.xml @@ -17,7 +17,7 @@ 9 Qt %{Qt:Version} (SQUISH_DEFAULT_COMPILER) - ~/Qt5.6.1/5.6/SQUISH_DEFAULT_COMPILER/bin/qmake + ~/Qt5.14.1/5.14.1/SQUISH_DEFAULT_COMPILER/bin/qmake Qt4ProjectManager.QtVersion.Desktop false diff --git a/tests/system/settings/unix/QtProject/qtcreator/profiles.xml b/tests/system/settings/unix/QtProject/qtcreator/profiles.xml index 627451db8b3..81f328703d3 100644 --- a/tests/system/settings/unix/QtProject/qtcreator/profiles.xml +++ b/tests/system/settings/unix/QtProject/qtcreator/profiles.xml @@ -91,7 +91,7 @@ :///DESKTOP/// {542217c7-ce0f-48f7-843b-d4fad339688d} - Desktop 5.6.1 default + Desktop 5.14.1 default false diff --git a/tests/system/settings/unix/QtProject/qtcreator/qtversion.xml b/tests/system/settings/unix/QtProject/qtcreator/qtversion.xml index 90e86a4f6a8..cb208914864 100644 --- a/tests/system/settings/unix/QtProject/qtcreator/qtversion.xml +++ b/tests/system/settings/unix/QtProject/qtcreator/qtversion.xml @@ -27,7 +27,7 @@ 15 Qt %{Qt:Version} (SQUISH_DEFAULT_COMPILER) - ~/Qt5.6.1/5.6/SQUISH_DEFAULT_COMPILER/bin/qmake + ~/Qt5.14.1/5.14.1/SQUISH_DEFAULT_COMPILER/bin/qmake Qt4ProjectManager.QtVersion.Desktop false diff --git a/tests/system/settings/windows/QtProject/qtcreator/profiles.xml b/tests/system/settings/windows/QtProject/qtcreator/profiles.xml index ac1911748fb..fab39649776 100644 --- a/tests/system/settings/windows/QtProject/qtcreator/profiles.xml +++ b/tests/system/settings/windows/QtProject/qtcreator/profiles.xml @@ -72,8 +72,8 @@ {7ca0887f-a9a5-4251-aba6-560a15595d20} - {d35e7a1a-5ab8-4fd6-8a2c-634846c669bb} - {7ca0887f-a9a5-4251-aba6-560a15595d20} + {ce3a8004-e9ae-46f2-b62d-d7daf69435ca} + {3df7c776-a480-4a04-9099-6c75adac2dca} 24 @@ -81,7 +81,7 @@ :///DESKTOP/// {f9c7858c-d167-4b78-847a-91943bd0af07} - Desktop 5.6.1 default + Desktop 5.14.1 default false diff --git a/tests/system/settings/windows/QtProject/qtcreator/qtversion.xml b/tests/system/settings/windows/QtProject/qtcreator/qtversion.xml index e9c384e6343..2939316b75f 100644 --- a/tests/system/settings/windows/QtProject/qtcreator/qtversion.xml +++ b/tests/system/settings/windows/QtProject/qtcreator/qtversion.xml @@ -26,8 +26,8 @@ QtVersion.2 24 - Qt %{Qt:Version} (msvc2013) - C:/Qt/Qt5.6.1/5.6/msvc2013/bin/qmake.exe + Qt %{Qt:Version} (msvc2017_64) + C:/Qt/Qt5.14.1/5.14.1/msvc2017_64/bin/qmake.exe Qt4ProjectManager.QtVersion.Desktop false diff --git a/tests/system/settings/windows/QtProject/qtcreator/toolchains.xml b/tests/system/settings/windows/QtProject/qtcreator/toolchains.xml index 1dea56573ee..49518d2d28b 100644 --- a/tests/system/settings/windows/QtProject/qtcreator/toolchains.xml +++ b/tests/system/settings/windows/QtProject/qtcreator/toolchains.xml @@ -49,18 +49,31 @@ ToolChain.3 - x86-windows-msvc2015-pe-32bit - C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/vcvarsall.bat - x86 - true - Microsoft Visual C++ Compiler 14.0 (x86) - ProjectExplorer.ToolChain.Msvc:{c96cfaf3-fb8a-472b-b3c7-e94e8c490f17} + x86-windows-msvc2017-pe-64bit + C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvarsall.bat + amd64 + false + MSVC2017 (amd64) + ProjectExplorer.ToolChain.Msvc:{ce3a8004-e9ae-46f2-b62d-d7daf69435ca} 1 C ToolChain.4 + + x86-windows-msvc2015-pe-32bit + C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/vcvarsall.bat + x86 + true + Microsoft Visual C++ Compiler 14.0 (x86) + ProjectExplorer.ToolChain.Msvc:{c96cfaf3-fb8a-472b-b3c7-e94e8c490f17} + 1 + C + + + + ToolChain.5 x86-windows-msvc2015-pe-32bit C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/vcvarsall.bat @@ -73,7 +86,7 @@ - ToolChain.5 + ToolChain.6 x86-windows-msvc2013-pe-32bit C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/vcvarsall.bat @@ -83,9 +96,22 @@ ProjectExplorer.ToolChain.Msvc:{7ca0887f-a9a5-4251-aba6-560a15595d20} + + ToolChain.7 + + x86-windows-msvc2017-pe-64bit + C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvarsall.bat + amd64 + false + MSVC2017 (amd64) + ProjectExplorer.ToolChain.Msvc:{3df7c776-a480-4a04-9099-6c75adac2dca} + 2 + Cxx + + ToolChain.Count - 6 + 8 Version diff --git a/tests/system/shared/classes.py b/tests/system/shared/classes.py index 90bbe4d7967..3a675c61e5e 100644 --- a/tests/system/shared/classes.py +++ b/tests/system/shared/classes.py @@ -32,15 +32,15 @@ class Targets: (DESKTOP_4_8_7_DEFAULT, EMBEDDED_LINUX, DESKTOP_5_4_1_GCC, - DESKTOP_5_6_1_DEFAULT, - DESKTOP_5_10_1_DEFAULT) = ALL_TARGETS + DESKTOP_5_10_1_DEFAULT, + DESKTOP_5_14_1_DEFAULT) = ALL_TARGETS __TARGET_NAME_DICT__ = dict(zip(ALL_TARGETS, ["Desktop 4.8.7 default", "Embedded Linux", "Desktop 5.4.1 GCC", - "Desktop 5.6.1 default", - "Desktop 5.10.1 default"])) + "Desktop 5.10.1 default", + "Desktop 5.14.1 default"])) @staticmethod def availableTargetClasses(): @@ -71,7 +71,7 @@ class Targets: @staticmethod def getDefaultKit(): - return Targets.DESKTOP_5_6_1_DEFAULT + return Targets.DESKTOP_5_14_1_DEFAULT # this class holds some constants for easier usage inside the Projects view class ProjectSettings: @@ -106,7 +106,7 @@ class Qt5Path: @staticmethod def getPaths(pathSpec): - qt5targets = [Targets.DESKTOP_5_6_1_DEFAULT, Targets.DESKTOP_5_10_1_DEFAULT] + qt5targets = [Targets.DESKTOP_5_10_1_DEFAULT, Targets.DESKTOP_5_14_1_DEFAULT] if platform.system() != 'Darwin': qt5targets.append(Targets.DESKTOP_5_4_1_GCC) if pathSpec == Qt5Path.DOCS: diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index 39cdda43518..96b79a5c4ad 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -278,7 +278,7 @@ def createProject_Qt_Console(path, projectName, checks = True, buildSystem = Non __verifyFileCreation__(path, expectedFiles) def createNewQtQuickApplication(workingDir, projectName=None, - targets=Targets.desktopTargetClasses(), minimumQtVersion="5.6", + targets=Targets.desktopTargetClasses(), minimumQtVersion="5.10", template="Qt Quick Application - Empty", fromWelcome=False, buildSystem=None): available = __createProjectOrFileSelectType__(" Application (Qt Quick)", template, fromWelcome) @@ -298,7 +298,7 @@ def createNewQtQuickApplication(workingDir, projectName=None, return checkedTargets, projectName -def createNewQtQuickUI(workingDir, qtVersion = "5.6"): +def createNewQtQuickUI(workingDir, qtVersion = "5.10"): available = __createProjectOrFileSelectType__(" Other Project", 'Qt Quick UI Prototype') if workingDir == None: workingDir = tempDir() @@ -316,7 +316,7 @@ def createNewQtQuickUI(workingDir, qtVersion = "5.6"): return checkedTargets, projectName -def createNewQmlExtension(workingDir, targets=[Targets.DESKTOP_5_6_1_DEFAULT]): +def createNewQmlExtension(workingDir, targets=[Targets.DESKTOP_5_14_1_DEFAULT]): available = __createProjectOrFileSelectType__(" Library", "Qt Quick 2 Extension Plugin") if workingDir == None: workingDir = tempDir() @@ -505,10 +505,7 @@ def __getSupportedPlatforms__(text, templateName, getAsStrings=False): else: version = None if templateName.startswith("Qt Quick Application - "): - if templateName == "Qt Quick Application - Empty": - result = set([Targets.DESKTOP_5_6_1_DEFAULT, Targets.DESKTOP_5_10_1_DEFAULT]) - else: - result = set([Targets.DESKTOP_5_10_1_DEFAULT]) + result = set([Targets.DESKTOP_5_10_1_DEFAULT, Targets.DESKTOP_5_14_1_DEFAULT]) elif 'Supported Platforms' in text: supports = text[text.find('Supported Platforms'):].split(":")[1].strip().split(" ") result = set() @@ -517,7 +514,7 @@ def __getSupportedPlatforms__(text, templateName, getAsStrings=False): result.add(Targets.DESKTOP_4_8_7_DEFAULT) if platform.system() in ("Linux", "Darwin"): result.add(Targets.EMBEDDED_LINUX) - result = result.union(set([Targets.DESKTOP_5_6_1_DEFAULT, Targets.DESKTOP_5_10_1_DEFAULT])) + result = result.union(set([Targets.DESKTOP_5_10_1_DEFAULT, Targets.DESKTOP_5_14_1_DEFAULT])) if platform.system() != 'Darwin': result.add(Targets.DESKTOP_5_4_1_GCC) elif 'Platform independent' in text: diff --git a/tests/system/suite_APTW/tst_APTW03/test.py b/tests/system/suite_APTW/tst_APTW03/test.py index fb04c53fa8b..e08901fb6dc 100644 --- a/tests/system/suite_APTW/tst_APTW03/test.py +++ b/tests/system/suite_APTW/tst_APTW03/test.py @@ -86,7 +86,7 @@ def main(): checkSimpleCppLib("SampleApp1", False) checkSimpleCppLib("SampleApp2", True) - pluginTargets = (Targets.DESKTOP_5_6_1_DEFAULT, Targets.DESKTOP_5_10_1_DEFAULT) + pluginTargets = (Targets.DESKTOP_5_10_1_DEFAULT, Targets.DESKTOP_5_14_1_DEFAULT) projectName, className = createNewQtPlugin(tempDir(), "SampleApp3", "MyPlugin", pluginTargets) virtualFunctionsAdded = False for kit, config in iterateBuildConfigs("Debug"): diff --git a/tests/system/suite_CCOM/tst_CCOM01/test.py b/tests/system/suite_CCOM/tst_CCOM01/test.py index 6c9101c3813..20dd368a80e 100755 --- a/tests/system/suite_CCOM/tst_CCOM01/test.py +++ b/tests/system/suite_CCOM/tst_CCOM01/test.py @@ -28,7 +28,7 @@ source("../../shared/qtcreator.py") # entry of test def main(): # prepare example project - sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT), + sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), "quick", "animation") proFile = "animation.pro" if not neededFilePresent(os.path.join(sourceExample, proFile)): @@ -42,6 +42,7 @@ def main(): # open example project, supports only Qt 5 targets = Targets.desktopTargetClasses() targets.discard(Targets.DESKTOP_4_8_7_DEFAULT) + targets.discard(Targets.DESKTOP_5_4_1_GCC) openQmakeProject(examplePath, targets) # build and wait until finished - on all build configurations availableConfigs = iterateBuildConfigs() diff --git a/tests/system/suite_CCOM/tst_CCOM02/test.py b/tests/system/suite_CCOM/tst_CCOM02/test.py index b49594ddfb3..f44d68ffd0e 100755 --- a/tests/system/suite_CCOM/tst_CCOM02/test.py +++ b/tests/system/suite_CCOM/tst_CCOM02/test.py @@ -29,7 +29,7 @@ source("../../shared/qtcreator.py") # entry of test def main(): # prepare example project - sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT), + sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), "quick", "animation") proFile = "animation.pro" if not neededFilePresent(os.path.join(sourceExample, proFile)): diff --git a/tests/system/suite_CSUP/tst_CSUP04/test.py b/tests/system/suite_CSUP/tst_CSUP04/test.py index 143e3fe8126..99ec6ae8db3 100644 --- a/tests/system/suite_CSUP/tst_CSUP04/test.py +++ b/tests/system/suite_CSUP/tst_CSUP04/test.py @@ -28,7 +28,7 @@ source("../../shared/qtcreator.py") # entry of test def main(): # prepare example project - sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT), + sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), "gui", "openglwindow") proFile = "openglwindow.pro" diff --git a/tests/system/suite_CSUP/tst_CSUP05/test.py b/tests/system/suite_CSUP/tst_CSUP05/test.py index 3e686b0509a..2bd3dd846c7 100644 --- a/tests/system/suite_CSUP/tst_CSUP05/test.py +++ b/tests/system/suite_CSUP/tst_CSUP05/test.py @@ -28,7 +28,7 @@ source("../../shared/qtcreator.py") # entry of test def main(): # prepare example project - sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT), + sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), "gui", "openglwindow") proFile = "openglwindow.pro" if not neededFilePresent(os.path.join(sourceExample, proFile)): diff --git a/tests/system/suite_CSUP/tst_CSUP06/test.py b/tests/system/suite_CSUP/tst_CSUP06/test.py index 3626a959510..c28c8bb198f 100644 --- a/tests/system/suite_CSUP/tst_CSUP06/test.py +++ b/tests/system/suite_CSUP/tst_CSUP06/test.py @@ -168,7 +168,7 @@ def main(): with TestSection(getCodeModelString(useClang)): if not startCreatorVerifyingClang(useClang): continue - openQmakeProject(examplePath, [Targets.DESKTOP_5_6_1_DEFAULT]) + openQmakeProject(examplePath, [Targets.DESKTOP_5_14_1_DEFAULT]) checkCodeModelSettings(useClang) if not openDocument("cplusplus-tools.Sources.main\\.cpp"): earlyExit("Failed to open main.cpp.") diff --git a/tests/system/suite_QMLS/tst_QMLS03/test.py b/tests/system/suite_QMLS/tst_QMLS03/test.py index c82568a6bce..a1f742eee3c 100644 --- a/tests/system/suite_QMLS/tst_QMLS03/test.py +++ b/tests/system/suite_QMLS/tst_QMLS03/test.py @@ -67,7 +67,7 @@ def checkUsages(resultsView, expectedResults, directory): def main(): # prepare example project - sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT), + sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), "quick", "animation") proFile = "animation.pro" if not neededFilePresent(os.path.join(sourceExample, proFile)): @@ -80,7 +80,7 @@ def main(): if not startedWithoutPluginError(): return # open example project - openQmakeProject(examplePath, [Targets.DESKTOP_5_6_1_DEFAULT]) + openQmakeProject(examplePath, [Targets.DESKTOP_5_14_1_DEFAULT]) # open qml file openDocument("animation.Resources.animation\\.qrc./animation.basics.color-animation\\.qml") # get editor @@ -94,10 +94,10 @@ def main(): type(editorArea, "") invokeContextMenuItem(editorArea, "Find References to Symbol Under Cursor") # check if usage was properly found - expectedResults = [ExpectedResult("color-animation.qml", 49, "Rectangle {"), - ExpectedResult("color-animation.qml", 109, "Rectangle {"), - ExpectedResult("property-animation.qml", 48, "Rectangle {"), - ExpectedResult("property-animation.qml", 57, "Rectangle {")] + expectedResults = [ExpectedResult("color-animation.qml", 59, "Rectangle {"), + ExpectedResult("color-animation.qml", 119, "Rectangle {"), + ExpectedResult("property-animation.qml", 58, "Rectangle {"), + ExpectedResult("property-animation.qml", 67, "Rectangle {")] resultsView = waitForObject(":Qt Creator_Find::Internal::SearchResultTreeView") test.verify(checkUsages(resultsView, expectedResults, templateDir), "Verifying if usages were properly found using context menu.") @@ -113,10 +113,10 @@ def main(): type(editorArea, "") invokeMenuItem("Tools", "QML/JS", "Find References to Symbol Under Cursor") # check if usage was properly found - expectedResults = [ExpectedResult("color-animation.qml", 50, "anchors { left: parent.left; top: parent.top; right: parent.right; bottom: parent.verticalCenter }"), - ExpectedResult("color-animation.qml", 110, "anchors { left: parent.left; top: parent.verticalCenter; right: parent.right; bottom: parent.bottom }"), - ExpectedResult("property-animation.qml", 49, "anchors { left: parent.left; top: parent.top; right: parent.right; bottom: parent.verticalCenter }"), - ExpectedResult("property-animation.qml", 58, "anchors { left: parent.left; top: parent.verticalCenter; right: parent.right; bottom: parent.bottom }")] + expectedResults = [ExpectedResult("color-animation.qml", 60, "anchors { left: parent.left; top: parent.top; right: parent.right; bottom: parent.verticalCenter }"), + ExpectedResult("color-animation.qml", 120, "anchors { left: parent.left; top: parent.verticalCenter; right: parent.right; bottom: parent.bottom }"), + ExpectedResult("property-animation.qml", 59, "anchors { left: parent.left; top: parent.top; right: parent.right; bottom: parent.verticalCenter }"), + ExpectedResult("property-animation.qml", 68, "anchors { left: parent.left; top: parent.verticalCenter; right: parent.right; bottom: parent.bottom }")] resultsView = waitForObject(":Qt Creator_Find::Internal::SearchResultTreeView") test.verify(checkUsages(resultsView, expectedResults, templateDir), "Verifying if usages were properly found using main menu.") @@ -132,7 +132,7 @@ def main(): type(editorArea, "") type(editorArea, "") # check if usage was properly found - expectedResults = [ExpectedResult("color-animation.qml", 93, "SequentialAnimation on opacity {")] + expectedResults = [ExpectedResult("color-animation.qml", 103, "SequentialAnimation on opacity {")] resultsView = waitForObject(":Qt Creator_Find::Internal::SearchResultTreeView") test.verify(checkUsages(resultsView, expectedResults, templateDir), "Verifying if usages were properly found using shortcut.") diff --git a/tests/system/suite_WELP/tst_WELP02/test.py b/tests/system/suite_WELP/tst_WELP02/test.py index b44f0382dce..d2650081f8d 100644 --- a/tests/system/suite_WELP/tst_WELP02/test.py +++ b/tests/system/suite_WELP/tst_WELP02/test.py @@ -65,7 +65,7 @@ def checkTypeAndProperties(typePropertiesDetails): def main(): # prepare example project - sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT), + sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), "quick", "animation") if not neededFilePresent(sourceExample): return diff --git a/tests/system/suite_debugger/tst_qml_js_console/test.py b/tests/system/suite_debugger/tst_qml_js_console/test.py index b94303bfb1b..c7d9df09f25 100644 --- a/tests/system/suite_debugger/tst_qml_js_console/test.py +++ b/tests/system/suite_debugger/tst_qml_js_console/test.py @@ -114,6 +114,8 @@ def testLoggingFeatures(): clickButton(":*Qt Creator.Clear_QToolButton") def main(): + test.xfail("Skipping test. This will not work correctly with Qt <= 5.15 (QTBUG-82150).") + return projName = "simpleQuickUI2.qmlproject" projFolder = os.path.dirname(findFile("testdata", "simpleQuickUI2/%s" % projName)) if not neededFilePresent(os.path.join(projFolder, projName)): diff --git a/tests/system/suite_debugger/tst_qml_locals/test.py b/tests/system/suite_debugger/tst_qml_locals/test.py index f85a2d3b23d..63516e89518 100644 --- a/tests/system/suite_debugger/tst_qml_locals/test.py +++ b/tests/system/suite_debugger/tst_qml_locals/test.py @@ -27,6 +27,8 @@ source("../../shared/qtcreator.py") source("Tree.py") def main(): + test.xfail("Skipping test. This must be rewritten for current kits.") + return if os.getenv("SYSTEST_OPENGL_MISSING") == "1": test.xfail("This test needs OpenGL - skipping...") return diff --git a/tests/system/suite_debugger/tst_simple_analyze/test.py b/tests/system/suite_debugger/tst_simple_analyze/test.py index 6c694f063ef..69ee40d5b65 100644 --- a/tests/system/suite_debugger/tst_simple_analyze/test.py +++ b/tests/system/suite_debugger/tst_simple_analyze/test.py @@ -66,8 +66,7 @@ def performTest(workingDir, projectName, availableConfigs): # because of differences between MSVC's and MinGW's Makefile (so clean before changing kit) invokeMenuItem('Build', 'Clean Project "%s"' % projectName) verifyBuildConfig(kit, config, True, True, True) - qtVersion = "5.6.1" if kit == Targets.DESKTOP_5_6_1_DEFAULT else "5.10.1" - test.log("Selected kit using Qt %s" % qtVersion) + test.log("Selected kit '%s'" % Targets.getStringForTarget(kit)) # explicitly build before start debugging for adding the executable as allowed program to WinFW invokeMenuItem("Build", "Rebuild All Projects") waitForCompile() @@ -100,7 +99,7 @@ def performTest(workingDir, projectName, availableConfigs): colMean, colMedian, colLongest, colShortest) = range(2, 11) model = waitForObject(":Events.QmlProfilerEventsTable_QmlProfiler::" "Internal::QmlProfilerStatisticsMainView").model() - compareEventsTab(model, "events_qt%s.tsv" % qtVersion) + compareEventsTab(model, "events_qt5.10.1.tsv") test.compare(dumpItems(model, column=colPercent)[0], '100 %') # cannot run following test on colShortest (unstable) for i in [colMean, colMedian, colLongest]: diff --git a/tests/system/suite_debugger/tst_simple_analyze/testdata/events_qt5.6.1.tsv b/tests/system/suite_debugger/tst_simple_analyze/testdata/events_qt5.6.1.tsv deleted file mode 100644 index a5228fad419..00000000000 --- a/tests/system/suite_debugger/tst_simple_analyze/testdata/events_qt5.6.1.tsv +++ /dev/null @@ -1,9 +0,0 @@ -"0" "1" "6" "11" -"" "" "1" "Main program" -"main.qml:15" "Handling Signal" "2" "onTriggered: { runCount += 1; var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } }" -"main.qml:15" "JavaScript" "2" "onTriggered" -"main.qml:4" "Creating" "2" "QtQuick.Window/Window" -"main.qml:1" "Compiling" "1" "main.qml" -"main.qml:10" "Creating" "2" "QtQuick/Timer" -"main.qml:14" "Binding" "3" "running: runCount < 2" -"main.qml:14" "JavaScript" "3" "expression for running" diff --git a/tests/system/suite_editors/tst_memberoperator/test.py b/tests/system/suite_editors/tst_memberoperator/test.py index 99e511049a3..f7e7ed67375 100644 --- a/tests/system/suite_editors/tst_memberoperator/test.py +++ b/tests/system/suite_editors/tst_memberoperator/test.py @@ -47,7 +47,8 @@ def main(): if not startCreatorVerifyingClang(useClang): continue createProject_Qt_Console(tempDir(), "SquishProject") - selectBuildConfig(Targets.DESKTOP_5_6_1_DEFAULT, "Debug") # do not use the default Qt4 + # by default Qt4 is selected, use a Qt5 kit instead + selectBuildConfig(Targets.DESKTOP_5_10_1_DEFAULT, "Debug") checkCodeModelSettings(useClang) selectFromLocator("main.cpp") cppwindow = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget") diff --git a/tests/system/suite_editors/tst_qml_editor/test.py b/tests/system/suite_editors/tst_qml_editor/test.py index 56179134cbd..ecd9ab008e6 100644 --- a/tests/system/suite_editors/tst_qml_editor/test.py +++ b/tests/system/suite_editors/tst_qml_editor/test.py @@ -28,7 +28,7 @@ source("../../shared/qtcreator.py") focusDocumentPath = "keyinteraction.Resources.keyinteraction\.qrc./keyinteraction.focus.%s" def main(): - target = Targets.DESKTOP_5_6_1_DEFAULT + target = Targets.DESKTOP_5_14_1_DEFAULT sourceExample = os.path.join(Qt5Path.examplesPath(target), "quick/keyinteraction") proFile = "keyinteraction.pro" if not neededFilePresent(os.path.join(sourceExample, proFile)): diff --git a/tests/system/suite_general/tst_create_proj_wizard/test.py b/tests/system/suite_general/tst_create_proj_wizard/test.py index ab984d52257..4669c47b846 100644 --- a/tests/system/suite_general/tst_create_proj_wizard/test.py +++ b/tests/system/suite_general/tst_create_proj_wizard/test.py @@ -71,7 +71,7 @@ def main(): with TestSection("Testing project template %s -> %s" % (category, template)): displayedPlatforms = __createProject__(category, template) if template.startswith("Qt Quick Application - "): - qtVersionsForQuick = ["5.6", "5.10"] if template == "Qt Quick Application - Empty" else ["5.10"] + qtVersionsForQuick = ["5.10", "5.14"] for counter, qtVersion in enumerate(qtVersionsForQuick): def additionalFunc(displayedPlatforms, qtVersion): requiredQtVersion = __createProjectHandleQtQuickSelection__(qtVersion) diff --git a/tests/system/suite_general/tst_rename_file/test.py b/tests/system/suite_general/tst_rename_file/test.py index 5c296973b02..c39bdda57a2 100644 --- a/tests/system/suite_general/tst_rename_file/test.py +++ b/tests/system/suite_general/tst_rename_file/test.py @@ -28,7 +28,7 @@ source("../../shared/qtcreator.py") def main(): # prepare example project projectName = "adding" - sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT), + sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), "qml", "referenceexamples", "adding") proFile = projectName + ".pro" if not neededFilePresent(os.path.join(sourceExample, proFile)): diff --git a/tests/system/suite_general/tst_session_handling/test.py b/tests/system/suite_general/tst_session_handling/test.py index 96a3f33dd9d..f33cdab833f 100644 --- a/tests/system/suite_general/tst_session_handling/test.py +++ b/tests/system/suite_general/tst_session_handling/test.py @@ -39,7 +39,7 @@ def main(): "Verifying window title contains created session name.") checkWelcomePage(sessionName, True) for project in projects: - openQmakeProject(project, [Targets.DESKTOP_5_6_1_DEFAULT]) + openQmakeProject(project, [Targets.DESKTOP_5_14_1_DEFAULT]) waitForProjectParsing() checkNavigator(52, "Verifying whether all projects have been opened.") openDocument("animation.Resources.animation\\.qrc./animation.basics.animators\\.qml") @@ -67,9 +67,9 @@ def main(): invokeMenuItem("File", "Exit") def prepareTestExamples(): - examples = [os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT), + examples = [os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), "quick", "animation", "animation.pro"), - os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT), + os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), "quick", "keyinteraction", "keyinteraction.pro") ] projects = [] diff --git a/tests/system/suite_qtquick/tst_qml_outline/test.py b/tests/system/suite_qtquick/tst_qml_outline/test.py index 4c0c5e8a037..b0cd8df3165 100644 --- a/tests/system/suite_qtquick/tst_qml_outline/test.py +++ b/tests/system/suite_qtquick/tst_qml_outline/test.py @@ -30,7 +30,7 @@ outline = ":Qt Creator_QmlJSEditor::Internal::QmlJSOutlineTreeView" treebase = "keyinteraction.Resources.keyinteraction\\.qrc./keyinteraction.focus." def main(): - sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT), + sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), "quick", "keyinteraction") proFile = "keyinteraction.pro" if not neededFilePresent(os.path.join(sourceExample, proFile)): @@ -39,7 +39,7 @@ def main(): startQC() if not startedWithoutPluginError(): return - openQmakeProject(os.path.join(templateDir, proFile), [Targets.DESKTOP_5_6_1_DEFAULT]) + openQmakeProject(os.path.join(templateDir, proFile), [Targets.DESKTOP_5_14_1_DEFAULT]) qmlFiles = [treebase + "focus\\.qml", treebase + "Core.ListMenu\\.qml"] checkOutlineFor(qmlFiles) testModify() diff --git a/tests/system/suite_qtquick/tst_qtquick_creation/test.py b/tests/system/suite_qtquick/tst_qtquick_creation/test.py index d27b7fa9c0a..d8a5cc8ee29 100644 --- a/tests/system/suite_qtquick/tst_qtquick_creation/test.py +++ b/tests/system/suite_qtquick/tst_qtquick_creation/test.py @@ -30,8 +30,8 @@ def main(): if not startedWithoutPluginError(): return - available = [("5.6", "Qt Quick Application - Empty", Targets.DESKTOP_5_6_1_DEFAULT), - ("5.10", "Qt Quick Application - Swipe", Targets.DESKTOP_5_10_1_DEFAULT)] + available = [("5.10", "Qt Quick Application - Empty", Targets.DESKTOP_5_10_1_DEFAULT), + ("5.14", "Qt Quick Application - Swipe", Targets.DESKTOP_5_14_1_DEFAULT)] for qtVersion, appTemplate, targ in available: # using a temporary directory won't mess up a potentially existing diff --git a/tests/system/suite_qtquick/tst_qtquick_creation3/test.py b/tests/system/suite_qtquick/tst_qtquick_creation3/test.py index adf7c4f62f8..1b2613cda83 100644 --- a/tests/system/suite_qtquick/tst_qtquick_creation3/test.py +++ b/tests/system/suite_qtquick/tst_qtquick_creation3/test.py @@ -36,7 +36,7 @@ def main(): startQC() if not startedWithoutPluginError(): return - available = ["5.6", "5.10"] + available = ["5.10", "5.14"] for qtVersion in available: # using a temporary directory won't mess up a potentially existing @@ -45,9 +45,9 @@ def main(): checkedKitNames = Targets.getTargetsAsStrings(checkedKits) test.verify(_exactlyOne_(map(lambda name: qtVersion in name, checkedKitNames)), "The requested kit should have been checked") - if qtVersion == "5.10": - test.verify(not any(map(lambda name: "5.6" in name, checkedKitNames)), - "The 5.6 kit should not have been checked when 5.10 is required") + if qtVersion == "5.14": + test.verify(not any(map(lambda name: "5.10" in name, checkedKitNames)), + "The 5.10 kit should not have been checked when 5.14 is required") clickButton(waitForObject(":*Qt Creator.Run_Core::Internal::FancyToolButton")) if not waitForProcessRunning(): test.fatal("Couldn't start application - leaving test") diff --git a/tests/system/suite_qtquick/tst_qtquick_creation4/test.py b/tests/system/suite_qtquick/tst_qtquick_creation4/test.py index 630cb35bae8..82d04ef8d3d 100644 --- a/tests/system/suite_qtquick/tst_qtquick_creation4/test.py +++ b/tests/system/suite_qtquick/tst_qtquick_creation4/test.py @@ -29,7 +29,7 @@ def main(): startQC() if not startedWithoutPluginError(): return - for target in [Targets.DESKTOP_5_6_1_DEFAULT, Targets.DESKTOP_5_10_1_DEFAULT]: + for target in [Targets.DESKTOP_5_10_1_DEFAULT, Targets.DESKTOP_5_14_1_DEFAULT]: # using a temporary directory won't mess up a potentially existing createNewQmlExtension(tempDir(), [target]) # wait for parsing to complete