From e0751d56d0994617a58a9e4ec903e76b36cd4f20 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Mon, 30 Mar 2020 16:37:42 +0300 Subject: QmlDesigner: Colorize light gizmos Light gizmo icons and models are now colored based on the light color. Image provider is used instead of simpler ColorOverlay component, as ColorOverlay doesn't properly handle transparency when rendered offscreen in puppet. Change-Id: If6af915bca9bea2cb48ac23ac6c5ba46dc150e3b Fixes: QDS-1733 Reviewed-by: Mahmoud Badri Reviewed-by: Thomas Hartmann --- .../qml/qmlpuppet/mockfiles/IconGizmo.qml | 11 ---- .../qml/qmlpuppet/mockfiles/LightGizmo.qml | 17 ++--- .../qml/qmlpuppet/mockfiles/LightModel.qml | 3 +- .../qml/qmlpuppet/qml2puppet/editor3d/editor3d.pri | 6 +- .../qml2puppet/editor3d/icongizmoimageprovider.cpp | 73 ++++++++++++++++++++++ .../qml2puppet/editor3d/icongizmoimageprovider.h | 41 ++++++++++++ .../instances/qt5informationnodeinstanceserver.cpp | 3 + 7 files changed, 132 insertions(+), 22 deletions(-) create mode 100644 share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/icongizmoimageprovider.cpp create mode 100644 share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/icongizmoimageprovider.h (limited to 'share') diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/IconGizmo.qml b/share/qtcreator/qml/qmlpuppet/mockfiles/IconGizmo.qml index b42bf4cc2c..0d9641fa72 100644 --- a/share/qtcreator/qml/qmlpuppet/mockfiles/IconGizmo.qml +++ b/share/qtcreator/qml/qmlpuppet/mockfiles/IconGizmo.qml @@ -25,7 +25,6 @@ import QtQuick 2.0 import QtQuick3D 1.15 -import QtGraphicalEffects 1.12 Item { id: iconGizmo @@ -45,7 +44,6 @@ Item { } property alias iconSource: iconImage.source - //property alias overlayColor: colorOverlay.color signal positionCommit() signal clicked(Node node, bool multi) @@ -91,15 +89,6 @@ Item { acceptedButtons: Qt.LeftButton } } -// ColorOverlay doesn't work correctly with hidden windows so commenting it out for now -// ColorOverlay { -// id: colorOverlay -// anchors.fill: parent -// cached: true -// source: iconImage -// color: "#00000000" -// opacity: 0.6 -// } } } } diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/LightGizmo.qml b/share/qtcreator/qml/qmlpuppet/mockfiles/LightGizmo.qml index 9a956c6723..434c5f5c80 100644 --- a/share/qtcreator/qml/qmlpuppet/mockfiles/LightGizmo.qml +++ b/share/qtcreator/qml/qmlpuppet/mockfiles/LightGizmo.qml @@ -30,19 +30,17 @@ IconGizmo { id: lightGizmo property Model lightModel: null + property color overlayColor: targetNode ? targetNode.color : "transparent" iconSource: targetNode ? targetNode instanceof DirectionalLight - ? "qrc:///qtquickplugin/mockfiles/images/directional_light_gradient.png" + ? "image://IconGizmoImageProvider/directional_light_gradient.png:" + overlayColor : targetNode instanceof AreaLight - ? "qrc:///qtquickplugin/mockfiles/images/area_light_gradient.png" + ? "image://IconGizmoImageProvider/area_light_gradient.png:" + overlayColor : targetNode instanceof PointLight - ? "qrc:///qtquickplugin/mockfiles/images/point_light_gradient.png" - : "qrc:///qtquickplugin/mockfiles/images/spot_light_gradient.png" - : "qrc:///qtquickplugin/mockfiles/images/point_light_gradient.png" - - // ColorOverlay doesn't work correctly with hidden windows so commenting it out for now - //overlayColor: targetNode ? targetNode.color : "transparent" + ? "image://IconGizmoImageProvider/point_light_gradient.png:" + overlayColor + : "image://IconGizmoImageProvider/spot_light_gradient.png:" + overlayColor + : "image://IconGizmoImageProvider/point_light_gradient.png:" + overlayColor function connectModel(model) { @@ -57,6 +55,9 @@ IconGizmo { model.targetNode = targetNode; model.targetNode = Qt.binding(function() {return targetNode;}); + model.color = lightGizmo.overlayColor; + model.color = Qt.binding(function() {return lightGizmo.overlayColor;}); + model.visible = visible; model.visible = Qt.binding(function() {return visible;}); } diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/LightModel.qml b/share/qtcreator/qml/qmlpuppet/mockfiles/LightModel.qml index 86bebf19d2..9255e77dde 100644 --- a/share/qtcreator/qml/qmlpuppet/mockfiles/LightModel.qml +++ b/share/qtcreator/qml/qmlpuppet/mockfiles/LightModel.qml @@ -35,6 +35,7 @@ Model { property Node targetNode: null property Node scene: null property bool selected: false + property color color function updateGeometry() { @@ -49,7 +50,7 @@ Model { materials: [ DefaultMaterial { id: defaultMaterial - emissiveColor: lightModel.selected ? "#FF0000" : "#555555" + emissiveColor: lightModel.selected ? lightModel.color : "#555555" lighting: DefaultMaterial.NoLighting cullMode: Material.NoCulling } diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/editor3d.pri b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/editor3d.pri index 9a5be562e3..755aef73e2 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/editor3d.pri +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/editor3d.pri @@ -4,7 +4,8 @@ HEADERS += $$PWD/generalhelper.h \ $$PWD/lightgeometry.h \ $$PWD/gridgeometry.h \ $$PWD/selectionboxgeometry.h \ - $$PWD/linegeometry.h + $$PWD/linegeometry.h \ + $$PWD/icongizmoimageprovider.h SOURCES += $$PWD/generalhelper.cpp \ $$PWD/mousearea3d.cpp \ @@ -12,4 +13,5 @@ SOURCES += $$PWD/generalhelper.cpp \ $$PWD/lightgeometry.cpp \ $$PWD/gridgeometry.cpp \ $$PWD/selectionboxgeometry.cpp \ - $$PWD/linegeometry.cpp + $$PWD/linegeometry.cpp \ + $$PWD/icongizmoimageprovider.cpp diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/icongizmoimageprovider.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/icongizmoimageprovider.cpp new file mode 100644 index 0000000000..2e5a2b0d0a --- /dev/null +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/icongizmoimageprovider.cpp @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2020 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. +** +****************************************************************************/ + +#include "icongizmoimageprovider.h" + +namespace QmlDesigner { +namespace Internal { + +IconGizmoImageProvider::IconGizmoImageProvider() + : QQuickImageProvider(QQuickImageProvider::Image) +{ +} + +QImage IconGizmoImageProvider::requestImage(const QString &id, QSize *size, const QSize &requestedSize) +{ + // id format: : + QStringList parts = id.split(':'); + if (parts.size() == 2) { + QImage image(QStringLiteral("://qtquickplugin/mockfiles/images/%1").arg(parts[0])); + + // Recolorize non-transparent image pixels + QColor targetColor(parts[1]); + int r = targetColor.red(); + int g = targetColor.green(); + int b = targetColor.blue(); + int size = image.sizeInBytes(); + uchar *byte = image.bits(); + for (int i = 0; i < size; i += 4) { + // Skip if alpha is zero + if (*(byte + 3) != 0) { + // Average between target color and current color + *byte = uchar((int(*byte) + b) / 2); + ++byte; + *byte = uchar((int(*byte) + g) / 2); + ++byte; + *byte = uchar((int(*byte) + r) / 2); + ++byte; + // Preserve alpha + ++byte; + } else { + byte += 4; + } + } + return image; + } else { + return {}; + } +} + +} +} diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/icongizmoimageprovider.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/icongizmoimageprovider.h new file mode 100644 index 0000000000..e4833e3b20 --- /dev/null +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/icongizmoimageprovider.h @@ -0,0 +1,41 @@ +/**************************************************************************** +** +** Copyright (C) 2020 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. +** +****************************************************************************/ + +#pragma once + +#include + +namespace QmlDesigner { +namespace Internal { + +class IconGizmoImageProvider : public QQuickImageProvider +{ +public: + IconGizmoImageProvider(); + + QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize) override; +}; +} +} diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp index 4331e35ddc..798baa61ac 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp @@ -71,6 +71,7 @@ #include "../editor3d/gridgeometry.h" #include "../editor3d/selectionboxgeometry.h" #include "../editor3d/linegeometry.h" +#include "../editor3d/icongizmoimageprovider.h" #include #include @@ -114,6 +115,8 @@ void Qt5InformationNodeInstanceServer::createEditView3D() QObject::connect(helper, &QmlDesigner::Internal::GeneralHelper::toolStateChanged, this, &Qt5InformationNodeInstanceServer::handleToolStateChanged); engine()->rootContext()->setContextProperty("_generalHelper", helper); + engine()->addImageProvider(QLatin1String("IconGizmoImageProvider"), + new QmlDesigner::Internal::IconGizmoImageProvider); m_3dHelper = helper; m_editView3D = new QQuickView(quickView()->engine(), quickView()); -- cgit v1.2.1 From ee81b5d895ad603232afc407c218ab5eb004679a Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 31 Mar 2020 13:23:14 +0300 Subject: QmlDesigner: Exit puppet asynchronously in case of failed icon render The application event loop is not yet active at setup time, so just calling qGuiApp->quit() directly doesn't actually exit the application. Change-Id: Iccae4dd59d92b593205c2057b189774f827ffcda Fixes: QDS-1875 Reviewed-by: Mahmoud Badri --- .../qtcreator/qml/qmlpuppet/qml2puppet/iconrenderer/iconrenderer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'share') diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/iconrenderer/iconrenderer.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/iconrenderer/iconrenderer.cpp index 034a809b16..48830caee6 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/iconrenderer/iconrenderer.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/iconrenderer/iconrenderer.cpp @@ -150,10 +150,10 @@ void IconRenderer::setupRender() QTimer::singleShot(1000, qGuiApp, &QGuiApplication::quit); }); } else { - qGuiApp->quit(); + QTimer::singleShot(0, qGuiApp, &QGuiApplication::quit); } } else { - qGuiApp->quit(); + QTimer::singleShot(0, qGuiApp, &QGuiApplication::quit); } } -- cgit v1.2.1 From 33cc9913210cd2accc7b13ef0a5ce6afcecac531 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 30 Mar 2020 18:03:54 +0200 Subject: QmlDesigner: Fix tooltip Task-number: QTCREATORBUG-23786 Change-Id: Ia87f6c711c8fb46dd8ac74802e224a5e7382aa46 Reviewed-by: Leena Miettinen --- .../qmldesigner/propertyEditorQmlSources/QtQuick/AnimationSection.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share') diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/AnimationSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/AnimationSection.qml index 23c801eca3..9641d74b1b 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/AnimationSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/AnimationSection.qml @@ -37,7 +37,7 @@ Section { SectionLayout { Label { text: qsTr("Running") - tooltip: qsTr("Sets whether the animation should run to completion when it is stopped.") + tooltip: qsTr("Sets whether the animation is currently running.") } CheckBox { -- cgit v1.2.1 From 9ad735861368cde74fc04f0601521a2f7e20fb16 Mon Sep 17 00:00:00 2001 From: Brook Cronin Date: Tue, 31 Mar 2020 16:08:09 +0200 Subject: add new icon font, update mapping in constants Change-Id: Idbaa82a22ac317fc9089f76fc5de506e3f4bba5c Reviewed-by: Thomas Hartmann --- .../imports/StudioTheme/Constants.qml | 112 ++++++++++++--------- .../imports/StudioTheme/icons.ttf | Bin 8108 -> 10568 bytes 2 files changed, 64 insertions(+), 48 deletions(-) (limited to 'share') diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Constants.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Constants.qml index e79b399ede..200d67c568 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Constants.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Constants.qml @@ -37,54 +37,70 @@ QtObject { } readonly property string actionIcon: "\u0021" - readonly property string actionIconBinding: "\u0022" - readonly property string addFile: "\u0023" - readonly property string alignBottom: "\u0024" - readonly property string alignCenterHorizontal: "\u0025" - readonly property string alignCenterVertical: "\u0026" - readonly property string alignLeft: "\u0027" - readonly property string alignRight: "\u0028" - readonly property string alignTo: "\u0029" - readonly property string alignTop: "\u002A" - readonly property string anchorBaseline: "\u002B" - readonly property string anchorBottom: "\u002C" - readonly property string anchorFill: "\u002D" - readonly property string anchorLeft: "\u002E" - readonly property string anchorRight: "\u002F" - readonly property string anchorTop: "\u0030" - readonly property string annotationBubble: "\u0031" - readonly property string annotationDecal: "\u0032" - readonly property string centerHorizontal: "\u0033" - readonly property string centerVertical: "\u0034" - readonly property string closeCross: "\u0035" - readonly property string distributeBottom: "\u0036" - readonly property string distributeCenterHorizontal: "\u0037" - readonly property string distributeCenterVertical: "\u0038" - readonly property string distributeLeft: "\u0039" - readonly property string distributeOriginBottomRight: "\u003A" - readonly property string distributeOriginCenter: "\u003B" - readonly property string distributeOriginNone: "\u003C" - readonly property string distributeOriginTopLeft: "\u003D" - readonly property string distributeRight: "\u003E" - readonly property string distributeSpacingHorizontal: "\u003F" - readonly property string distributeSpacingVertical: "\u0040" - readonly property string distributeTop: "\u0041" - readonly property string edit: "\u0042" - readonly property string fontStyleBold: "\u0043" - readonly property string fontStyleItalic: "\u0044" - readonly property string fontStyleStrikethrough: "\u0045" - readonly property string fontStyleUnderline: "\u0046" - readonly property string testIcon: "\u0047" - readonly property string textAlignBottom: "\u0048" - readonly property string textAlignCenter: "\u0049" - readonly property string textAlignLeft: "\u004A" - readonly property string textAlignMiddle: "\u004B" - readonly property string textAlignRight: "\u004C" - readonly property string textAlignTop: "\u004D" - readonly property string tickIcon: "\u004E" - readonly property string triState: "\u004F" - readonly property string upDownIcon: "\u0050" - readonly property string upDownSquare2: "\u0051" + readonly property string actionIconBinding: "\u0022" + readonly property string addColumnAfter: "\u0023" + readonly property string addColumnBefore: "\u0024" + readonly property string addFile: "\u0025" + readonly property string addRowAfter: "\u0026" + readonly property string addRowBefore: "\u0027" + readonly property string addTable: "\u0028" + readonly property string alignBottom: "\u0029" + readonly property string alignCenterHorizontal: "\u002A" + readonly property string alignCenterVertical: "\u002B" + readonly property string alignLeft: "\u002C" + readonly property string alignRight: "\u002D" + readonly property string alignTo: "\u002E" + readonly property string alignTop: "\u002F" + readonly property string anchorBaseline: "\u0030" + readonly property string anchorBottom: "\u0031" + readonly property string anchorFill: "\u0032" + readonly property string anchorLeft: "\u0033" + readonly property string anchorRight: "\u0034" + readonly property string anchorTop: "\u0035" + readonly property string annotationBubble: "\u0036" + readonly property string annotationDecal: "\u0037" + readonly property string centerHorizontal: "\u0038" + readonly property string centerVertical: "\u0039" + readonly property string closeCross: "\u003A" + readonly property string deleteColumn: "\u003B" + readonly property string deleteRow: "\u003C" + readonly property string deleteTable: "\u003D" + readonly property string distributeBottom: "\u003E" + readonly property string distributeCenterHorizontal: "\u003F" + readonly property string distributeCenterVertical: "\u0040" + readonly property string distributeLeft: "\u0041" + readonly property string distributeOriginBottomRight: "\u0042" + readonly property string distributeOriginCenter: "\u0043" + readonly property string distributeOriginNone: "\u0044" + readonly property string distributeOriginTopLeft: "\u0045" + readonly property string distributeRight: "\u0046" + readonly property string distributeSpacingHorizontal: "\u0047" + readonly property string distributeSpacingVertical: "\u0048" + readonly property string distributeTop: "\u0049" + readonly property string edit: "\u004A" + readonly property string fontStyleBold: "\u004B" + readonly property string fontStyleItalic: "\u004C" + readonly property string fontStyleStrikethrough: "\u004D" + readonly property string fontStyleUnderline: "\u004E" + readonly property string mergeCells: "\u004F" + readonly property string redo: "\u0050" + readonly property string splitColumns: "\u0051" + readonly property string splitRows: "\u0052" + readonly property string testIcon: "\u0053" + readonly property string textAlignBottom: "\u0054" + readonly property string textAlignCenter: "\u0055" + readonly property string textAlignLeft: "\u0056" + readonly property string textAlignMiddle: "\u0057" + readonly property string textAlignRight: "\u0058" + readonly property string textAlignTop: "\u0059" + readonly property string textBulletList: "\u005A" + readonly property string textFullJustification: "\u005B" + readonly property string textNumberedList: "\u005C" + readonly property string tickIcon: "\u005D" + readonly property string triState: "\u005E" + readonly property string undo: "\u005F" + readonly property string upDownIcon: "\u0060" + readonly property string upDownSquare2: "\u0061" 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 index 28840afacf..d65b065195 100644 Binary files a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/icons.ttf and b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/icons.ttf differ -- cgit v1.2.1 From 247ffa0e1b13b62645371e8bbbde10b636454134 Mon Sep 17 00:00:00 2001 From: Brook Cronin Date: Wed, 1 Apr 2020 07:57:23 +0200 Subject: fix formatting Change-Id: Iaf49d5fa3239209e68f30762cc565fe3833b571e Reviewed-by: Thomas Hartmann --- .../imports/StudioTheme/Constants.qml | 128 ++++++++++----------- 1 file changed, 64 insertions(+), 64 deletions(-) (limited to 'share') diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Constants.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Constants.qml index 200d67c568..3d692af671 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Constants.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Constants.qml @@ -37,70 +37,70 @@ QtObject { } readonly property string actionIcon: "\u0021" - readonly property string actionIconBinding: "\u0022" - readonly property string addColumnAfter: "\u0023" - readonly property string addColumnBefore: "\u0024" - readonly property string addFile: "\u0025" - readonly property string addRowAfter: "\u0026" - readonly property string addRowBefore: "\u0027" - readonly property string addTable: "\u0028" - readonly property string alignBottom: "\u0029" - readonly property string alignCenterHorizontal: "\u002A" - readonly property string alignCenterVertical: "\u002B" - readonly property string alignLeft: "\u002C" - readonly property string alignRight: "\u002D" - readonly property string alignTo: "\u002E" - readonly property string alignTop: "\u002F" - readonly property string anchorBaseline: "\u0030" - readonly property string anchorBottom: "\u0031" - readonly property string anchorFill: "\u0032" - readonly property string anchorLeft: "\u0033" - readonly property string anchorRight: "\u0034" - readonly property string anchorTop: "\u0035" - readonly property string annotationBubble: "\u0036" - readonly property string annotationDecal: "\u0037" - readonly property string centerHorizontal: "\u0038" - readonly property string centerVertical: "\u0039" - readonly property string closeCross: "\u003A" - readonly property string deleteColumn: "\u003B" - readonly property string deleteRow: "\u003C" - readonly property string deleteTable: "\u003D" - readonly property string distributeBottom: "\u003E" - readonly property string distributeCenterHorizontal: "\u003F" - readonly property string distributeCenterVertical: "\u0040" - readonly property string distributeLeft: "\u0041" - readonly property string distributeOriginBottomRight: "\u0042" - readonly property string distributeOriginCenter: "\u0043" - readonly property string distributeOriginNone: "\u0044" - readonly property string distributeOriginTopLeft: "\u0045" - readonly property string distributeRight: "\u0046" - readonly property string distributeSpacingHorizontal: "\u0047" - readonly property string distributeSpacingVertical: "\u0048" - readonly property string distributeTop: "\u0049" - readonly property string edit: "\u004A" - readonly property string fontStyleBold: "\u004B" - readonly property string fontStyleItalic: "\u004C" - readonly property string fontStyleStrikethrough: "\u004D" - readonly property string fontStyleUnderline: "\u004E" - readonly property string mergeCells: "\u004F" - readonly property string redo: "\u0050" - readonly property string splitColumns: "\u0051" - readonly property string splitRows: "\u0052" - readonly property string testIcon: "\u0053" - readonly property string textAlignBottom: "\u0054" - readonly property string textAlignCenter: "\u0055" - readonly property string textAlignLeft: "\u0056" - readonly property string textAlignMiddle: "\u0057" - readonly property string textAlignRight: "\u0058" - readonly property string textAlignTop: "\u0059" - readonly property string textBulletList: "\u005A" - readonly property string textFullJustification: "\u005B" - readonly property string textNumberedList: "\u005C" - readonly property string tickIcon: "\u005D" - readonly property string triState: "\u005E" - readonly property string undo: "\u005F" - readonly property string upDownIcon: "\u0060" - readonly property string upDownSquare2: "\u0061" + readonly property string actionIconBinding: "\u0022" + readonly property string addColumnAfter: "\u0023" + readonly property string addColumnBefore: "\u0024" + readonly property string addFile: "\u0025" + readonly property string addRowAfter: "\u0026" + readonly property string addRowBefore: "\u0027" + readonly property string addTable: "\u0028" + readonly property string alignBottom: "\u0029" + readonly property string alignCenterHorizontal: "\u002A" + readonly property string alignCenterVertical: "\u002B" + readonly property string alignLeft: "\u002C" + readonly property string alignRight: "\u002D" + readonly property string alignTo: "\u002E" + readonly property string alignTop: "\u002F" + readonly property string anchorBaseline: "\u0030" + readonly property string anchorBottom: "\u0031" + readonly property string anchorFill: "\u0032" + readonly property string anchorLeft: "\u0033" + readonly property string anchorRight: "\u0034" + readonly property string anchorTop: "\u0035" + readonly property string annotationBubble: "\u0036" + readonly property string annotationDecal: "\u0037" + readonly property string centerHorizontal: "\u0038" + readonly property string centerVertical: "\u0039" + readonly property string closeCross: "\u003A" + readonly property string deleteColumn: "\u003B" + readonly property string deleteRow: "\u003C" + readonly property string deleteTable: "\u003D" + readonly property string distributeBottom: "\u003E" + readonly property string distributeCenterHorizontal: "\u003F" + readonly property string distributeCenterVertical: "\u0040" + readonly property string distributeLeft: "\u0041" + readonly property string distributeOriginBottomRight: "\u0042" + readonly property string distributeOriginCenter: "\u0043" + readonly property string distributeOriginNone: "\u0044" + readonly property string distributeOriginTopLeft: "\u0045" + readonly property string distributeRight: "\u0046" + readonly property string distributeSpacingHorizontal: "\u0047" + readonly property string distributeSpacingVertical: "\u0048" + readonly property string distributeTop: "\u0049" + readonly property string edit: "\u004A" + readonly property string fontStyleBold: "\u004B" + readonly property string fontStyleItalic: "\u004C" + readonly property string fontStyleStrikethrough: "\u004D" + readonly property string fontStyleUnderline: "\u004E" + readonly property string mergeCells: "\u004F" + readonly property string redo: "\u0050" + readonly property string splitColumns: "\u0051" + readonly property string splitRows: "\u0052" + readonly property string testIcon: "\u0053" + readonly property string textAlignBottom: "\u0054" + readonly property string textAlignCenter: "\u0055" + readonly property string textAlignLeft: "\u0056" + readonly property string textAlignMiddle: "\u0057" + readonly property string textAlignRight: "\u0058" + readonly property string textAlignTop: "\u0059" + readonly property string textBulletList: "\u005A" + readonly property string textFullJustification: "\u005B" + readonly property string textNumberedList: "\u005C" + readonly property string tickIcon: "\u005D" + readonly property string triState: "\u005E" + readonly property string undo: "\u005F" + readonly property string upDownIcon: "\u0060" + readonly property string upDownSquare2: "\u0061" readonly property font iconFont: Qt.font({ "family": controlIcons.name, -- cgit v1.2.1 From 7222df86d11793a7ff681adb4c681998b5ff984f Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 31 Mar 2020 16:15:17 +0200 Subject: QmlDesigner: Rename signal The name clicked is missleading. Change-Id: I2782d1af5c0bd8a58c24729f043291b482cec6a8 Reviewed-by: Aleksei German Reviewed-by: Tim Jenssen --- .../imports/HelperWidgets/ColorButton.qml | 20 ++++++++++---------- .../imports/HelperWidgets/ColorEditor.qml | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'share') diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorButton.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorButton.qml index 8381513548..e609297149 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorButton.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorButton.qml @@ -41,7 +41,7 @@ Item { property bool block: false - signal clicked + signal updateColor signal rightMouseButtonClicked onAlphaChanged: invalidateColor(); @@ -216,7 +216,7 @@ Item { } onReleased: { if (mouse.button === Qt.LeftButton) - colorButton.clicked() + colorButton.updateColor() } acceptedButtons: Qt.LeftButton | Qt.RightButton @@ -245,7 +245,7 @@ Item { if (colorButton.hue !== value) colorButton.hue = value } - onClicked: colorButton.clicked() + onClicked: colorButton.updateColor() } Row { @@ -278,7 +278,7 @@ Item { var tmp = redSlider.value / 255.0 if (colorButton.color.r !== tmp && !colorButton.block) { colorButton.color.r = tmp - colorButton.clicked() + colorButton.updateColor() } } } @@ -307,7 +307,7 @@ Item { var tmp = greenSlider.value / 255.0 if (colorButton.color.g !== tmp && !colorButton.block) { colorButton.color.g = tmp - colorButton.clicked() + colorButton.updateColor() } } } @@ -336,7 +336,7 @@ Item { var tmp = blueSlider.value / 255.0 if (colorButton.color.b !== tmp && !colorButton.block) { colorButton.color.b = tmp - colorButton.clicked() + colorButton.updateColor() } } } @@ -359,7 +359,7 @@ Item { onValueModified: { if (colorButton.alpha !== alphaSlider.value && !colorButton.block) { colorButton.alpha = alphaSlider.value - colorButton.clicked() + colorButton.updateColor() } } } @@ -384,7 +384,7 @@ Item { onValueModified: { if (colorButton.hue !== hueSlider2.value && !colorButton.block) { colorButton.hue = hueSlider2.value - colorButton.clicked() + colorButton.updateColor() } } } @@ -406,7 +406,7 @@ Item { onValueModified: { if (colorButton.saturation !== saturationSlider.value && !colorButton.block) { colorButton.saturation = saturationSlider.value - colorButton.clicked() + colorButton.updateColor() } } } @@ -428,7 +428,7 @@ Item { onValueModified: { if (colorButton.lightness !== lightnessSlider.value && !colorButton.block) { colorButton.lightness = lightnessSlider.value - colorButton.clicked() + colorButton.updateColor() } } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml index a1b5672ebb..536877b58e 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml @@ -626,7 +626,7 @@ Column { sliderMargins: 4 - onClicked: { + onUpdateColor: { colorEditor.color = colorButton.color if (contextMenu.opened) contextMenu.close() -- cgit v1.2.1 From 09f34a697fb6c6ba1a287b842045878d671069da Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 2 Apr 2020 14:22:59 +0300 Subject: QmlDesigner: Fix crash in puppet when component has errors Check component creation errors earlier to avoid crash. This allows puppet to notify creator about the problem, so invalid components can be properly highlighted in navigator. Change-Id: I059a5be04c4e509a38f6d47daa97e0da36c333ae Fixes: QDS-1887 Reviewed-by: Mahmoud Badri --- .../qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'share') diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp index 1c6601784b..7fabfcf903 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp @@ -753,10 +753,14 @@ QObject *ObjectNodeInstance::createComponent(const QString &componentPath, QQmlC Q_UNUSED(disableComponentComplete) QQmlComponent component(context->engine(), fixComponentPathForIncompatibleQt(componentPath)); - QObject *object = component.beginCreate(context); - QmlPrivateGate::tweakObjects(object); - component.completeCreate(); + QObject *object = nullptr; + if (!component.isError()) { + object = component.beginCreate(context); + QmlPrivateGate::tweakObjects(object); + component.completeCreate(); + QQmlEngine::setObjectOwnership(object, QQmlEngine::CppOwnership); + } if (component.isError()) { qDebug() << componentPath; @@ -764,8 +768,6 @@ QObject *ObjectNodeInstance::createComponent(const QString &componentPath, QQmlC qWarning() << error; } - QQmlEngine::setObjectOwnership(object, QQmlEngine::CppOwnership); - return object; } -- cgit v1.2.1 From 7f958700a09f09ac124b20d23236ede472b58d87 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 2 Apr 2020 11:19:28 +0200 Subject: Debugger: Make LLDB work a bit with remote Linux The device on remote side *has* to configure (/usr/bin/)lldb-server as "GDB server executable" in the device settings. A real gdbserver does not work. Change-Id: I045ffb60a824e06ee683d8bdfffeb480a580af5f Reviewed-by: Christian Kandeler --- share/qtcreator/debugger/lldbbridge.py | 56 ++++++++++++++++++++++++++-------- 1 file changed, 44 insertions(+), 12 deletions(-) (limited to 'share') diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py index b980605451..2995256b1a 100644 --- a/share/qtcreator/debugger/lldbbridge.py +++ b/share/qtcreator/debugger/lldbbridge.py @@ -879,7 +879,35 @@ class Dumper(DumperBase): self.debugger.SetCurrentPlatformSDKRoot(self.sysRoot_) exefile = None if self.attachPid_ > 0 else self.executable_ - self.target = self.debugger.CreateTarget(exefile, None, None, True, error) + + self.target = self.debugger.CreateTarget( + exefile, None, self.platform_, True, error) + + if not error.Success(): + self.report(self.describeError(error)) + self.reportState('enginerunfailed') + return + + if (self.startMode_ == DebuggerStartMode.AttachToRemoteServer + or self.startMode_ == DebuggerStartMode.AttachToRemoteProcess): + + + remote_channel = 'connect://' + self.remoteChannel_ + connect_options = lldb.SBPlatformConnectOptions(remote_channel) + + res = self.target.GetPlatform().ConnectRemote(connect_options) + DumperBase.warn("CONNECT: %s %s %s" % (res, + self.target.GetPlatform().GetName(), + self.target.GetPlatform().IsConnected())) + + + broadcaster = self.target.GetBroadcaster() + listener = self.debugger.GetListener() + broadcaster.AddListener(listener, lldb.SBProcess.eBroadcastBitStateChanged) + listener.StartListeningForEvents(broadcaster, lldb.SBProcess.eBroadcastBitStateChanged) + broadcaster.AddListener(listener, lldb.SBTarget.eBroadcastBitBreakpointChanged) + listener.StartListeningForEvents( + broadcaster, lldb.SBTarget.eBroadcastBitBreakpointChanged) if self.nativeMixed: self.interpreterEventBreakpoint = \ @@ -918,17 +946,29 @@ class Dumper(DumperBase): self.reportState('enginerunandinferiorrunok') elif (self.startMode_ == DebuggerStartMode.AttachToRemoteServer or self.startMode_ == DebuggerStartMode.AttachToRemoteProcess): - self.process = self.target.ConnectRemote( - self.debugger.GetListener(), - self.remoteChannel_, None, error) + + f = lldb.SBFileSpec() + f.SetFilename(self.executable_) + + launchInfo = lldb.SBLaunchInfo(self.processArgs_) + #launchInfo.SetWorkingDirectory(self.workingDirectory_) + launchInfo.SetWorkingDirectory('/tmp') + launchInfo.SetExecutableFile(f, True) + + DumperBase.warn("TARGET: %s" % self.target) + self.process = self.target.Launch(launchInfo, error) + DumperBase.warn("PROCESS: %s" % self.process) + if not error.Success(): self.report(self.describeError(error)) self.reportState('enginerunfailed') return + # Even if it stops it seems that LLDB assumes it is running # and later detects that it did stop after all, so it is be # better to mirror that and wait for the spontaneous stop. self.reportState('enginerunandinferiorrunok') + elif self.startMode_ == DebuggerStartMode.AttachCore: coreFile = args.get('coreFile', '') self.process = self.target.LoadCore(coreFile) @@ -949,14 +989,6 @@ class Dumper(DumperBase): return self.report('pid="%s"' % self.process.GetProcessID()) self.reportState('enginerunandinferiorrunok') - if self.target is not None: - broadcaster = self.target.GetBroadcaster() - listener = self.debugger.GetListener() - broadcaster.AddListener(listener, lldb.SBProcess.eBroadcastBitStateChanged) - listener.StartListeningForEvents(broadcaster, lldb.SBProcess.eBroadcastBitStateChanged) - broadcaster.AddListener(listener, lldb.SBTarget.eBroadcastBitBreakpointChanged) - listener.StartListeningForEvents( - broadcaster, lldb.SBTarget.eBroadcastBitBreakpointChanged) def loop(self): event = lldb.SBEvent() -- cgit v1.2.1