From e48f1189508fcf7b12e987835ad00dc0473b1cc7 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Thu, 7 Jan 2016 12:51:47 +0100 Subject: Fix plugins.qmltypes for designer Multiple definitions of "QQuickItem" break the inheritance hierarchy required for Qt Quick Designer. Change-Id: I867a2fa7cdbb0054518c566ae31d8d9dc859b7a1 Reviewed-by: Marco Benelli Reviewed-by: J-P Nurmi --- src/imports/controls/plugins.qmltypes | 154 ---------------------------------- 1 file changed, 154 deletions(-) (limited to 'src/imports') diff --git a/src/imports/controls/plugins.qmltypes b/src/imports/controls/plugins.qmltypes index 518a9b6c..7ffa52be 100644 --- a/src/imports/controls/plugins.qmltypes +++ b/src/imports/controls/plugins.qmltypes @@ -266,160 +266,6 @@ Module { Signal { name: "implicitWidthChanged2"; revision: 1 } Signal { name: "implicitHeightChanged2"; revision: 1 } } - Component { - name: "QQuickItem" - defaultProperty: "data" - prototype: "QObject" - Enum { - name: "TransformOrigin" - values: { - "TopLeft": 0, - "Top": 1, - "TopRight": 2, - "Left": 3, - "Center": 4, - "Right": 5, - "BottomLeft": 6, - "Bottom": 7, - "BottomRight": 8 - } - } - Property { name: "parent"; type: "QQuickItem"; isPointer: true } - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "resources"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "children"; type: "QQuickItem"; isList: true; isReadonly: true } - Property { name: "x"; type: "double" } - Property { name: "y"; type: "double" } - Property { name: "z"; type: "double" } - Property { name: "width"; type: "double" } - Property { name: "height"; type: "double" } - Property { name: "opacity"; type: "double" } - Property { name: "enabled"; type: "bool" } - Property { name: "visible"; type: "bool" } - Property { name: "visibleChildren"; type: "QQuickItem"; isList: true; isReadonly: true } - Property { name: "states"; type: "QQuickState"; isList: true; isReadonly: true } - Property { name: "transitions"; type: "QQuickTransition"; isList: true; isReadonly: true } - Property { name: "state"; type: "string" } - Property { name: "childrenRect"; type: "QRectF"; isReadonly: true } - Property { name: "anchors"; type: "QQuickAnchors"; isReadonly: true; isPointer: true } - Property { name: "left"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "right"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "horizontalCenter"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "top"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "bottom"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "verticalCenter"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "baseline"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "baselineOffset"; type: "double" } - Property { name: "clip"; type: "bool" } - Property { name: "focus"; type: "bool" } - Property { name: "activeFocus"; type: "bool"; isReadonly: true } - Property { name: "activeFocusOnTab"; revision: 1; type: "bool" } - Property { name: "rotation"; type: "double" } - Property { name: "scale"; type: "double" } - Property { name: "transformOrigin"; type: "TransformOrigin" } - Property { name: "transformOriginPoint"; type: "QPointF"; isReadonly: true } - Property { name: "transform"; type: "QQuickTransform"; isList: true; isReadonly: true } - Property { name: "smooth"; type: "bool" } - Property { name: "antialiasing"; type: "bool" } - Property { name: "implicitWidth"; type: "double" } - Property { name: "implicitHeight"; type: "double" } - Property { name: "layer"; type: "QQuickItemLayer"; isReadonly: true; isPointer: true } - Signal { - name: "childrenRectChanged" - Parameter { type: "QRectF" } - } - Signal { - name: "baselineOffsetChanged" - Parameter { type: "double" } - } - Signal { - name: "stateChanged" - Parameter { type: "string" } - } - Signal { - name: "focusChanged" - Parameter { type: "bool" } - } - Signal { - name: "activeFocusChanged" - Parameter { type: "bool" } - } - Signal { - name: "activeFocusOnTabChanged" - revision: 1 - Parameter { type: "bool" } - } - Signal { - name: "parentChanged" - Parameter { type: "QQuickItem"; isPointer: true } - } - Signal { - name: "transformOriginChanged" - Parameter { type: "TransformOrigin" } - } - Signal { - name: "smoothChanged" - Parameter { type: "bool" } - } - Signal { - name: "antialiasingChanged" - Parameter { type: "bool" } - } - Signal { - name: "clipChanged" - Parameter { type: "bool" } - } - Signal { - name: "windowChanged" - revision: 1 - Parameter { name: "window"; type: "QQuickWindow"; isPointer: true } - } - Method { name: "update" } - Method { - name: "grabToImage" - revision: 2 - type: "bool" - Parameter { name: "callback"; type: "QJSValue" } - Parameter { name: "targetSize"; type: "QSize" } - } - Method { - name: "grabToImage" - revision: 2 - type: "bool" - Parameter { name: "callback"; type: "QJSValue" } - } - Method { - name: "contains" - type: "bool" - Parameter { name: "point"; type: "QPointF" } - } - Method { - name: "mapFromItem" - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { - name: "mapToItem" - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { name: "forceActiveFocus" } - Method { - name: "forceActiveFocus" - Parameter { name: "reason"; type: "Qt::FocusReason" } - } - Method { - name: "nextItemInFocusChain" - revision: 1 - type: "QQuickItem*" - Parameter { name: "forward"; type: "bool" } - } - Method { name: "nextItemInFocusChain"; revision: 1; type: "QQuickItem*" } - Method { - name: "childAt" - type: "QQuickItem*" - Parameter { name: "x"; type: "double" } - Parameter { name: "y"; type: "double" } - } - } Component { name: "QQuickItemDelegate" defaultProperty: "data" -- cgit v1.2.3 From 8ca88664aceeb4e1b3ebd51c0e8400a6af20da71 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 6 Jan 2016 23:05:39 +0100 Subject: Material: fix BusyIndicator on high DPI Take the device pixel ratio into account Change-Id: Icd2aa70018254975675d284ce77f6db02af9517a Reviewed-by: Mitch Curtis --- src/imports/controls/material/qquickmaterialprogressring.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/imports') diff --git a/src/imports/controls/material/qquickmaterialprogressring.cpp b/src/imports/controls/material/qquickmaterialprogressring.cpp index 54728686..c11a347f 100644 --- a/src/imports/controls/material/qquickmaterialprogressring.cpp +++ b/src/imports/controls/material/qquickmaterialprogressring.cpp @@ -74,6 +74,7 @@ public: void afterNodeSync() Q_DECL_OVERRIDE; private: + qreal m_devicePixelRatio; QSGNode *m_containerNode; QQuickWindow *m_window; }; @@ -165,6 +166,7 @@ QQuickAnimatorJob *QQuickMaterialRingAnimator::createJob() const } QQuickMaterialRingAnimatorJob::QQuickMaterialRingAnimatorJob() : + m_devicePixelRatio(1.0), m_containerNode(Q_NULLPTR), m_window(Q_NULLPTR) { @@ -179,6 +181,7 @@ void QQuickMaterialRingAnimatorJob::initialize(QQuickAnimatorController *control QQuickAnimatorJob::initialize(controller); m_containerNode = QQuickItemPrivate::get(m_target)->childContainerNode(); m_window = m_target->window(); + m_devicePixelRatio = m_window->effectiveDevicePixelRatio(); } void QQuickMaterialRingAnimatorJob::updateCurrentTime(int time) @@ -192,8 +195,8 @@ void QQuickMaterialRingAnimatorJob::updateCurrentTime(int time) Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType); - const qreal width = rectNode->rect().width(); - const qreal height = rectNode->rect().height(); + const qreal width = rectNode->rect().width() * m_devicePixelRatio; + const qreal height = rectNode->rect().height() * m_devicePixelRatio; QImage image(width, height, QImage::Format_ARGB32_Premultiplied); image.fill(Qt::transparent); @@ -203,7 +206,7 @@ void QQuickMaterialRingAnimatorJob::updateCurrentTime(int time) QPen pen; QQuickMaterialRingTexture *textureNode = static_cast(rectNode->firstChild()); pen.setColor(textureNode->color()); - pen.setWidth(4); + pen.setWidth(4 * m_devicePixelRatio); painter.setPen(pen); const qreal percentageComplete = time / qreal(rotationAnimationDuration); @@ -237,7 +240,7 @@ void QQuickMaterialRingAnimatorJob::updateCurrentTime(int time) } const int halfPen = pen.width() / 2; - const QRectF arcBounds = QRectF(rectNode->rect().adjusted(halfPen, halfPen, -halfPen, -halfPen)); + const QRectF arcBounds = QRectF(halfPen, halfPen, width - pen.width(), height - pen.width()); // The current angle of the rotation animation. const qreal rotation = oneDegree * percentageComplete * -targetRotation; startAngle -= rotation; -- cgit v1.2.3 From ddebc2d5ded6e08449b10311dd3c6634c84d71b5 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 7 Jan 2016 13:46:22 +0100 Subject: Material: sync ProgressBar height with Android Change-Id: I4e7864e39fcf6dc8f3f0f821e2c9129a472967ba Reviewed-by: Mitch Curtis --- src/imports/controls/material/ProgressBar.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/imports') diff --git a/src/imports/controls/material/ProgressBar.qml b/src/imports/controls/material/ProgressBar.qml index 34e1aaea..709ac28d 100644 --- a/src/imports/controls/material/ProgressBar.qml +++ b/src/imports/controls/material/ProgressBar.qml @@ -66,7 +66,7 @@ T.ProgressBar { x: (indeterminate ? offset * parent.width : 0) y: (parent.height - height) / 2 width: offset * (parent.width - x) - height: 6 + height: 4 color: control.Material.accentColor @@ -94,7 +94,7 @@ T.ProgressBar { x: control.leftPadding y: control.topPadding + (control.availableHeight - height) / 2 width: control.availableWidth - height: 6 + height: 4 color: Qt.rgba(control.Material.accentColor.r, control.Material.accentColor.g, control.Material.accentColor.b, 0.25) } -- cgit v1.2.3 From ad2193f66b942d138c183992af2ec76fc66aa7a5 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 7 Jan 2016 19:10:18 +0100 Subject: Material style: hide implementation details Change-Id: Ib797d34014c5faddc05e93f6fc5c4f95c5664997 Reviewed-by: Mitch Curtis --- src/imports/controls/material/BusyIndicator.qml | 1 + src/imports/controls/material/qtlabsmaterialstyleplugin.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/imports') diff --git a/src/imports/controls/material/BusyIndicator.qml b/src/imports/controls/material/BusyIndicator.qml index 6d5e4e8d..9eb48613 100644 --- a/src/imports/controls/material/BusyIndicator.qml +++ b/src/imports/controls/material/BusyIndicator.qml @@ -37,6 +37,7 @@ import QtQuick 2.6 import Qt.labs.templates 1.0 as T import Qt.labs.controls.material 1.0 +import Qt.labs.controls.material.impl 1.0 T.BusyIndicator { id: control diff --git a/src/imports/controls/material/qtlabsmaterialstyleplugin.cpp b/src/imports/controls/material/qtlabsmaterialstyleplugin.cpp index db8b47ee..975e5db6 100644 --- a/src/imports/controls/material/qtlabsmaterialstyleplugin.cpp +++ b/src/imports/controls/material/qtlabsmaterialstyleplugin.cpp @@ -76,8 +76,6 @@ QtLabsMaterialStylePlugin::~QtLabsMaterialStylePlugin() void QtLabsMaterialStylePlugin::registerTypes(const char *uri) { qmlRegisterUncreatableType(uri, 1, 0, "Material", tr("Material is an attached property")); - qmlRegisterType(uri, 1, 0, "ProgressRing"); - qmlRegisterType(uri, 1, 0, "RingAnimator"); } void QtLabsMaterialStylePlugin::initializeEngine(QQmlEngine *engine, const char *uri) @@ -97,6 +95,10 @@ void QtLabsMaterialStylePlugin::initializeEngine(QQmlEngine *engine, const char } initResources(); + + QByteArray import = QByteArray(uri) + ".impl"; + qmlRegisterType(import, 1, 0, "ProgressRing"); + qmlRegisterType(import, 1, 0, "RingAnimator"); } QT_END_NAMESPACE -- cgit v1.2.3 From a3dddf0471452448003cfe6c6802e3ccaf565b5d Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 7 Jan 2016 15:52:08 +0100 Subject: Fix style inheritance for popups Change-Id: I7bc36cb68e8d668fff2270e018de7eb1c71ccd20 Task-number: QTBUG-50347 Reviewed-by: Mitch Curtis --- src/imports/controls/material/material.pro | 2 +- src/imports/controls/universal/universal.pro | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/imports') diff --git a/src/imports/controls/material/material.pro b/src/imports/controls/material/material.pro index 06b9ed7d..63450289 100644 --- a/src/imports/controls/material/material.pro +++ b/src/imports/controls/material/material.pro @@ -3,7 +3,7 @@ TARGETPATH = Qt/labs/controls/material IMPORT_VERSION = 1.0 QT += qml quick -QT_PRIVATE += core-private gui-private qml-private quick-private labscontrols-private +QT_PRIVATE += core-private gui-private qml-private quick-private labstemplates-private labscontrols-private DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII diff --git a/src/imports/controls/universal/universal.pro b/src/imports/controls/universal/universal.pro index 41cef97d..88bad8f7 100644 --- a/src/imports/controls/universal/universal.pro +++ b/src/imports/controls/universal/universal.pro @@ -3,7 +3,7 @@ TARGETPATH = Qt/labs/controls/universal IMPORT_VERSION = 1.0 QT += qml quick -QT_PRIVATE += core-private gui-private qml-private quick-private labscontrols-private +QT_PRIVATE += core-private gui-private qml-private quick-private labstemplates-private labscontrols-private DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII -- cgit v1.2.3