From f5c13e141c9c9bf7b131da6948ebcfc01d82f160 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Fri, 15 Dec 2017 12:34:03 +0100 Subject: Popups: use deferred execution QQuickPopup is backed by a QQuickControl subclass aka QQuickPopupItem. However, since the QML engine sees "background" and "contentItem" as properties of QQuickPopup, we must ensure that the deferred properties are executed for the QQuickPopup wrapper object. Task-number: QTBUG-50992 Change-Id: I2ec055b382e41530a6f4a740cb80853c0181c21a Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickcontrol_p_p.h | 4 +- src/quicktemplates2/qquickmenu.cpp | 3 + src/quicktemplates2/qquickpagelayout.cpp | 13 ++-- src/quicktemplates2/qquickpopup.cpp | 11 ++-- src/quicktemplates2/qquickpopup_p.h | 1 + src/quicktemplates2/qquickpopupitem.cpp | 30 ++++++++++ .../customization/data/styles/empty/Dialog.qml | 57 ++++++++++++++++++ .../customization/data/styles/empty/Drawer.qml | 57 ++++++++++++++++++ .../auto/customization/data/styles/empty/Menu.qml | 57 ++++++++++++++++++ .../auto/customization/data/styles/empty/Popup.qml | 57 ++++++++++++++++++ .../customization/data/styles/empty/ToolTip.qml | 57 ++++++++++++++++++ .../data/styles/incomplete/Dialog.qml | 65 ++++++++++++++++++++ .../data/styles/incomplete/Drawer.qml | 65 ++++++++++++++++++++ .../customization/data/styles/incomplete/Menu.qml | 65 ++++++++++++++++++++ .../customization/data/styles/incomplete/Popup.qml | 65 ++++++++++++++++++++ .../data/styles/incomplete/ToolTip.qml | 65 ++++++++++++++++++++ .../customization/data/styles/override/Dialog.qml | 65 ++++++++++++++++++++ .../customization/data/styles/override/Drawer.qml | 65 ++++++++++++++++++++ .../customization/data/styles/override/Menu.qml | 65 ++++++++++++++++++++ .../customization/data/styles/override/Popup.qml | 65 ++++++++++++++++++++ .../customization/data/styles/override/ToolTip.qml | 65 ++++++++++++++++++++ .../customization/data/styles/simple/Dialog.qml | 70 ++++++++++++++++++++++ .../customization/data/styles/simple/Drawer.qml | 70 ++++++++++++++++++++++ .../auto/customization/data/styles/simple/Menu.qml | 70 ++++++++++++++++++++++ .../customization/data/styles/simple/Popup.qml | 70 ++++++++++++++++++++++ .../customization/data/styles/simple/ToolTip.qml | 70 ++++++++++++++++++++++ tests/auto/customization/tst_customization.cpp | 20 +++++++ 27 files changed, 1356 insertions(+), 11 deletions(-) create mode 100644 tests/auto/customization/data/styles/empty/Dialog.qml create mode 100644 tests/auto/customization/data/styles/empty/Drawer.qml create mode 100644 tests/auto/customization/data/styles/empty/Menu.qml create mode 100644 tests/auto/customization/data/styles/empty/Popup.qml create mode 100644 tests/auto/customization/data/styles/empty/ToolTip.qml create mode 100644 tests/auto/customization/data/styles/incomplete/Dialog.qml create mode 100644 tests/auto/customization/data/styles/incomplete/Drawer.qml create mode 100644 tests/auto/customization/data/styles/incomplete/Menu.qml create mode 100644 tests/auto/customization/data/styles/incomplete/Popup.qml create mode 100644 tests/auto/customization/data/styles/incomplete/ToolTip.qml create mode 100644 tests/auto/customization/data/styles/override/Dialog.qml create mode 100644 tests/auto/customization/data/styles/override/Drawer.qml create mode 100644 tests/auto/customization/data/styles/override/Menu.qml create mode 100644 tests/auto/customization/data/styles/override/Popup.qml create mode 100644 tests/auto/customization/data/styles/override/ToolTip.qml create mode 100644 tests/auto/customization/data/styles/simple/Dialog.qml create mode 100644 tests/auto/customization/data/styles/simple/Drawer.qml create mode 100644 tests/auto/customization/data/styles/simple/Menu.qml create mode 100644 tests/auto/customization/data/styles/simple/Popup.qml create mode 100644 tests/auto/customization/data/styles/simple/ToolTip.qml diff --git a/src/quicktemplates2/qquickcontrol_p_p.h b/src/quicktemplates2/qquickcontrol_p_p.h index d8b1dd40..81fa03a4 100644 --- a/src/quicktemplates2/qquickcontrol_p_p.h +++ b/src/quicktemplates2/qquickcontrol_p_p.h @@ -127,8 +127,8 @@ public: static bool calcHoverEnabled(const QQuickItem *item); #endif - void executeContentItem(bool complete = false); - void executeBackground(bool complete = false); + virtual void executeContentItem(bool complete = false); + virtual void executeBackground(bool complete = false); static void destroyDelegate(QObject *object, QObject *parent); diff --git a/src/quicktemplates2/qquickmenu.cpp b/src/quicktemplates2/qquickmenu.cpp index 52c048a6..13c738ac 100644 --- a/src/quicktemplates2/qquickmenu.cpp +++ b/src/quicktemplates2/qquickmenu.cpp @@ -38,6 +38,7 @@ #include "qquickmenu_p_p.h" #include "qquickmenuitem_p.h" #include "qquickcontrol_p_p.h" +#include "qquickpopupitem_p_p.h" #include #include @@ -449,6 +450,8 @@ QVariant QQuickMenu::contentModel() const QQmlListProperty QQuickMenu::contentData() { Q_D(QQuickMenu); + if (!d->contentItem) + QQuickControlPrivate::get(d->popupItem)->executeContentItem(); return QQmlListProperty(this, d, QQuickMenuPrivate::contentData_append, QQuickMenuPrivate::contentData_count, diff --git a/src/quicktemplates2/qquickpagelayout.cpp b/src/quicktemplates2/qquickpagelayout.cpp index 99d4fe23..595db560 100644 --- a/src/quicktemplates2/qquickpagelayout.cpp +++ b/src/quicktemplates2/qquickpagelayout.cpp @@ -36,6 +36,7 @@ #include "qquickpagelayout_p_p.h" #include "qquickcontrol_p.h" +#include "qquickcontrol_p_p.h" #include "qquicktoolbar_p.h" #include "qquicktabbar_p.h" #include "qquickdialogbuttonbox_p.h" @@ -140,17 +141,19 @@ bool QQuickPageLayout::setFooter(QQuickItem *footer) void QQuickPageLayout::update() { - QQuickItem *content = m_control->contentItem(); + QQuickItem *content = QQuickControlPrivate::get(m_control)->contentItem; const qreal hh = m_header && m_header->isVisible() ? m_header->height() : 0; const qreal fh = m_footer && m_footer->isVisible() ? m_footer->height() : 0; const qreal hsp = hh > 0 ? m_control->spacing() : 0; const qreal fsp = fh > 0 ? m_control->spacing() : 0; - content->setY(m_control->topPadding() + hh + hsp); - content->setX(m_control->leftPadding()); - content->setWidth(m_control->availableWidth()); - content->setHeight(m_control->availableHeight() - hh - fh - hsp - fsp); + if (content) { + content->setY(m_control->topPadding() + hh + hsp); + content->setX(m_control->leftPadding()); + content->setWidth(m_control->availableWidth()); + content->setHeight(m_control->availableHeight() - hh - fh - hsp - fsp); + } if (m_header) m_header->setWidth(m_control->width()); diff --git a/src/quicktemplates2/qquickpopup.cpp b/src/quicktemplates2/qquickpopup.cpp index ce4072e5..bb5ce660 100644 --- a/src/quicktemplates2/qquickpopup.cpp +++ b/src/quicktemplates2/qquickpopup.cpp @@ -261,6 +261,7 @@ void QQuickPopupPrivate::init() popupItem->setVisible(false); q->setParentItem(qobject_cast(parent)); QObject::connect(popupItem, &QQuickControl::paddingChanged, q, &QQuickPopup::paddingChanged); + QObject::connect(popupItem, &QQuickControl::backgroundChanged, q, &QQuickPopup::backgroundChanged); QObject::connect(popupItem, &QQuickControl::contentItemChanged, q, &QQuickPopup::contentItemChanged); positioner = new QQuickPopupPositioner(q); } @@ -1428,11 +1429,7 @@ QQuickItem *QQuickPopup::background() const void QQuickPopup::setBackground(QQuickItem *background) { Q_D(QQuickPopup); - if (d->popupItem->background() == background) - return; - d->popupItem->setBackground(background); - emit backgroundChanged(); } /*! @@ -1485,6 +1482,9 @@ void QQuickPopup::setContentItem(QQuickItem *item) QQmlListProperty QQuickPopup::contentData() { Q_D(QQuickPopup); + QQuickControlPrivate *p = QQuickControlPrivate::get(d->popupItem); + if (!p->contentItem) + p->executeContentItem(); return QQmlListProperty(d->popupItem->contentItem(), nullptr, QQuickItemPrivate::data_append, QQuickItemPrivate::data_count, @@ -1886,6 +1886,9 @@ void QQuickPopup::classBegin() { Q_D(QQuickPopup); d->complete = false; + QQmlContext *context = qmlContext(this); + if (context) + QQmlEngine::setContextForObject(d->popupItem, context); d->popupItem->classBegin(); } diff --git a/src/quicktemplates2/qquickpopup_p.h b/src/quicktemplates2/qquickpopup_p.h index 199f7e4c..16e46755 100644 --- a/src/quicktemplates2/qquickpopup_p.h +++ b/src/quicktemplates2/qquickpopup_p.h @@ -115,6 +115,7 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickPopup : public QObject, public QQml Q_PROPERTY(QQuickTransition *exit READ exit WRITE setExit NOTIFY exitChanged FINAL) // 2.1 (Qt 5.8) Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing RESET resetSpacing NOTIFY spacingChanged FINAL REVISION 1) + Q_CLASSINFO("DeferredPropertyNames", "background,contentItem") Q_CLASSINFO("DefaultProperty", "contentData") public: diff --git a/src/quicktemplates2/qquickpopupitem.cpp b/src/quicktemplates2/qquickpopupitem.cpp index bd667835..db335a06 100644 --- a/src/quicktemplates2/qquickpopupitem.cpp +++ b/src/quicktemplates2/qquickpopupitem.cpp @@ -39,6 +39,7 @@ #include "qquickshortcutcontext_p_p.h" #include "qquickcontrol_p_p.h" #include "qquickpopup_p_p.h" +#include "qquickdeferredexecute_p_p.h" #include #include @@ -59,6 +60,9 @@ public: QQuickItem *getContentItem() override; + void executeContentItem(bool complete = false) override; + void executeBackground(bool complete = false) override; + int backId; int escapeId; QQuickPopup *popup; @@ -100,6 +104,32 @@ QQuickItem *QQuickPopupItemPrivate::getContentItem() return new QQuickItem(q); } +static inline QString contentItemName() { return QStringLiteral("contentItem"); } + +void QQuickPopupItemPrivate::executeContentItem(bool complete) +{ + if (contentItem.wasExecuted()) + return; + + if (!contentItem) + quickBeginDeferred(popup, contentItemName(), contentItem); + if (complete) + quickCompleteDeferred(popup, contentItemName(), contentItem); +} + +static inline QString backgroundName() { return QStringLiteral("background"); } + +void QQuickPopupItemPrivate::executeBackground(bool complete) +{ + if (background.wasExecuted()) + return; + + if (!background) + quickBeginDeferred(popup, backgroundName(), background); + if (complete) + quickCompleteDeferred(popup, backgroundName(), background); +} + QQuickPopupItem::QQuickPopupItem(QQuickPopup *popup) : QQuickControl(*(new QQuickPopupItemPrivate(popup)), nullptr) { diff --git a/tests/auto/customization/data/styles/empty/Dialog.qml b/tests/auto/customization/data/styles/empty/Dialog.qml new file mode 100644 index 00000000..a9729e47 --- /dev/null +++ b/tests/auto/customization/data/styles/empty/Dialog.qml @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.Dialog { + id: control + objectName: "dialog-empty" +} diff --git a/tests/auto/customization/data/styles/empty/Drawer.qml b/tests/auto/customization/data/styles/empty/Drawer.qml new file mode 100644 index 00000000..3d8939f5 --- /dev/null +++ b/tests/auto/customization/data/styles/empty/Drawer.qml @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.Drawer { + id: control + objectName: "drawer-empty" +} diff --git a/tests/auto/customization/data/styles/empty/Menu.qml b/tests/auto/customization/data/styles/empty/Menu.qml new file mode 100644 index 00000000..acc73d90 --- /dev/null +++ b/tests/auto/customization/data/styles/empty/Menu.qml @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.Menu { + id: control + objectName: "menu-empty" +} diff --git a/tests/auto/customization/data/styles/empty/Popup.qml b/tests/auto/customization/data/styles/empty/Popup.qml new file mode 100644 index 00000000..56013fc5 --- /dev/null +++ b/tests/auto/customization/data/styles/empty/Popup.qml @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.Popup { + id: control + objectName: "popup-empty" +} diff --git a/tests/auto/customization/data/styles/empty/ToolTip.qml b/tests/auto/customization/data/styles/empty/ToolTip.qml new file mode 100644 index 00000000..ce8f5d85 --- /dev/null +++ b/tests/auto/customization/data/styles/empty/ToolTip.qml @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.ToolTip { + id: control + objectName: "tooltip-empty" +} diff --git a/tests/auto/customization/data/styles/incomplete/Dialog.qml b/tests/auto/customization/data/styles/incomplete/Dialog.qml new file mode 100644 index 00000000..17dba80d --- /dev/null +++ b/tests/auto/customization/data/styles/incomplete/Dialog.qml @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.Dialog { + id: control + objectName: "dialog-incomplete" + + contentItem: Item { + objectName: "dialog-contentItem-incomplete" + } + + background: Item { + objectName: "dialog-background-incomplete" + } +} diff --git a/tests/auto/customization/data/styles/incomplete/Drawer.qml b/tests/auto/customization/data/styles/incomplete/Drawer.qml new file mode 100644 index 00000000..c8083fb8 --- /dev/null +++ b/tests/auto/customization/data/styles/incomplete/Drawer.qml @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.Drawer { + id: control + objectName: "drawer-incomplete" + + contentItem: Item { + objectName: "drawer-contentItem-incomplete" + } + + background: Item { + objectName: "drawer-background-incomplete" + } +} diff --git a/tests/auto/customization/data/styles/incomplete/Menu.qml b/tests/auto/customization/data/styles/incomplete/Menu.qml new file mode 100644 index 00000000..8027b1db --- /dev/null +++ b/tests/auto/customization/data/styles/incomplete/Menu.qml @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.Menu { + id: control + objectName: "menu-incomplete" + + contentItem: Item { + objectName: "menu-contentItem-incomplete" + } + + background: Item { + objectName: "menu-background-incomplete" + } +} diff --git a/tests/auto/customization/data/styles/incomplete/Popup.qml b/tests/auto/customization/data/styles/incomplete/Popup.qml new file mode 100644 index 00000000..d268405e --- /dev/null +++ b/tests/auto/customization/data/styles/incomplete/Popup.qml @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.Popup { + id: control + objectName: "popup-incomplete" + + contentItem: Item { + objectName: "popup-contentItem-incomplete" + } + + background: Item { + objectName: "popup-background-incomplete" + } +} diff --git a/tests/auto/customization/data/styles/incomplete/ToolTip.qml b/tests/auto/customization/data/styles/incomplete/ToolTip.qml new file mode 100644 index 00000000..9a22ad06 --- /dev/null +++ b/tests/auto/customization/data/styles/incomplete/ToolTip.qml @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.ToolTip { + id: control + objectName: "tooltip-incomplete" + + contentItem: Item { + objectName: "tooltip-contentItem-incomplete" + } + + background: Item { + objectName: "tooltip-background-incomplete" + } +} diff --git a/tests/auto/customization/data/styles/override/Dialog.qml b/tests/auto/customization/data/styles/override/Dialog.qml new file mode 100644 index 00000000..820bdae8 --- /dev/null +++ b/tests/auto/customization/data/styles/override/Dialog.qml @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import "../simple" as Simple + +Simple.Dialog { + id: control + objectName: "dialog-override" + + contentItem: Item { + objectName: "dialog-contentItem-override" + } + + background: Item { + objectName: "dialog-background-override" + } +} diff --git a/tests/auto/customization/data/styles/override/Drawer.qml b/tests/auto/customization/data/styles/override/Drawer.qml new file mode 100644 index 00000000..5fc918c7 --- /dev/null +++ b/tests/auto/customization/data/styles/override/Drawer.qml @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import "../simple" as Simple + +Simple.Drawer { + id: control + objectName: "drawer-override" + + contentItem: Item { + objectName: "drawer-contentItem-override" + } + + background: Item { + objectName: "drawer-background-override" + } +} diff --git a/tests/auto/customization/data/styles/override/Menu.qml b/tests/auto/customization/data/styles/override/Menu.qml new file mode 100644 index 00000000..891de1bd --- /dev/null +++ b/tests/auto/customization/data/styles/override/Menu.qml @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import "../simple" as Simple + +Simple.Menu { + id: control + objectName: "menu-override" + + contentItem: Item { + objectName: "menu-contentItem-override" + } + + background: Item { + objectName: "menu-background-override" + } +} diff --git a/tests/auto/customization/data/styles/override/Popup.qml b/tests/auto/customization/data/styles/override/Popup.qml new file mode 100644 index 00000000..96f00eb0 --- /dev/null +++ b/tests/auto/customization/data/styles/override/Popup.qml @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import "../simple" as Simple + +Simple.Popup { + id: control + objectName: "popup-override" + + contentItem: Item { + objectName: "popup-contentItem-override" + } + + background: Item { + objectName: "popup-background-override" + } +} diff --git a/tests/auto/customization/data/styles/override/ToolTip.qml b/tests/auto/customization/data/styles/override/ToolTip.qml new file mode 100644 index 00000000..63f7ff6c --- /dev/null +++ b/tests/auto/customization/data/styles/override/ToolTip.qml @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import "../simple" as Simple + +Simple.ToolTip { + id: control + objectName: "tooltip-override" + + contentItem: Item { + objectName: "tooltip-contentItem-override" + } + + background: Item { + objectName: "tooltip-background-override" + } +} diff --git a/tests/auto/customization/data/styles/simple/Dialog.qml b/tests/auto/customization/data/styles/simple/Dialog.qml new file mode 100644 index 00000000..c30399eb --- /dev/null +++ b/tests/auto/customization/data/styles/simple/Dialog.qml @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.Dialog { + id: control + objectName: "dialog-simple" + + implicitWidth: Math.max(contentItem.implicitWidth, background.implicitWidth) + implicitHeight: Math.max(contentItem.implicitHeight, background.implicitHeight) + + contentItem: Text { + objectName: "dialog-contentItem-simple" + } + + background: Rectangle { + objectName: "dialog-background-simple" + implicitWidth: 20 + implicitHeight: 20 + } +} diff --git a/tests/auto/customization/data/styles/simple/Drawer.qml b/tests/auto/customization/data/styles/simple/Drawer.qml new file mode 100644 index 00000000..64028ba5 --- /dev/null +++ b/tests/auto/customization/data/styles/simple/Drawer.qml @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.Drawer { + id: control + objectName: "drawer-simple" + + implicitWidth: Math.max(contentItem.implicitWidth, background.implicitWidth) + implicitHeight: Math.max(contentItem.implicitHeight, background.implicitHeight) + + contentItem: Item { + objectName: "drawer-contentItem-simple" + } + + background: Rectangle { + objectName: "drawer-background-simple" + implicitWidth: 20 + implicitHeight: 20 + } +} diff --git a/tests/auto/customization/data/styles/simple/Menu.qml b/tests/auto/customization/data/styles/simple/Menu.qml new file mode 100644 index 00000000..06163fcc --- /dev/null +++ b/tests/auto/customization/data/styles/simple/Menu.qml @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.Menu { + id: control + objectName: "menu-simple" + + implicitWidth: Math.max(contentItem.implicitWidth, background.implicitWidth) + implicitHeight: Math.max(contentItem.implicitHeight, background.implicitHeight) + + contentItem: ListView { + objectName: "menu-contentItem-simple" + } + + background: Rectangle { + objectName: "menu-background-simple" + implicitWidth: 20 + implicitHeight: 20 + } +} diff --git a/tests/auto/customization/data/styles/simple/Popup.qml b/tests/auto/customization/data/styles/simple/Popup.qml new file mode 100644 index 00000000..f605d3d6 --- /dev/null +++ b/tests/auto/customization/data/styles/simple/Popup.qml @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.Popup { + id: control + objectName: "popup-simple" + + implicitWidth: Math.max(contentItem.implicitWidth, background.implicitWidth) + implicitHeight: Math.max(contentItem.implicitHeight, background.implicitHeight) + + contentItem: Item { + objectName: "popup-contentItem-simple" + } + + background: Rectangle { + objectName: "popup-background-simple" + implicitWidth: 20 + implicitHeight: 20 + } +} diff --git a/tests/auto/customization/data/styles/simple/ToolTip.qml b/tests/auto/customization/data/styles/simple/ToolTip.qml new file mode 100644 index 00000000..1df40746 --- /dev/null +++ b/tests/auto/customization/data/styles/simple/ToolTip.qml @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.ToolTip { + id: control + objectName: "tooltip-simple" + + implicitWidth: Math.max(contentItem.implicitWidth, background.implicitWidth) + implicitHeight: Math.max(contentItem.implicitHeight, background.implicitHeight) + + contentItem: Text { + objectName: "tooltip-contentItem-simple" + } + + background: Rectangle { + objectName: "tooltip-background-simple" + implicitWidth: 20 + implicitHeight: 20 + } +} diff --git a/tests/auto/customization/tst_customization.cpp b/tests/auto/customization/tst_customization.cpp index 4d68d0c5..34c56785 100644 --- a/tests/auto/customization/tst_customization.cpp +++ b/tests/auto/customization/tst_customization.cpp @@ -151,16 +151,20 @@ void tst_customization::creation_data() QTest::newRow("empty:Control") << "empty" << "Control"<< QStringList(); QTest::newRow("empty:DelayButton") << "empty" << "DelayButton"<< QStringList(); QTest::newRow("empty:Dial") << "empty" << "Dial" << QStringList(); + QTest::newRow("empty:Dialog") << "empty" << "Dialog" << QStringList(); QTest::newRow("empty:DialogButtonBox") << "empty" << "DialogButtonBox" << QStringList(); + QTest::newRow("empty:Drawer") << "empty" << "Drawer" << QStringList(); QTest::newRow("empty:Frame") << "empty" << "Frame"<< QStringList(); QTest::newRow("empty:GroupBox") << "empty" << "GroupBox"<< QStringList(); QTest::newRow("empty:ItemDelegate") << "empty" << "ItemDelegate" << QStringList(); QTest::newRow("empty:Label") << "empty" << "Label"<< QStringList(); + QTest::newRow("empty:Menu") << "empty" << "Menu" << QStringList(); QTest::newRow("empty:MenuItem") << "empty" << "MenuItem"<< QStringList(); QTest::newRow("empty:MenuSeparator") << "empty" << "MenuSeparator"<< QStringList(); QTest::newRow("empty:Page") << "empty" << "Page"<< QStringList(); QTest::newRow("empty:PageIndicator") << "empty" << "PageIndicator"<< QStringList(); QTest::newRow("empty:Pane") << "empty" << "Pane"<< QStringList(); + QTest::newRow("empty:Popup") << "empty" << "Popup" << QStringList(); QTest::newRow("empty:ProgressBar") << "empty" << "ProgressBar"<< QStringList(); QTest::newRow("empty:RadioButton") << "empty" << "RadioButton" << QStringList(); QTest::newRow("empty:RadioDelegate") << "empty" << "RadioDelegate" << QStringList(); @@ -183,6 +187,7 @@ void tst_customization::creation_data() QTest::newRow("empty:ToolBar") << "empty" << "ToolBar"<< QStringList(); QTest::newRow("empty:ToolButton") << "empty" << "ToolButton"<< QStringList(); QTest::newRow("empty:ToolSeparator") << "empty" << "ToolSeparator"<< QStringList(); + QTest::newRow("empty:ToolTip") << "empty" << "ToolTip"<< QStringList(); // QTest::newRow("empty:Tumbler") << "empty" << "Tumbler"<< QStringList(); // ### TODO: fix crash with contentItem-less Tumbler // the "incomplete" style is missing bindings to the delegates (must be created regardless) @@ -197,16 +202,20 @@ void tst_customization::creation_data() QTest::newRow("incomplete:Control") << "incomplete" << "Control" << (QStringList() << "background" << "contentItem"); QTest::newRow("incomplete:DelayButton") << "incomplete" << "DelayButton" << (QStringList() << "background" << "contentItem"); QTest::newRow("incomplete:Dial") << "incomplete" << "Dial" << (QStringList() << "background" << "contentItem" << "handle"); + QTest::newRow("incomplete:Dialog") << "incomplete" << "Dialog" << (QStringList() << "background" << "contentItem"); QTest::newRow("incomplete:DialogButtonBox") << "incomplete" << "DialogButtonBox" << (QStringList() << "background" << "contentItem"); + QTest::newRow("incomplete:Drawer") << "incomplete" << "Drawer" << (QStringList() << "background" << "contentItem"); QTest::newRow("incomplete:Frame") << "incomplete" << "Frame"<< (QStringList() << "background" << "contentItem"); QTest::newRow("incomplete:GroupBox") << "incomplete" << "GroupBox"<< (QStringList() << "background" << "contentItem" << "label"); QTest::newRow("incomplete:ItemDelegate") << "incomplete" << "ItemDelegate" << (QStringList() << "background" << "contentItem"); QTest::newRow("incomplete:Label") << "incomplete" << "Label" << (QStringList() << "background"); + QTest::newRow("incomplete:Menu") << "incomplete" << "Menu" << (QStringList() << "background" << "contentItem"); QTest::newRow("incomplete:MenuItem") << "incomplete" << "MenuItem" << (QStringList() << "background" << "contentItem" << "indicator"); QTest::newRow("incomplete:MenuSeparator") << "incomplete" << "MenuSeparator" << (QStringList() << "background" << "contentItem"); QTest::newRow("incomplete:Page") << "incomplete" << "Page" << (QStringList() << "background" << "contentItem"); QTest::newRow("incomplete:PageIndicator") << "incomplete" << "PageIndicator" << (QStringList() << "background" << "contentItem"); QTest::newRow("incomplete:Pane") << "incomplete" << "Pane" << (QStringList() << "background" << "contentItem"); + QTest::newRow("incomplete:Popup") << "incomplete" << "Popup" << (QStringList() << "background" << "contentItem"); QTest::newRow("incomplete:ProgressBar") << "incomplete" << "ProgressBar" << (QStringList() << "background" << "contentItem"); QTest::newRow("incomplete:RadioButton") << "incomplete" << "RadioButton" << (QStringList() << "background" << "contentItem" << "indicator"); QTest::newRow("incomplete:RadioDelegate") << "incomplete" << "RadioDelegate" << (QStringList() << "background" << "contentItem" << "indicator"); @@ -229,6 +238,7 @@ void tst_customization::creation_data() QTest::newRow("incomplete:ToolBar") << "incomplete" << "ToolBar"<< (QStringList() << "background" << "contentItem"); QTest::newRow("incomplete:ToolButton") << "incomplete" << "ToolButton"<< (QStringList() << "background" << "contentItem"); QTest::newRow("incomplete:ToolSeparator") << "incomplete" << "ToolSeparator"<< (QStringList() << "background" << "contentItem"); + QTest::newRow("incomplete:ToolTip") << "incomplete" << "ToolTip" << (QStringList() << "background" << "contentItem"); QTest::newRow("incomplete:Tumbler") << "incomplete" << "Tumbler"<< (QStringList() << "background" << "contentItem"); // the "simple" style simulates a proper style and contains bindings to/in delegates @@ -243,16 +253,20 @@ void tst_customization::creation_data() QTest::newRow("simple:Control") << "simple" << "Control" << (QStringList() << "background" << "contentItem"); QTest::newRow("simple:DelayButton") << "simple" << "DelayButton" << (QStringList() << "background" << "contentItem"); QTest::newRow("simple:Dial") << "simple" << "Dial" << (QStringList() << "background" << "handle"); + QTest::newRow("simple:Dialog") << "simple" << "Dialog" << (QStringList() << "background" << "contentItem"); QTest::newRow("simple:DialogButtonBox") << "simple" << "DialogButtonBox" << (QStringList() << "background" << "contentItem"); + QTest::newRow("simple:Drawer") << "simple" << "Drawer" << (QStringList() << "background" << "contentItem"); QTest::newRow("simple:Frame") << "simple" << "Frame"<< (QStringList() << "background" << "contentItem"); QTest::newRow("simple:GroupBox") << "simple" << "GroupBox"<< (QStringList() << "background" << "contentItem" << "label"); QTest::newRow("simple:ItemDelegate") << "simple" << "ItemDelegate" << (QStringList() << "background" << "contentItem"); QTest::newRow("simple:Label") << "simple" << "Label" << (QStringList() << "background"); + QTest::newRow("simple:Menu") << "simple" << "Menu" << (QStringList() << "background" << "contentItem"); QTest::newRow("simple:MenuItem") << "simple" << "MenuItem" << (QStringList() << "background" << "contentItem" << "indicator"); QTest::newRow("simple:MenuSeparator") << "simple" << "MenuSeparator" << (QStringList() << "background" << "contentItem"); QTest::newRow("simple:Page") << "simple" << "Page" << (QStringList() << "background" << "contentItem"); QTest::newRow("simple:PageIndicator") << "simple" << "PageIndicator" << (QStringList() << "background" << "contentItem"); QTest::newRow("simple:Pane") << "simple" << "Pane" << (QStringList() << "background" << "contentItem"); + QTest::newRow("simple:Popup") << "simple" << "Popup" << (QStringList() << "background" << "contentItem"); QTest::newRow("simple:ProgressBar") << "simple" << "ProgressBar" << (QStringList() << "background" << "contentItem"); QTest::newRow("simple:RadioButton") << "simple" << "RadioButton" << (QStringList() << "contentItem" << "indicator"); QTest::newRow("simple:RadioDelegate") << "simple" << "RadioDelegate" << (QStringList() << "background" << "contentItem" << "indicator"); @@ -275,6 +289,7 @@ void tst_customization::creation_data() QTest::newRow("simple:ToolBar") << "simple" << "ToolBar"<< (QStringList() << "background" << "contentItem"); QTest::newRow("simple:ToolButton") << "simple" << "ToolButton"<< (QStringList() << "background" << "contentItem"); QTest::newRow("simple:ToolSeparator") << "simple" << "ToolSeparator"<< (QStringList() << "background" << "contentItem"); + QTest::newRow("simple:ToolTip") << "simple" << "ToolTip" << (QStringList() << "background" << "contentItem"); QTest::newRow("simple:Tumbler") << "simple" << "Tumbler"<< (QStringList() << "background" << "contentItem"); // the "override" style overrides all delegates in the "simple" style @@ -289,16 +304,20 @@ void tst_customization::creation_data() QTest::newRow("override:Control") << "override" << "Control" << (QStringList() << "background" << "contentItem"); QTest::newRow("override:DelayButton") << "override" << "DelayButton" << (QStringList() << "background" << "contentItem"); QTest::newRow("override:Dial") << "override" << "Dial" << (QStringList() << "background" << "contentItem" << "handle"); + QTest::newRow("override:Dialog") << "override" << "Dialog" << (QStringList() << "background" << "contentItem"); QTest::newRow("override:DialogButtonBox") << "override" << "DialogButtonBox" << (QStringList() << "background" << "contentItem"); + QTest::newRow("override:Drawer") << "override" << "Drawer" << (QStringList() << "background" << "contentItem"); QTest::newRow("override:Frame") << "override" << "Frame"<< (QStringList() << "background" << "contentItem"); QTest::newRow("override:GroupBox") << "override" << "GroupBox"<< (QStringList() << "background" << "contentItem" << "label"); QTest::newRow("override:ItemDelegate") << "override" << "ItemDelegate" << (QStringList() << "background" << "contentItem"); QTest::newRow("override:Label") << "override" << "Label" << (QStringList() << "background"); + QTest::newRow("override:Menu") << "override" << "Menu" << (QStringList() << "background" << "contentItem"); QTest::newRow("override:MenuItem") << "override" << "MenuItem" << (QStringList() << "background" << "contentItem" << "indicator"); QTest::newRow("override:MenuSeparator") << "override" << "MenuSeparator" << (QStringList() << "background" << "contentItem"); QTest::newRow("override:Page") << "override" << "Page" << (QStringList() << "background" << "contentItem"); QTest::newRow("override:PageIndicator") << "override" << "PageIndicator" << (QStringList() << "background" << "contentItem"); QTest::newRow("override:Pane") << "override" << "Pane" << (QStringList() << "background" << "contentItem"); + QTest::newRow("override:Popup") << "override" << "Popup" << (QStringList() << "background" << "contentItem"); QTest::newRow("override:ProgressBar") << "override" << "ProgressBar" << (QStringList() << "background" << "contentItem"); QTest::newRow("override:RadioButton") << "override" << "RadioButton" << (QStringList() << "background" << "contentItem" << "indicator"); QTest::newRow("override:RadioDelegate") << "override" << "RadioDelegate" << (QStringList() << "background" << "contentItem" << "indicator"); @@ -321,6 +340,7 @@ void tst_customization::creation_data() QTest::newRow("override:ToolBar") << "override" << "ToolBar"<< (QStringList() << "background" << "contentItem"); QTest::newRow("override:ToolButton") << "override" << "ToolButton"<< (QStringList() << "background" << "contentItem"); QTest::newRow("override:ToolSeparator") << "override" << "ToolSeparator"<< (QStringList() << "background" << "contentItem"); + QTest::newRow("override:ToolTip") << "override" << "ToolTip" << (QStringList() << "background" << "contentItem"); QTest::newRow("override:Tumbler") << "override" << "Tumbler"<< (QStringList() << "background" << "contentItem"); } -- cgit v1.2.3 From 44382ff104965c5596b5138aa84e0e4ccf178772 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 8 Nov 2017 16:08:56 +0100 Subject: SwipeView: fix slow swiping in large views Flickable has a default maximumFlickVelocity of 2500 regardless of its size. When SwipeView covers the whole screen and ends up being large, 2500 pixels per second is nowhere near enough. Calculate a suitable maximum flick velocity based on the size of the view. Task-number: QTBUG-62110 Change-Id: Iaf26f586f99e7635ea931a4e3060ad4dd480a011 Reviewed-by: Mitch Curtis --- src/imports/controls/SwipeView.qml | 1 + src/imports/controls/material/SwipeView.qml | 1 + 2 files changed, 2 insertions(+) diff --git a/src/imports/controls/SwipeView.qml b/src/imports/controls/SwipeView.qml index 4ccef22b..9f2d9ccb 100644 --- a/src/imports/controls/SwipeView.qml +++ b/src/imports/controls/SwipeView.qml @@ -60,5 +60,6 @@ T.SwipeView { preferredHighlightBegin: 0 preferredHighlightEnd: 0 highlightMoveDuration: 250 + maximumFlickVelocity: 4 * (control.orientation === Qt.Horizontal ? width : height) } } diff --git a/src/imports/controls/material/SwipeView.qml b/src/imports/controls/material/SwipeView.qml index 293cce46..64ecb00f 100644 --- a/src/imports/controls/material/SwipeView.qml +++ b/src/imports/controls/material/SwipeView.qml @@ -59,5 +59,6 @@ T.SwipeView { preferredHighlightBegin: 0 preferredHighlightEnd: 0 highlightMoveDuration: 250 + maximumFlickVelocity: 4 * (control.orientation === Qt.Horizontal ? width : height) } } -- cgit v1.2.3 From bbdf0c2d8a3bf4779a973dda9436ce12c8360f13 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 18 Dec 2017 17:00:19 +0100 Subject: Default: cleanup unnecessary property assignments QQuickText's default horizontal alignment is AlignLeft. There's no need to repeat the default. Furthermore, an empty QQuickText element does not do anything, so the "visible: control.text" binding seems bogus. Change-Id: I9461301606c45a3d889ad49e62356d38fcef6f87 Reviewed-by: Mitch Curtis --- src/imports/controls/CheckBox.qml | 2 -- src/imports/controls/CheckDelegate.qml | 2 -- src/imports/controls/ComboBox.qml | 1 - src/imports/controls/GroupBox.qml | 1 - src/imports/controls/ItemDelegate.qml | 2 -- src/imports/controls/MenuItem.qml | 2 -- src/imports/controls/RadioButton.qml | 2 -- src/imports/controls/RadioDelegate.qml | 2 -- src/imports/controls/SwipeDelegate.qml | 2 -- src/imports/controls/Switch.qml | 2 -- src/imports/controls/SwitchDelegate.qml | 2 -- 11 files changed, 20 deletions(-) diff --git a/src/imports/controls/CheckBox.qml b/src/imports/controls/CheckBox.qml index 7945ca72..4da79098 100644 --- a/src/imports/controls/CheckBox.qml +++ b/src/imports/controls/CheckBox.qml @@ -66,8 +66,6 @@ T.CheckBox { font: control.font color: control.down ? Default.textDarkColor : Default.textColor elide: Text.ElideRight - visible: control.text - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter opacity: enabled ? 1 : 0.3 } diff --git a/src/imports/controls/CheckDelegate.qml b/src/imports/controls/CheckDelegate.qml index 05a0baf6..3333642c 100644 --- a/src/imports/controls/CheckDelegate.qml +++ b/src/imports/controls/CheckDelegate.qml @@ -60,8 +60,6 @@ T.CheckDelegate { font: control.font color: control.enabled ? Default.textDarkColor : Default.textDisabledColor elide: Text.ElideRight - visible: control.text - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } diff --git a/src/imports/controls/ComboBox.qml b/src/imports/controls/ComboBox.qml index 8d1a28be..3eabcacf 100644 --- a/src/imports/controls/ComboBox.qml +++ b/src/imports/controls/ComboBox.qml @@ -88,7 +88,6 @@ T.ComboBox { color: !control.editable && control.visualFocus ? Default.focusColor : Default.textColor selectionColor: Default.focusColor selectedTextColor: Default.textLightColor - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter opacity: control.enabled ? 1 : 0.3 diff --git a/src/imports/controls/GroupBox.qml b/src/imports/controls/GroupBox.qml index ee81250b..272577c9 100644 --- a/src/imports/controls/GroupBox.qml +++ b/src/imports/controls/GroupBox.qml @@ -62,7 +62,6 @@ T.GroupBox { font: control.font color: control.enabled ? Default.textColor : Default.textDisabledColor elide: Text.ElideRight - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } diff --git a/src/imports/controls/ItemDelegate.qml b/src/imports/controls/ItemDelegate.qml index 6ee03ca2..3a7e1044 100644 --- a/src/imports/controls/ItemDelegate.qml +++ b/src/imports/controls/ItemDelegate.qml @@ -60,8 +60,6 @@ T.ItemDelegate { font: control.font color: control.enabled ? Default.textDarkColor : Default.textDisabledColor elide: Text.ElideRight - visible: control.text - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } diff --git a/src/imports/controls/MenuItem.qml b/src/imports/controls/MenuItem.qml index 2c8eab5f..74ae6002 100644 --- a/src/imports/controls/MenuItem.qml +++ b/src/imports/controls/MenuItem.qml @@ -59,8 +59,6 @@ T.MenuItem { font: control.font color: control.enabled ? Default.textDarkColor : Default.textDisabledColor elide: Text.ElideRight - visible: control.text - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } diff --git a/src/imports/controls/RadioButton.qml b/src/imports/controls/RadioButton.qml index 878a0fe3..3ca0466b 100644 --- a/src/imports/controls/RadioButton.qml +++ b/src/imports/controls/RadioButton.qml @@ -66,8 +66,6 @@ T.RadioButton { font: control.font color: control.down ? Default.textDarkColor : Default.textColor elide: Text.ElideRight - visible: control.text - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter opacity: enabled ? 1 : 0.3 } diff --git a/src/imports/controls/RadioDelegate.qml b/src/imports/controls/RadioDelegate.qml index 03cd83bd..708c826a 100644 --- a/src/imports/controls/RadioDelegate.qml +++ b/src/imports/controls/RadioDelegate.qml @@ -60,8 +60,6 @@ T.RadioDelegate { font: control.font color: control.enabled ? Default.textDarkColor : Default.textDisabledColor elide: Text.ElideRight - visible: control.text - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } diff --git a/src/imports/controls/SwipeDelegate.qml b/src/imports/controls/SwipeDelegate.qml index d9f72da9..2ddbea28 100644 --- a/src/imports/controls/SwipeDelegate.qml +++ b/src/imports/controls/SwipeDelegate.qml @@ -62,8 +62,6 @@ T.SwipeDelegate { font: control.font color: control.enabled ? Default.textDarkColor : Default.textDisabledColor elide: Text.ElideRight - visible: control.text - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } diff --git a/src/imports/controls/Switch.qml b/src/imports/controls/Switch.qml index 55b08039..030cdfa0 100644 --- a/src/imports/controls/Switch.qml +++ b/src/imports/controls/Switch.qml @@ -66,8 +66,6 @@ T.Switch { font: control.font color: control.enabled ? Default.textDarkColor : Default.textDisabledColor elide: Text.ElideRight - visible: control.text - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } } diff --git a/src/imports/controls/SwitchDelegate.qml b/src/imports/controls/SwitchDelegate.qml index 6536ac53..49e0fad2 100644 --- a/src/imports/controls/SwitchDelegate.qml +++ b/src/imports/controls/SwitchDelegate.qml @@ -66,8 +66,6 @@ T.SwitchDelegate { font: control.font color: control.enabled ? Default.textDarkColor : Default.textDisabledColor elide: Text.ElideRight - visible: control.text - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } -- cgit v1.2.3 From d1706827085d648ccef13e1df74796f19d455e89 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 19 Dec 2017 10:33:50 +0100 Subject: StackView: don't block touch Unlike with mouse events there's setAcceptedMouseButtons(), currently there's no way to control whether a control receives touch events or not. As a temporary workaround until QQuickItem::setAcceptTouchEvents() has been added, we'll have to ignore touch events by hand. Task-number: QTBUG-65084 Change-Id: I3d51bdc80981557399f3bdfd181e359679cd1c20 Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickstackview.cpp | 7 +++++++ src/quicktemplates2/qquickstackview_p.h | 4 ++++ tests/auto/controls/data/tst_stackview.qml | 22 ++++++++++++++++++++++ 3 files changed, 33 insertions(+) diff --git a/src/quicktemplates2/qquickstackview.cpp b/src/quicktemplates2/qquickstackview.cpp index 20e3c817..df67da87 100644 --- a/src/quicktemplates2/qquickstackview.cpp +++ b/src/quicktemplates2/qquickstackview.cpp @@ -1035,6 +1035,13 @@ bool QQuickStackView::childMouseEventFilter(QQuickItem *item, QEvent *event) return window && !window->mouseGrabberItem(); } +#if QT_CONFIG(quicktemplates2_multitouch) +void QQuickStackView::touchEvent(QTouchEvent *event) +{ + event->ignore(); // QTBUG-65084 +} +#endif + #if QT_CONFIG(accessibility) QAccessible::Role QQuickStackView::accessibleRole() const { diff --git a/src/quicktemplates2/qquickstackview_p.h b/src/quicktemplates2/qquickstackview_p.h index ff115416..645223fd 100644 --- a/src/quicktemplates2/qquickstackview_p.h +++ b/src/quicktemplates2/qquickstackview_p.h @@ -153,6 +153,10 @@ protected: void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override; bool childMouseEventFilter(QQuickItem *, QEvent *) override; +#if QT_CONFIG(quicktemplates2_multitouch) + void touchEvent(QTouchEvent *event) override; +#endif + #if QT_CONFIG(accessibility) QAccessible::Role accessibleRole() const override; #endif diff --git a/tests/auto/controls/data/tst_stackview.qml b/tests/auto/controls/data/tst_stackview.qml index 1b421b4f..1bbdc2c3 100644 --- a/tests/auto/controls/data/tst_stackview.qml +++ b/tests/auto/controls/data/tst_stackview.qml @@ -1137,4 +1137,26 @@ TestCase { compare(control.depth, 1) verify(item) } + + // QTBUG-65084 + function test_mouseArea() { + var ma = createTemporaryObject(mouseArea, testCase, {width: testCase.width, height: testCase.height}) + verify(ma) + + var control = stackView.createObject(ma, {width: testCase.width, height: testCase.height}) + verify(control) + + mousePress(control) + verify(ma.pressed) + + mouseRelease(control) + verify(!ma.pressed) + + var touch = touchEvent(control) + touch.press(0, control).commit() + verify(ma.pressed) + + touch.release(0, control).commit() + verify(!ma.pressed) + } } -- cgit v1.2.3 From aea42abe76dae2cb47cda64ee36fcda85305e91d Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 19 Dec 2017 10:43:21 +0100 Subject: Material: cleanup unnecessary property assignments Change-Id: I1698392b1ef75b84d114cb19207729217abb4aed Reviewed-by: Mitch Curtis --- src/imports/controls/material/CheckBox.qml | 2 -- src/imports/controls/material/CheckDelegate.qml | 2 -- src/imports/controls/material/ComboBox.qml | 1 - src/imports/controls/material/GroupBox.qml | 1 - src/imports/controls/material/ItemDelegate.qml | 2 -- src/imports/controls/material/MenuItem.qml | 2 -- src/imports/controls/material/RadioButton.qml | 2 -- src/imports/controls/material/RadioDelegate.qml | 2 -- src/imports/controls/material/SwipeDelegate.qml | 2 -- src/imports/controls/material/Switch.qml | 2 -- src/imports/controls/material/SwitchDelegate.qml | 2 -- 11 files changed, 20 deletions(-) diff --git a/src/imports/controls/material/CheckBox.qml b/src/imports/controls/material/CheckBox.qml index e1c559da..bb953761 100644 --- a/src/imports/controls/material/CheckBox.qml +++ b/src/imports/controls/material/CheckBox.qml @@ -80,8 +80,6 @@ T.CheckBox { font: control.font color: control.enabled ? control.Material.foreground : control.Material.hintTextColor elide: Text.ElideRight - visible: control.text - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } } diff --git a/src/imports/controls/material/CheckDelegate.qml b/src/imports/controls/material/CheckDelegate.qml index 545ca64a..63c63bdf 100644 --- a/src/imports/controls/material/CheckDelegate.qml +++ b/src/imports/controls/material/CheckDelegate.qml @@ -68,8 +68,6 @@ T.CheckDelegate { font: control.font color: control.enabled ? control.Material.foreground : control.Material.hintTextColor elide: Text.ElideRight - visible: control.text - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } diff --git a/src/imports/controls/material/ComboBox.qml b/src/imports/controls/material/ComboBox.qml index d2ca7679..79eee2b5 100644 --- a/src/imports/controls/material/ComboBox.qml +++ b/src/imports/controls/material/ComboBox.qml @@ -92,7 +92,6 @@ T.ComboBox { color: control.enabled ? control.Material.foreground : control.Material.hintTextColor selectionColor: control.Material.accentColor selectedTextColor: control.Material.primaryHighlightedTextColor - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter cursorDelegate: CursorDelegate { } diff --git a/src/imports/controls/material/GroupBox.qml b/src/imports/controls/material/GroupBox.qml index e7055404..67105653 100644 --- a/src/imports/controls/material/GroupBox.qml +++ b/src/imports/controls/material/GroupBox.qml @@ -62,7 +62,6 @@ T.GroupBox { font: control.font color: control.enabled ? control.Material.foreground : control.Material.hintTextColor elide: Text.ElideRight - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } diff --git a/src/imports/controls/material/ItemDelegate.qml b/src/imports/controls/material/ItemDelegate.qml index 59d51c36..a096bfc2 100644 --- a/src/imports/controls/material/ItemDelegate.qml +++ b/src/imports/controls/material/ItemDelegate.qml @@ -60,8 +60,6 @@ T.ItemDelegate { font: control.font color: control.enabled ? control.Material.foreground : control.Material.hintTextColor elide: Text.ElideRight - visible: control.text - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } diff --git a/src/imports/controls/material/MenuItem.qml b/src/imports/controls/material/MenuItem.qml index 5a136231..06408101 100644 --- a/src/imports/controls/material/MenuItem.qml +++ b/src/imports/controls/material/MenuItem.qml @@ -69,8 +69,6 @@ T.MenuItem { font: control.font color: control.enabled ? control.Material.foreground : control.Material.hintTextColor elide: Text.ElideRight - visible: control.text - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } diff --git a/src/imports/controls/material/RadioButton.qml b/src/imports/controls/material/RadioButton.qml index d178654f..9dec07b5 100644 --- a/src/imports/controls/material/RadioButton.qml +++ b/src/imports/controls/material/RadioButton.qml @@ -80,8 +80,6 @@ T.RadioButton { font: control.font color: control.enabled ? control.Material.foreground : control.Material.hintTextColor elide: Text.ElideRight - visible: control.text - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } } diff --git a/src/imports/controls/material/RadioDelegate.qml b/src/imports/controls/material/RadioDelegate.qml index fb4f33dc..e2c15342 100644 --- a/src/imports/controls/material/RadioDelegate.qml +++ b/src/imports/controls/material/RadioDelegate.qml @@ -68,8 +68,6 @@ T.RadioDelegate { font: control.font color: control.enabled ? control.Material.foreground : control.Material.hintTextColor elide: Text.ElideRight - visible: control.text - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } diff --git a/src/imports/controls/material/SwipeDelegate.qml b/src/imports/controls/material/SwipeDelegate.qml index d9014fcd..a406df2c 100644 --- a/src/imports/controls/material/SwipeDelegate.qml +++ b/src/imports/controls/material/SwipeDelegate.qml @@ -64,8 +64,6 @@ T.SwipeDelegate { font: control.font color: control.enabled ? control.Material.foreground : control.Material.hintTextColor elide: Text.ElideRight - visible: control.text - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } diff --git a/src/imports/controls/material/Switch.qml b/src/imports/controls/material/Switch.qml index c4f279ee..36adcb45 100644 --- a/src/imports/controls/material/Switch.qml +++ b/src/imports/controls/material/Switch.qml @@ -75,8 +75,6 @@ T.Switch { font: control.font color: control.enabled ? control.Material.foreground : control.Material.hintTextColor elide: Text.ElideRight - visible: control.text - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } } diff --git a/src/imports/controls/material/SwitchDelegate.qml b/src/imports/controls/material/SwitchDelegate.qml index 717ee250..2af147a0 100644 --- a/src/imports/controls/material/SwitchDelegate.qml +++ b/src/imports/controls/material/SwitchDelegate.qml @@ -68,8 +68,6 @@ T.SwitchDelegate { font: control.font color: control.enabled ? control.Material.foreground : control.Material.hintTextColor elide: Text.ElideRight - visible: control.text - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } -- cgit v1.2.3 From 6d88fc14ab97379ccc3546ad8bfb70effe69abda Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 19 Dec 2017 10:45:28 +0100 Subject: Universal: cleanup unnecessary property assignments Change-Id: I80c258ea21b4f6651e9c6e075357daabfb32d64b Reviewed-by: Mitch Curtis --- src/imports/controls/universal/CheckBox.qml | 2 -- src/imports/controls/universal/CheckDelegate.qml | 2 -- src/imports/controls/universal/ComboBox.qml | 1 - src/imports/controls/universal/GroupBox.qml | 1 - src/imports/controls/universal/ItemDelegate.qml | 2 -- src/imports/controls/universal/MenuItem.qml | 2 -- src/imports/controls/universal/RadioButton.qml | 2 -- src/imports/controls/universal/RadioDelegate.qml | 2 -- src/imports/controls/universal/SwipeDelegate.qml | 2 -- src/imports/controls/universal/Switch.qml | 2 -- src/imports/controls/universal/SwitchDelegate.qml | 2 -- 11 files changed, 20 deletions(-) diff --git a/src/imports/controls/universal/CheckBox.qml b/src/imports/controls/universal/CheckBox.qml index 8f4b248d..97a46c86 100644 --- a/src/imports/controls/universal/CheckBox.qml +++ b/src/imports/controls/universal/CheckBox.qml @@ -67,8 +67,6 @@ T.CheckBox { text: control.text font: control.font elide: Text.ElideRight - visible: control.text - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter opacity: enabled ? 1.0 : 0.2 diff --git a/src/imports/controls/universal/CheckDelegate.qml b/src/imports/controls/universal/CheckDelegate.qml index d3d8690e..230851cf 100644 --- a/src/imports/controls/universal/CheckDelegate.qml +++ b/src/imports/controls/universal/CheckDelegate.qml @@ -68,8 +68,6 @@ T.CheckDelegate { text: control.text font: control.font elide: Text.ElideRight - visible: control.text - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter opacity: enabled ? 1.0 : 0.2 diff --git a/src/imports/controls/universal/ComboBox.qml b/src/imports/controls/universal/ComboBox.qml index 596dcf5b..17e869d4 100644 --- a/src/imports/controls/universal/ComboBox.qml +++ b/src/imports/controls/universal/ComboBox.qml @@ -100,7 +100,6 @@ T.ComboBox { control.editable && control.activeFocus ? control.Universal.chromeBlackHighColor : control.Universal.foreground selectionColor: control.Universal.accent selectedTextColor: control.Universal.chromeWhiteColor - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } diff --git a/src/imports/controls/universal/GroupBox.qml b/src/imports/controls/universal/GroupBox.qml index 420cf22d..38ab3d0b 100644 --- a/src/imports/controls/universal/GroupBox.qml +++ b/src/imports/controls/universal/GroupBox.qml @@ -60,7 +60,6 @@ T.GroupBox { text: control.title font: control.font elide: Text.ElideRight - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter opacity: enabled ? 1.0 : 0.2 diff --git a/src/imports/controls/universal/ItemDelegate.qml b/src/imports/controls/universal/ItemDelegate.qml index 69b2cd9d..4154d6f7 100644 --- a/src/imports/controls/universal/ItemDelegate.qml +++ b/src/imports/controls/universal/ItemDelegate.qml @@ -61,8 +61,6 @@ T.ItemDelegate { text: control.text font: control.font elide: Text.ElideRight - visible: control.text - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter opacity: enabled ? 1.0 : 0.2 diff --git a/src/imports/controls/universal/MenuItem.qml b/src/imports/controls/universal/MenuItem.qml index 35e2f2ba..48e7bf1c 100644 --- a/src/imports/controls/universal/MenuItem.qml +++ b/src/imports/controls/universal/MenuItem.qml @@ -61,8 +61,6 @@ T.MenuItem { font: control.font color: !control.enabled ? control.Universal.baseLowColor : control.Universal.baseHighColor elide: Text.ElideRight - visible: control.text - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } diff --git a/src/imports/controls/universal/RadioButton.qml b/src/imports/controls/universal/RadioButton.qml index 5d778660..44949614 100644 --- a/src/imports/controls/universal/RadioButton.qml +++ b/src/imports/controls/universal/RadioButton.qml @@ -67,8 +67,6 @@ T.RadioButton { text: control.text font: control.font elide: Text.ElideRight - visible: control.text - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter opacity: enabled ? 1.0 : 0.2 diff --git a/src/imports/controls/universal/RadioDelegate.qml b/src/imports/controls/universal/RadioDelegate.qml index e8b0216c..575fa84d 100644 --- a/src/imports/controls/universal/RadioDelegate.qml +++ b/src/imports/controls/universal/RadioDelegate.qml @@ -68,8 +68,6 @@ T.RadioDelegate { text: control.text font: control.font elide: Text.ElideRight - visible: control.text - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter opacity: enabled ? 1.0 : 0.2 diff --git a/src/imports/controls/universal/SwipeDelegate.qml b/src/imports/controls/universal/SwipeDelegate.qml index cec5c132..60f2542c 100644 --- a/src/imports/controls/universal/SwipeDelegate.qml +++ b/src/imports/controls/universal/SwipeDelegate.qml @@ -63,8 +63,6 @@ T.SwipeDelegate { text: control.text font: control.font elide: Text.ElideRight - visible: control.text - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter opacity: enabled ? 1.0 : 0.2 diff --git a/src/imports/controls/universal/Switch.qml b/src/imports/controls/universal/Switch.qml index ad07d0df..bffd2b57 100644 --- a/src/imports/controls/universal/Switch.qml +++ b/src/imports/controls/universal/Switch.qml @@ -67,8 +67,6 @@ T.Switch { text: control.text font: control.font elide: Text.ElideRight - visible: control.text - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter opacity: enabled ? 1.0 : 0.2 diff --git a/src/imports/controls/universal/SwitchDelegate.qml b/src/imports/controls/universal/SwitchDelegate.qml index a4ba85db..533c2554 100644 --- a/src/imports/controls/universal/SwitchDelegate.qml +++ b/src/imports/controls/universal/SwitchDelegate.qml @@ -68,8 +68,6 @@ T.SwitchDelegate { text: control.text font: control.font elide: Text.ElideRight - visible: control.text - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter opacity: enabled ? 1.0 : 0.2 -- cgit v1.2.3 From b7216da727e4d2c135601afdf561ffcd2460af4e Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 19 Dec 2017 10:48:10 +0100 Subject: Examples: cleanup unnecessary/wrong property assignments Change-Id: Id7c65c9493c0e70512f3f2b167a091ece06ee5d8 Reviewed-by: Mitch Curtis --- src/imports/controls/doc/snippets/qtquickcontrols2-checkbox-custom.qml | 1 - .../controls/doc/snippets/qtquickcontrols2-checkdelegate-custom.qml | 1 - src/imports/controls/doc/snippets/qtquickcontrols2-combobox-custom.qml | 1 - .../controls/doc/snippets/qtquickcontrols2-itemdelegate-custom.qml | 2 -- .../controls/doc/snippets/qtquickcontrols2-radiobutton-custom.qml | 1 - .../controls/doc/snippets/qtquickcontrols2-radiodelegate-custom.qml | 1 - .../controls/doc/snippets/qtquickcontrols2-swipedelegate-custom.qml | 2 -- src/imports/controls/doc/snippets/qtquickcontrols2-switch-custom.qml | 1 - .../controls/doc/snippets/qtquickcontrols2-switchdelegate-custom.qml | 1 - 9 files changed, 11 deletions(-) diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-checkbox-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-checkbox-custom.qml index e86f1393..ed2a6621 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-checkbox-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-checkbox-custom.qml @@ -58,7 +58,6 @@ CheckBox { font: control.font opacity: enabled ? 1.0 : 0.3 color: control.down ? "#17a81a" : "#21be2b" - horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter leftPadding: control.indicator.width + control.spacing } diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-checkdelegate-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-checkdelegate-custom.qml index 2815aa25..aa19ff14 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-checkdelegate-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-checkdelegate-custom.qml @@ -41,7 +41,6 @@ CheckDelegate { opacity: enabled ? 1.0 : 0.3 color: control.down ? "#17a81a" : "#21be2b" elide: Text.ElideRight - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-combobox-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-combobox-custom.qml index eb5f832c..68e7ddad 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-combobox-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-combobox-custom.qml @@ -76,7 +76,6 @@ ComboBox { text: control.displayText font: control.font color: control.pressed ? "#17a81a" : "#21be2b" - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter elide: Text.ElideRight } diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-itemdelegate-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-itemdelegate-custom.qml index 8ce86d61..e19d28f3 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-itemdelegate-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-itemdelegate-custom.qml @@ -39,8 +39,6 @@ ItemDelegate { font: control.font color: control.enabled ? (control.down ? "#17a81a" : "#21be2b") : "#bdbebf" elide: Text.ElideRight - visible: control.text - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-radiobutton-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-radiobutton-custom.qml index 3b3e8d4a..6d77772d 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-radiobutton-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-radiobutton-custom.qml @@ -58,7 +58,6 @@ RadioButton { font: control.font opacity: enabled ? 1.0 : 0.3 color: control.down ? "#17a81a" : "#21be2b" - horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter leftPadding: control.indicator.width + control.spacing } diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-radiodelegate-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-radiodelegate-custom.qml index 1033befd..d486943d 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-radiodelegate-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-radiodelegate-custom.qml @@ -41,7 +41,6 @@ RadioDelegate { opacity: enabled ? 1.0 : 0.3 color: control.down ? "#17a81a" : "#21be2b" elide: Text.ElideRight - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate-custom.qml index f8b8f7af..4159e7f7 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate-custom.qml @@ -58,8 +58,6 @@ SwipeDelegate { font: control.font color: control.enabled ? (control.down ? "#17a81a" : "#21be2b") : "#bdbebf" elide: Text.ElideRight - visible: control.text - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter Behavior on x { diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-switch-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-switch-custom.qml index f1ec0797..51e6b0c2 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-switch-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-switch-custom.qml @@ -57,7 +57,6 @@ Switch { font: control.font opacity: enabled ? 1.0 : 0.3 color: control.down ? "#17a81a" : "#21be2b" - horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter leftPadding: control.indicator.width + control.spacing } diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-switchdelegate-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-switchdelegate-custom.qml index 00b82f79..726614d8 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-switchdelegate-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-switchdelegate-custom.qml @@ -41,7 +41,6 @@ SwitchDelegate { opacity: enabled ? 1.0 : 0.3 color: control.down ? "#17a81a" : "#21be2b" elide: Text.ElideRight - horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } -- cgit v1.2.3 From aaedef9fec97329b7ca5568670de571f5b8e8df8 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 20 Dec 2017 10:53:28 +0100 Subject: Attempt to stabilize tst_tumbler::test_itemsCorrectlyPositioned() Since 8e4b910, we've been often seeing the following failure in CI: FAIL! : tst_controls::Default::Tumbler::test_itemsCorrectlyPositioned() Compared values are not the same Actual (): 0.00008000000001118224 Expected (): 0 Loc: [/Users/qt/work/qt/qtquickcontrols2/tests/auto/controls/data/tst_tumbler.qml(352)] QQuickPathView uses such tiny 0.00001 offsets internally. => Use fuzzy compare for the expected position. Change-Id: Ie6c1025003aa57335232d23fb8466d1578dc1ab3 Reviewed-by: Mitch Curtis --- tests/auto/controls/data/tst_tumbler.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/controls/data/tst_tumbler.qml b/tests/auto/controls/data/tst_tumbler.qml index aaf888c2..825c2489 100644 --- a/tests/auto/controls/data/tst_tumbler.qml +++ b/tests/auto/controls/data/tst_tumbler.qml @@ -348,8 +348,8 @@ TestCase { verify(firstItem); // Test QTBUG-40298. actualPos = testCase.mapFromItem(firstItem, 0, 0); - compare(actualPos.x, tumbler.leftPadding); - compare(actualPos.y, tumbler.topPadding); + fuzzyCompare(actualPos.x, tumbler.leftPadding, 0.0001); + fuzzyCompare(actualPos.y, tumbler.topPadding, 0.0001); var secondItemCenterPos = itemCenterPos(1); var secondItem = tumblerView.itemAt(secondItemCenterPos.x, secondItemCenterPos.y); -- cgit v1.2.3 From 4367be99cc89c733b8667a30c8a82dac21ba08bb Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 19 Dec 2017 12:53:44 +0100 Subject: Make tst_customization easier to maintain Maintain the tested controls and delegates in a single array that can be re-used for testing all styles without repetitive and error-prone hand-written data rows. For this to work, the structure of the tested styles must match. The "incomplete" and "override" styles filled in all possible delegates, whereas the "simple" style filled in only the normally used delegates. The test styles have now been synced with the structure of our built- in styles. For example, Dials and Sliders don't normally have a content item, and CheckBoxes and RadioButtons don't normally have a background. Change-Id: I48a26ee170f66882c55b54a282f2e4b3a3875f9a Reviewed-by: Mitch Curtis --- .../data/styles/incomplete/CheckBox.qml | 4 - .../customization/data/styles/incomplete/Dial.qml | 4 - .../data/styles/incomplete/RadioButton.qml | 4 - .../data/styles/incomplete/RangeSlider.qml | 4 - .../data/styles/incomplete/ScrollView.qml | 4 - .../data/styles/incomplete/Slider.qml | 4 - .../data/styles/incomplete/Switch.qml | 4 - .../data/styles/override/CheckBox.qml | 4 - .../customization/data/styles/override/Dial.qml | 4 - .../data/styles/override/RadioButton.qml | 4 - .../data/styles/override/RangeSlider.qml | 4 - .../data/styles/override/ScrollView.qml | 4 - .../customization/data/styles/override/Slider.qml | 4 - .../customization/data/styles/override/Switch.qml | 4 - .../data/styles/simple/ScrollView.qml | 4 - tests/auto/customization/tst_customization.cpp | 265 ++++++--------------- 16 files changed, 69 insertions(+), 256 deletions(-) diff --git a/tests/auto/customization/data/styles/incomplete/CheckBox.qml b/tests/auto/customization/data/styles/incomplete/CheckBox.qml index 2f1afa7a..3c299892 100644 --- a/tests/auto/customization/data/styles/incomplete/CheckBox.qml +++ b/tests/auto/customization/data/styles/incomplete/CheckBox.qml @@ -62,8 +62,4 @@ T.CheckBox { contentItem: Item { objectName: "checkbox-contentItem-incomplete" } - - background: Item { - objectName: "checkbox-background-incomplete" - } } diff --git a/tests/auto/customization/data/styles/incomplete/Dial.qml b/tests/auto/customization/data/styles/incomplete/Dial.qml index 3e896cdf..bc318f72 100644 --- a/tests/auto/customization/data/styles/incomplete/Dial.qml +++ b/tests/auto/customization/data/styles/incomplete/Dial.qml @@ -59,10 +59,6 @@ T.Dial { objectName: "dial-handle-incomplete" } - contentItem: Item { - objectName: "dial-contentItem-incomplete" - } - background: Item { objectName: "dial-background-incomplete" } diff --git a/tests/auto/customization/data/styles/incomplete/RadioButton.qml b/tests/auto/customization/data/styles/incomplete/RadioButton.qml index 8def1447..28b62af9 100644 --- a/tests/auto/customization/data/styles/incomplete/RadioButton.qml +++ b/tests/auto/customization/data/styles/incomplete/RadioButton.qml @@ -62,8 +62,4 @@ T.RadioButton { contentItem: Item { objectName: "radiobutton-contentItem-incomplete" } - - background: Item { - objectName: "radiobutton-background-incomplete" - } } diff --git a/tests/auto/customization/data/styles/incomplete/RangeSlider.qml b/tests/auto/customization/data/styles/incomplete/RangeSlider.qml index 1905d7ec..3bc3dfcb 100644 --- a/tests/auto/customization/data/styles/incomplete/RangeSlider.qml +++ b/tests/auto/customization/data/styles/incomplete/RangeSlider.qml @@ -63,10 +63,6 @@ T.RangeSlider { objectName: "rangeslider-second.handle-incomplete" } - contentItem: Item { - objectName: "rangeslider-contentItem-incomplete" - } - background: Item { objectName: "rangeslider-background-incomplete" } diff --git a/tests/auto/customization/data/styles/incomplete/ScrollView.qml b/tests/auto/customization/data/styles/incomplete/ScrollView.qml index ef0d6f36..48088a67 100644 --- a/tests/auto/customization/data/styles/incomplete/ScrollView.qml +++ b/tests/auto/customization/data/styles/incomplete/ScrollView.qml @@ -55,10 +55,6 @@ T.ScrollView { id: control objectName: "scrollview-incomplete" - contentItem: Flickable { - objectName: "scrollview-contentItem-incomplete" - } - background: Item { objectName: "scrollview-background-incomplete" } diff --git a/tests/auto/customization/data/styles/incomplete/Slider.qml b/tests/auto/customization/data/styles/incomplete/Slider.qml index 1dfa4d59..54978965 100644 --- a/tests/auto/customization/data/styles/incomplete/Slider.qml +++ b/tests/auto/customization/data/styles/incomplete/Slider.qml @@ -59,10 +59,6 @@ T.Slider { objectName: "slider-handle-incomplete" } - contentItem: Item { - objectName: "slider-contentItem-incomplete" - } - background: Item { objectName: "slider-background-incomplete" } diff --git a/tests/auto/customization/data/styles/incomplete/Switch.qml b/tests/auto/customization/data/styles/incomplete/Switch.qml index ef661b43..94f6cd8b 100644 --- a/tests/auto/customization/data/styles/incomplete/Switch.qml +++ b/tests/auto/customization/data/styles/incomplete/Switch.qml @@ -62,8 +62,4 @@ T.Switch { contentItem: Item { objectName: "switch-contentItem-incomplete" } - - background: Item { - objectName: "switch-background-incomplete" - } } diff --git a/tests/auto/customization/data/styles/override/CheckBox.qml b/tests/auto/customization/data/styles/override/CheckBox.qml index 538cbdb1..dfaba8a4 100644 --- a/tests/auto/customization/data/styles/override/CheckBox.qml +++ b/tests/auto/customization/data/styles/override/CheckBox.qml @@ -62,8 +62,4 @@ Simple.CheckBox { contentItem: Item { objectName: "checkbox-contentItem-override" } - - background: Item { - objectName: "checkbox-background-override" - } } diff --git a/tests/auto/customization/data/styles/override/Dial.qml b/tests/auto/customization/data/styles/override/Dial.qml index f843a4ca..4b84a30a 100644 --- a/tests/auto/customization/data/styles/override/Dial.qml +++ b/tests/auto/customization/data/styles/override/Dial.qml @@ -59,10 +59,6 @@ Simple.Dial { objectName: "dial-handle-override" } - contentItem: Item { - objectName: "dial-contentItem-override" - } - background: Item { objectName: "dial-background-override" } diff --git a/tests/auto/customization/data/styles/override/RadioButton.qml b/tests/auto/customization/data/styles/override/RadioButton.qml index 0ecec7e3..42397f08 100644 --- a/tests/auto/customization/data/styles/override/RadioButton.qml +++ b/tests/auto/customization/data/styles/override/RadioButton.qml @@ -62,8 +62,4 @@ Simple.RadioButton { contentItem: Item { objectName: "radiobutton-contentItem-override" } - - background: Item { - objectName: "radiobutton-background-override" - } } diff --git a/tests/auto/customization/data/styles/override/RangeSlider.qml b/tests/auto/customization/data/styles/override/RangeSlider.qml index b10ff8a2..575926e5 100644 --- a/tests/auto/customization/data/styles/override/RangeSlider.qml +++ b/tests/auto/customization/data/styles/override/RangeSlider.qml @@ -63,10 +63,6 @@ Simple.RangeSlider { objectName: "rangeslider-second.handle-override" } - contentItem: Item { - objectName: "rangeslider-contentItem-override" - } - background: Item { objectName: "rangeslider-background-override" } diff --git a/tests/auto/customization/data/styles/override/ScrollView.qml b/tests/auto/customization/data/styles/override/ScrollView.qml index 0c8bd774..040c9815 100644 --- a/tests/auto/customization/data/styles/override/ScrollView.qml +++ b/tests/auto/customization/data/styles/override/ScrollView.qml @@ -55,10 +55,6 @@ Simple.ScrollView { id: control objectName: "scrollview-override" - contentItem: Flickable { - objectName: "scrollview-contentItem-override" - } - background: Item { objectName: "scrollview-background-override" } diff --git a/tests/auto/customization/data/styles/override/Slider.qml b/tests/auto/customization/data/styles/override/Slider.qml index dc4fb8d7..0ca6f6c4 100644 --- a/tests/auto/customization/data/styles/override/Slider.qml +++ b/tests/auto/customization/data/styles/override/Slider.qml @@ -59,10 +59,6 @@ Simple.Slider { objectName: "slider-handle-override" } - contentItem: Item { - objectName: "slider-contentItem-override" - } - background: Item { objectName: "slider-background-override" } diff --git a/tests/auto/customization/data/styles/override/Switch.qml b/tests/auto/customization/data/styles/override/Switch.qml index 60e7c829..4ab8ffe7 100644 --- a/tests/auto/customization/data/styles/override/Switch.qml +++ b/tests/auto/customization/data/styles/override/Switch.qml @@ -62,8 +62,4 @@ Simple.Switch { contentItem: Item { objectName: "switch-contentItem-override" } - - background: Item { - objectName: "switch-background-override" - } } diff --git a/tests/auto/customization/data/styles/simple/ScrollView.qml b/tests/auto/customization/data/styles/simple/ScrollView.qml index d0b0c5d8..1aabc897 100644 --- a/tests/auto/customization/data/styles/simple/ScrollView.qml +++ b/tests/auto/customization/data/styles/simple/ScrollView.qml @@ -58,10 +58,6 @@ T.ScrollView { implicitWidth: Math.max(contentItem.implicitWidth, background.implicitWidth) implicitHeight: Math.max(contentItem.implicitHeight, background.implicitHeight) - contentItem: Flickable { - objectName: "scrollview-contentItem-simple" - } - background: Rectangle { objectName: "scrollview-background-simple" } diff --git a/tests/auto/customization/tst_customization.cpp b/tests/auto/customization/tst_customization.cpp index 34c56785..10525e9e 100644 --- a/tests/auto/customization/tst_customization.cpp +++ b/tests/auto/customization/tst_customization.cpp @@ -46,6 +46,64 @@ using namespace QQuickVisualTestUtil; +struct ControlInfo +{ + QString type; + QStringList delegates; +}; + +static const ControlInfo ControlInfos[] = { + { "AbstractButton", QStringList() << "background" << "contentItem" << "indicator" }, + { "ApplicationWindow", QStringList() << "background" }, + { "BusyIndicator", QStringList() << "background" << "contentItem" }, + { "Button", QStringList() << "background" << "contentItem" }, + { "CheckBox", QStringList() << "contentItem" << "indicator" }, + { "CheckDelegate", QStringList() << "background" << "contentItem" << "indicator" }, + { "ComboBox", QStringList() << "background" << "contentItem" << "indicator" }, // popup not created until needed + { "Container", QStringList() << "background" << "contentItem" }, + { "Control", QStringList() << "background" << "contentItem" }, + { "DelayButton", QStringList() << "background" << "contentItem" }, + { "Dial", QStringList() << "background" << "handle" }, + { "Dialog", QStringList() << "background" << "contentItem" }, + { "DialogButtonBox", QStringList() << "background" << "contentItem" }, + { "Drawer", QStringList() << "background" << "contentItem" }, + { "Frame", QStringList() << "background" << "contentItem" }, + { "GroupBox", QStringList() << "background" << "contentItem" << "label" }, + { "ItemDelegate", QStringList() << "background" << "contentItem" }, + { "Label", QStringList() << "background" }, + { "Menu", QStringList() << "background" << "contentItem" }, + { "MenuItem", QStringList() << "background" << "contentItem" << "indicator" }, + { "MenuSeparator", QStringList() << "background" << "contentItem" }, + { "Page", QStringList() << "background" << "contentItem" }, + { "PageIndicator", QStringList() << "background" << "contentItem" }, + { "Pane", QStringList() << "background" << "contentItem" }, + { "Popup", QStringList() << "background" << "contentItem" }, + { "ProgressBar", QStringList() << "background" << "contentItem" }, + { "RadioButton", QStringList() << "contentItem" << "indicator" }, + { "RadioDelegate", QStringList() << "background" << "contentItem" << "indicator" }, + { "RangeSlider", QStringList() << "background" << "first.handle" << "second.handle" }, + { "RoundButton", QStringList() << "background" << "contentItem" }, + { "ScrollBar", QStringList() << "background" << "contentItem" }, + { "ScrollIndicator", QStringList() << "background" << "contentItem" }, + { "ScrollView", QStringList() << "background" }, + { "Slider", QStringList() << "background" << "handle" }, + { "SpinBox", QStringList() << "background" << "contentItem" << "up.indicator" << "down.indicator" }, + { "StackView", QStringList() << "background" << "contentItem" }, + { "SwipeDelegate", QStringList() << "background" << "contentItem" }, + { "SwipeView", QStringList() << "background" << "contentItem" }, + { "Switch", QStringList() << "contentItem" << "indicator" }, + { "SwitchDelegate", QStringList() << "background" << "contentItem" << "indicator" }, + { "TabBar", QStringList() << "background" << "contentItem" }, + { "TabButton", QStringList() << "background" << "contentItem" }, + { "TextField", QStringList() << "background" }, + { "TextArea", QStringList() << "background" }, + { "ToolBar", QStringList() << "background" << "contentItem" }, + { "ToolButton", QStringList() << "background" << "contentItem" }, + { "ToolSeparator", QStringList() << "background" << "contentItem" }, + { "ToolTip", QStringList() << "background" << "contentItem" }, + { "Tumbler", QStringList() << "background" << "contentItem" } +}; + class tst_customization : public QQmlDataTest { Q_OBJECT @@ -140,208 +198,20 @@ void tst_customization::creation_data() QTest::addColumn("delegates"); // the "empty" style does not contain any delegates - QTest::newRow("empty:AbstractButton") << "empty" << "AbstractButton"<< QStringList(); - QTest::newRow("empty:ApplicationWindow") << "empty" << "ApplicationWindow"<< QStringList(); - QTest::newRow("empty:BusyIndicator") << "empty" << "BusyIndicator"<< QStringList(); - QTest::newRow("empty:Button") << "empty" << "Button"<< QStringList(); - QTest::newRow("empty:CheckBox") << "empty" << "CheckBox" << QStringList(); - QTest::newRow("empty:CheckDelegate") << "empty" << "CheckDelegate" << QStringList(); - QTest::newRow("empty:ComboBox") << "empty" << "ComboBox" << QStringList(); - QTest::newRow("empty:Container") << "empty" << "Container"<< QStringList(); - QTest::newRow("empty:Control") << "empty" << "Control"<< QStringList(); - QTest::newRow("empty:DelayButton") << "empty" << "DelayButton"<< QStringList(); - QTest::newRow("empty:Dial") << "empty" << "Dial" << QStringList(); - QTest::newRow("empty:Dialog") << "empty" << "Dialog" << QStringList(); - QTest::newRow("empty:DialogButtonBox") << "empty" << "DialogButtonBox" << QStringList(); - QTest::newRow("empty:Drawer") << "empty" << "Drawer" << QStringList(); - QTest::newRow("empty:Frame") << "empty" << "Frame"<< QStringList(); - QTest::newRow("empty:GroupBox") << "empty" << "GroupBox"<< QStringList(); - QTest::newRow("empty:ItemDelegate") << "empty" << "ItemDelegate" << QStringList(); - QTest::newRow("empty:Label") << "empty" << "Label"<< QStringList(); - QTest::newRow("empty:Menu") << "empty" << "Menu" << QStringList(); - QTest::newRow("empty:MenuItem") << "empty" << "MenuItem"<< QStringList(); - QTest::newRow("empty:MenuSeparator") << "empty" << "MenuSeparator"<< QStringList(); - QTest::newRow("empty:Page") << "empty" << "Page"<< QStringList(); - QTest::newRow("empty:PageIndicator") << "empty" << "PageIndicator"<< QStringList(); - QTest::newRow("empty:Pane") << "empty" << "Pane"<< QStringList(); - QTest::newRow("empty:Popup") << "empty" << "Popup" << QStringList(); - QTest::newRow("empty:ProgressBar") << "empty" << "ProgressBar"<< QStringList(); - QTest::newRow("empty:RadioButton") << "empty" << "RadioButton" << QStringList(); - QTest::newRow("empty:RadioDelegate") << "empty" << "RadioDelegate" << QStringList(); - QTest::newRow("empty:RangeSlider") << "empty" << "RangeSlider" << QStringList(); - QTest::newRow("empty:RoundButton") << "empty" << "RoundButton" << QStringList(); - QTest::newRow("empty:ScrollBar") << "empty" << "ScrollBar"<< QStringList(); - QTest::newRow("empty:ScrollIndicator") << "empty" << "ScrollIndicator"<< QStringList(); - QTest::newRow("empty:ScrollView") << "empty" << "ScrollView"<< QStringList(); - QTest::newRow("empty:Slider") << "empty" << "Slider" << QStringList(); - QTest::newRow("empty:SpinBox") << "empty" << "SpinBox" << QStringList(); - QTest::newRow("empty:StackView") << "empty" << "StackView" << QStringList(); - QTest::newRow("empty:SwipeDelegate") << "empty" << "SwipeDelegate" << QStringList(); - QTest::newRow("empty:SwipeView") << "empty" << "SwipeView" << QStringList(); - QTest::newRow("empty:Switch") << "empty" << "Switch" << QStringList(); - QTest::newRow("empty:SwitchDelegate") << "empty" << "SwitchDelegate" << QStringList(); - QTest::newRow("empty:TabBar") << "empty" << "TabBar"<< QStringList(); - QTest::newRow("empty:TabButton") << "empty" << "TabButton"<< QStringList(); - QTest::newRow("empty:TextField") << "empty" << "TextField"<< QStringList(); - QTest::newRow("empty:TextArea") << "empty" << "TextArea"<< QStringList(); - QTest::newRow("empty:ToolBar") << "empty" << "ToolBar"<< QStringList(); - QTest::newRow("empty:ToolButton") << "empty" << "ToolButton"<< QStringList(); - QTest::newRow("empty:ToolSeparator") << "empty" << "ToolSeparator"<< QStringList(); - QTest::newRow("empty:ToolTip") << "empty" << "ToolTip"<< QStringList(); - // QTest::newRow("empty:Tumbler") << "empty" << "Tumbler"<< QStringList(); // ### TODO: fix crash with contentItem-less Tumbler + for (const ControlInfo &control : ControlInfos) + QTest::newRow(qPrintable("empty:" + control.type)) << "empty" << control.type << QStringList(); // the "incomplete" style is missing bindings to the delegates (must be created regardless) - QTest::newRow("incomplete:AbstractButton") << "incomplete" << "AbstractButton" << (QStringList() << "background" << "contentItem" << "indicator"); - QTest::newRow("incomplete:ApplicationWindow") << "incomplete" << "ApplicationWindow" << (QStringList() << "background"); - QTest::newRow("incomplete:BusyIndicator") << "incomplete" << "BusyIndicator" << (QStringList() << "background" << "contentItem"); - QTest::newRow("incomplete:Button") << "incomplete" << "Button" << (QStringList() << "background" << "contentItem"); - QTest::newRow("incomplete:CheckBox") << "incomplete" << "CheckBox" << (QStringList() << "background" << "contentItem" << "indicator"); - QTest::newRow("incomplete:CheckDelegate") << "incomplete" << "CheckDelegate" << (QStringList() << "background" << "contentItem" << "indicator"); - QTest::newRow("incomplete:ComboBox") << "incomplete" << "ComboBox" << (QStringList() << "background" << "contentItem" << "indicator"); // popup not created until needed - QTest::newRow("incomplete:Container") << "incomplete" << "Container" << (QStringList() << "background" << "contentItem"); - QTest::newRow("incomplete:Control") << "incomplete" << "Control" << (QStringList() << "background" << "contentItem"); - QTest::newRow("incomplete:DelayButton") << "incomplete" << "DelayButton" << (QStringList() << "background" << "contentItem"); - QTest::newRow("incomplete:Dial") << "incomplete" << "Dial" << (QStringList() << "background" << "contentItem" << "handle"); - QTest::newRow("incomplete:Dialog") << "incomplete" << "Dialog" << (QStringList() << "background" << "contentItem"); - QTest::newRow("incomplete:DialogButtonBox") << "incomplete" << "DialogButtonBox" << (QStringList() << "background" << "contentItem"); - QTest::newRow("incomplete:Drawer") << "incomplete" << "Drawer" << (QStringList() << "background" << "contentItem"); - QTest::newRow("incomplete:Frame") << "incomplete" << "Frame"<< (QStringList() << "background" << "contentItem"); - QTest::newRow("incomplete:GroupBox") << "incomplete" << "GroupBox"<< (QStringList() << "background" << "contentItem" << "label"); - QTest::newRow("incomplete:ItemDelegate") << "incomplete" << "ItemDelegate" << (QStringList() << "background" << "contentItem"); - QTest::newRow("incomplete:Label") << "incomplete" << "Label" << (QStringList() << "background"); - QTest::newRow("incomplete:Menu") << "incomplete" << "Menu" << (QStringList() << "background" << "contentItem"); - QTest::newRow("incomplete:MenuItem") << "incomplete" << "MenuItem" << (QStringList() << "background" << "contentItem" << "indicator"); - QTest::newRow("incomplete:MenuSeparator") << "incomplete" << "MenuSeparator" << (QStringList() << "background" << "contentItem"); - QTest::newRow("incomplete:Page") << "incomplete" << "Page" << (QStringList() << "background" << "contentItem"); - QTest::newRow("incomplete:PageIndicator") << "incomplete" << "PageIndicator" << (QStringList() << "background" << "contentItem"); - QTest::newRow("incomplete:Pane") << "incomplete" << "Pane" << (QStringList() << "background" << "contentItem"); - QTest::newRow("incomplete:Popup") << "incomplete" << "Popup" << (QStringList() << "background" << "contentItem"); - QTest::newRow("incomplete:ProgressBar") << "incomplete" << "ProgressBar" << (QStringList() << "background" << "contentItem"); - QTest::newRow("incomplete:RadioButton") << "incomplete" << "RadioButton" << (QStringList() << "background" << "contentItem" << "indicator"); - QTest::newRow("incomplete:RadioDelegate") << "incomplete" << "RadioDelegate" << (QStringList() << "background" << "contentItem" << "indicator"); - QTest::newRow("incomplete:RangeSlider") << "incomplete" << "RangeSlider" << (QStringList() << "background" << "contentItem" << "first.handle" << "second.handle"); - QTest::newRow("incomplete:RoundButton") << "incomplete" << "RoundButton" << (QStringList() << "background" << "contentItem"); - QTest::newRow("incomplete:ScrollBar") << "incomplete" << "ScrollBar" << (QStringList() << "background" << "contentItem"); - QTest::newRow("incomplete:ScrollIndicator") << "incomplete" << "ScrollIndicator" << (QStringList() << "background" << "contentItem"); - QTest::newRow("incomplete:ScrollView") << "incomplete" << "ScrollView" << (QStringList() << "background" << "contentItem"); - QTest::newRow("incomplete:Slider") << "incomplete" << "Slider" << (QStringList() << "background" << "contentItem" << "handle"); - QTest::newRow("incomplete:SpinBox") << "incomplete" << "SpinBox" << (QStringList() << "background" << "contentItem" << "up.indicator" << "down.indicator"); - QTest::newRow("incomplete:StackView") << "incomplete" << "StackView" << (QStringList() << "background" << "contentItem"); - QTest::newRow("incomplete:SwipeDelegate") << "incomplete" << "SwipeDelegate" << (QStringList() << "background" << "contentItem"); - QTest::newRow("incomplete:SwipeView") << "incomplete" << "SwipeView" << (QStringList() << "background" << "contentItem"); - QTest::newRow("incomplete:Switch") << "incomplete" << "Switch" << (QStringList() << "background" << "contentItem" << "indicator"); - QTest::newRow("incomplete:SwitchDelegate") << "incomplete" << "SwitchDelegate" << (QStringList() << "background" << "contentItem" << "indicator"); - QTest::newRow("incomplete:TabBar") << "incomplete" << "TabBar"<< (QStringList() << "background" << "contentItem"); - QTest::newRow("incomplete:TabButton") << "incomplete" << "TabButton"<< (QStringList() << "background" << "contentItem"); - QTest::newRow("incomplete:TextField") << "incomplete" << "TextField" << (QStringList() << "background"); - QTest::newRow("incomplete:TextArea") << "incomplete" << "TextArea" << (QStringList() << "background"); - QTest::newRow("incomplete:ToolBar") << "incomplete" << "ToolBar"<< (QStringList() << "background" << "contentItem"); - QTest::newRow("incomplete:ToolButton") << "incomplete" << "ToolButton"<< (QStringList() << "background" << "contentItem"); - QTest::newRow("incomplete:ToolSeparator") << "incomplete" << "ToolSeparator"<< (QStringList() << "background" << "contentItem"); - QTest::newRow("incomplete:ToolTip") << "incomplete" << "ToolTip" << (QStringList() << "background" << "contentItem"); - QTest::newRow("incomplete:Tumbler") << "incomplete" << "Tumbler"<< (QStringList() << "background" << "contentItem"); + for (const ControlInfo &control : ControlInfos) + QTest::newRow(qPrintable("incomplete:" + control.type)) << "incomplete" << control.type << control.delegates; // the "simple" style simulates a proper style and contains bindings to/in delegates - QTest::newRow("simple:AbstractButton") << "simple" << "AbstractButton" << (QStringList() << "background" << "contentItem" << "indicator"); - QTest::newRow("simple:ApplicationWindow") << "simple" << "ApplicationWindow" << (QStringList() << "background"); - QTest::newRow("simple:BusyIndicator") << "simple" << "BusyIndicator" << (QStringList() << "background" << "contentItem"); - QTest::newRow("simple:Button") << "simple" << "Button" << (QStringList() << "background" << "contentItem"); - QTest::newRow("simple:CheckBox") << "simple" << "CheckBox" << (QStringList() << "contentItem" << "indicator"); - QTest::newRow("simple:CheckDelegate") << "simple" << "CheckDelegate" << (QStringList() << "background" << "contentItem" << "indicator"); - QTest::newRow("simple:ComboBox") << "simple" << "ComboBox" << (QStringList() << "background" << "contentItem" << "indicator"); // popup not created until needed - QTest::newRow("simple:Container") << "simple" << "Container" << (QStringList() << "background" << "contentItem"); - QTest::newRow("simple:Control") << "simple" << "Control" << (QStringList() << "background" << "contentItem"); - QTest::newRow("simple:DelayButton") << "simple" << "DelayButton" << (QStringList() << "background" << "contentItem"); - QTest::newRow("simple:Dial") << "simple" << "Dial" << (QStringList() << "background" << "handle"); - QTest::newRow("simple:Dialog") << "simple" << "Dialog" << (QStringList() << "background" << "contentItem"); - QTest::newRow("simple:DialogButtonBox") << "simple" << "DialogButtonBox" << (QStringList() << "background" << "contentItem"); - QTest::newRow("simple:Drawer") << "simple" << "Drawer" << (QStringList() << "background" << "contentItem"); - QTest::newRow("simple:Frame") << "simple" << "Frame"<< (QStringList() << "background" << "contentItem"); - QTest::newRow("simple:GroupBox") << "simple" << "GroupBox"<< (QStringList() << "background" << "contentItem" << "label"); - QTest::newRow("simple:ItemDelegate") << "simple" << "ItemDelegate" << (QStringList() << "background" << "contentItem"); - QTest::newRow("simple:Label") << "simple" << "Label" << (QStringList() << "background"); - QTest::newRow("simple:Menu") << "simple" << "Menu" << (QStringList() << "background" << "contentItem"); - QTest::newRow("simple:MenuItem") << "simple" << "MenuItem" << (QStringList() << "background" << "contentItem" << "indicator"); - QTest::newRow("simple:MenuSeparator") << "simple" << "MenuSeparator" << (QStringList() << "background" << "contentItem"); - QTest::newRow("simple:Page") << "simple" << "Page" << (QStringList() << "background" << "contentItem"); - QTest::newRow("simple:PageIndicator") << "simple" << "PageIndicator" << (QStringList() << "background" << "contentItem"); - QTest::newRow("simple:Pane") << "simple" << "Pane" << (QStringList() << "background" << "contentItem"); - QTest::newRow("simple:Popup") << "simple" << "Popup" << (QStringList() << "background" << "contentItem"); - QTest::newRow("simple:ProgressBar") << "simple" << "ProgressBar" << (QStringList() << "background" << "contentItem"); - QTest::newRow("simple:RadioButton") << "simple" << "RadioButton" << (QStringList() << "contentItem" << "indicator"); - QTest::newRow("simple:RadioDelegate") << "simple" << "RadioDelegate" << (QStringList() << "background" << "contentItem" << "indicator"); - QTest::newRow("simple:RangeSlider") << "simple" << "RangeSlider" << (QStringList() << "background" << "first.handle" << "second.handle"); - QTest::newRow("simple:RoundButton") << "simple" << "RoundButton" << (QStringList() << "background" << "contentItem"); - QTest::newRow("simple:ScrollBar") << "simple" << "ScrollBar" << (QStringList() << "background" << "contentItem"); - QTest::newRow("simple:ScrollIndicator") << "simple" << "ScrollIndicator" << (QStringList() << "background" << "contentItem"); - QTest::newRow("simple:ScrollView") << "simple" << "ScrollView" << (QStringList() << "background" << "contentItem"); - QTest::newRow("simple:Slider") << "simple" << "Slider" << (QStringList() << "background" << "handle"); - QTest::newRow("simple:SpinBox") << "simple" << "SpinBox" << (QStringList() << "background" << "contentItem" << "up.indicator" << "down.indicator"); - QTest::newRow("simple:StackView") << "simple" << "StackView" << (QStringList() << "background" << "contentItem"); - QTest::newRow("simple:SwipeDelegate") << "simple" << "SwipeDelegate" << (QStringList() << "background" << "contentItem"); - QTest::newRow("simple:SwipeView") << "simple" << "SwipeView" << (QStringList() << "background" << "contentItem"); - QTest::newRow("simple:Switch") << "simple" << "Switch" << (QStringList() << "contentItem" << "indicator"); - QTest::newRow("simple:SwitchDelegate") << "simple" << "SwitchDelegate" << (QStringList() << "background" << "contentItem" << "indicator"); - QTest::newRow("simple:TabBar") << "simple" << "TabBar"<< (QStringList() << "background" << "contentItem"); - QTest::newRow("simple:TabButton") << "simple" << "TabButton"<< (QStringList() << "background" << "contentItem"); - QTest::newRow("simple:TextField") << "simple" << "TextField" << (QStringList() << "background"); - QTest::newRow("simple:TextArea") << "simple" << "TextArea" << (QStringList() << "background"); - QTest::newRow("simple:ToolBar") << "simple" << "ToolBar"<< (QStringList() << "background" << "contentItem"); - QTest::newRow("simple:ToolButton") << "simple" << "ToolButton"<< (QStringList() << "background" << "contentItem"); - QTest::newRow("simple:ToolSeparator") << "simple" << "ToolSeparator"<< (QStringList() << "background" << "contentItem"); - QTest::newRow("simple:ToolTip") << "simple" << "ToolTip" << (QStringList() << "background" << "contentItem"); - QTest::newRow("simple:Tumbler") << "simple" << "Tumbler"<< (QStringList() << "background" << "contentItem"); + for (const ControlInfo &control : ControlInfos) + QTest::newRow(qPrintable("simple:" + control.type)) << "simple" << control.type << control.delegates; // the "override" style overrides all delegates in the "simple" style - QTest::newRow("override:AbstractButton") << "override" << "AbstractButton" << (QStringList() << "background" << "contentItem" << "indicator"); - QTest::newRow("override:ApplicationWindow") << "override" << "ApplicationWindow" << (QStringList() << "background"); - QTest::newRow("override:BusyIndicator") << "override" << "BusyIndicator" << (QStringList() << "background" << "contentItem"); - QTest::newRow("override:Button") << "override" << "Button" << (QStringList() << "background" << "contentItem"); - QTest::newRow("override:CheckBox") << "override" << "CheckBox" << (QStringList() << "background" << "contentItem" << "indicator"); - QTest::newRow("override:CheckDelegate") << "override" << "CheckDelegate" << (QStringList() << "background" << "contentItem" << "indicator"); - QTest::newRow("override:ComboBox") << "override" << "ComboBox" << (QStringList() << "background" << "contentItem" << "indicator"); // popup not created until needed - QTest::newRow("override:Container") << "override" << "Container" << (QStringList() << "background" << "contentItem"); - QTest::newRow("override:Control") << "override" << "Control" << (QStringList() << "background" << "contentItem"); - QTest::newRow("override:DelayButton") << "override" << "DelayButton" << (QStringList() << "background" << "contentItem"); - QTest::newRow("override:Dial") << "override" << "Dial" << (QStringList() << "background" << "contentItem" << "handle"); - QTest::newRow("override:Dialog") << "override" << "Dialog" << (QStringList() << "background" << "contentItem"); - QTest::newRow("override:DialogButtonBox") << "override" << "DialogButtonBox" << (QStringList() << "background" << "contentItem"); - QTest::newRow("override:Drawer") << "override" << "Drawer" << (QStringList() << "background" << "contentItem"); - QTest::newRow("override:Frame") << "override" << "Frame"<< (QStringList() << "background" << "contentItem"); - QTest::newRow("override:GroupBox") << "override" << "GroupBox"<< (QStringList() << "background" << "contentItem" << "label"); - QTest::newRow("override:ItemDelegate") << "override" << "ItemDelegate" << (QStringList() << "background" << "contentItem"); - QTest::newRow("override:Label") << "override" << "Label" << (QStringList() << "background"); - QTest::newRow("override:Menu") << "override" << "Menu" << (QStringList() << "background" << "contentItem"); - QTest::newRow("override:MenuItem") << "override" << "MenuItem" << (QStringList() << "background" << "contentItem" << "indicator"); - QTest::newRow("override:MenuSeparator") << "override" << "MenuSeparator" << (QStringList() << "background" << "contentItem"); - QTest::newRow("override:Page") << "override" << "Page" << (QStringList() << "background" << "contentItem"); - QTest::newRow("override:PageIndicator") << "override" << "PageIndicator" << (QStringList() << "background" << "contentItem"); - QTest::newRow("override:Pane") << "override" << "Pane" << (QStringList() << "background" << "contentItem"); - QTest::newRow("override:Popup") << "override" << "Popup" << (QStringList() << "background" << "contentItem"); - QTest::newRow("override:ProgressBar") << "override" << "ProgressBar" << (QStringList() << "background" << "contentItem"); - QTest::newRow("override:RadioButton") << "override" << "RadioButton" << (QStringList() << "background" << "contentItem" << "indicator"); - QTest::newRow("override:RadioDelegate") << "override" << "RadioDelegate" << (QStringList() << "background" << "contentItem" << "indicator"); - QTest::newRow("override:RangeSlider") << "override" << "RangeSlider" << (QStringList() << "background" << "contentItem" << "first.handle" << "second.handle"); - QTest::newRow("override:RoundButton") << "override" << "RoundButton" << (QStringList() << "background" << "contentItem"); - QTest::newRow("override:ScrollBar") << "override" << "ScrollBar" << (QStringList() << "background" << "contentItem"); - QTest::newRow("override:ScrollIndicator") << "override" << "ScrollIndicator" << (QStringList() << "background" << "contentItem"); - QTest::newRow("override:ScrollView") << "override" << "ScrollView" << (QStringList() << "background" << "contentItem"); - QTest::newRow("override:Slider") << "override" << "Slider" << (QStringList() << "background" << "contentItem" << "handle"); - QTest::newRow("override:SpinBox") << "override" << "SpinBox" << (QStringList() << "background" << "contentItem" << "up.indicator" << "down.indicator"); - QTest::newRow("override:StackView") << "override" << "StackView" << (QStringList() << "background" << "contentItem"); - QTest::newRow("override:SwipeDelegate") << "override" << "SwipeDelegate" << (QStringList() << "background" << "contentItem"); - QTest::newRow("override:SwipeView") << "override" << "SwipeView" << (QStringList() << "background" << "contentItem"); - QTest::newRow("override:Switch") << "override" << "Switch" << (QStringList() << "background" << "contentItem" << "indicator"); - QTest::newRow("override:SwitchDelegate") << "override" << "SwitchDelegate" << (QStringList() << "background" << "contentItem" << "indicator"); - QTest::newRow("override:TabBar") << "override" << "TabBar"<< (QStringList() << "background" << "contentItem"); - QTest::newRow("override:TabButton") << "override" << "TabButton"<< (QStringList() << "background" << "contentItem"); - QTest::newRow("override:TextField") << "override" << "TextField" << (QStringList() << "background"); - QTest::newRow("override:TextArea") << "override" << "TextArea" << (QStringList() << "background"); - QTest::newRow("override:ToolBar") << "override" << "ToolBar"<< (QStringList() << "background" << "contentItem"); - QTest::newRow("override:ToolButton") << "override" << "ToolButton"<< (QStringList() << "background" << "contentItem"); - QTest::newRow("override:ToolSeparator") << "override" << "ToolSeparator"<< (QStringList() << "background" << "contentItem"); - QTest::newRow("override:ToolTip") << "override" << "ToolTip" << (QStringList() << "background" << "contentItem"); - QTest::newRow("override:Tumbler") << "override" << "Tumbler"<< (QStringList() << "background" << "contentItem"); + for (const ControlInfo &control : ControlInfos) + QTest::newRow(qPrintable("override:" + control.type)) << "override" << control.type << control.delegates; } void tst_customization::creation() @@ -350,6 +220,9 @@ void tst_customization::creation() QFETCH(QString, type); QFETCH(QStringList, delegates); + if (!qstrcmp(QTest::currentDataTag(), "empty:Tumbler")) + QSKIP("TODO: fix crash with contentItem-less Tumbler"); + QQuickStyle::setStyle(testFile("styles/" + style)); QString error; -- cgit v1.2.3 From b94cb52c8b03511a2549469dfed33c6e0e857021 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 19 Dec 2017 14:47:09 +0100 Subject: Default: cleanup and test internal IDs Remove the undesired internal IDs where easily possible, and add expected failures for the harder ones for now. Task-number: QTBUG-65341 Change-Id: I5964b2cb59652661c90141259c68b95c721cf6ca Reviewed-by: Mitch Curtis --- src/imports/controls/Dial.qml | 1 - src/imports/controls/ScrollBar.qml | 6 ++---- src/imports/controls/ScrollIndicator.qml | 6 ++---- tests/auto/customization/tst_customization.cpp | 14 ++++++++++++++ 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/imports/controls/Dial.qml b/src/imports/controls/Dial.qml index affcfa62..0bd2f163 100644 --- a/src/imports/controls/Dial.qml +++ b/src/imports/controls/Dial.qml @@ -54,7 +54,6 @@ T.Dial { } handle: Image { - id: handleItem x: background.x + background.width / 2 - handle.width / 2 y: background.y + background.height / 2 - handle.height / 2 width: 14 diff --git a/src/imports/controls/ScrollBar.qml b/src/imports/controls/ScrollBar.qml index 79e3e1ee..3e763550 100644 --- a/src/imports/controls/ScrollBar.qml +++ b/src/imports/controls/ScrollBar.qml @@ -51,8 +51,6 @@ T.ScrollBar { visible: control.policy !== T.ScrollBar.AlwaysOff contentItem: Rectangle { - id: handle - implicitWidth: control.interactive ? 6 : 2 implicitHeight: control.interactive ? 6 : 2 @@ -63,14 +61,14 @@ T.ScrollBar { states: State { name: "active" when: control.policy === T.ScrollBar.AlwaysOn || (control.active && control.size < 1.0) - PropertyChanges { target: handle; opacity: 0.75 } + PropertyChanges { target: control.contentItem; opacity: 0.75 } } transitions: Transition { from: "active" SequentialAnimation { PauseAnimation { duration: 450 } - NumberAnimation { target: handle; duration: 200; property: "opacity"; to: 0.0 } + NumberAnimation { target: control.contentItem; duration: 200; property: "opacity"; to: 0.0 } } } } diff --git a/src/imports/controls/ScrollIndicator.qml b/src/imports/controls/ScrollIndicator.qml index 12ec2d40..8607c8d4 100644 --- a/src/imports/controls/ScrollIndicator.qml +++ b/src/imports/controls/ScrollIndicator.qml @@ -50,8 +50,6 @@ T.ScrollIndicator { padding: 2 contentItem: Rectangle { - id: indicator - implicitWidth: 2 implicitHeight: 2 @@ -62,7 +60,7 @@ T.ScrollIndicator { states: State { name: "active" when: control.active - PropertyChanges { target: indicator; opacity: 0.75 } + PropertyChanges { target: control.contentItem; opacity: 0.75 } } transitions: [ @@ -70,7 +68,7 @@ T.ScrollIndicator { from: "active" SequentialAnimation { PauseAnimation { duration: 450 } - NumberAnimation { target: indicator; duration: 200; property: "opacity"; to: 0.0 } + NumberAnimation { target: control.contentItem; duration: 200; property: "opacity"; to: 0.0 } } } ] diff --git a/tests/auto/customization/tst_customization.cpp b/tests/auto/customization/tst_customization.cpp index 10525e9e..e975e546 100644 --- a/tests/auto/customization/tst_customization.cpp +++ b/tests/auto/customization/tst_customization.cpp @@ -131,6 +131,7 @@ typedef QHash QObjectNameHash; Q_GLOBAL_STATIC(QObjectNameHash, qt_objectNames) Q_GLOBAL_STATIC(QStringList, qt_createdQObjects) Q_GLOBAL_STATIC(QStringList, qt_destroyedQObjects) +Q_GLOBAL_STATIC(QStringList, qt_destroyedParentQObjects) extern "C" Q_DECL_EXPORT void qt_addQObject(QObject *object) { @@ -152,6 +153,13 @@ extern "C" Q_DECL_EXPORT void qt_removeQObject(QObject *object) if (!objectName.isEmpty()) qt_destroyedQObjects()->append(objectName); qt_objectNames()->remove(object); + + QObject *parent = object->parent(); + if (parent) { + QString parentName = parent->objectName(); + if (!parentName.isEmpty()) + qt_destroyedParentQObjects()->append(parentName); + } } void tst_customization::init() @@ -179,6 +187,7 @@ void tst_customization::reset() { qt_createdQObjects()->clear(); qt_destroyedQObjects()->clear(); + qt_destroyedParentQObjects()->clear(); } QObject* tst_customization::createControl(const QString &name, QString *error) @@ -247,6 +256,11 @@ void tst_customization::creation() QVERIFY2(qt_createdQObjects()->isEmpty(), qPrintable("unexpectedly created: " + qt_createdQObjects->join(", "))); QVERIFY2(qt_destroyedQObjects()->isEmpty(), qPrintable("unexpectedly destroyed: " + qt_destroyedQObjects->join(", ") + " were unexpectedly destroyed")); + + QEXPECT_FAIL("Default:BusyIndicator", "TODO: remove internal IDs", Abort); + QEXPECT_FAIL("Default:DelayButton", "TODO: remove internal IDs", Abort); + + QVERIFY2(qt_destroyedParentQObjects()->isEmpty(), qPrintable("delegates/children of: " + qt_destroyedParentQObjects->join(", ") + " were unexpectedly destroyed")); } void tst_customization::comboPopup() -- cgit v1.2.3 From da27cace5aa65c1972b746d9fc1d4507a04b5f93 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 19 Dec 2017 16:05:52 +0100 Subject: Default: cleanup the internal ID from BusyIndicator An internal ID in the OpacityAnimator element prevented deferred execution for the whole content item. Apply the same visibility trick in C++ to avoid having to use an ID in QML. Task-number: QTBUG-65341 Change-Id: Icb20e4ecc60d1093e849737799bb269f7f03097a Reviewed-by: Mitch Curtis --- src/imports/controls/BusyIndicator.qml | 4 ++-- .../controls/qquickdefaultbusyindicator.cpp | 24 ++++++++++++++++++++-- .../controls/qquickdefaultbusyindicator_p.h | 4 ++++ tests/auto/customization/tst_customization.cpp | 1 - 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/src/imports/controls/BusyIndicator.qml b/src/imports/controls/BusyIndicator.qml index 234c2e01..c92ef720 100644 --- a/src/imports/controls/BusyIndicator.qml +++ b/src/imports/controls/BusyIndicator.qml @@ -51,8 +51,8 @@ T.BusyIndicator { implicitWidth: 48 implicitHeight: 48 + running: control.running opacity: control.running ? 1 : 0 - visible: control.running || animator.running - Behavior on opacity { OpacityAnimator { id: animator; duration: 250 } } + Behavior on opacity { OpacityAnimator { duration: 250 } } } } diff --git a/src/imports/controls/qquickdefaultbusyindicator.cpp b/src/imports/controls/qquickdefaultbusyindicator.cpp index 315b2b8b..526eb29f 100644 --- a/src/imports/controls/qquickdefaultbusyindicator.cpp +++ b/src/imports/controls/qquickdefaultbusyindicator.cpp @@ -136,6 +136,17 @@ QQuickDefaultBusyIndicator::QQuickDefaultBusyIndicator(QQuickItem *parent) : setFlag(ItemHasContents); } +bool QQuickDefaultBusyIndicator::isRunning() const +{ + return isVisible(); +} + +void QQuickDefaultBusyIndicator::setRunning(bool running) +{ + if (running) + setVisible(true); +} + int QQuickDefaultBusyIndicator::elapsed() const { return m_elapsed; @@ -144,14 +155,23 @@ int QQuickDefaultBusyIndicator::elapsed() const void QQuickDefaultBusyIndicator::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) { QQuickItem::itemChange(change, data); - if (change == ItemVisibleHasChanged) + switch (change) { + case ItemOpacityHasChanged: + if (qFuzzyIsNull(data.realValue)) + setVisible(false); + break; + case ItemVisibleHasChanged: update(); + break; + default: + break; + } } QSGNode *QQuickDefaultBusyIndicator::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *) { QQuickDefaultBusyIndicatorNode *node = static_cast(oldNode); - if (isVisible() && width() > 0 && height() > 0) { + if (isRunning() && width() > 0 && height() > 0) { if (!node) { node = new QQuickDefaultBusyIndicatorNode(this); node->start(); diff --git a/src/imports/controls/qquickdefaultbusyindicator_p.h b/src/imports/controls/qquickdefaultbusyindicator_p.h index 7daeabd1..21a706e7 100644 --- a/src/imports/controls/qquickdefaultbusyindicator_p.h +++ b/src/imports/controls/qquickdefaultbusyindicator_p.h @@ -55,10 +55,14 @@ QT_BEGIN_NAMESPACE class QQuickDefaultBusyIndicator : public QQuickItem { Q_OBJECT + Q_PROPERTY(bool running READ isRunning WRITE setRunning) public: explicit QQuickDefaultBusyIndicator(QQuickItem *parent = nullptr); + bool isRunning() const; + void setRunning(bool running); + int elapsed() const; protected: diff --git a/tests/auto/customization/tst_customization.cpp b/tests/auto/customization/tst_customization.cpp index e975e546..13527263 100644 --- a/tests/auto/customization/tst_customization.cpp +++ b/tests/auto/customization/tst_customization.cpp @@ -257,7 +257,6 @@ void tst_customization::creation() QVERIFY2(qt_createdQObjects()->isEmpty(), qPrintable("unexpectedly created: " + qt_createdQObjects->join(", "))); QVERIFY2(qt_destroyedQObjects()->isEmpty(), qPrintable("unexpectedly destroyed: " + qt_destroyedQObjects->join(", ") + " were unexpectedly destroyed")); - QEXPECT_FAIL("Default:BusyIndicator", "TODO: remove internal IDs", Abort); QEXPECT_FAIL("Default:DelayButton", "TODO: remove internal IDs", Abort); QVERIFY2(qt_destroyedParentQObjects()->isEmpty(), qPrintable("delegates/children of: " + qt_destroyedParentQObjects->join(", ") + " were unexpectedly destroyed")); -- cgit v1.2.3 From 1e33020fc02b56001d805d3d66badd41480b746d Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 19 Dec 2017 17:00:15 +0100 Subject: Default: eliminate internal IDs in DelayButton An ID in the internal Text element prevented deferred execution for the whole content item. The ID was used for two reasons. First of all, it was used to propagate implicit size from the Text element to the root of the content item. Secondly, it was used to calculate clip areas to provide the same text in two different colors. This patch provides two internal C++ helpers, ItemGroup and ClippedText, that provide these functionalities without the need of using IDs in QML. At the same time we got rid of two wrapper Items and simplified some QML bindings, which results to a nice boost (18->22) in qmlbench on TX1. Task-number: QTBUG-65341 Change-Id: Icf9c09356cf5c0ed641bde537bee7291bd260057 Reviewed-by: Mitch Curtis --- src/imports/controls/DelayButton.qml | 62 ++++-------- src/imports/controls/qtquickcontrols2plugin.cpp | 4 + src/quickcontrols2/qquickclippedtext.cpp | 122 ++++++++++++++++++++++++ src/quickcontrols2/qquickclippedtext_p.h | 96 +++++++++++++++++++ src/quickcontrols2/qquickitemgroup.cpp | 122 ++++++++++++++++++++++++ src/quickcontrols2/qquickitemgroup_p.h | 83 ++++++++++++++++ src/quickcontrols2/quickcontrols2.pri | 4 + tests/auto/customization/tst_customization.cpp | 2 - 8 files changed, 452 insertions(+), 43 deletions(-) create mode 100644 src/quickcontrols2/qquickclippedtext.cpp create mode 100644 src/quickcontrols2/qquickclippedtext_p.h create mode 100644 src/quickcontrols2/qquickitemgroup.cpp create mode 100644 src/quickcontrols2/qquickitemgroup_p.h diff --git a/src/imports/controls/DelayButton.qml b/src/imports/controls/DelayButton.qml index 4a569fcf..133b2786 100644 --- a/src/imports/controls/DelayButton.qml +++ b/src/imports/controls/DelayButton.qml @@ -58,55 +58,35 @@ T.DelayButton { } } - contentItem: Item { - implicitWidth: label.implicitWidth - implicitHeight: label.implicitHeight - - Item { - x: -control.leftPadding + (control.progress * control.width) - width: (1.0 - control.progress) * control.width - height: parent.height - + contentItem: ItemGroup { + ClippedText { clip: control.progress > 0 + clipX: -control.leftPadding + control.progress * control.width + clipWidth: (1.0 - control.progress) * control.width visible: control.progress < 1 - Text { - id: label - x: -parent.x - width: control.availableWidth - height: parent.height - - text: control.text - font: control.font - opacity: enabled ? 1 : 0.3 - color: control.visualFocus ? Default.focusColor : (control.down ? Default.textDarkColor : Default.textColor) - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - elide: Text.ElideRight - } + text: control.text + font: control.font + opacity: enabled ? 1 : 0.3 + color: control.visualFocus ? Default.focusColor : (control.down ? Default.textDarkColor : Default.textColor) + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + elide: Text.ElideRight } - Item { - x: -control.leftPadding - width: control.progress * control.width - height: parent.height - + ClippedText { clip: control.progress > 0 + clipX: -control.leftPadding + clipWidth: control.progress * control.width visible: control.progress > 0 - Text { - x: control.leftPadding - width: control.availableWidth - height: parent.height - - text: control.text - font: control.font - opacity: enabled ? 1 : 0.3 - color: Default.textLightColor - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - elide: Text.ElideRight - } + text: control.text + font: control.font + opacity: enabled ? 1 : 0.3 + color: Default.textLightColor + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + elide: Text.ElideRight } } diff --git a/src/imports/controls/qtquickcontrols2plugin.cpp b/src/imports/controls/qtquickcontrols2plugin.cpp index 32270be0..e9471227 100644 --- a/src/imports/controls/qtquickcontrols2plugin.cpp +++ b/src/imports/controls/qtquickcontrols2plugin.cpp @@ -44,6 +44,8 @@ #if QT_CONFIG(quick_listview) && QT_CONFIG(quick_pathview) #include #endif +#include +#include #include "qquickdefaultbusyindicator_p.h" #include "qquickdefaultprogressbar_p.h" @@ -164,8 +166,10 @@ void QtQuickControls2Plugin::initializeEngine(QQmlEngine *engine, const char *ur qmlRegisterModule(import, 2, QT_VERSION_MINOR - 7); // Qt 5.7->2.0, 5.8->2.1, 5.9->2.2... qmlRegisterType(import, 2, 0, "BusyIndicatorImpl"); + qmlRegisterType(import, 2, 2, "ClippedText"); qmlRegisterType(import, 2, 0, "ProgressBarImpl"); qmlRegisterType(import, 2, 0, "DialRing"); + qmlRegisterType(import, 2, 2, "ItemGroup"); qmlRegisterType(import, 2, 2, "PlaceholderText"); #if QT_CONFIG(quick_listview) && QT_CONFIG(quick_pathview) qmlRegisterType(import, 2, 1, "TumblerView"); diff --git a/src/quickcontrols2/qquickclippedtext.cpp b/src/quickcontrols2/qquickclippedtext.cpp new file mode 100644 index 00000000..7f113592 --- /dev/null +++ b/src/quickcontrols2/qquickclippedtext.cpp @@ -0,0 +1,122 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickclippedtext_p.h" + +#include + +QT_BEGIN_NAMESPACE + +QQuickClippedText::QQuickClippedText(QQuickItem *parent) + : QQuickText(parent), + m_hasClipWidth(false), + m_hasClipHeight(false), + m_clipX(0), + m_clipY(0), + m_clipWidth(0), + m_clipHeight(0) +{ +} + +qreal QQuickClippedText::clipX() const +{ + return m_clipX; +} + +void QQuickClippedText::setClipX(qreal x) +{ + if (qFuzzyCompare(x, m_clipX)) + return; + + m_clipX = x; + markClipDirty(); +} + +qreal QQuickClippedText::clipY() const +{ + return m_clipY; +} + +void QQuickClippedText::setClipY(qreal y) +{ + if (qFuzzyCompare(y, m_clipY)) + return; + + m_clipY = y; + markClipDirty(); +} + +qreal QQuickClippedText::clipWidth() const +{ + return m_clipWidth ? m_clipWidth : width(); +} + +void QQuickClippedText::setClipWidth(qreal width) +{ + m_hasClipWidth = true; + if (qFuzzyCompare(width, m_clipWidth)) + return; + + m_clipWidth = width; + markClipDirty(); +} + +qreal QQuickClippedText::clipHeight() const +{ + return m_clipHeight ? m_clipHeight : height(); +} + +void QQuickClippedText::setClipHeight(qreal height) +{ + m_hasClipHeight = true; + if (qFuzzyCompare(height, m_clipHeight)) + return; + + m_clipHeight = height; + markClipDirty(); +} + +QRectF QQuickClippedText::clipRect() const +{ + return QRectF(clipX(), clipY(), clipWidth(), clipHeight()); +} + +void QQuickClippedText::markClipDirty() +{ + QQuickItemPrivate::get(this)->dirty(QQuickItemPrivate::Size); +} + +QT_END_NAMESPACE diff --git a/src/quickcontrols2/qquickclippedtext_p.h b/src/quickcontrols2/qquickclippedtext_p.h new file mode 100644 index 00000000..7521525f --- /dev/null +++ b/src/quickcontrols2/qquickclippedtext_p.h @@ -0,0 +1,96 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKCLIPPEDTEXT_P_H +#define QQUICKCLIPPEDTEXT_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickClippedText : public QQuickText +{ + Q_OBJECT + Q_PROPERTY(qreal clipX READ clipX WRITE setClipX FINAL) + Q_PROPERTY(qreal clipY READ clipY WRITE setClipY FINAL) + Q_PROPERTY(qreal clipWidth READ clipWidth WRITE setClipWidth FINAL) + Q_PROPERTY(qreal clipHeight READ clipHeight WRITE setClipHeight FINAL) + +public: + explicit QQuickClippedText(QQuickItem *parent = nullptr); + + qreal clipX() const; + void setClipX(qreal x); + + qreal clipY() const; + void setClipY(qreal y); + + qreal clipWidth() const; + void setClipWidth(qreal width); + + qreal clipHeight() const; + void setClipHeight(qreal height); + + QRectF clipRect() const override; + +private: + void markClipDirty(); + + bool m_hasClipWidth; + bool m_hasClipHeight; + qreal m_clipX; + qreal m_clipY; + qreal m_clipWidth; + qreal m_clipHeight; +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QQuickClippedText) + +#endif // QQUICKCLIPPEDTEXT_P_H diff --git a/src/quickcontrols2/qquickitemgroup.cpp b/src/quickcontrols2/qquickitemgroup.cpp new file mode 100644 index 00000000..1396a871 --- /dev/null +++ b/src/quickcontrols2/qquickitemgroup.cpp @@ -0,0 +1,122 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qquickitemgroup_p.h" + +#include + +QT_BEGIN_NAMESPACE + +QQuickItemGroup::QQuickItemGroup(QQuickItem *parent) + : QQuickImplicitSizeItem(*(new QQuickImplicitSizeItemPrivate), parent) +{ +} + +QQuickItemGroup::~QQuickItemGroup() +{ + const auto children = childItems(); + for (QQuickItem *child : children) + unwatch(child); +} + +void QQuickItemGroup::watch(QQuickItem *item) +{ + QQuickItemPrivate::get(item)->addItemChangeListener(this, QQuickItemPrivate::ImplicitWidth | QQuickItemPrivate::ImplicitHeight); +} + +void QQuickItemGroup::unwatch(QQuickItem *item) +{ + QQuickItemPrivate::get(item)->removeItemChangeListener(this, QQuickItemPrivate::ImplicitWidth | QQuickItemPrivate::ImplicitHeight); +} + +QSizeF QQuickItemGroup::calculateImplicitSize() const +{ + qreal width = 0; + qreal height = 0; + const auto children = childItems(); + for (QQuickItem *child : children) { + width = qMax(width, child->implicitWidth()); + height = qMax(height, child->implicitHeight()); + } + return QSizeF(width, height); +} + +void QQuickItemGroup::updateImplicitSize() +{ + QSizeF size = calculateImplicitSize(); + setImplicitSize(size.width(), size.height()); +} + +void QQuickItemGroup::itemChange(ItemChange change, const ItemChangeData &data) +{ + QQuickImplicitSizeItem::itemChange(change, data); + switch (change) { + case ItemChildAddedChange: + watch(data.item); + data.item->setSize(QSizeF(width(), height())); + updateImplicitSize(); + break; + case ItemChildRemovedChange: + unwatch(data.item); + updateImplicitSize(); + break; + default: + break; + } +} + +void QQuickItemGroup::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) +{ + QQuickImplicitSizeItem::geometryChanged(newGeometry, oldGeometry); + + if (newGeometry.size() != oldGeometry.size()) { + const auto children = childItems(); + for (QQuickItem *child : children) + child->setSize(newGeometry.size()); + } +} + +void QQuickItemGroup::itemImplicitWidthChanged(QQuickItem *) +{ + setImplicitWidth(calculateImplicitSize().width()); +} + +void QQuickItemGroup::itemImplicitHeightChanged(QQuickItem *) +{ + setImplicitHeight(calculateImplicitSize().height()); +} + +QT_END_NAMESPACE diff --git a/src/quickcontrols2/qquickitemgroup_p.h b/src/quickcontrols2/qquickitemgroup_p.h new file mode 100644 index 00000000..af062d57 --- /dev/null +++ b/src/quickcontrols2/qquickitemgroup_p.h @@ -0,0 +1,83 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQUICKITEMGROUP_P_H +#define QQUICKITEMGROUP_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickItemGroup : public QQuickImplicitSizeItem, protected QQuickItemChangeListener +{ + Q_OBJECT + +public: + explicit QQuickItemGroup(QQuickItem *parent = nullptr); + ~QQuickItemGroup(); + +protected: + void watch(QQuickItem *item); + void unwatch(QQuickItem *item); + + QSizeF calculateImplicitSize() const; + void updateImplicitSize(); + + void itemChange(ItemChange change, const ItemChangeData &data) override; + void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override; + + void itemImplicitWidthChanged(QQuickItem *item) override; + void itemImplicitHeightChanged(QQuickItem *item) override; +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QQuickItemGroup) + +#endif // QQUICKITEMGROUP_P_H diff --git a/src/quickcontrols2/quickcontrols2.pri b/src/quickcontrols2/quickcontrols2.pri index a618989e..9be0c009 100644 --- a/src/quickcontrols2/quickcontrols2.pri +++ b/src/quickcontrols2/quickcontrols2.pri @@ -1,6 +1,8 @@ HEADERS += \ $$PWD/qquickanimatednode_p.h \ + $$PWD/qquickclippedtext_p.h \ $$PWD/qquickcolorimageprovider_p.h \ + $$PWD/qquickitemgroup_p.h \ $$PWD/qquickplaceholdertext_p.h \ $$PWD/qquickproxytheme_p.h \ $$PWD/qquickstyle.h \ @@ -13,7 +15,9 @@ HEADERS += \ SOURCES += \ $$PWD/qquickanimatednode.cpp \ + $$PWD/qquickclippedtext.cpp \ $$PWD/qquickcolorimageprovider.cpp \ + $$PWD/qquickitemgroup.cpp \ $$PWD/qquickplaceholdertext.cpp \ $$PWD/qquickproxytheme.cpp \ $$PWD/qquickstyle.cpp \ diff --git a/tests/auto/customization/tst_customization.cpp b/tests/auto/customization/tst_customization.cpp index 13527263..4c8ea72b 100644 --- a/tests/auto/customization/tst_customization.cpp +++ b/tests/auto/customization/tst_customization.cpp @@ -257,8 +257,6 @@ void tst_customization::creation() QVERIFY2(qt_createdQObjects()->isEmpty(), qPrintable("unexpectedly created: " + qt_createdQObjects->join(", "))); QVERIFY2(qt_destroyedQObjects()->isEmpty(), qPrintable("unexpectedly destroyed: " + qt_destroyedQObjects->join(", ") + " were unexpectedly destroyed")); - QEXPECT_FAIL("Default:DelayButton", "TODO: remove internal IDs", Abort); - QVERIFY2(qt_destroyedParentQObjects()->isEmpty(), qPrintable("delegates/children of: " + qt_destroyedParentQObjects->join(", ") + " were unexpectedly destroyed")); } -- cgit v1.2.3 From c40486acc352d49398186fa32d1ccabdd5fc83c6 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 19 Dec 2017 13:38:40 +0100 Subject: Fix deferred execution If the QML engine refuses to defer execution of a delegate (it contains an ID), we must make sure to cancel any pending deferred execution for the same delegate. Otherwise, we may end up overriding a custom (non- deferred) delegate with a default (deferred) delegate. This patch adds a new test style "identified" to tst_customization. This style contains delegates with IDs so we can test the behavior with IDs in base styles. Furthermore, overriding delegates is now tested in various ways (with and without IDs in the base and custom styles) in a separate test method. This is done by generating QML code to override delegates with dummy Item instances with appropriate IDs and names. Task-number: QTBUG-65341 Change-Id: Ie6dca287cb74672004d9d8f599760b9d32c3a380 Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickabstractbutton.cpp | 13 +- src/quicktemplates2/qquickabstractbutton_p_p.h | 1 + src/quicktemplates2/qquickapplicationwindow.cpp | 12 +- src/quicktemplates2/qquickcombobox.cpp | 25 +++- src/quicktemplates2/qquickcontrol.cpp | 22 +++- src/quicktemplates2/qquickcontrol_p_p.h | 3 + src/quicktemplates2/qquickdeferredexecute.cpp | 32 +++-- src/quicktemplates2/qquickdeferredexecute_p_p.h | 9 +- src/quicktemplates2/qquickdial.cpp | 12 +- src/quicktemplates2/qquickgroupbox.cpp | 12 +- src/quicktemplates2/qquicklabel.cpp | 11 +- src/quicktemplates2/qquicklabel_p_p.h | 1 + src/quicktemplates2/qquickpopupitem.cpp | 17 ++- src/quicktemplates2/qquickrangeslider.cpp | 16 ++- src/quicktemplates2/qquickslider.cpp | 12 +- src/quicktemplates2/qquickspinbox.cpp | 12 +- src/quicktemplates2/qquicktextarea.cpp | 11 +- src/quicktemplates2/qquicktextarea_p_p.h | 1 + src/quicktemplates2/qquicktextfield.cpp | 11 +- src/quicktemplates2/qquicktextfield_p_p.h | 1 + .../data/styles/identified/AbstractButton.qml | 72 +++++++++++ .../data/styles/identified/ApplicationWindow.qml | 62 ++++++++++ .../data/styles/identified/BusyIndicator.qml | 67 +++++++++++ .../data/styles/identified/Button.qml | 67 +++++++++++ .../data/styles/identified/CheckBox.qml | 67 +++++++++++ .../data/styles/identified/CheckDelegate.qml | 72 +++++++++++ .../data/styles/identified/ComboBox.qml | 78 ++++++++++++ .../data/styles/identified/Container.qml | 67 +++++++++++ .../data/styles/identified/Control.qml | 67 +++++++++++ .../data/styles/identified/DelayButton.qml | 67 +++++++++++ .../customization/data/styles/identified/Dial.qml | 67 +++++++++++ .../data/styles/identified/Dialog.qml | 67 +++++++++++ .../data/styles/identified/DialogButtonBox.qml | 67 +++++++++++ .../data/styles/identified/Drawer.qml | 67 +++++++++++ .../customization/data/styles/identified/Frame.qml | 67 +++++++++++ .../data/styles/identified/GroupBox.qml | 72 +++++++++++ .../data/styles/identified/ItemDelegate.qml | 67 +++++++++++ .../customization/data/styles/identified/Label.qml | 62 ++++++++++ .../customization/data/styles/identified/Menu.qml | 67 +++++++++++ .../data/styles/identified/MenuItem.qml | 72 +++++++++++ .../data/styles/identified/MenuSeparator.qml | 67 +++++++++++ .../customization/data/styles/identified/Page.qml | 67 +++++++++++ .../data/styles/identified/PageIndicator.qml | 67 +++++++++++ .../customization/data/styles/identified/Pane.qml | 67 +++++++++++ .../customization/data/styles/identified/Popup.qml | 67 +++++++++++ .../data/styles/identified/ProgressBar.qml | 67 +++++++++++ .../data/styles/identified/RadioButton.qml | 67 +++++++++++ .../data/styles/identified/RadioDelegate.qml | 72 +++++++++++ .../data/styles/identified/RangeSlider.qml | 72 +++++++++++ .../data/styles/identified/RoundButton.qml | 67 +++++++++++ .../data/styles/identified/ScrollBar.qml | 67 +++++++++++ .../data/styles/identified/ScrollIndicator.qml | 67 +++++++++++ .../data/styles/identified/ScrollView.qml | 62 ++++++++++ .../data/styles/identified/Slider.qml | 67 +++++++++++ .../data/styles/identified/SpinBox.qml | 77 ++++++++++++ .../data/styles/identified/StackView.qml | 67 +++++++++++ .../data/styles/identified/SwipeDelegate.qml | 67 +++++++++++ .../data/styles/identified/SwipeView.qml | 67 +++++++++++ .../data/styles/identified/Switch.qml | 67 +++++++++++ .../data/styles/identified/SwitchDelegate.qml | 72 +++++++++++ .../data/styles/identified/TabBar.qml | 67 +++++++++++ .../data/styles/identified/TabButton.qml | 67 +++++++++++ .../data/styles/identified/TextArea.qml | 62 ++++++++++ .../data/styles/identified/TextField.qml | 62 ++++++++++ .../data/styles/identified/ToolBar.qml | 67 +++++++++++ .../data/styles/identified/ToolButton.qml | 67 +++++++++++ .../data/styles/identified/ToolSeparator.qml | 67 +++++++++++ .../data/styles/identified/ToolTip.qml | 67 +++++++++++ .../data/styles/identified/Tumbler.qml | 67 +++++++++++ tests/auto/customization/tst_customization.cpp | 131 ++++++++++++++++++++- 70 files changed, 3643 insertions(+), 36 deletions(-) create mode 100644 tests/auto/customization/data/styles/identified/AbstractButton.qml create mode 100644 tests/auto/customization/data/styles/identified/ApplicationWindow.qml create mode 100644 tests/auto/customization/data/styles/identified/BusyIndicator.qml create mode 100644 tests/auto/customization/data/styles/identified/Button.qml create mode 100644 tests/auto/customization/data/styles/identified/CheckBox.qml create mode 100644 tests/auto/customization/data/styles/identified/CheckDelegate.qml create mode 100644 tests/auto/customization/data/styles/identified/ComboBox.qml create mode 100644 tests/auto/customization/data/styles/identified/Container.qml create mode 100644 tests/auto/customization/data/styles/identified/Control.qml create mode 100644 tests/auto/customization/data/styles/identified/DelayButton.qml create mode 100644 tests/auto/customization/data/styles/identified/Dial.qml create mode 100644 tests/auto/customization/data/styles/identified/Dialog.qml create mode 100644 tests/auto/customization/data/styles/identified/DialogButtonBox.qml create mode 100644 tests/auto/customization/data/styles/identified/Drawer.qml create mode 100644 tests/auto/customization/data/styles/identified/Frame.qml create mode 100644 tests/auto/customization/data/styles/identified/GroupBox.qml create mode 100644 tests/auto/customization/data/styles/identified/ItemDelegate.qml create mode 100644 tests/auto/customization/data/styles/identified/Label.qml create mode 100644 tests/auto/customization/data/styles/identified/Menu.qml create mode 100644 tests/auto/customization/data/styles/identified/MenuItem.qml create mode 100644 tests/auto/customization/data/styles/identified/MenuSeparator.qml create mode 100644 tests/auto/customization/data/styles/identified/Page.qml create mode 100644 tests/auto/customization/data/styles/identified/PageIndicator.qml create mode 100644 tests/auto/customization/data/styles/identified/Pane.qml create mode 100644 tests/auto/customization/data/styles/identified/Popup.qml create mode 100644 tests/auto/customization/data/styles/identified/ProgressBar.qml create mode 100644 tests/auto/customization/data/styles/identified/RadioButton.qml create mode 100644 tests/auto/customization/data/styles/identified/RadioDelegate.qml create mode 100644 tests/auto/customization/data/styles/identified/RangeSlider.qml create mode 100644 tests/auto/customization/data/styles/identified/RoundButton.qml create mode 100644 tests/auto/customization/data/styles/identified/ScrollBar.qml create mode 100644 tests/auto/customization/data/styles/identified/ScrollIndicator.qml create mode 100644 tests/auto/customization/data/styles/identified/ScrollView.qml create mode 100644 tests/auto/customization/data/styles/identified/Slider.qml create mode 100644 tests/auto/customization/data/styles/identified/SpinBox.qml create mode 100644 tests/auto/customization/data/styles/identified/StackView.qml create mode 100644 tests/auto/customization/data/styles/identified/SwipeDelegate.qml create mode 100644 tests/auto/customization/data/styles/identified/SwipeView.qml create mode 100644 tests/auto/customization/data/styles/identified/Switch.qml create mode 100644 tests/auto/customization/data/styles/identified/SwitchDelegate.qml create mode 100644 tests/auto/customization/data/styles/identified/TabBar.qml create mode 100644 tests/auto/customization/data/styles/identified/TabButton.qml create mode 100644 tests/auto/customization/data/styles/identified/TextArea.qml create mode 100644 tests/auto/customization/data/styles/identified/TextField.qml create mode 100644 tests/auto/customization/data/styles/identified/ToolBar.qml create mode 100644 tests/auto/customization/data/styles/identified/ToolButton.qml create mode 100644 tests/auto/customization/data/styles/identified/ToolSeparator.qml create mode 100644 tests/auto/customization/data/styles/identified/ToolTip.qml create mode 100644 tests/auto/customization/data/styles/identified/Tumbler.qml diff --git a/src/quicktemplates2/qquickabstractbutton.cpp b/src/quicktemplates2/qquickabstractbutton.cpp index 45ade7bb..af676a50 100644 --- a/src/quicktemplates2/qquickabstractbutton.cpp +++ b/src/quicktemplates2/qquickabstractbutton.cpp @@ -261,13 +261,19 @@ void QQuickAbstractButtonPrivate::toggle(bool value) static inline QString indicatorName() { return QStringLiteral("indicator"); } +void QQuickAbstractButtonPrivate::cancelIndicator() +{ + Q_Q(QQuickAbstractButton); + quickCancelDeferred(q, indicatorName()); +} + void QQuickAbstractButtonPrivate::executeIndicator(bool complete) { - Q_Q(QQuickControl); + Q_Q(QQuickAbstractButton); if (indicator.wasExecuted()) return; - if (!indicator) + if (!indicator || complete) quickBeginDeferred(q, indicatorName(), indicator); if (complete) quickCompleteDeferred(q, indicatorName(), indicator); @@ -572,6 +578,9 @@ void QQuickAbstractButton::setIndicator(QQuickItem *indicator) if (d->indicator == indicator) return; + if (!d->indicator.isExecuting()) + d->cancelIndicator(); + delete d->indicator; d->indicator = indicator; if (indicator) { diff --git a/src/quicktemplates2/qquickabstractbutton_p_p.h b/src/quicktemplates2/qquickabstractbutton_p_p.h index 6634971e..07e6d3f2 100644 --- a/src/quicktemplates2/qquickabstractbutton_p_p.h +++ b/src/quicktemplates2/qquickabstractbutton_p_p.h @@ -85,6 +85,7 @@ public: void toggle(bool value); + void cancelIndicator(); void executeIndicator(bool complete = false); QString text; diff --git a/src/quicktemplates2/qquickapplicationwindow.cpp b/src/quicktemplates2/qquickapplicationwindow.cpp index c1a7f301..b07b2142 100644 --- a/src/quicktemplates2/qquickapplicationwindow.cpp +++ b/src/quicktemplates2/qquickapplicationwindow.cpp @@ -175,6 +175,7 @@ public: static void contentData_append(QQmlListProperty *prop, QObject *obj); + void cancelBackground(); void executeBackground(bool complete = false); bool complete; @@ -301,13 +302,19 @@ void QQuickApplicationWindowPrivate::contentData_append(QQmlListPropertybackground == background) return; + if (!d->background.isExecuting()) + d->cancelBackground(); + delete d->background; d->background = background; if (background) { diff --git a/src/quicktemplates2/qquickcombobox.cpp b/src/quicktemplates2/qquickcombobox.cpp index d221b9bc..fb10730e 100644 --- a/src/quicktemplates2/qquickcombobox.cpp +++ b/src/quicktemplates2/qquickcombobox.cpp @@ -253,7 +253,10 @@ public: void handleRelease(const QPointF &point) override; void handleUngrab() override; + void cancelIndicator(); void executeIndicator(bool complete = false); + + void cancelPopup(); void executePopup(bool complete = false); bool flat; @@ -671,13 +674,19 @@ void QQuickComboBoxPrivate::handleUngrab() static inline QString indicatorName() { return QStringLiteral("indicator"); } +void QQuickComboBoxPrivate::cancelIndicator() +{ + Q_Q(QQuickComboBox); + quickCancelDeferred(q, indicatorName()); +} + void QQuickComboBoxPrivate::executeIndicator(bool complete) { Q_Q(QQuickComboBox); if (indicator.wasExecuted()) return; - if (!indicator) + if (!indicator || complete) quickBeginDeferred(q, indicatorName(), indicator); if (complete) quickCompleteDeferred(q, indicatorName(), indicator); @@ -685,13 +694,19 @@ void QQuickComboBoxPrivate::executeIndicator(bool complete) static inline QString popupName() { return QStringLiteral("popup"); } +void QQuickComboBoxPrivate::cancelPopup() +{ + Q_Q(QQuickComboBox); + quickCancelDeferred(q, popupName()); +} + void QQuickComboBoxPrivate::executePopup(bool complete) { Q_Q(QQuickComboBox); if (popup.wasExecuted()) return; - if (!popup) + if (!popup || complete) quickBeginDeferred(q, popupName(), popup); if (complete) quickCompleteDeferred(q, popupName(), popup); @@ -1015,6 +1030,9 @@ void QQuickComboBox::setIndicator(QQuickItem *indicator) if (d->indicator == indicator) return; + if (!d->indicator.isExecuting()) + d->cancelIndicator(); + delete d->indicator; d->indicator = indicator; if (indicator) { @@ -1052,6 +1070,9 @@ void QQuickComboBox::setPopup(QQuickPopup *popup) if (d->popup == popup) return; + if (!d->popup.isExecuting()) + d->cancelPopup(); + if (d->popup) { QObjectPrivate::disconnect(d->popup.data(), &QQuickPopup::visibleChanged, d, &QQuickComboBoxPrivate::popupVisibleChanged); delete d->popup; diff --git a/src/quicktemplates2/qquickcontrol.cpp b/src/quicktemplates2/qquickcontrol.cpp index cfecc67c..6fbd4c07 100644 --- a/src/quicktemplates2/qquickcontrol.cpp +++ b/src/quicktemplates2/qquickcontrol.cpp @@ -292,6 +292,9 @@ void QQuickControlPrivate::setContentItem_helper(QQuickItem *item, bool notify) if (contentItem == item) return; + if (!contentItem.isExecuting()) + cancelContentItem(); + q->contentItemChange(item, contentItem); delete contentItem; contentItem = item; @@ -938,13 +941,19 @@ QLocale QQuickControlPrivate::calcLocale(const QQuickItem *item) static inline QString contentItemName() { return QStringLiteral("contentItem"); } +void QQuickControlPrivate::cancelContentItem() +{ + Q_Q(QQuickControl); + quickCancelDeferred(q, contentItemName()); +} + void QQuickControlPrivate::executeContentItem(bool complete) { Q_Q(QQuickControl); if (contentItem.wasExecuted()) return; - if (!contentItem) + if (!contentItem || complete) quickBeginDeferred(q, contentItemName(), contentItem); if (complete) quickCompleteDeferred(q, contentItemName(), contentItem); @@ -952,13 +961,19 @@ void QQuickControlPrivate::executeContentItem(bool complete) static inline QString backgroundName() { return QStringLiteral("background"); } +void QQuickControlPrivate::cancelBackground() +{ + Q_Q(QQuickControl); + quickCancelDeferred(q, backgroundName()); +} + void QQuickControlPrivate::executeBackground(bool complete) { Q_Q(QQuickControl); if (background.wasExecuted()) return; - if (!background) + if (!background || complete) quickBeginDeferred(q, backgroundName(), background); if (complete) quickCompleteDeferred(q, backgroundName(), background); @@ -1257,6 +1272,9 @@ void QQuickControl::setBackground(QQuickItem *background) if (d->background == background) return; + if (!d->background.isExecuting()) + d->cancelBackground(); + delete d->background; d->background = background; if (background) { diff --git a/src/quicktemplates2/qquickcontrol_p_p.h b/src/quicktemplates2/qquickcontrol_p_p.h index 81fa03a4..3ed8b637 100644 --- a/src/quicktemplates2/qquickcontrol_p_p.h +++ b/src/quicktemplates2/qquickcontrol_p_p.h @@ -127,7 +127,10 @@ public: static bool calcHoverEnabled(const QQuickItem *item); #endif + virtual void cancelContentItem(); virtual void executeContentItem(bool complete = false); + + virtual void cancelBackground(); virtual void executeBackground(bool complete = false); static void destroyDelegate(QObject *object, QObject *parent); diff --git a/src/quicktemplates2/qquickdeferredexecute.cpp b/src/quicktemplates2/qquickdeferredexecute.cpp index 802ed3d0..ca6953bc 100644 --- a/src/quicktemplates2/qquickdeferredexecute.cpp +++ b/src/quicktemplates2/qquickdeferredexecute.cpp @@ -55,13 +55,24 @@ static inline uint qHash(QObject *object, const QString &propertyName) Q_GLOBAL_STATIC(DeferredStates, deferredStates) -static void beginDeferred(QQmlEnginePrivate *enginePriv, const QQmlProperty &property, QQmlComponentPrivate::DeferredState *deferredState) +static void cancelDeferred(QObject *object, int propertyIndex) +{ + QQmlData *ddata = QQmlData::get(object); + auto dit = ddata->deferredData.rbegin(); + while (dit != ddata->deferredData.rend()) { + (*dit)->bindings.remove(propertyIndex); + ++dit; + } +} + +static bool beginDeferred(QQmlEnginePrivate *enginePriv, const QQmlProperty &property, QQmlComponentPrivate::DeferredState *deferredState) { QObject *object = property.object(); QQmlData *ddata = QQmlData::get(object); Q_ASSERT(!ddata->deferredData.isEmpty()); int propertyIndex = property.index(); + int wasInProgress = enginePriv->inProgressCreations; for (auto dit = ddata->deferredData.rbegin(); dit != ddata->deferredData.rend(); ++dit) { QQmlData::DeferredData *deferData = *dit; @@ -91,12 +102,11 @@ static void beginDeferred(QQmlEnginePrivate *enginePriv, const QQmlProperty &pro // Cleanup any remaining deferred bindings for this property, also in inner contexts, // to avoid executing them later and overriding the property that was just populated. - while (dit != ddata->deferredData.rend()) { - (*dit)->bindings.remove(propertyIndex); - ++dit; - } + cancelDeferred(object, propertyIndex); break; } + + return enginePriv->inProgressCreations > wasInProgress; } void beginDeferred(QObject *object, const QString &property) @@ -106,15 +116,21 @@ void beginDeferred(QObject *object, const QString &property) QQmlEnginePrivate *ep = QQmlEnginePrivate::get(data->context->engine); QQmlComponentPrivate::DeferredState *state = new QQmlComponentPrivate::DeferredState; - beginDeferred(ep, QQmlProperty(object, property), state); + if (beginDeferred(ep, QQmlProperty(object, property), state)) + deferredStates()->insert(qHash(object, property), state); + else + delete state; // Release deferred data for those compilation units that no longer have deferred bindings data->releaseDeferredData(); - - deferredStates()->insert(qHash(object, property), state); } } +void cancelDeferred(QObject *object, const QString &property) +{ + cancelDeferred(object, QQmlProperty(object, property).index()); +} + void completeDeferred(QObject *object, const QString &property) { QQmlData *data = QQmlData::get(object); diff --git a/src/quicktemplates2/qquickdeferredexecute_p_p.h b/src/quicktemplates2/qquickdeferredexecute_p_p.h index 87124e48..400c5734 100644 --- a/src/quicktemplates2/qquickdeferredexecute_p_p.h +++ b/src/quicktemplates2/qquickdeferredexecute_p_p.h @@ -58,25 +58,28 @@ class QObject; namespace QtQuickPrivate { void beginDeferred(QObject *object, const QString &property); + void cancelDeferred(QObject *object, const QString &property); void completeDeferred(QObject *object, const QString &property); } template void quickBeginDeferred(QObject *object, const QString &property, QQuickDeferredPointer &delegate) { - Q_ASSERT(delegate.isNull()); delegate.setExecuting(true); QtQuickPrivate::beginDeferred(object, property); delegate.setExecuting(false); } +inline void quickCancelDeferred(QObject *object, const QString &property) +{ + QtQuickPrivate::cancelDeferred(object, property); +} + template void quickCompleteDeferred(QObject *object, const QString &property, QQuickDeferredPointer &delegate) { Q_ASSERT(!delegate.wasExecuted()); - delegate.setExecuting(true); QtQuickPrivate::completeDeferred(object, property); - delegate.setExecuting(false); delegate.setExecuted(); } diff --git a/src/quicktemplates2/qquickdial.cpp b/src/quicktemplates2/qquickdial.cpp index 964cefe1..b5957069 100644 --- a/src/quicktemplates2/qquickdial.cpp +++ b/src/quicktemplates2/qquickdial.cpp @@ -123,6 +123,7 @@ public: void handleRelease(const QPointF &point) override; void handleUngrab() override; + void cancelHandle(); void executeHandle(bool complete = false); qreal from; @@ -258,13 +259,19 @@ void QQuickDialPrivate::handleUngrab() static inline QString handleName() { return QStringLiteral("handle"); } +void QQuickDialPrivate::cancelHandle() +{ + Q_Q(QQuickDial); + quickCancelDeferred(q, handleName()); +} + void QQuickDialPrivate::executeHandle(bool complete) { Q_Q(QQuickDial); if (handle.wasExecuted()) return; - if (!handle) + if (!handle || complete) quickBeginDeferred(q, handleName(), handle); if (complete) quickCompleteDeferred(q, handleName(), handle); @@ -553,6 +560,9 @@ void QQuickDial::setHandle(QQuickItem *handle) if (handle == d->handle) return; + if (!d->handle.isExecuting()) + d->cancelHandle(); + delete d->handle; d->handle = handle; if (d->handle && !d->handle->parentItem()) diff --git a/src/quicktemplates2/qquickgroupbox.cpp b/src/quicktemplates2/qquickgroupbox.cpp index 674f5b18..3c7bf715 100644 --- a/src/quicktemplates2/qquickgroupbox.cpp +++ b/src/quicktemplates2/qquickgroupbox.cpp @@ -91,6 +91,7 @@ class QQuickGroupBoxPrivate : public QQuickFramePrivate public: QQuickGroupBoxPrivate() : label(nullptr) { } + void cancelLabel(); void executeLabel(bool complete = false); QString title; @@ -99,13 +100,19 @@ public: static inline QString labelName() { return QStringLiteral("label"); } +void QQuickGroupBoxPrivate::cancelLabel() +{ + Q_Q(QQuickGroupBox); + quickCancelDeferred(q, labelName()); +} + void QQuickGroupBoxPrivate::executeLabel(bool complete) { Q_Q(QQuickGroupBox); if (label.wasExecuted()) return; - if (!label) + if (!label || complete) quickBeginDeferred(q, labelName(), label); if (complete) quickCompleteDeferred(q, labelName(), label); @@ -162,6 +169,9 @@ void QQuickGroupBox::setLabel(QQuickItem *label) if (d->label == label) return; + if (!d->label.isExecuting()) + d->cancelLabel(); + delete d->label; d->label = label; if (label && !label->parentItem()) diff --git a/src/quicktemplates2/qquicklabel.cpp b/src/quicktemplates2/qquicklabel.cpp index 418a7834..c8b125ca 100644 --- a/src/quicktemplates2/qquicklabel.cpp +++ b/src/quicktemplates2/qquicklabel.cpp @@ -158,13 +158,19 @@ QAccessible::Role QQuickLabelPrivate::accessibleRole() const static inline QString backgroundName() { return QStringLiteral("background"); } +void QQuickLabelPrivate::cancelBackground() +{ + Q_Q(QQuickLabel); + quickCancelDeferred(q, backgroundName()); +} + void QQuickLabelPrivate::executeBackground(bool complete) { Q_Q(QQuickLabel); if (background.wasExecuted()) return; - if (!background) + if (!background || complete) quickBeginDeferred(q, backgroundName(), background); if (complete) quickCompleteDeferred(q, backgroundName(), background); @@ -217,6 +223,9 @@ void QQuickLabel::setBackground(QQuickItem *background) if (d->background == background) return; + if (!d->background.isExecuting()) + d->cancelBackground(); + delete d->background; d->background = background; if (background) { diff --git a/src/quicktemplates2/qquicklabel_p_p.h b/src/quicktemplates2/qquicklabel_p_p.h index b8ad2ae7..f612434b 100644 --- a/src/quicktemplates2/qquicklabel_p_p.h +++ b/src/quicktemplates2/qquicklabel_p_p.h @@ -85,6 +85,7 @@ public: QAccessible::Role accessibleRole() const override; #endif + void cancelBackground(); void executeBackground(bool complete = false); QFont font; diff --git a/src/quicktemplates2/qquickpopupitem.cpp b/src/quicktemplates2/qquickpopupitem.cpp index db335a06..96816eac 100644 --- a/src/quicktemplates2/qquickpopupitem.cpp +++ b/src/quicktemplates2/qquickpopupitem.cpp @@ -60,7 +60,10 @@ public: QQuickItem *getContentItem() override; + void cancelContentItem() override; void executeContentItem(bool complete = false) override; + + void cancelBackground() override; void executeBackground(bool complete = false) override; int backId; @@ -106,12 +109,17 @@ QQuickItem *QQuickPopupItemPrivate::getContentItem() static inline QString contentItemName() { return QStringLiteral("contentItem"); } +void QQuickPopupItemPrivate::cancelContentItem() +{ + quickCancelDeferred(popup, contentItemName()); +} + void QQuickPopupItemPrivate::executeContentItem(bool complete) { if (contentItem.wasExecuted()) return; - if (!contentItem) + if (!contentItem || complete) quickBeginDeferred(popup, contentItemName(), contentItem); if (complete) quickCompleteDeferred(popup, contentItemName(), contentItem); @@ -119,12 +127,17 @@ void QQuickPopupItemPrivate::executeContentItem(bool complete) static inline QString backgroundName() { return QStringLiteral("background"); } +void QQuickPopupItemPrivate::cancelBackground() +{ + quickCancelDeferred(popup, backgroundName()); +} + void QQuickPopupItemPrivate::executeBackground(bool complete) { if (background.wasExecuted()) return; - if (!background) + if (!background || complete) quickBeginDeferred(popup, backgroundName(), background); if (complete) quickCompleteDeferred(popup, backgroundName(), background); diff --git a/src/quicktemplates2/qquickrangeslider.cpp b/src/quicktemplates2/qquickrangeslider.cpp index 51b646ce..557adc3a 100644 --- a/src/quicktemplates2/qquickrangeslider.cpp +++ b/src/quicktemplates2/qquickrangeslider.cpp @@ -110,6 +110,7 @@ public: void setPosition(qreal position, bool ignoreOtherPosition = false); void updatePosition(bool ignoreOtherPosition = false); + void cancelHandle(); void executeHandle(bool complete = false); static QQuickRangeSliderNodePrivate *get(QQuickRangeSliderNode *node); @@ -154,13 +155,19 @@ void QQuickRangeSliderNodePrivate::updatePosition(bool ignoreOtherPosition) static inline QString handleName() { return QStringLiteral("handle"); } +void QQuickRangeSliderNodePrivate::cancelHandle() +{ + Q_Q(QQuickRangeSliderNode); + quickCancelDeferred(q, handleName()); +} + void QQuickRangeSliderNodePrivate::executeHandle(bool complete) { Q_Q(QQuickRangeSliderNode); if (handle.wasExecuted()) return; - if (!handle) + if (!handle || complete) quickBeginDeferred(q, handleName(), handle); if (complete) quickCompleteDeferred(q, handleName(), handle); @@ -256,14 +263,17 @@ void QQuickRangeSliderNode::setHandle(QQuickItem *handle) if (d->handle == handle) return; + if (!d->handle.isExecuting()) + d->cancelHandle(); + delete d->handle; d->handle = handle; if (handle) { if (!handle->parentItem()) handle->setParentItem(d->slider); - QQuickItem *firstHandle = d->slider->first()->handle(); - QQuickItem *secondHandle = d->slider->second()->handle(); + QQuickItem *firstHandle = QQuickRangeSliderNodePrivate::get(d->slider->first())->handle; + QQuickItem *secondHandle = QQuickRangeSliderNodePrivate::get(d->slider->second())->handle; if (firstHandle && secondHandle) { // The order of property assignments in QML is undefined, // but we need the first handle to be before the second due diff --git a/src/quicktemplates2/qquickslider.cpp b/src/quicktemplates2/qquickslider.cpp index 73fa2725..94c9762d 100644 --- a/src/quicktemplates2/qquickslider.cpp +++ b/src/quicktemplates2/qquickslider.cpp @@ -113,6 +113,7 @@ public: void handleRelease(const QPointF &point) override; void handleUngrab() override; + void cancelHandle(); void executeHandle(bool complete = false); qreal from; @@ -240,13 +241,19 @@ void QQuickSliderPrivate::handleUngrab() static inline QString handleName() { return QStringLiteral("handle"); } +void QQuickSliderPrivate::cancelHandle() +{ + Q_Q(QQuickSlider); + quickCancelDeferred(q, handleName()); +} + void QQuickSliderPrivate::executeHandle(bool complete) { Q_Q(QQuickSlider); if (handle.wasExecuted()) return; - if (!handle) + if (!handle || complete) quickBeginDeferred(q, handleName(), handle); if (complete) quickCompleteDeferred(q, handleName(), handle); @@ -514,6 +521,9 @@ void QQuickSlider::setHandle(QQuickItem *handle) if (d->handle == handle) return; + if (!d->handle.isExecuting()) + d->cancelHandle(); + delete d->handle; d->handle = handle; if (handle && !handle->parentItem()) diff --git a/src/quicktemplates2/qquickspinbox.cpp b/src/quicktemplates2/qquickspinbox.cpp index 80bef2db..24ec19f8 100644 --- a/src/quicktemplates2/qquickspinbox.cpp +++ b/src/quicktemplates2/qquickspinbox.cpp @@ -177,6 +177,7 @@ public: return button->d_func(); } + void cancelIndicator(); void executeIndicator(bool complete = false); bool pressed; @@ -934,13 +935,19 @@ void QQuickSpinBox::accessibilityActiveChanged(bool active) static inline QString indicatorName() { return QStringLiteral("indicator"); } +void QQuickSpinButtonPrivate::cancelIndicator() +{ + Q_Q(QQuickSpinButton); + quickCancelDeferred(q, indicatorName()); +} + void QQuickSpinButtonPrivate::executeIndicator(bool complete) { Q_Q(QQuickSpinButton); if (indicator.wasExecuted()) return; - if (!indicator) + if (!indicator || complete) quickBeginDeferred(q, indicatorName(), indicator); if (complete) quickCompleteDeferred(q, indicatorName(), indicator); @@ -981,6 +988,9 @@ void QQuickSpinButton::setIndicator(QQuickItem *indicator) if (d->indicator == indicator) return; + if (!d->indicator.isExecuting()) + d->cancelIndicator(); + delete d->indicator; d->indicator = indicator; diff --git a/src/quicktemplates2/qquicktextarea.cpp b/src/quicktemplates2/qquicktextarea.cpp index 06867742..500e7bba 100644 --- a/src/quicktemplates2/qquicktextarea.cpp +++ b/src/quicktemplates2/qquicktextarea.cpp @@ -394,13 +394,19 @@ QAccessible::Role QQuickTextAreaPrivate::accessibleRole() const static inline QString backgroundName() { return QStringLiteral("background"); } +void QQuickTextAreaPrivate::cancelBackground() +{ + Q_Q(QQuickTextArea); + quickCancelDeferred(q, backgroundName()); +} + void QQuickTextAreaPrivate::executeBackground(bool complete) { Q_Q(QQuickTextArea); if (background.wasExecuted()) return; - if (!background) + if (!background || complete) quickBeginDeferred(q, backgroundName(), background); if (complete) quickCompleteDeferred(q, backgroundName(), background); @@ -471,6 +477,9 @@ void QQuickTextArea::setBackground(QQuickItem *background) if (d->background == background) return; + if (!d->background.isExecuting()) + d->cancelBackground(); + delete d->background; d->background = background; if (background) { diff --git a/src/quicktemplates2/qquicktextarea_p_p.h b/src/quicktemplates2/qquicktextarea_p_p.h index ede9d97f..42ac6fe7 100644 --- a/src/quicktemplates2/qquicktextarea_p_p.h +++ b/src/quicktemplates2/qquicktextarea_p_p.h @@ -109,6 +109,7 @@ public: QAccessible::Role accessibleRole() const override; #endif + void cancelBackground(); void executeBackground(bool complete = false); #if QT_CONFIG(quicktemplates2_hover) diff --git a/src/quicktemplates2/qquicktextfield.cpp b/src/quicktemplates2/qquicktextfield.cpp index 2d432ec0..8ca51ddb 100644 --- a/src/quicktemplates2/qquicktextfield.cpp +++ b/src/quicktemplates2/qquicktextfield.cpp @@ -268,13 +268,19 @@ QAccessible::Role QQuickTextFieldPrivate::accessibleRole() const static inline QString backgroundName() { return QStringLiteral("background"); } +void QQuickTextFieldPrivate::cancelBackground() +{ + Q_Q(QQuickTextField); + quickCancelDeferred(q, backgroundName()); +} + void QQuickTextFieldPrivate::executeBackground(bool complete) { Q_Q(QQuickTextField); if (background.wasExecuted()) return; - if (!background) + if (!background || complete) quickBeginDeferred(q, backgroundName(), background); if (complete) quickCompleteDeferred(q, backgroundName(), background); @@ -333,6 +339,9 @@ void QQuickTextField::setBackground(QQuickItem *background) if (d->background == background) return; + if (!d->background.isExecuting()) + d->cancelBackground(); + delete d->background; d->background = background; if (background) { diff --git a/src/quicktemplates2/qquicktextfield_p_p.h b/src/quicktemplates2/qquicktextfield_p_p.h index 037c6a21..32a79db3 100644 --- a/src/quicktemplates2/qquicktextfield_p_p.h +++ b/src/quicktemplates2/qquicktextfield_p_p.h @@ -98,6 +98,7 @@ public: QAccessible::Role accessibleRole() const override; #endif + void cancelBackground(); void executeBackground(bool complete = false); #if QT_CONFIG(quicktemplates2_hover) diff --git a/tests/auto/customization/data/styles/identified/AbstractButton.qml b/tests/auto/customization/data/styles/identified/AbstractButton.qml new file mode 100644 index 00000000..f390ae4b --- /dev/null +++ b/tests/auto/customization/data/styles/identified/AbstractButton.qml @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.AbstractButton { + id: control + objectName: "abstractbutton-identified" + + indicator: Item { + id: indicator + objectName: "abstractbutton-indicator-identified" + } + + contentItem: Item { + id: contentItem + objectName: "abstractbutton-contentItem-identified" + } + + background: Item { + id: background + objectName: "abstractbutton-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/ApplicationWindow.qml b/tests/auto/customization/data/styles/identified/ApplicationWindow.qml new file mode 100644 index 00000000..9d5973f1 --- /dev/null +++ b/tests/auto/customization/data/styles/identified/ApplicationWindow.qml @@ -0,0 +1,62 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.ApplicationWindow { + id: control + objectName: "applicationwindow-identified" + + background: Item { + id: background + objectName: "applicationwindow-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/BusyIndicator.qml b/tests/auto/customization/data/styles/identified/BusyIndicator.qml new file mode 100644 index 00000000..57a21ff9 --- /dev/null +++ b/tests/auto/customization/data/styles/identified/BusyIndicator.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.BusyIndicator { + id: control + objectName: "busyindicator-identified" + + contentItem: Item { + id: contentItem + objectName: "busyindicator-contentItem-identified" + } + + background: Item { + id: background + objectName: "busyindicator-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/Button.qml b/tests/auto/customization/data/styles/identified/Button.qml new file mode 100644 index 00000000..d92a106c --- /dev/null +++ b/tests/auto/customization/data/styles/identified/Button.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.Button { + id: control + objectName: "button-identified" + + contentItem: Item { + id: contentItem + objectName: "button-contentItem-identified" + } + + background: Item { + id: background + objectName: "button-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/CheckBox.qml b/tests/auto/customization/data/styles/identified/CheckBox.qml new file mode 100644 index 00000000..f1a77f6f --- /dev/null +++ b/tests/auto/customization/data/styles/identified/CheckBox.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.CheckBox { + id: control + objectName: "checkbox-identified" + + indicator: Item { + id: indicator + objectName: "checkbox-indicator-identified" + } + + contentItem: Item { + id: contentItem + objectName: "checkbox-contentItem-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/CheckDelegate.qml b/tests/auto/customization/data/styles/identified/CheckDelegate.qml new file mode 100644 index 00000000..d5ec11b3 --- /dev/null +++ b/tests/auto/customization/data/styles/identified/CheckDelegate.qml @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.CheckDelegate { + id: control + objectName: "checkdelegate-identified" + + indicator: Item { + id: indicator + objectName: "checkdelegate-indicator-identified" + } + + contentItem: Item { + id: contentItem + objectName: "checkdelegate-contentItem-identified" + } + + background: Item { + id: background + objectName: "checkdelegate-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/ComboBox.qml b/tests/auto/customization/data/styles/identified/ComboBox.qml new file mode 100644 index 00000000..e3ee2a68 --- /dev/null +++ b/tests/auto/customization/data/styles/identified/ComboBox.qml @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T +import QtQuick.Templates 2.2 as T + +T.ComboBox { + id: control + objectName: "combobox-identified" + + indicator: Item { + id: indicator + objectName: "combobox-indicator-identified" + } + + contentItem: Item { + id: contentItem + objectName: "combobox-contentItem-identified" + } + + background: Item { + id: background + objectName: "combobox-background-identified" + } + + popup: T.Popup { + id: popup + objectName: "combobox-popup-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/Container.qml b/tests/auto/customization/data/styles/identified/Container.qml new file mode 100644 index 00000000..eba77a02 --- /dev/null +++ b/tests/auto/customization/data/styles/identified/Container.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.Container { + id: control + objectName: "container-identified" + + contentItem: Item { + id: contentItem + objectName: "container-contentItem-identified" + } + + background: Item { + id: background + objectName: "container-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/Control.qml b/tests/auto/customization/data/styles/identified/Control.qml new file mode 100644 index 00000000..2299d88f --- /dev/null +++ b/tests/auto/customization/data/styles/identified/Control.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.Control { + id: control + objectName: "control-identified" + + contentItem: Item { + id: contentItem + objectName: "control-contentItem-identified" + } + + background: Item { + id: background + objectName: "control-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/DelayButton.qml b/tests/auto/customization/data/styles/identified/DelayButton.qml new file mode 100644 index 00000000..9879a261 --- /dev/null +++ b/tests/auto/customization/data/styles/identified/DelayButton.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.DelayButton { + id: control + objectName: "delaybutton-identified" + + contentItem: Item { + id: contentItem + objectName: "delaybutton-contentItem-identified" + } + + background: Item { + id: background + objectName: "delaybutton-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/Dial.qml b/tests/auto/customization/data/styles/identified/Dial.qml new file mode 100644 index 00000000..50f387d3 --- /dev/null +++ b/tests/auto/customization/data/styles/identified/Dial.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.Dial { + id: control + objectName: "dial-identified" + + handle: Item { + id: handle + objectName: "dial-handle-identified" + } + + background: Item { + id: background + objectName: "dial-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/Dialog.qml b/tests/auto/customization/data/styles/identified/Dialog.qml new file mode 100644 index 00000000..acfc2e1d --- /dev/null +++ b/tests/auto/customization/data/styles/identified/Dialog.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.Dialog { + id: control + objectName: "dialog-identified" + + contentItem: Item { + id: contentItem + objectName: "dialog-contentItem-identified" + } + + background: Item { + id: background + objectName: "dialog-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/DialogButtonBox.qml b/tests/auto/customization/data/styles/identified/DialogButtonBox.qml new file mode 100644 index 00000000..7b1bd04a --- /dev/null +++ b/tests/auto/customization/data/styles/identified/DialogButtonBox.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.DialogButtonBox { + id: control + objectName: "dialogbuttonbox-identified" + + contentItem: Item { + id: contentItem + objectName: "dialogbuttonbox-contentItem-identified" + } + + background: Item { + id: background + objectName: "dialogbuttonbox-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/Drawer.qml b/tests/auto/customization/data/styles/identified/Drawer.qml new file mode 100644 index 00000000..42e3829e --- /dev/null +++ b/tests/auto/customization/data/styles/identified/Drawer.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.Drawer { + id: control + objectName: "drawer-identified" + + contentItem: Item { + id: contentItem + objectName: "drawer-contentItem-identified" + } + + background: Item { + id: background + objectName: "drawer-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/Frame.qml b/tests/auto/customization/data/styles/identified/Frame.qml new file mode 100644 index 00000000..f3875eb7 --- /dev/null +++ b/tests/auto/customization/data/styles/identified/Frame.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.Frame { + id: control + objectName: "frame-identified" + + contentItem: Item { + id: contentItem + objectName: "frame-contentItem-identified" + } + + background: Item { + id: background + objectName: "frame-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/GroupBox.qml b/tests/auto/customization/data/styles/identified/GroupBox.qml new file mode 100644 index 00000000..5d77b27a --- /dev/null +++ b/tests/auto/customization/data/styles/identified/GroupBox.qml @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.GroupBox { + id: control + objectName: "groupbox-identified" + + label: Text { + id: label + objectName: "groupbox-label-identified" + } + + contentItem: Item { + id: contentItem + objectName: "groupbox-contentItem-identified" + } + + background: Item { + id: background + objectName: "groupbox-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/ItemDelegate.qml b/tests/auto/customization/data/styles/identified/ItemDelegate.qml new file mode 100644 index 00000000..3ef8396b --- /dev/null +++ b/tests/auto/customization/data/styles/identified/ItemDelegate.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.ItemDelegate { + id: control + objectName: "itemdelegate-identified" + + contentItem: Item { + id: contentItem + objectName: "itemdelegate-contentItem-identified" + } + + background: Item { + id: background + objectName: "itemdelegate-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/Label.qml b/tests/auto/customization/data/styles/identified/Label.qml new file mode 100644 index 00000000..d10ee1dd --- /dev/null +++ b/tests/auto/customization/data/styles/identified/Label.qml @@ -0,0 +1,62 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.Label { + id: control + objectName: "label-identified" + + background: Item { + id: background + objectName: "label-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/Menu.qml b/tests/auto/customization/data/styles/identified/Menu.qml new file mode 100644 index 00000000..cb0e52e9 --- /dev/null +++ b/tests/auto/customization/data/styles/identified/Menu.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.Menu { + id: control + objectName: "menu-identified" + + contentItem: Item { + id: contentItem + objectName: "menu-contentItem-identified" + } + + background: Item { + id: background + objectName: "menu-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/MenuItem.qml b/tests/auto/customization/data/styles/identified/MenuItem.qml new file mode 100644 index 00000000..cd4d53fb --- /dev/null +++ b/tests/auto/customization/data/styles/identified/MenuItem.qml @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.MenuItem { + id: control + objectName: "menuitem-identified" + + indicator: Item { + id: indicator + objectName: "menuitem-indicator-identified" + } + + contentItem: Item { + id: contentItem + objectName: "menuitem-contentItem-identified" + } + + background: Item { + id: background + objectName: "menuitem-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/MenuSeparator.qml b/tests/auto/customization/data/styles/identified/MenuSeparator.qml new file mode 100644 index 00000000..c82ea4f3 --- /dev/null +++ b/tests/auto/customization/data/styles/identified/MenuSeparator.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.MenuSeparator { + id: control + objectName: "menuseparator-identified" + + contentItem: Item { + id: contentItem + objectName: "menuseparator-contentItem-identified" + } + + background: Item { + id: background + objectName: "menuseparator-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/Page.qml b/tests/auto/customization/data/styles/identified/Page.qml new file mode 100644 index 00000000..5c8cf73e --- /dev/null +++ b/tests/auto/customization/data/styles/identified/Page.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.Page { + id: control + objectName: "page-identified" + + contentItem: Item { + id: contentItem + objectName: "page-contentItem-identified" + } + + background: Item { + id: background + objectName: "page-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/PageIndicator.qml b/tests/auto/customization/data/styles/identified/PageIndicator.qml new file mode 100644 index 00000000..92f28b39 --- /dev/null +++ b/tests/auto/customization/data/styles/identified/PageIndicator.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.PageIndicator { + id: control + objectName: "pageindicator-identified" + + contentItem: Item { + id: contentItem + objectName: "pageindicator-contentItem-identified" + } + + background: Item { + id: background + objectName: "pageindicator-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/Pane.qml b/tests/auto/customization/data/styles/identified/Pane.qml new file mode 100644 index 00000000..a0315788 --- /dev/null +++ b/tests/auto/customization/data/styles/identified/Pane.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.Pane { + id: control + objectName: "pane-identified" + + contentItem: Item { + id: contentItem + objectName: "pane-contentItem-identified" + } + + background: Item { + id: background + objectName: "pane-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/Popup.qml b/tests/auto/customization/data/styles/identified/Popup.qml new file mode 100644 index 00000000..b19b1251 --- /dev/null +++ b/tests/auto/customization/data/styles/identified/Popup.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.Popup { + id: control + objectName: "popup-identified" + + contentItem: Item { + id: contentItem + objectName: "popup-contentItem-identified" + } + + background: Item { + id: background + objectName: "popup-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/ProgressBar.qml b/tests/auto/customization/data/styles/identified/ProgressBar.qml new file mode 100644 index 00000000..6f22a986 --- /dev/null +++ b/tests/auto/customization/data/styles/identified/ProgressBar.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.ProgressBar { + id: control + objectName: "progressbar-identified" + + contentItem: Item { + id: contentItem + objectName: "progressbar-contentItem-identified" + } + + background: Item { + id: background + objectName: "progressbar-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/RadioButton.qml b/tests/auto/customization/data/styles/identified/RadioButton.qml new file mode 100644 index 00000000..356a9cdd --- /dev/null +++ b/tests/auto/customization/data/styles/identified/RadioButton.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.RadioButton { + id: control + objectName: "radiobutton-identified" + + indicator: Item { + id: indicator + objectName: "radiobutton-indicator-identified" + } + + contentItem: Item { + id: contentItem + objectName: "radiobutton-contentItem-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/RadioDelegate.qml b/tests/auto/customization/data/styles/identified/RadioDelegate.qml new file mode 100644 index 00000000..2af8728a --- /dev/null +++ b/tests/auto/customization/data/styles/identified/RadioDelegate.qml @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.RadioDelegate { + id: control + objectName: "radiodelegate-identified" + + indicator: Item { + id: indicator + objectName: "radiodelegate-indicator-identified" + } + + contentItem: Item { + id: contentItem + objectName: "radiodelegate-contentItem-identified" + } + + background: Item { + id: background + objectName: "radiodelegate-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/RangeSlider.qml b/tests/auto/customization/data/styles/identified/RangeSlider.qml new file mode 100644 index 00000000..02f2df4d --- /dev/null +++ b/tests/auto/customization/data/styles/identified/RangeSlider.qml @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.RangeSlider { + id: control + objectName: "rangeslider-identified" + + first.handle: Item { + id: firstHandle + objectName: "rangeslider-first.handle-identified" + } + + second.handle: Item { + id: secondHandle + objectName: "rangeslider-second.handle-identified" + } + + background: Item { + id: background + objectName: "rangeslider-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/RoundButton.qml b/tests/auto/customization/data/styles/identified/RoundButton.qml new file mode 100644 index 00000000..f8d56d7c --- /dev/null +++ b/tests/auto/customization/data/styles/identified/RoundButton.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.RoundButton { + id: control + objectName: "roundbutton-identified" + + contentItem: Item { + id: contentItem + objectName: "roundbutton-contentItem-identified" + } + + background: Item { + id: background + objectName: "roundbutton-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/ScrollBar.qml b/tests/auto/customization/data/styles/identified/ScrollBar.qml new file mode 100644 index 00000000..c07132db --- /dev/null +++ b/tests/auto/customization/data/styles/identified/ScrollBar.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.ScrollBar { + id: control + objectName: "scrollbar-identified" + + contentItem: Item { + id: contentItem + objectName: "scrollbar-contentItem-identified" + } + + background: Item { + id: background + objectName: "scrollbar-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/ScrollIndicator.qml b/tests/auto/customization/data/styles/identified/ScrollIndicator.qml new file mode 100644 index 00000000..91cbe662 --- /dev/null +++ b/tests/auto/customization/data/styles/identified/ScrollIndicator.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.ScrollIndicator { + id: control + objectName: "scrollindicator-identified" + + contentItem: Item { + id: contentItem + objectName: "scrollindicator-contentItem-identified" + } + + background: Item { + id: background + objectName: "scrollindicator-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/ScrollView.qml b/tests/auto/customization/data/styles/identified/ScrollView.qml new file mode 100644 index 00000000..983e00f7 --- /dev/null +++ b/tests/auto/customization/data/styles/identified/ScrollView.qml @@ -0,0 +1,62 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.ScrollView { + id: control + objectName: "scrollview-identified" + + background: Item { + id: background + objectName: "scrollview-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/Slider.qml b/tests/auto/customization/data/styles/identified/Slider.qml new file mode 100644 index 00000000..71bea7d3 --- /dev/null +++ b/tests/auto/customization/data/styles/identified/Slider.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.Slider { + id: control + objectName: "slider-identified" + + handle: Item { + id: handle + objectName: "slider-handle-identified" + } + + background: Item { + id: background + objectName: "slider-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/SpinBox.qml b/tests/auto/customization/data/styles/identified/SpinBox.qml new file mode 100644 index 00000000..1b044b82 --- /dev/null +++ b/tests/auto/customization/data/styles/identified/SpinBox.qml @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.SpinBox { + id: control + objectName: "spinbox-identified" + + up.indicator: Item { + id: upIndicator + objectName: "spinbox-up.indicator-identified" + } + + down.indicator: Item { + id: downIndicator + objectName: "spinbox-down.indicator-identified" + } + + contentItem: Item { + id: contentItem + objectName: "spinbox-contentItem-identified" + } + + background: Item { + id: background + objectName: "spinbox-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/StackView.qml b/tests/auto/customization/data/styles/identified/StackView.qml new file mode 100644 index 00000000..e227b6b2 --- /dev/null +++ b/tests/auto/customization/data/styles/identified/StackView.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.StackView { + id: control + objectName: "stackview-identified" + + contentItem: Item { + id: contentItem + objectName: "stackview-contentItem-identified" + } + + background: Item { + id: background + objectName: "stackview-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/SwipeDelegate.qml b/tests/auto/customization/data/styles/identified/SwipeDelegate.qml new file mode 100644 index 00000000..483273c8 --- /dev/null +++ b/tests/auto/customization/data/styles/identified/SwipeDelegate.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.SwipeDelegate { + id: control + objectName: "swipedelegate-identified" + + contentItem: Item { + id: contentItem + objectName: "swipedelegate-contentItem-identified" + } + + background: Item { + id: background + objectName: "swipedelegate-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/SwipeView.qml b/tests/auto/customization/data/styles/identified/SwipeView.qml new file mode 100644 index 00000000..ecb74803 --- /dev/null +++ b/tests/auto/customization/data/styles/identified/SwipeView.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.SwipeView { + id: control + objectName: "swipeview-identified" + + contentItem: Item { + id: contentItem + objectName: "swipeview-contentItem-identified" + } + + background: Item { + id: background + objectName: "swipeview-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/Switch.qml b/tests/auto/customization/data/styles/identified/Switch.qml new file mode 100644 index 00000000..dcdbfdf9 --- /dev/null +++ b/tests/auto/customization/data/styles/identified/Switch.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.Switch { + id: control + objectName: "switch-identified" + + indicator: Item { + id: indicator + objectName: "switch-indicator-identified" + } + + contentItem: Item { + id: contentItem + objectName: "switch-contentItem-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/SwitchDelegate.qml b/tests/auto/customization/data/styles/identified/SwitchDelegate.qml new file mode 100644 index 00000000..7eb87698 --- /dev/null +++ b/tests/auto/customization/data/styles/identified/SwitchDelegate.qml @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.SwitchDelegate { + id: control + objectName: "switchdelegate-identified" + + indicator: Item { + id: indicator + objectName: "switchdelegate-indicator-identified" + } + + contentItem: Item { + id: contentItem + objectName: "switchdelegate-contentItem-identified" + } + + background: Item { + id: background + objectName: "switchdelegate-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/TabBar.qml b/tests/auto/customization/data/styles/identified/TabBar.qml new file mode 100644 index 00000000..d79257a1 --- /dev/null +++ b/tests/auto/customization/data/styles/identified/TabBar.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.TabBar { + id: control + objectName: "tabbar-identified" + + contentItem: Item { + id: contentItem + objectName: "tabbar-contentItem-identified" + } + + background: Item { + id: background + objectName: "tabbar-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/TabButton.qml b/tests/auto/customization/data/styles/identified/TabButton.qml new file mode 100644 index 00000000..0bef790a --- /dev/null +++ b/tests/auto/customization/data/styles/identified/TabButton.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.TabButton { + id: control + objectName: "tabbutton-identified" + + contentItem: Item { + id: contentItem + objectName: "tabbutton-contentItem-identified" + } + + background: Item { + id: background + objectName: "tabbutton-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/TextArea.qml b/tests/auto/customization/data/styles/identified/TextArea.qml new file mode 100644 index 00000000..160bd264 --- /dev/null +++ b/tests/auto/customization/data/styles/identified/TextArea.qml @@ -0,0 +1,62 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.TextArea { + id: control + objectName: "textarea-identified" + + background: Item { + id: background + objectName: "textarea-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/TextField.qml b/tests/auto/customization/data/styles/identified/TextField.qml new file mode 100644 index 00000000..02fcbf20 --- /dev/null +++ b/tests/auto/customization/data/styles/identified/TextField.qml @@ -0,0 +1,62 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.TextField { + id: control + objectName: "textfield-identified" + + background: Item { + id: background + objectName: "textfield-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/ToolBar.qml b/tests/auto/customization/data/styles/identified/ToolBar.qml new file mode 100644 index 00000000..af571bb9 --- /dev/null +++ b/tests/auto/customization/data/styles/identified/ToolBar.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.ToolBar { + id: control + objectName: "toolbar-identified" + + contentItem: Item { + id: contentItem + objectName: "toolbar-contentItem-identified" + } + + background: Item { + id: background + objectName: "toolbar-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/ToolButton.qml b/tests/auto/customization/data/styles/identified/ToolButton.qml new file mode 100644 index 00000000..c5f875e0 --- /dev/null +++ b/tests/auto/customization/data/styles/identified/ToolButton.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.ToolButton { + id: control + objectName: "toolbutton-identified" + + contentItem: Item { + id: contentItem + objectName: "toolbutton-contentItem-identified" + } + + background: Item { + id: background + objectName: "toolbutton-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/ToolSeparator.qml b/tests/auto/customization/data/styles/identified/ToolSeparator.qml new file mode 100644 index 00000000..f682e35f --- /dev/null +++ b/tests/auto/customization/data/styles/identified/ToolSeparator.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.ToolSeparator { + id: control + objectName: "toolseparator-identified" + + contentItem: Item { + id: contentItem + objectName: "toolseparator-contentItem-identified" + } + + background: Item { + id: background + objectName: "toolseparator-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/ToolTip.qml b/tests/auto/customization/data/styles/identified/ToolTip.qml new file mode 100644 index 00000000..efe727e8 --- /dev/null +++ b/tests/auto/customization/data/styles/identified/ToolTip.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.ToolTip { + id: control + objectName: "tooltip-identified" + + contentItem: Item { + id: contentItem + objectName: "tooltip-contentItem-identified" + } + + background: Item { + id: background + objectName: "tooltip-background-identified" + } +} diff --git a/tests/auto/customization/data/styles/identified/Tumbler.qml b/tests/auto/customization/data/styles/identified/Tumbler.qml new file mode 100644 index 00000000..faef7125 --- /dev/null +++ b/tests/auto/customization/data/styles/identified/Tumbler.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Templates 2.2 as T + +T.Tumbler { + id: control + objectName: "tumbler-identified" + + contentItem: ListView { + id: contentItem + objectName: "tumbler-contentItem-identified" + } + + background: Item { + id: background + objectName: "tumbler-background-identified" + } +} diff --git a/tests/auto/customization/tst_customization.cpp b/tests/auto/customization/tst_customization.cpp index 4c8ea72b..48dd4048 100644 --- a/tests/auto/customization/tst_customization.cpp +++ b/tests/auto/customization/tst_customization.cpp @@ -115,6 +115,9 @@ private slots: void creation_data(); void creation(); + void override_data(); + void override(); + void comboPopup(); private: @@ -122,7 +125,7 @@ private: void addHooks(); void removeHooks(); - QObject* createControl(const QString &type, QString *error); + QObject* createControl(const QString &type, const QString &qml, QString *error); QQmlEngine *engine = nullptr; }; @@ -190,10 +193,10 @@ void tst_customization::reset() qt_destroyedParentQObjects()->clear(); } -QObject* tst_customization::createControl(const QString &name, QString *error) +QObject* tst_customization::createControl(const QString &name, const QString &qml, QString *error) { QQmlComponent component(engine); - component.setData("import QtQuick.Controls 2.2; " + name.toUtf8() + " { }", QUrl()); + component.setData("import QtQuick 2.9; import QtQuick.Controls 2.2; " + name.toUtf8() + " { " + qml.toUtf8() + " }", QUrl()); QObject *obj = component.create(); if (!obj) *error = component.errorString(); @@ -214,6 +217,10 @@ void tst_customization::creation_data() for (const ControlInfo &control : ControlInfos) QTest::newRow(qPrintable("incomplete:" + control.type)) << "incomplete" << control.type << control.delegates; + // the "identified" style has IDs in the delegates (prevents deferred execution) + for (const ControlInfo &control : ControlInfos) + QTest::newRow(qPrintable("identified:" + control.type)) << "identified" << control.type << control.delegates; + // the "simple" style simulates a proper style and contains bindings to/in delegates for (const ControlInfo &control : ControlInfos) QTest::newRow(qPrintable("simple:" + control.type)) << "simple" << control.type << control.delegates; @@ -235,23 +242,38 @@ void tst_customization::creation() QQuickStyle::setStyle(testFile("styles/" + style)); QString error; - QScopedPointer control(createControl(type, &error)); + QScopedPointer control(createControl(type, "", &error)); QVERIFY2(control, qPrintable(error)); QByteArray templateType = "QQuick" + type.toUtf8(); QVERIFY2(control->inherits(templateType), qPrintable(type + " does not inherit " + templateType + " (" + control->metaObject()->className() + ")")); + // -