diff options
Diffstat (limited to 'share')
30 files changed, 675 insertions, 374 deletions
diff --git a/share/CMakeLists.txt b/share/CMakeLists.txt index b1e61d596e..575c0aea8c 100644 --- a/share/CMakeLists.txt +++ b/share/CMakeLists.txt @@ -1,11 +1,23 @@ add_subdirectory(qtcreator) if (NOT APPLE AND NOT WIN32) + set(DATE_ATTRIBUTE) + if(SHOW_BUILD_DATE) + string(TIMESTAMP timestamp "%Y-%m-%d") + set(DATE_ATTRIBUTE " date=\"${timestamp}\"") + endif() + configure_file(metainfo/org.qt-project.qtcreator.appdata.xml.cmakein metainfo/org.qt-project.qtcreator.appdata.xml) + install( DIRECTORY applications - metainfo DESTINATION ${CMAKE_INSTALL_DATAROOTDIR} ) + install( + FILES + ${CMAKE_CURRENT_BINARY_DIR}/metainfo/org.qt-project.qtcreator.appdata.xml + DESTINATION + ${CMAKE_INSTALL_DATAROOTDIR}/metainfo/ + ) endif() diff --git a/share/metainfo/org.qt-project.qtcreator.appdata.xml b/share/metainfo/org.qt-project.qtcreator.appdata.xml.cmakein index 4706e69b22..b721029a0a 100644 --- a/share/metainfo/org.qt-project.qtcreator.appdata.xml +++ b/share/metainfo/org.qt-project.qtcreator.appdata.xml.cmakein @@ -26,4 +26,20 @@ <url type="homepage">https://www.qt.io/ide/</url> <project_group>Qt</project_group> + <content_rating type="oars-1.1" /> + <screenshots> + <screenshot> + <image>https://doc.qt.io/qtcreator/images/qtcreator-breakdown.png</image> + </screenshot> + <screenshot> + <image>https://doc.qt.io/qtcreator/images/qtcreator-qt-quick-editors.png</image> + </screenshot> + </screenshots> + <releases> + <release version="${IDE_VERSION_DISPLAY}"${DATE_ATTRIBUTE}> + <description> + <p>Qt Creator v${IDE_VERSION_DISPLAY}</p> + </description> + </release> + </releases> </component> diff --git a/share/qtcreator/debugger/creatortypes.py b/share/qtcreator/debugger/creatortypes.py index 52a9893421..bddfbb8f4f 100644 --- a/share/qtcreator/debugger/creatortypes.py +++ b/share/qtcreator/debugger/creatortypes.py @@ -221,12 +221,26 @@ def qdump__CPlusPlus__Internal__Value(d, value): def qdump__Utils__FilePath(d, value): try: + # support FilePath before 4.15 as well if not d.extractPointer(value["m_url"]): # there is no valid URL d.putStringValue(value["m_data"]) else: d.putItem(value["m_url"]) except: - d.putStringValue(value) # support FileName before 4.10 as well + scheme, host, path = d.split("{@QString}{@QString}{@QString}", value) + scheme_enc = d.encodeString(scheme) + host_enc = d.encodeString(host) + path_enc = d.encodeString(path) + val = "" + slash = "2F00" + dot = "2E00" + colon = "3A00" + if len(scheme_enc): + val = scheme_enc + colon + slash + slash + host_enc + if not path_enc.startswith(slash): + val += slash + dot + slash + val += path_enc + d.putValue(val, "utf16") d.putPlainChildren(value) diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py index c2a3fa94a5..0c810556b9 100644 --- a/share/qtcreator/debugger/gdbbridge.py +++ b/share/qtcreator/debugger/gdbbridge.py @@ -177,12 +177,14 @@ class PlainDumper(): def importPlainDumpers(args): if args == 'off': + theDumper.usePlainDumpers = False try: gdb.execute('disable pretty-printer .* .*') except: # Might occur in non-ASCII directories DumperBase.warn('COULD NOT DISABLE PRETTY PRINTERS') else: + theDumper.usePlainDumpers = True theDumper.importPlainDumpers() @@ -219,6 +221,9 @@ class Dumper(DumperBase): def __init__(self): DumperBase.__init__(self) + # whether to load plain dumpers for objfiles + self.usePlainDumpers = False + # These values will be kept between calls to 'fetchVariables'. self.isGdb = True self.typeCache = {} @@ -1033,11 +1038,14 @@ class Dumper(DumperBase): self.qqDumpers[name] = PlainDumper(printer) self.qqFormats[name] = '' + def importPlainDumpersForObj(self, obj): + for printers in obj.pretty_printers + gdb.pretty_printers: + for printer in printers.subprinters: + self.importPlainDumper(printer) + def importPlainDumpers(self): for obj in gdb.objfiles(): - for printers in obj.pretty_printers + gdb.pretty_printers: - for printer in printers.subprinters: - self.importPlainDumper(printer) + self.importPlainDumpersForObj(obj) def qtNamespace(self): # This function is replaced by handleQtCoreLoaded() @@ -1060,6 +1068,9 @@ class Dumper(DumperBase): self.addDebugLibs(objfile) self.handleQtCoreLoaded(objfile) + if self.usePlainDumpers: + self.importPlainDumpersForObj(objfile) + def addDebugLibs(self, objfile): # The directory where separate debug symbols are searched for # is "/usr/lib/debug". diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py index 651719dfff..7888752a23 100644 --- a/share/qtcreator/debugger/lldbbridge.py +++ b/share/qtcreator/debugger/lldbbridge.py @@ -1107,13 +1107,59 @@ class Dumper(DumperBase): return isNativeMixed = int(args.get('nativemixed', 0)) + extraQml = int(args.get('extraqml', '0')) limit = args.get('stacklimit', -1) (n, isLimited) = (limit, True) if limit > 0 else (thread.GetNumFrames(), False) self.currentCallContext = None result = 'stack={current-thread="%d"' % thread.GetThreadID() result += ',frames=[' - for i in range(n): + + ii = 0 + if extraQml: + ns = self.qtNamespace() + needle = self.qtNamespace() + 'QV4::ExecutionEngine' + pats = [ + '{0}qt_v4StackTraceForEngine((void*)0x{1:x})', + '{0}qt_v4StackTrace((({0}QV4::ExecutionEngine *)0x{1:x})->currentContext())', + '{0}qt_v4StackTrace((({0}QV4::ExecutionEngine *)0x{1:x})->currentContext)', + ] + done = False + while ii < n and not done: + res = None + frame = thread.GetFrameAtIndex(ii) + if not frame.IsValid(): + break + for variable in frame.GetVariables(True, True, False, True): + if not variable.GetType().IsPointerType(): + continue + derefvar = variable.Dereference() + if derefvar.GetType().GetName() != needle: + continue + addr = derefvar.GetLoadAddress() + for pat in pats: + exp = pat.format(ns, addr) + val = frame.EvaluateExpression(exp) + err = val.GetError() + res = str(val) + if err.Fail(): + continue + pos = res.find('"stack=[') + if pos == -1: + continue + res = res[pos + 8:-2] + res = res.replace('\\\"', '\"') + res = res.replace('func=', 'function=') + result += res + done = True + break + ii += 1 + # if we have not found a qml stack do not omit original stack + if not done: + DumperBase.warn("Failed to fetch qml stack - you need Qt debug information") + ii = 0 + + for i in range(n - ii): frame = thread.GetFrameAtIndex(i) if not frame.IsValid(): isLimited = False diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/RotateGizmo.qml b/share/qtcreator/qml/qmlpuppet/mockfiles/RotateGizmo.qml index 6fccfbcdc7..880ced6e9c 100644 --- a/share/qtcreator/qml/qmlpuppet/mockfiles/RotateGizmo.qml +++ b/share/qtcreator/qml/qmlpuppet/mockfiles/RotateGizmo.qml @@ -40,16 +40,28 @@ Node { property real currentAngle property point currentMousePos property alias freeDraggerArea: mouseAreaFree + property bool blocked: false position: dragHelper.pivotScenePosition(targetNode) - onTargetNodeChanged: position = dragHelper.pivotScenePosition(targetNode) + onTargetNodeChanged: { + position = dragHelper.pivotScenePosition(targetNode); + blocked = _generalHelper.isRotationBlocked(targetNode); + } Connections { target: rotateGizmo.targetNode function onSceneTransformChanged() { - rotateGizmo.position = rotateGizmo.dragHelper.pivotScenePosition(rotateGizmo.targetNode); + rotateGizmo.position = dragHelper.pivotScenePosition(targetNode); + } + } + + Connections { + target: _generalHelper + function onRotationBlocksChanged() + { + blocked = _generalHelper.isRotationBlocked(targetNode); } } @@ -82,11 +94,12 @@ Node { objectName: "Rotate Ring X" eulerRotation: Qt.vector3d(0, 90, 0) targetNode: rotateGizmo.targetNode - color: highlightOnHover && (hovering || dragging) ? Qt.lighter(Qt.rgba(1, 0, 0, 1)) - : Qt.rgba(1, 0, 0, 1) + color: rotateGizmo.blocked ? Qt.rgba(0.5, 0.5, 0.5, 1) + : highlightOnHover && (hovering || dragging) + ? Qt.lighter(Qt.rgba(1, 0, 0, 1)) : Qt.rgba(1, 0, 0, 1) priority: 40 view3D: rotateGizmo.view3D - active: rotateGizmo.visible + active: rotateGizmo.visible && !rotateGizmo.blocked dragHelper: rotateGizmo.dragHelper onRotateCommit: rotateGizmo.rotateCommit() @@ -100,13 +113,14 @@ Node { objectName: "Rotate Ring Y" eulerRotation: Qt.vector3d(90, 0, 0) targetNode: rotateGizmo.targetNode - color: highlightOnHover && (hovering || dragging) ? Qt.lighter(Qt.rgba(0, 0.6, 0, 1)) - : Qt.rgba(0, 0.6, 0, 1) + color: rotateGizmo.blocked ? Qt.rgba(0.5, 0.5, 0.5, 1) + : highlightOnHover && (hovering || dragging) + ? Qt.lighter(Qt.rgba(0, 0.6, 0, 1)) : Qt.rgba(0, 0.6, 0, 1) // Just a smidge smaller than higher priority rings so that it doesn't obscure them scale: Qt.vector3d(0.998, 0.998, 0.998) priority: 30 view3D: rotateGizmo.view3D - active: rotateGizmo.visible + active: rotateGizmo.visible && !rotateGizmo.blocked dragHelper: rotateGizmo.dragHelper onRotateCommit: rotateGizmo.rotateCommit() @@ -120,13 +134,14 @@ Node { objectName: "Rotate Ring Z" eulerRotation: Qt.vector3d(0, 0, 0) targetNode: rotateGizmo.targetNode - color: highlightOnHover && (hovering || dragging) ? Qt.lighter(Qt.rgba(0, 0, 1, 1)) - : Qt.rgba(0, 0, 1, 1) + color: rotateGizmo.blocked ? Qt.rgba(0.5, 0.5, 0.5, 1) + : highlightOnHover && (hovering || dragging) + ? Qt.lighter(Qt.rgba(0, 0, 1, 1)) : Qt.rgba(0, 0, 1, 1) // Just a smidge smaller than higher priority rings so that it doesn't obscure them scale: Qt.vector3d(0.996, 0.996, 0.996) priority: 20 view3D: rotateGizmo.view3D - active: rotateGizmo.visible + active: rotateGizmo.visible && !rotateGizmo.blocked dragHelper: rotateGizmo.dragHelper onRotateCommit: rotateGizmo.rotateCommit() @@ -154,12 +169,14 @@ Node { objectName: "cameraRing" rotation: rotateGizmo.view3D.camera.rotation targetNode: rotateGizmo.targetNode - color: highlightOnHover && (hovering || dragging) ? Qt.lighter(Qt.rgba(0.5, 0.5, 0.5, 1)) - : Qt.rgba(0.5, 0.5, 0.5, 1) + color: rotateGizmo.blocked ? Qt.rgba(0.5, 0.5, 0.5, 1) + : highlightOnHover && (hovering || dragging) + ? Qt.lighter(Qt.rgba(0.5, 0.5, 0.5, 1)) + : Qt.rgba(0.5, 0.5, 0.5, 1) scale: Qt.vector3d(1.1, 1.1, 1.1) priority: 10 view3D: rotateGizmo.view3D - active: rotateGizmo.visible + active: rotateGizmo.visible && !rotateGizmo.blocked dragHelper: rotateGizmo.dragHelper visible: !rotRingX.dragging && !rotRingY.dragging && !rotRingZ.dragging && !freeRotator.dragging @@ -176,7 +193,7 @@ Node { materials: DefaultMaterial { id: material diffuseColor: "black" - opacity: mouseAreaFree.hovering ? 0.15 : 0 + opacity: mouseAreaFree.hovering && !rotateGizmo.blocked ? 0.15 : 0 lighting: DefaultMaterial.NoLighting } scale: Qt.vector3d(0.15, 0.15, 0.15) @@ -184,7 +201,6 @@ Node { property bool dragging: false property vector3d _pointerPosPressed - property vector3d _targetPosOnScreen property vector3d _startRotation function handlePressed(screenPos) @@ -195,14 +211,20 @@ Node { // Need to recreate vector as we need to adjust it and we can't do that on reference of // scenePosition, which is read-only property var scenePos = rotateGizmo.dragHelper.pivotScenePosition(rotateGizmo.targetNode); - _targetPosOnScreen = view3D.mapFrom3DScene(scenePos); - _targetPosOnScreen.z = 0; _pointerPosPressed = Qt.vector3d(screenPos.x, screenPos.y, 0); // Recreate vector so we don't follow the changes in targetNode.rotation _startRotation = Qt.vector3d(rotateGizmo.targetNode.eulerRotation.x, rotateGizmo.targetNode.eulerRotation.y, rotateGizmo.targetNode.eulerRotation.z); + // Ensure we never set NaN values for rotation, even if target node originally has them + if (isNaN(_startRotation.x)) + _startRotation.x = 0; + if (isNaN(_startRotation.y)) + _startRotation.y = 0; + if (isNaN(_startRotation.z)) + _startRotation.z = 0; + dragging = true; } @@ -213,7 +235,7 @@ Node { mouseAreaFree.applyFreeRotation( rotateGizmo.targetNode, _startRotation, _pointerPosPressed, - Qt.vector3d(screenPos.x, screenPos.y, 0), _targetPosOnScreen); + Qt.vector3d(screenPos.x, screenPos.y, 0)); rotateGizmo.rotateChange(); } @@ -225,7 +247,7 @@ Node { mouseAreaFree.applyFreeRotation( rotateGizmo.targetNode, _startRotation, _pointerPosPressed, - Qt.vector3d(screenPos.x, screenPos.y, 0), _targetPosOnScreen); + Qt.vector3d(screenPos.x, screenPos.y, 0)); rotateGizmo.rotateCommit(); dragging = false; @@ -242,7 +264,7 @@ Node { height: 100 circlePickArea: Qt.point(25, 50) grabsMouse: rotateGizmo.targetNode - active: rotateGizmo.visible + active: rotateGizmo.visible && !rotateGizmo.blocked dragHelper: rotateGizmo.dragHelper onPressed: freeRotator.handlePressed(screenPos) diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/RotateRing.qml b/share/qtcreator/qml/qmlpuppet/mockfiles/RotateRing.qml index 00494a5d91..19760b8ff9 100644 --- a/share/qtcreator/qml/qmlpuppet/mockfiles/RotateRing.qml +++ b/share/qtcreator/qml/qmlpuppet/mockfiles/RotateRing.qml @@ -90,6 +90,13 @@ Model { _startRotation = Qt.vector3d(targetNode.eulerRotation.x, targetNode.eulerRotation.y, targetNode.eulerRotation.z); + // Ensure we never set NaN values for rotation, even if target node originally has them + if (isNaN(_startRotation.x)) + _startRotation.x = 0; + if (isNaN(_startRotation.y)) + _startRotation.y = 0; + if (isNaN(_startRotation.z)) + _startRotation.z = 0; currentAngle = 0; currentMousePos = screenPos; } diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.cpp index 133035de20..f65e3ccc4f 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.cpp @@ -356,6 +356,24 @@ bool GeneralHelper::isMacOS() const #endif } +void GeneralHelper::addRotationBlocks(const QSet<QQuick3DNode *> &nodes) +{ + m_rotationBlockedNodes.unite(nodes); + emit rotationBlocksChanged(); +} + +void GeneralHelper::removeRotationBlocks(const QSet<QQuick3DNode *> &nodes) +{ + for (auto node : nodes) + m_rotationBlockedNodes.remove(node); + emit rotationBlocksChanged(); +} + +bool GeneralHelper::isRotationBlocked(QQuick3DNode *node) const +{ + return m_rotationBlockedNodes.contains(node); +} + bool GeneralHelper::eventFilter(QObject *obj, QEvent *event) { if (event->type() == QEvent::DynamicPropertyChange) { diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.h index 6347520e69..212411eee4 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.h @@ -93,11 +93,16 @@ public: bool isMacOS() const; + void addRotationBlocks(const QSet<QQuick3DNode *> &nodes); + void removeRotationBlocks(const QSet<QQuick3DNode *> &nodes); + Q_INVOKABLE bool isRotationBlocked(QQuick3DNode *node) const; + signals: void overlayUpdateNeeded(); void toolStateChanged(const QString &sceneId, const QString &tool, const QVariant &toolState); void hiddenStateChanged(QQuick3DNode *node); void lockedStateChanged(QQuick3DNode *node); + void rotationBlocksChanged(); protected: bool eventFilter(QObject *obj, QEvent *event) final; @@ -110,6 +115,7 @@ private: QHash<QString, QVariantMap> m_toolStates; QHash<QString, QVariantMap> m_toolStatesPending; QSet<QQuick3DNode *> m_gizmoTargets; + QSet<QQuick3DNode *> m_rotationBlockedNodes; }; } diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp index 1f3a662d3e..2b2ec60da8 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp @@ -63,6 +63,7 @@ #include "inputeventcommand.h" #include "view3dactioncommand.h" #include "requestmodelnodepreviewimagecommand.h" +#include "changeauxiliarycommand.h" #include "dummycontextobject.h" #include "../editor3d/generalhelper.h" @@ -288,6 +289,57 @@ void Qt5InformationNodeInstanceServer::resolveImportSupport() #endif } +void Qt5InformationNodeInstanceServer::updateRotationBlocks(const QVector<PropertyValueContainer> &valueChanges) +{ +#ifdef QUICK3D_MODULE + auto helper = qobject_cast<QmlDesigner::Internal::GeneralHelper *>(m_3dHelper); + if (helper) { + QSet<QQuick3DNode *> blockedNodes; + QSet<QQuick3DNode *> unblockedNodes; + const PropertyName propName = "rotBlocked@internal"; + for (const auto &container : valueChanges) { + if (container.name() == propName) { + ServerNodeInstance instance = instanceForId(container.instanceId()); + if (instance.isValid()) { + auto node = qobject_cast<QQuick3DNode *>(instance.internalObject()); + if (node) { + if (container.value().toBool()) + blockedNodes.insert(node); + else + unblockedNodes.insert(node); + } + } + } + } + helper->addRotationBlocks(blockedNodes); + helper->removeRotationBlocks(unblockedNodes); + } +#else + Q_UNUSED(valueChanges) +#endif +} + +void Qt5InformationNodeInstanceServer::removeRotationBlocks(const QVector<qint32> &instanceIds) +{ +#ifdef QUICK3D_MODULE + auto helper = qobject_cast<QmlDesigner::Internal::GeneralHelper *>(m_3dHelper); + if (helper) { + QSet<QQuick3DNode *> unblockedNodes; + for (const auto &id : instanceIds) { + ServerNodeInstance instance = instanceForId(id); + if (instance.isValid()) { + auto node = qobject_cast<QQuick3DNode *>(instance.internalObject()); + if (node) + unblockedNodes.insert(node); + } + } + helper->removeRotationBlocks(unblockedNodes); + } +#else + Q_UNUSED(instanceIds) +#endif +} + void Qt5InformationNodeInstanceServer::createEditView3D() { #ifdef QUICK3D_MODULE @@ -1492,8 +1544,10 @@ void Qt5InformationNodeInstanceServer::createScene(const CreateSceneCommand &com sendChildrenChangedCommand(instanceList); nodeInstanceClient()->componentCompleted(createComponentCompletedCommand(instanceList)); - if (isQuick3DMode()) + if (isQuick3DMode()) { setup3DEditView(instanceList, command.edit3dToolStates); + updateRotationBlocks(command.auxiliaryChanges); + } QObject::connect(&m_renderModelNodeImageViewTimer, &QTimer::timeout, this, &Qt5InformationNodeInstanceServer::doRenderModelNodeImageView); @@ -1656,6 +1710,8 @@ void Qt5InformationNodeInstanceServer::removeInstances(const RemoveInstancesComm { int nodeCount = m_3DSceneMap.size(); + removeRotationBlocks(command.instanceIds()); + Qt5NodeInstanceServer::removeInstances(command); if (nodeCount != m_3DSceneMap.size()) { @@ -1741,6 +1797,7 @@ void Qt5InformationNodeInstanceServer::requestModelNodePreviewImage(const Reques void Qt5InformationNodeInstanceServer::changeAuxiliaryValues(const ChangeAuxiliaryCommand &command) { + updateRotationBlocks(command.auxiliaryChanges); Qt5NodeInstanceServer::changeAuxiliaryValues(command); render3DEditView(); } diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.h index 55a07379b4..6e882e8728 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.h @@ -30,6 +30,8 @@ #include "valueschangedcommand.h" #include "changeselectioncommand.h" #include "requestmodelnodepreviewimagecommand.h" +#include "propertybindingcontainer.h" +#include "propertyabstractcontainer.h" #include <QTimer> #include <QVariant> @@ -132,6 +134,8 @@ private: void updateLockedAndHiddenStates(const QSet<ServerNodeInstance> &instances); void handleInputEvents(); void resolveImportSupport(); + void updateRotationBlocks(const QVector<PropertyValueContainer> &valueChanges); + void removeRotationBlocks(const QVector<qint32> &instanceIds); void createAuxiliaryQuickView(const QUrl &url, RenderViewData &viewData); diff --git a/share/qtcreator/qmldesigner/formatconfiguration.json b/share/qtcreator/qmldesigner/formatconfiguration.json new file mode 100644 index 0000000000..8526c710c7 --- /dev/null +++ b/share/qtcreator/qmldesigner/formatconfiguration.json @@ -0,0 +1,24 @@ +{ + "propertylist" : [ + { + "id": "textItem", + "subclasses": ["QtQuick.Text","QtQuick.TextInput","QtQuick.TextEdit"], + "properties": ["font.bold","font.italic","font.underline","color","font.capitalization","font.family","font.hintingPreference", + "font.kerning","font.letterSpacing","font.pixelSize","font.pointSize","font.preferShaping","font.strikeout", + "font.styleName","font.weight","font.wordSpacing","fontInfo.bold","fontInfo.family","fontInfo.italic","fontInfo.pixelSize", + "fontInfo.pointSize","fontInfo.styleName","fontInfo.weight","lineHeight","lineHeightMode","linkColor", + "maximumLineCount","minimumPixelSize","minimumPointSize","renderType","style","styleColor","padding","topPadding", + "bottomPadding","leftPadding","rightPadding"] + }, + { + "id": "rectangleItem", + "subclasses": ["QtQuick.Rectangle"], + "properties": ["color","border.color","border.width","radius"] + }, + { + "id":"positionerItem", + "subclasses": ["QtQuick.Row","QtQuick.Column","QtQuick.Grid"], + "properties": ["padding", "spacing", "topPadding", "bottomPadding", "leftPadding", "rightPadding"] + } + ] +} diff --git a/share/qtcreator/qmldesigner/itemLibraryQmlSources/Assets.qml b/share/qtcreator/qmldesigner/itemLibraryQmlSources/Assets.qml new file mode 100644 index 0000000000..58f42cdb5d --- /dev/null +++ b/share/qtcreator/qmldesigner/itemLibraryQmlSources/Assets.qml @@ -0,0 +1,184 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 1.15 +import QtQuickDesignerTheme 1.0 +import HelperWidgets 2.0 +import StudioControls 1.0 as StudioControls +import StudioTheme 1.0 as StudioTheme + +Item { + DropArea { + id: dropArea + + property var files // list of supported dropped files + + enabled: true + anchors.fill: parent + + onEntered: { + files = [] + for (var i = 0; i < drag.urls.length; ++i) { + var url = drag.urls[i].toString(); + if (url.startsWith("file:///")) // remove file scheme (happens on Windows) + url = url.substr(8) + var ext = url.slice(url.lastIndexOf('.') + 1).toLowerCase() + if (rootView.supportedSuffixes().includes('*.' + ext)) + files.push(url) + } + + if (files.length === 0) + drag.accepted = false; + } + + onDropped: { + if (files.length > 0) + rootView.handleFilesDrop(files) + } + } + + ScrollView { // TODO: experiment using ListView instead of ScrollView + Column + id: assetsView + anchors.fill: parent + + Column { + spacing: 2 + Repeater { + model: assetsModel // context property + delegate: dirSection + } + + Component { + id: dirSection + + Section { + width: assetsView.width - + (assetsView.verticalScrollBarVisible ? assetsView.verticalThickness : 0) + caption: dirName + sectionHeight: 30 + sectionFontSize: 15 + contentLevel: dirDepth + levelShift: 20 + leftPadding: 0 + hideHeader: dirDepth === 0 + showLeftBorder: true + expanded: dirExpanded + visible: dirVisible + expandOnClick: false + onToggleExpand: { + dirExpanded = !dirExpanded + } + + Column { + spacing: 5 + leftPadding: 15 + + Repeater { + model: dirsModel + delegate: dirSection + } + + Repeater { + model: filesModel + delegate: fileSection + } + } + } + } + + Component { + id: fileSection + + Rectangle { + width: assetsView.width - + (assetsView.verticalScrollBarVisible ? assetsView.verticalThickness : 0) + height: img.height + color: mouseArea.containsMouse ? "#444444" : "transparent" + + Row { + spacing: 5 + + Image { + id: img + asynchronous: true + width: 48 + height: 48 + source: "image://qmldesigner_assets/" + filePath + } + + Text { + text: fileName + color: StudioTheme.Values.themeTextColor + font.pixelSize: 14 + anchors.verticalCenter: parent.verticalCenter + } + } + + readonly property string suffix: fileName.substr(-4) + readonly property bool isFont: suffix === ".ttf" || suffix === ".otf" + + MouseArea { + id: mouseArea + + anchors.fill: parent + hoverEnabled: true + acceptedButtons: Qt.LeftButton | Qt.RightButton + + onExited: tooltipBackend.hideTooltip() + onCanceled: tooltipBackend.hideTooltip() + onPositionChanged: tooltipBackend.reposition() + onPressed: { + forceActiveFocus() + if (mouse.button === Qt.LeftButton) + rootView.startDragAsset(filePath) + else + print("TODO: impl context menu") + } + + ToolTip { + visible: !isFont && mouseArea.containsMouse + text: filePath + delay: 1000 + } + + Timer { + interval: 1000 + running: mouseArea.containsMouse + onTriggered: { + if (suffix === ".ttf" || suffix === ".otf") { + tooltipBackend.name = fileName + tooltipBackend.path = filePath + tooltipBackend.showTooltip() + } + } + } + } + } + } + } + } +} diff --git a/share/qtcreator/qmldesigner/itemLibraryQmlSources/ItemsView.qml b/share/qtcreator/qmldesigner/itemLibraryQmlSources/ItemsView.qml index f574917440..6742aceda8 100644 --- a/share/qtcreator/qmldesigner/itemLibraryQmlSources/ItemsView.qml +++ b/share/qtcreator/qmldesigner/itemLibraryQmlSources/ItemsView.qml @@ -225,7 +225,8 @@ ScrollView { importToRemove = importRemovable ? importUrl : "" currentImport = model currentCategory = null - moduleContextMenu.popup() + if (!rootView.isSearchActive()) + moduleContextMenu.popup() } Column { @@ -251,7 +252,8 @@ ScrollView { onShowContextMenu: { currentCategory = model currentImport = parent.currentImportModel - moduleContextMenu.popup() + if (!rootView.isSearchActive()) + moduleContextMenu.popup() } Grid { diff --git a/share/qtcreator/qmldesigner/itemLibraryQmlSources/LibraryHeader.qml b/share/qtcreator/qmldesigner/itemLibraryQmlSources/LibraryHeader.qml index 164a103422..52570b230c 100644 --- a/share/qtcreator/qmldesigner/itemLibraryQmlSources/LibraryHeader.qml +++ b/share/qtcreator/qmldesigner/itemLibraryQmlSources/LibraryHeader.qml @@ -32,8 +32,6 @@ import StudioTheme 1.0 as StudioTheme Item { id: root - width: 200 - height: 75 function setTab(index) { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ExtendedFunctionLogic.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ExtendedFunctionLogic.qml index 57c39fcd68..d257ccf0cc 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ExtendedFunctionLogic.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ExtendedFunctionLogic.qml @@ -105,6 +105,13 @@ Item { extendedFunctionButton.menuVisible = false } + Connections { + target: modelNodeBackend + onSelectionChanged: { + menu.close() + } + } + StudioControls.MenuItem { text: qsTr("Reset") onTriggered: { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Section.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Section.qml index 09697c23ec..458c5d3150 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Section.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Section.qml @@ -38,12 +38,14 @@ Item { property alias sectionFontSize: label.font.pixelSize property alias showTopSeparator: topSeparator.visible property alias showArrow: arrow.visible + property alias showLeftBorder: leftBorder.visible property int leftPadding: 8 property int rightPadding: 0 property bool expanded: true - property int level: 0 + property int level: 0 // affects arrow and title + property int contentLevel: 0 // affects whole section property int levelShift: 10 property bool hideHeader: false property bool expandOnClick: true // if false, toggleExpand signal will be emitted instead @@ -138,6 +140,14 @@ Item { anchors.top: topSpacer.bottom } + Rectangle { + id: leftBorder + visible: false + width: 1 + height: parent.height - 15 + color: header.color + } + Item { id: bottomSpacer height: addBottomPadding && row.height > 0 ? StudioTheme.Values.sectionHeadSpacerHeight : 0 @@ -160,12 +170,12 @@ Item { ] transitions: Transition { - id: trans - enabled: false - NumberAnimation { - properties: "implicitHeight,rotation"; - duration: 120; - easing.type: Easing.OutCubic - } + id: trans + enabled: false + NumberAnimation { + properties: "implicitHeight,rotation"; + duration: 120; + easing.type: Easing.OutCubic } + } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/SpinBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/SpinBox.qml index 916bfc29d9..ca8f075fee 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/SpinBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/SpinBox.qml @@ -50,6 +50,17 @@ Item { transaction.end(); } + Component.onCompleted: { + spinBox.enabled = !isBlocked(backendValue.name); + } + + Connections { + target: modelNodeBackend + function onSelectionChanged() { + spinBox.enabled = !isBlocked(backendValue.name); + } + } + StudioControls.RealSpinBox { id: spinBox diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/InternalConstants.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/InternalConstants.qml index 19e319be32..bdbc8d95fc 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/InternalConstants.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/InternalConstants.qml @@ -48,99 +48,110 @@ QtObject { readonly property string adsDropDown: "\u002B" readonly property string alias: "\u002C" readonly property string aliasAnimated: "\u002D" - readonly property string aliasProperty: "\u002E" - readonly property string alignBottom: "\u002F" - readonly property string alignCenterHorizontal: "\u0030" - readonly property string alignCenterVertical: "\u0031" - readonly property string alignLeft: "\u0032" - readonly property string alignRight: "\u0033" - readonly property string alignTo: "\u0034" - readonly property string alignTop: "\u0035" - readonly property string anchorBaseline: "\u0036" - readonly property string anchorBottom: "\u0037" - readonly property string anchorFill: "\u0038" - readonly property string anchorLeft: "\u0039" - readonly property string anchorRight: "\u003A" - readonly property string anchorTop: "\u003B" - readonly property string animatedProperty: "\u003C" - readonly property string annotationBubble: "\u003D" - readonly property string annotationDecal: "\u003E" - readonly property string assign: "\u003F" - readonly property string centerHorizontal: "\u0040" - readonly property string centerVertical: "\u0041" - readonly property string closeCross: "\u0042" - readonly property string curveDesigner: "\u0043" - readonly property string curveEditor: "\u0044" - readonly property string decisionNode: "\u0045" - readonly property string deleteColumn: "\u0046" - readonly property string deleteRow: "\u0047" - readonly property string deleteTable: "\u0048" - readonly property string detach: "\u0049" - readonly property string distributeBottom: "\u004A" - readonly property string distributeCenterHorizontal: "\u004B" - readonly property string distributeCenterVertical: "\u004C" - readonly property string distributeLeft: "\u004D" - readonly property string distributeOriginBottomRight: "\u004E" - readonly property string distributeOriginCenter: "\u004F" - readonly property string distributeOriginNone: "\u0050" - readonly property string distributeOriginTopLeft: "\u0051" - readonly property string distributeRight: "\u0052" - readonly property string distributeSpacingHorizontal: "\u0053" - readonly property string distributeSpacingVertical: "\u0054" - readonly property string distributeTop: "\u0055" - readonly property string edit: "\u0056" - readonly property string flowAction: "\u0057" - readonly property string flowTransition: "\u0058" - readonly property string fontStyleBold: "\u0059" - readonly property string fontStyleItalic: "\u005A" - readonly property string fontStyleStrikethrough: "\u005B" - readonly property string fontStyleUnderline: "\u005C" - readonly property string gridView: "\u005D" - readonly property string idAliasOff: "\u005E" - readonly property string idAliasOn: "\u005F" - readonly property string keyframe: "\u0060" - readonly property string linkTriangle: "\u0061" - readonly property string linked: "\u0062" - readonly property string listView: "\u0063" - readonly property string lockOff: "\u0064" - readonly property string lockOn: "\u0065" - readonly property string mergeCells: "\u0066" - readonly property string minus: "\u0067" - readonly property string mirror: "\u0068" - readonly property string pin: "\u0069" - readonly property string plus: "\u006A" - readonly property string promote: "\u006B" - readonly property string redo: "\u006C" - readonly property string rotationFill: "\u006D" - readonly property string rotationOutline: "\u006E" - readonly property string search: "\u006F" - readonly property string splitColumns: "\u0070" - readonly property string splitRows: "\u0071" - readonly property string startNode: "\u0072" - readonly property string testIcon: "\u0073" - readonly property string textAlignBottom: "\u0074" - readonly property string textAlignCenter: "\u0075" - readonly property string textAlignLeft: "\u0076" - readonly property string textAlignMiddle: "\u0077" - readonly property string textAlignRight: "\u0078" - readonly property string textAlignTop: "\u0079" - readonly property string textBulletList: "\u007A" - readonly property string textFullJustification: "\u007B" - readonly property string textNumberedList: "\u007C" - readonly property string tickIcon: "\u007D" - readonly property string triState: "\u007E" - readonly property string unLinked: "\u007F" - readonly property string undo: "\u0080" - readonly property string unpin: "\u0081" - readonly property string upDownIcon: "\u0082" - readonly property string upDownSquare2: "\u0083" - readonly property string visibilityOff: "\u0084" - readonly property string visibilityOn: "\u0085" - readonly property string wildcard: "\u0086" - readonly property string zoomAll: "\u0087" - readonly property string zoomIn: "\u0088" - readonly property string zoomOut: "\u0089" - readonly property string zoomSelection: "\u008A" + readonly property string alignBottom: "\u002E" + readonly property string alignCenterHorizontal: "\u002F" + readonly property string alignCenterVertical: "\u0030" + readonly property string alignLeft: "\u0031" + readonly property string alignRight: "\u0032" + readonly property string alignTo: "\u0033" + readonly property string alignTop: "\u0034" + readonly property string anchorBaseline: "\u0035" + readonly property string anchorBottom: "\u0036" + readonly property string anchorFill: "\u0037" + readonly property string anchorLeft: "\u0038" + readonly property string anchorRight: "\u0039" + readonly property string anchorTop: "\u003A" + readonly property string animatedProperty: "\u003B" + readonly property string annotationBubble: "\u003C" + readonly property string annotationDecal: "\u003D" + readonly property string assign: "\u003E" + readonly property string bevelAll: "\u003F" + readonly property string bevelCorner: "\u0040" + readonly property string centerHorizontal: "\u0041" + readonly property string centerVertical: "\u0042" + readonly property string closeCross: "\u0043" + readonly property string copyStyle: "\u0044" + readonly property string cornerA: "\u0045" + readonly property string cornerB: "\u0046" + readonly property string cornersAll: "\u0047" + readonly property string curveDesigner: "\u0048" + readonly property string curveEditor: "\u0049" + readonly property string decisionNode: "\u004A" + readonly property string deleteColumn: "\u004B" + readonly property string deleteRow: "\u004C" + readonly property string deleteTable: "\u004D" + readonly property string detach: "\u004E" + readonly property string distributeBottom: "\u004F" + readonly property string distributeCenterHorizontal: "\u0050" + readonly property string distributeCenterVertical: "\u0051" + readonly property string distributeLeft: "\u0052" + readonly property string distributeOriginBottomRight: "\u0053" + readonly property string distributeOriginCenter: "\u0054" + readonly property string distributeOriginNone: "\u0055" + readonly property string distributeOriginTopLeft: "\u0056" + readonly property string distributeRight: "\u0057" + readonly property string distributeSpacingHorizontal: "\u0058" + readonly property string distributeSpacingVertical: "\u0059" + readonly property string distributeTop: "\u005A" + readonly property string edit: "\u005B" + readonly property string eyeDropper: "\u005C" + readonly property string flowAction: "\u005D" + readonly property string flowTransition: "\u005E" + readonly property string fontStyleBold: "\u005F" + readonly property string fontStyleItalic: "\u0060" + readonly property string fontStyleStrikethrough: "\u0061" + readonly property string fontStyleUnderline: "\u0062" + readonly property string gradient: "\u0063" + readonly property string gridView: "\u0064" + readonly property string idAliasOff: "\u0065" + readonly property string idAliasOn: "\u0066" + readonly property string keyframe: "\u0067" + readonly property string linkTriangle: "\u0068" + readonly property string linked: "\u0069" + readonly property string listView: "\u006A" + readonly property string lockOff: "\u006B" + readonly property string lockOn: "\u006C" + readonly property string mergeCells: "\u006D" + readonly property string minus: "\u006E" + readonly property string mirror: "\u006F" + readonly property string paddingEdge: "\u0070" + readonly property string paddingFrame: "\u0071" + readonly property string pasteStyle: "\u0072" + readonly property string pin: "\u0073" + readonly property string plus: "\u0074" + readonly property string promote: "\u0075" + readonly property string redo: "\u0076" + readonly property string rotationFill: "\u0077" + readonly property string rotationOutline: "\u0078" + readonly property string search: "\u0079" + readonly property string splitColumns: "\u007A" + readonly property string splitRows: "\u007B" + readonly property string startNode: "\u007C" + readonly property string testIcon: "\u007D" + readonly property string textAlignBottom: "\u007E" + readonly property string textAlignCenter: "\u007F" + readonly property string textAlignLeft: "\u0080" + readonly property string textAlignMiddle: "\u0081" + readonly property string textAlignRight: "\u0082" + readonly property string textAlignTop: "\u0083" + readonly property string textBulletList: "\u0084" + readonly property string textFullJustification: "\u0085" + readonly property string textNumberedList: "\u0086" + readonly property string tickIcon: "\u0087" + readonly property string transparent: "\u0088" + readonly property string triState: "\u0089" + readonly property string unLinked: "\u008A" + readonly property string undo: "\u008B" + readonly property string unpin: "\u008C" + readonly property string upDownIcon: "\u008D" + readonly property string upDownSquare2: "\u008E" + readonly property string visibilityOff: "\u008F" + readonly property string visibilityOn: "\u0090" + readonly property string wildcard: "\u0091" + readonly property string zoomAll: "\u0092" + readonly property string zoomIn: "\u0093" + readonly property string zoomOut: "\u0094" + readonly property string zoomSelection: "\u0095" readonly property font iconFont: Qt.font({ "family": controlIcons.name, diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/icons.ttf b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/icons.ttf Binary files differindex aef8a37d56..fb3e387077 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/icons.ttf +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/icons.ttf diff --git a/share/qtcreator/styles/creator-dark.xml b/share/qtcreator/styles/creator-dark.xml index 1ab4653423..b86483f30f 100644 --- a/share/qtcreator/styles/creator-dark.xml +++ b/share/qtcreator/styles/creator-dark.xml @@ -20,6 +20,7 @@ <style name="String" foreground="#d69545"/> <style name="Type" foreground="#ff8080"/> <style name="Local" foreground="#d6bb9a"/> + <style name="Parameter" foreground="#d6bb9a"/> <style name="Global" foreground="#9aa7d6"/> <style name="Field"/> <style name="Static" foreground="#66a334" italic="true"/> diff --git a/share/qtcreator/styles/intellij.xml b/share/qtcreator/styles/intellij.xml index b4a30c3f84..ee579f0e36 100644 --- a/share/qtcreator/styles/intellij.xml +++ b/share/qtcreator/styles/intellij.xml @@ -13,6 +13,7 @@ <style name="PrimitiveType" foreground="#000080" bold="true"/> <style name="Label" foreground="#800000" bold="true"/> <style name="Local" foreground="#000000"/> + <style name="Parameter" foreground="#000000"/> <style name="Number" foreground="#0000ff"/> <style name="Operator" foreground="#000000"/> <style name="Overloaded Operator" foreground="#000000"/> diff --git a/share/qtcreator/styles/solarized-dark.xml b/share/qtcreator/styles/solarized-dark.xml index 1d7b64058d..6930af67e0 100644 --- a/share/qtcreator/styles/solarized-dark.xml +++ b/share/qtcreator/styles/solarized-dark.xml @@ -26,6 +26,7 @@ <style name="String" foreground="#2aa198"/> <style name="Type" foreground="#b58900"/> <style name="Local" foreground="#839496"/> + <style name="Parameter" foreground="#839496"/> <style name="Global"/> <style name="Field" foreground="#268bd2"/> <style name="Static" foreground="#b58900" italic="true"/> diff --git a/share/qtcreator/styles/solarized-light.xml b/share/qtcreator/styles/solarized-light.xml index 4344e94d64..221fc8c211 100644 --- a/share/qtcreator/styles/solarized-light.xml +++ b/share/qtcreator/styles/solarized-light.xml @@ -26,6 +26,7 @@ <style name="String" foreground="#2aa198"/> <style name="Type" foreground="#b58900"/> <style name="Local" foreground="#657b83"/> + <style name="Parameter" foreground="#657b83"/> <style name="Global"/> <style name="Field" foreground="#268bd2"/> <style name="Static" foreground="#b58900" italic="true"/> diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/empty/wizard.json b/share/qtcreator/templates/wizards/projects/qtquickapplication/empty/wizard.json index 444f22d2de..2cf267e30d 100644 --- a/share/qtcreator/templates/wizards/projects/qtquickapplication/empty/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/empty/wizard.json @@ -20,7 +20,7 @@ { "key": "QtQuickVersion", "value": "%{JS: value('QtVersion').QtQuickVersion}" }, { "key": "QtQuickWindowVersion", "value": "%{JS: value('QtVersion').QtQuickWindowVersion}" }, { "key": "QtQuickVirtualKeyboardImport", "value": "%{JS: value('QtVersion').QtQuickVirtualKeyboardImport}" }, - { "key": "QtQuickFeature", "value": "QtSupport.Wizards.FeatureQtQuick.%{QtQuickVersion}" }, + { "key": "QtQuickFeature", "value": "%{JS: (value('QtQuickVersion')=='') ? 'QtSupport.Wizards.FeatureQtQuick.6' : 'QtSupport.Wizards.FeatureQtQuick.%{QtQuickVersion}'}" }, { "key": "UseVirtualKeyboardByDefault", "value": "%{JS: value('Plugins').indexOf('Boot2Qt') >= 0 || value('Plugins').indexOf('Boot2QtQdb') >= 0}" }, { "key": "HasTranslation", "value": "%{JS: value('TsFileName') !== ''}" }, { "key": "SetQPAPhysicalSize", "value": "%{UseVirtualKeyboardByDefault}" } @@ -83,10 +83,19 @@ "persistenceKey": "QtQuick.minimumQtVersion", "data": { - "index": 3, + "index": 1, "items": [ { + "trKey": "Qt 6", + "value": + { + "QtQuickVersion": "", + "QtQuickWindowVersion": "", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard" + } + }, + { "trKey": "Qt 5.15", "value": { @@ -121,60 +130,6 @@ "QtQuickWindowVersion": "2.12", "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.4" } - }, - { - "trKey": "Qt 5.11", - "value": - { - "QtQuickVersion": "2.11", - "QtQuickWindowVersion": "2.11", - "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.3" - } - }, - { - "trKey": "Qt 5.10", - "value": - { - "QtQuickVersion": "2.10", - "QtQuickWindowVersion": "2.10", - "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.3" - } - }, - { - "trKey": "Qt 5.9", - "value": - { - "QtQuickVersion": "2.9", - "QtQuickWindowVersion": "2.2", - "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.2" - } - }, - { - "trKey": "Qt 5.8", - "value": - { - "QtQuickVersion": "2.8", - "QtQuickWindowVersion": "2.2", - "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.1" - } - }, - { - "trKey": "Qt 5.7", - "value": - { - "QtQuickVersion": "2.7", - "QtQuickWindowVersion": "2.2", - "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.1" - } - }, - { - "trKey": "Qt 5.6", - "value": - { - "QtQuickVersion": "2.6", - "QtQuickWindowVersion": "2.2", - "QtQuickVirtualKeyboardImport": "QtQuick.Enterprise.VirtualKeyboard 2.0" - } } ] } diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/scroll/wizard.json b/share/qtcreator/templates/wizards/projects/qtquickapplication/scroll/wizard.json index c7acc28ddd..6a02548958 100644 --- a/share/qtcreator/templates/wizards/projects/qtquickapplication/scroll/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/scroll/wizard.json @@ -22,7 +22,7 @@ { "key": "QtQuickVirtualKeyboardImport", "value": "%{JS: value('QtVersion').QtQuickVirtualKeyboardImport}" }, { "key": "QtQuickControlsStyle", "value": "%{JS: value('ControlsStyle').QtQuickControlsStyle}" }, { "key": "QtQuickControlsStyleTheme", "value": "%{JS: value('ControlsStyle').QtQuickControlsStyleTheme}" }, - { "key": "QtQuickFeature", "value": "QtSupport.Wizards.FeatureQtQuick.%{QtQuickVersion}" }, + { "key": "QtQuickFeature", "value": "%{JS: (value('QtQuickVersion')=='') ? 'QtSupport.Wizards.FeatureQtQuick.6' : 'QtSupport.Wizards.FeatureQtQuick.%{QtQuickVersion}'}" }, { "key": "UseVirtualKeyboardByDefault", "value": "%{JS: value('Plugins').indexOf('Boot2Qt') >= 0 || value('Plugins').indexOf('Boot2QtQdb') >= 0}" }, { "key": "HasTranslation", "value": "%{JS: value('TsFileName') !== ''}" }, { "key": "SetQPAPhysicalSize", "value": "%{UseVirtualKeyboardByDefault}" } @@ -85,10 +85,19 @@ "persistenceKey": "QtQuick.minimumQtVersion", "data": { - "index": 3, + "index": 1, "items": [ { + "trKey": "Qt 6", + "value": + { + "QtQuickVersion": "", + "QtQuickControlsVersion": "", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard" + } + }, + { "trKey": "Qt 5.15", "value": { @@ -123,33 +132,6 @@ "QtQuickControlsVersion": "2.5", "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.4" } - }, - { - "trKey": "Qt 5.11", - "value": - { - "QtQuickVersion": "2.11", - "QtQuickControlsVersion": "2.4", - "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.3" - } - }, - { - "trKey": "Qt 5.10", - "value": - { - "QtQuickVersion": "2.10", - "QtQuickControlsVersion": "2.3", - "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.3" - } - }, - { - "trKey": "Qt 5.9", - "value": - { - "QtQuickVersion": "2.9", - "QtQuickControlsVersion": "2.2", - "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.2" - } } ] } @@ -204,7 +186,7 @@ } }, { - "trKey": "Fusion (Qt 5.10+)", + "trKey": "Fusion", "value": { "QtQuickControlsStyle": "Fusion", @@ -212,7 +194,7 @@ } }, { - "trKey": "Imagine (Qt 5.10+)", + "trKey": "Imagine", "value": { "QtQuickControlsStyle": "Imagine", diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/stack/wizard.json b/share/qtcreator/templates/wizards/projects/qtquickapplication/stack/wizard.json index 572292ec75..8752c9062c 100644 --- a/share/qtcreator/templates/wizards/projects/qtquickapplication/stack/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/stack/wizard.json @@ -22,7 +22,7 @@ { "key": "QtQuickVirtualKeyboardImport", "value": "%{JS: value('QtVersion').QtQuickVirtualKeyboardImport}" }, { "key": "QtQuickControlsStyle", "value": "%{JS: value('ControlsStyle').QtQuickControlsStyle}" }, { "key": "QtQuickControlsStyleTheme", "value": "%{JS: value('ControlsStyle').QtQuickControlsStyleTheme}" }, - { "key": "QtQuickFeature", "value": "QtSupport.Wizards.FeatureQtQuick.%{QtQuickVersion}" }, + { "key": "QtQuickFeature", "value": "%{JS: (value('QtQuickVersion')=='') ? 'QtSupport.Wizards.FeatureQtQuick.6' : 'QtSupport.Wizards.FeatureQtQuick.%{QtQuickVersion}'}" }, { "key": "UseVirtualKeyboardByDefault", "value": "%{JS: value('Plugins').indexOf('Boot2Qt') >= 0 || value('Plugins').indexOf('Boot2QtQdb') >= 0}" }, { "key": "HasTranslation", "value": "%{JS: value('TsFileName') !== ''}" }, { "key": "SetQPAPhysicalSize", "value": "%{UseVirtualKeyboardByDefault}" } @@ -85,10 +85,19 @@ "persistenceKey": "QtQuick.minimumQtVersion", "data": { - "index": 3, + "index": 1, "items": [ { + "trKey": "Qt 6", + "value": + { + "QtQuickVersion": "", + "QtQuickControlsVersion": "", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard" + } + }, + { "trKey": "Qt 5.15", "value": { @@ -124,51 +133,6 @@ "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.4" } }, - { - "trKey": "Qt 5.11", - "value": - { - "QtQuickVersion": "2.11", - "QtQuickControlsVersion": "2.4", - "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.3" - } - }, - { - "trKey": "Qt 5.10", - "value": - { - "QtQuickVersion": "2.10", - "QtQuickControlsVersion": "2.3", - "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.3" - } - }, - { - "trKey": "Qt 5.9", - "value": - { - "QtQuickVersion": "2.9", - "QtQuickControlsVersion": "2.2", - "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.2" - } - }, - { - "trKey": "Qt 5.8", - "value": - { - "QtQuickVersion": "2.8", - "QtQuickControlsVersion": "2.1", - "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.1" - } - }, - { - "trKey": "Qt 5.7", - "value": - { - "QtQuickVersion": "2.7", - "QtQuickControlsVersion": "2.0", - "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.1" - } - } ] } }, @@ -222,7 +186,7 @@ } }, { - "trKey": "Fusion (Qt 5.10+)", + "trKey": "Fusion", "value": { "QtQuickControlsStyle": "Fusion", @@ -230,7 +194,7 @@ } }, { - "trKey": "Imagine (Qt 5.10+)", + "trKey": "Imagine", "value": { "QtQuickControlsStyle": "Imagine", diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/swipe/wizard.json b/share/qtcreator/templates/wizards/projects/qtquickapplication/swipe/wizard.json index 4f7e8f1479..3e44affe58 100644 --- a/share/qtcreator/templates/wizards/projects/qtquickapplication/swipe/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/swipe/wizard.json @@ -22,7 +22,7 @@ { "key": "QtQuickVirtualKeyboardImport", "value": "%{JS: value('QtVersion').QtQuickVirtualKeyboardImport}" }, { "key": "QtQuickControlsStyle", "value": "%{JS: value('ControlsStyle').QtQuickControlsStyle}" }, { "key": "QtQuickControlsStyleTheme", "value": "%{JS: value('ControlsStyle').QtQuickControlsStyleTheme}" }, - { "key": "QtQuickFeature", "value": "QtSupport.Wizards.FeatureQtQuick.%{QtQuickVersion}" }, + { "key": "QtQuickFeature", "value": "%{JS: (value('QtQuickVersion')=='') ? 'QtSupport.Wizards.FeatureQtQuick.6' : 'QtSupport.Wizards.FeatureQtQuick.%{QtQuickVersion}'}" }, { "key": "UseVirtualKeyboardByDefault", "value": "%{JS: value('Plugins').indexOf('Boot2Qt') >= 0 || value('Plugins').indexOf('Boot2QtQdb') >= 0}" }, { "key": "HasTranslation", "value": "%{JS: value('TsFileName') !== ''}" }, { "key": "SetQPAPhysicalSize", "value": "%{UseVirtualKeyboardByDefault}" } @@ -85,10 +85,19 @@ "persistenceKey": "QtQuick.minimumQtVersion", "data": { - "index": 3, + "index": 1, "items": [ { + "trKey": "Qt 6", + "value": + { + "QtQuickVersion": "", + "QtQuickControlsVersion": "", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard" + } + }, + { "trKey": "Qt 5.15", "value": { @@ -123,51 +132,6 @@ "QtQuickControlsVersion": "2.5", "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.4" } - }, - { - "trKey": "Qt 5.11", - "value": - { - "QtQuickVersion": "2.11", - "QtQuickControlsVersion": "2.4", - "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.3" - } - }, - { - "trKey": "Qt 5.10", - "value": - { - "QtQuickVersion": "2.10", - "QtQuickControlsVersion": "2.3", - "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.3" - } - }, - { - "trKey": "Qt 5.9", - "value": - { - "QtQuickVersion": "2.9", - "QtQuickControlsVersion": "2.2", - "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.2" - } - }, - { - "trKey": "Qt 5.8", - "value": - { - "QtQuickVersion": "2.8", - "QtQuickControlsVersion": "2.1", - "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.1" - } - }, - { - "trKey": "Qt 5.7", - "value": - { - "QtQuickVersion": "2.7", - "QtQuickControlsVersion": "2.0", - "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.1" - } } ] } @@ -222,7 +186,7 @@ } }, { - "trKey": "Fusion (Qt 5.10+)", + "trKey": "Fusion", "value": { "QtQuickControlsStyle": "Fusion", @@ -230,7 +194,7 @@ } }, { - "trKey": "Imagine (Qt 5.10+)", + "trKey": "Imagine", "value": { "QtQuickControlsStyle": "Imagine", diff --git a/share/qtcreator/templates/wizards/projects/qtquickuiprototype/wizard.json b/share/qtcreator/templates/wizards/projects/qtquickuiprototype/wizard.json index ac39bb90be..d5642f0a98 100644 --- a/share/qtcreator/templates/wizards/projects/qtquickuiprototype/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtquickuiprototype/wizard.json @@ -17,7 +17,7 @@ { "key": "QtQuickVersion", "value": "%{JS: value('QtVersion').QtQuickVersion}" }, { "key": "QtQuickWindowVersion", "value": "%{JS: value('QtVersion').QtQuickWindowVersion}" }, { "key": "QtQuickVirtualKeyboardImport", "value": "%{JS: value('QtVersion').QtQuickVirtualKeyboardImport}" }, - { "key": "QtQuickFeature", "value": "QtSupport.Wizards.FeatureQtQuick.%{QtQuickVersion}" }, + { "key": "QtQuickFeature", "value": "%{JS: (value('QtQuickVersion')=='') ? 'QtSupport.Wizards.FeatureQtQuick.6' : 'QtSupport.Wizards.FeatureQtQuick.%{QtQuickVersion}'}" }, { "key": "UseVirtualKeyboardByDefault", "value": "%{JS: value('Plugins').indexOf('Boot2Qt') >= 0 || value('Plugins').indexOf('Boot2QtQdb') >= 0}" } ], @@ -40,10 +40,19 @@ "type": "ComboBox", "data": { - "index": 3, + "index": 1, "items": [ { + "trKey": "Qt 6", + "value": + { + "QtQuickVersion": "", + "QtQuickWindowVersion": "", + "QtQuickVirtualKeyboardImport": "" + } + }, + { "trKey": "Qt 5.15", "value": { @@ -78,60 +87,6 @@ "QtQuickWindowVersion": "2.12", "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.4" } - }, - { - "trKey": "Qt 5.11", - "value": - { - "QtQuickVersion": "2.11", - "QtQuickWindowVersion": "2.11", - "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.3" - } - }, - { - "trKey": "Qt 5.10", - "value": - { - "QtQuickVersion": "2.10", - "QtQuickWindowVersion": "2.10", - "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.3" - } - }, - { - "trKey": "Qt 5.9", - "value": - { - "QtQuickVersion": "2.9", - "QtQuickWindowVersion": "2.2", - "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.2" - } - }, - { - "trKey": "Qt 5.8", - "value": - { - "QtQuickVersion": "2.8", - "QtQuickWindowVersion": "2.2", - "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.1" - } - }, - { - "trKey": "Qt 5.7", - "value": - { - "QtQuickVersion": "2.7", - "QtQuickWindowVersion": "2.2", - "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.1" - } - }, - { - "trKey": "Qt 5.6", - "value": - { - "QtQuickVersion": "2.6", - "QtQuickWindowVersion": "2.2", - "QtQuickVirtualKeyboardImport": "QtQuick.Enterprise.VirtualKeyboard 2.0" - } } ] } diff --git a/share/share.pro b/share/share.pro index 3fe6c8b32c..757e0ed595 100644 --- a/share/share.pro +++ b/share/share.pro @@ -1,6 +1,23 @@ TEMPLATE = subdirs SUBDIRS = qtcreator/static.pro +include(../qtcreator.pri) + +linux { + appdata = $$cat($$PWD/metainfo/org.qt-project.qtcreator.appdata.xml.cmakein, blob) + appdata = $$replace(appdata, \\$\\{IDE_VERSION_DISPLAY\\}, $$QTCREATOR_DISPLAY_VERSION) + appdata = $$replace(appdata, \\$\\{DATE_ATTRIBUTE\\}, "") + write_file($$OUT_PWD/metainfo/org.qt-project.qtcreator.appdata.xml, appdata) + + appstream.files = $$OUT_PWD/metainfo/org.qt-project.qtcreator.appdata.xml + appstream.path = $$QTC_PREFIX/share/metainfo/ + + desktop.files = share/applications/org.qt-project.qtcreator.desktop + desktop.path = $$QTC_PREFIX/share/applications/ + + INSTALLS += appstream desktop +} + defineTest(hasLupdate) { cmd = $$eval(QT_TOOL.lupdate.binary) isEmpty(cmd) { |