diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-08-09 15:25:43 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2016-08-09 15:25:43 +0000 |
commit | 600a6dcfaf87905317e485bbe2894ab189749d92 (patch) | |
tree | bcf254b0f8e6478c3e718c3a3865cc8dffe29cb4 | |
parent | 3a07d1b2e102826f13c80361fe5491ec44c173a6 (diff) | |
parent | 6a6eaec0e8c2d4cd1ffbe2fe154a3a3caad54dc9 (diff) |
Merge "Merge remote-tracking branch 'origin/5.7' into dev" into refs/staging/dev
-rw-r--r-- | src/imports/controls/doc/qtquickcontrols2.qdocconf | 8 | ||||
-rw-r--r-- | src/imports/controls/doc/src/qtquickcontrols2-delegates.qdoc | 7 | ||||
-rw-r--r-- | src/imports/controls/doc/src/qtquickcontrols2-material.qdoc | 96 | ||||
-rw-r--r-- | src/imports/controls/doc/src/qtquickcontrols2-universal.qdoc | 37 | ||||
-rw-r--r-- | src/quicktemplates2/qquickapplicationwindow.cpp | 4 | ||||
-rw-r--r-- | src/quicktemplates2/qquickcombobox.cpp | 6 | ||||
-rw-r--r-- | src/quicktemplates2/qquickpage.cpp | 1 | ||||
-rw-r--r-- | src/quicktemplates2/qquickpagelayout.cpp | 4 | ||||
-rw-r--r-- | src/quicktemplates2/qquickswipedelegate.cpp | 1 | ||||
-rw-r--r-- | tests/auto/applicationwindow/data/layout.qml | 51 | ||||
-rw-r--r-- | tests/auto/applicationwindow/tst_applicationwindow.cpp | 48 | ||||
-rw-r--r-- | tests/auto/controls/data/tst_combobox.qml | 20 | ||||
-rw-r--r-- | tests/auto/controls/data/tst_page.qml | 12 |
13 files changed, 249 insertions, 46 deletions
diff --git a/src/imports/controls/doc/qtquickcontrols2.qdocconf b/src/imports/controls/doc/qtquickcontrols2.qdocconf index a01b48e5..49725b93 100644 --- a/src/imports/controls/doc/qtquickcontrols2.qdocconf +++ b/src/imports/controls/doc/qtquickcontrols2.qdocconf @@ -76,6 +76,14 @@ macro.endstyleproperty = "\\br" macro.stylemethod.HTML = "<div class=\"qmlproto\"><table class=\"qmlname\"><tbody><tr valign=\"top\" class=\"odd\" id=\"\5\"><td class=\"tblQmlFuncNode\"><p><span class=\"type\">\1</span> <span class=\"name\">\2</span>(<span class="type">\3</span> <i>\4</i>)</p></td></tr></tbody></table></div>" macro.endstylemethod = "\\br" +# \stylemethod2 {returntype} {methodname} {arg1type} {arg1name} {arg2type} {arg2name} {html-target-id} +# \target html-target-id +# This method returns ... +# (empty line) +# \endstylemethod2 +macro.stylemethod2.HTML = "<div class=\"qmlproto\"><table class=\"qmlname\"><tbody><tr valign=\"top\" class=\"odd\" id=\"\7\"><td class=\"tblQmlFuncNode\"><p><span class=\"type\">\1</span> <span class=\"name\">\2</span>(<span class="type">\3</span> <i>\4</i>, <span class="type">\5</span> <i>\6</i>)</p></td></tr></tbody></table></div>" +macro.endstylemethod2 = "\\br" + # \stylecolor {#6A00FF} {(default)} macro.stylecolor.HTML = "<div style=\"padding:10px;color:#fff;background:\1;\">\1 \2</div>" diff --git a/src/imports/controls/doc/src/qtquickcontrols2-delegates.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-delegates.qdoc index 0ecfdf42..33b97850 100644 --- a/src/imports/controls/doc/src/qtquickcontrols2-delegates.qdoc +++ b/src/imports/controls/doc/src/qtquickcontrols2-delegates.qdoc @@ -57,6 +57,13 @@ \b {See also} \l {RadioButton Control}. + \section1 SwipeDelegate Control + + \image qtquickcontrols2-swipedelegate.gif + + \l SwipeDelegate presents a view item that can be swiped left or right to + expose more options or information. + \section1 SwitchDelegate Control \image qtquickcontrols2-switchdelegate.gif diff --git a/src/imports/controls/doc/src/qtquickcontrols2-material.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-material.qdoc index 32660ff7..818ad7fd 100644 --- a/src/imports/controls/doc/src/qtquickcontrols2-material.qdoc +++ b/src/imports/controls/doc/src/qtquickcontrols2-material.qdoc @@ -37,17 +37,17 @@ \section1 Attached Properties \list - \li \l {accent-attached-prop}{\b accent} : color - \li \l {background-attached-prop}{\b background} : color - \li \l {foreground-attached-prop}{\b foreground} : color - \li \l {primary-attached-prop}{\b primary} : color - \li \l {theme-attached-prop}{\b theme} : enumeration + \li \l {material-accent-attached-prop}{\b accent} : color + \li \l {material-background-attached-prop}{\b background} : color + \li \l {material-foreground-attached-prop}{\b foreground} : color + \li \l {material-primary-attached-prop}{\b primary} : color + \li \l {material-theme-attached-prop}{\b theme} : enumeration \endlist \section1 Attached Methods \list - \li color \l {color-attached-method}{\b color}(enumeration predefined) + \li color \l {material-color-attached-method}{\b color}(enumeration predefined, enumeration shade) \endlist \section1 Detailed Description @@ -60,6 +60,9 @@ \image qtquickcontrols2-material.png \caption The Material style in light and dark themes + To run an application with the Material style, see + \l {Using Styles in Qt Quick Controls 2}. + \note The Material style is not a native Android style. The Material style is a 100% cross-platform Qt Quick Controls 2 style implementation that follows the Google Material Design Guidelines. The style runs on any @@ -69,9 +72,9 @@ \section2 Customization - The Material style allows customizing five attributes, \l {theme-attached-prop}{theme}, - \l {primary-attached-prop}{primary}, \l {accent-attached-prop}{accent}, - \l {foreground-attached-prop}{foreground}, and \l {background-attached-prop}{background}. + The Material style allows customizing five attributes, \l {material-theme-attached-prop}{theme}, + \l {material-primary-attached-prop}{primary}, \l {material-accent-attached-prop}{accent}, + \l {material-foreground-attached-prop}{foreground}, and \l {material-background-attached-prop}{background}. \image qtquickcontrols2-material-attributes.png @@ -141,7 +144,7 @@ \li Description \row \li \c QT_QUICK_CONTROLS_MATERIAL_THEME - \li The value can be one of the available \l {theme-attached-prop}{themes}, + \li The value can be one of the available \l {material-theme-attached-prop}{themes}, for example \c "Dark". \row \li \c QT_QUICK_CONTROLS_MATERIAL_ACCENT @@ -206,12 +209,56 @@ \value Material.Grey \stylecolor {#9E9E9E} {} \value Material.BlueGrey \stylecolor {#607D8B} {} + When the dark theme is in use, different \l {Pre-defined Shades}{shades} of + the pre-defined colors are used by default: + + \value Material.Red \stylecolor {#EF9A9A} {} + \value Material.Pink \stylecolor {#F48FB1} {(default accent)} + \value Material.Purple \stylecolor {#CE93D8} {} + \value Material.DeepPurple \stylecolor {#B39DDB} {} + \value Material.Indigo \stylecolor {#9FA8DA} {(default primary)} + \value Material.Blue \stylecolor {#90CAF9} {} + \value Material.LightBlue \stylecolor {#81D4FA} {} + \value Material.Cyan \stylecolor {#80DEEA} {} + \value Material.Teal \stylecolor {#80CBC4} {} + \value Material.Green \stylecolor {#A5D6A7} {} + \value Material.LightGreen \stylecolor {#C5E1A5} {} + \value Material.Lime \stylecolor {#E6EE9C} {} + \value Material.Yellow \stylecolor {#FFF59D} {} + \value Material.Amber \stylecolor {#FFE082} {} + \value Material.Orange \stylecolor {#FFCC80} {} + \value Material.DeepOrange \stylecolor {#FFAB91} {} + \value Material.Brown \stylecolor {#BCAAA4} {} + \value Material.Grey \stylecolor {#EEEEEE} {} + \value Material.BlueGrey \stylecolor {#B0BEC5} {} + + \section2 Pre-defined Shades + + There are several different + \l {https://material.google.com/style/color.html#color-color-palette}{shades} + of each \l {Pre-defined Colors}{pre-defined color} that can be passed to the + \l {material-color-attached-method}{Material.color()} function: + \value Material.Shade50 + \value Material.Shade100 + \value Material.Shade200 + \value Material.Shade300 + \value Material.Shade400 + \value Material.Shade500 + \value Material.Shade600 + \value Material.Shade700 + \value Material.Shade800 + \value Material.Shade900 + \value Material.ShadeA100 + \value Material.ShadeA200 + \value Material.ShadeA400 + \value Material.ShadeA700 + \b {See also} \l {Default Style}, \l {Universal Style} \section1 Attached Property Documentation - \styleproperty {Material.accent} {color} {accent-attached-prop} - \target accent-attached-prop + \styleproperty {Material.accent} {color} {material-accent-attached-prop} + \target material-accent-attached-prop This attached property holds the accent color of the theme. The property can be attached to any window or item. The value is propagated to children. @@ -223,8 +270,8 @@ \endstyleproperty - \styleproperty {Material.background} {color} {background-attached-prop} - \target background-attached-prop + \styleproperty {Material.background} {color} {material-background-attached-prop} + \target material-background-attached-prop This attached property holds the background color of the theme. The property can be attached to any window or item. The value is propagated to children. @@ -232,8 +279,8 @@ \endstyleproperty - \styleproperty {Material.foreground} {color} {foreground-attached-prop} - \target foreground-attached-prop + \styleproperty {Material.foreground} {color} {material-foreground-attached-prop} + \target material-foreground-attached-prop This attached property holds the foreground color of the theme. The property can be attached to any window or item. The value is propagated to children. @@ -241,8 +288,8 @@ \endstyleproperty - \styleproperty {Material.primary} {color} {primary-attached-prop} - \target primary-attached-prop + \styleproperty {Material.primary} {color} {material-primary-attached-prop} + \target material-primary-attached-prop This attached property holds the primary color of the theme. The property can be attached to any window or item. The value is propagated to children. @@ -254,8 +301,8 @@ \endstyleproperty - \styleproperty {Material.theme} {enumeration} {theme-attached-prop} - \target theme-attached-prop + \styleproperty {Material.theme} {enumeration} {material-theme-attached-prop} + \target material-theme-attached-prop This attached property holds whether the theme is light or dark. The property can be attached to any window or item. The value is propagated to children. @@ -272,10 +319,11 @@ \section1 Attached Method Documentation - \stylemethod {color} {color} {enumeration} {predefined} {color-attached-method} - \target color-attached-method + \stylemethod2 {color} {color} {enumeration} {predefined} {enumeration} {shade} {material-color-attached-method} + \target material-color-attached-method This attached method returns the color value of the specified \l {pre-defined colors} - {pre-defined color}. + {pre-defined color} combined with the given \l {pre-defined colors}{shade}. + If omitted, the shade argument defaults to \c Material.Shade500. \qml import QtQuick 2.0 @@ -286,7 +334,7 @@ } \endqml - \endstylemethod + \endstylemethod2 \section1 Related Information diff --git a/src/imports/controls/doc/src/qtquickcontrols2-universal.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-universal.qdoc index f1f97c87..db1e2766 100644 --- a/src/imports/controls/doc/src/qtquickcontrols2-universal.qdoc +++ b/src/imports/controls/doc/src/qtquickcontrols2-universal.qdoc @@ -37,10 +37,10 @@ \section1 Attached Properties \list - \li \l {accent-attached-prop}{\b accent} : color - \li \l {background-attached-prop}{\b background} : color - \li \l {foreground-attached-prop}{\b foreground} : color - \li \l {theme-attached-prop}{\b theme} : enumeration + \li \l {universal-accent-attached-prop}{\b accent} : color + \li \l {universal-background-attached-prop}{\b background} : color + \li \l {universal-foreground-attached-prop}{\b foreground} : color + \li \l {universal-theme-attached-prop}{\b theme} : enumeration \endlist \section1 Attached Methods @@ -60,6 +60,9 @@ \image qtquickcontrols2-universal.png \caption The Universal style in light and dark themes + To run an application with the Universal style, see + \l {Using Styles in Qt Quick Controls 2}. + \note The Universal style is not a native Windows 10 style. The Universal style is a 100% cross-platform Qt Quick Controls 2 style implementation that follows the Microsoft Universal Design Guidelines. The style runs on any @@ -69,9 +72,9 @@ \section2 Customization - The Universal style allows customizing four attributes, \l {theme-attached-prop}{theme}, - \l {accent-attached-prop}{accent}, \l {foreground-attached-prop}{foreground}, and - \l {background-attached-prop}{background}. + The Universal style allows customizing four attributes, \l {universal-theme-attached-prop}{theme}, + \l {universal-accent-attached-prop}{accent}, \l {universal-foreground-attached-prop}{foreground}, and + \l {universal-background-attached-prop}{background}. \image qtquickcontrols2-universal-attributes.png @@ -141,12 +144,12 @@ \li Description \row \li \c QT_QUICK_CONTROLS_UNIVERSAL_THEME - \li The value can be one of the available \l {theme-attached-prop}{themes}, + \li The value can be one of the available \l {universal-theme-attached-prop}{themes}, for example \c "Dark". \row \li \c QT_QUICK_CONTROLS_UNIVERSAL_ACCENT \li The value can be any \l {colorbasictypedocs}{color}, but it is recommended - to use one of the pre-defined \l {accent-attached-prop} {accents}, for + to use one of the pre-defined \l {universal-accent-attached-prop} {accents}, for example \c "Violet". \endtable @@ -169,8 +172,8 @@ \section1 Attached Property Documentation - \styleproperty {Universal.accent} {color} {accent-attached-prop} - \target accent-attached-prop + \styleproperty {Universal.accent} {color} {universal-accent-attached-prop} + \target universal-accent-attached-prop This attached property holds the accent color of the theme. The property can be attached to any window or item. The value is propagated to children. @@ -201,8 +204,8 @@ \endstyleproperty - \styleproperty {Universal.background} {color} {background-attached-prop} - \target background-attached-prop + \styleproperty {Universal.background} {color} {universal-background-attached-prop} + \target universal-background-attached-prop This attached property holds the background color of the theme. The property can be attached to any window or item. The value is propagated to children. @@ -210,15 +213,15 @@ \endstyleproperty - \styleproperty {Universal.foreground} {color} {foreground-attached-prop} - \target foreground-attached-prop + \styleproperty {Universal.foreground} {color} {universal-foreground-attached-prop} + \target universal-foreground-attached-prop This attached property holds the foreground color of the theme. The property can be attached to any window or item. The value is propagated to children. The default value is theme-specific (light or dark). - \styleproperty {Universal.theme} {enumeration} {theme-attached-prop} - \target theme-attached-prop + \styleproperty {Universal.theme} {enumeration} {universal-theme-attached-prop} + \target universal-theme-attached-prop This attached property holds whether the theme is light or dark. The property can be attached to any window or item. The value is propagated to children. diff --git a/src/quicktemplates2/qquickapplicationwindow.cpp b/src/quicktemplates2/qquickapplicationwindow.cpp index 714bfede..af14ba6f 100644 --- a/src/quicktemplates2/qquickapplicationwindow.cpp +++ b/src/quicktemplates2/qquickapplicationwindow.cpp @@ -151,8 +151,8 @@ void QQuickApplicationWindowPrivate::relayout() { Q_Q(QQuickApplicationWindow); QQuickItem *content = q->contentItem(); - qreal hh = header ? header->height() : 0; - qreal fh = footer ? footer->height() : 0; + qreal hh = header && header->isVisible() ? header->height() : 0; + qreal fh = footer && footer->isVisible() ? footer->height() : 0; content->setY(hh); content->setWidth(q->width()); diff --git a/src/quicktemplates2/qquickcombobox.cpp b/src/quicktemplates2/qquickcombobox.cpp index c70f8839..f6dfa195 100644 --- a/src/quicktemplates2/qquickcombobox.cpp +++ b/src/quicktemplates2/qquickcombobox.cpp @@ -40,6 +40,7 @@ #include "qquickpopup_p_p.h" #include <QtCore/qregexp.h> +#include <QtCore/qabstractitemmodel.h> #include <QtGui/qpa/qplatformtheme.h> #include <QtQml/qjsvalue.h> #include <QtQml/qqmlcontext.h> @@ -410,6 +411,11 @@ void QQuickComboBox::setModel(const QVariant& m) if (d->model == model) return; + if (QAbstractItemModel* aim = qvariant_cast<QAbstractItemModel *>(d->model)) + QObjectPrivate::disconnect(aim, &QAbstractItemModel::dataChanged, d, &QQuickComboBoxPrivate::updateCurrentText); + if (QAbstractItemModel* aim = qvariant_cast<QAbstractItemModel *>(model)) + QObjectPrivate::connect(aim, &QAbstractItemModel::dataChanged, d, &QQuickComboBoxPrivate::updateCurrentText); + d->model = model; d->createDelegateModel(); if (isComponentComplete()) { diff --git a/src/quicktemplates2/qquickpage.cpp b/src/quicktemplates2/qquickpage.cpp index 67b1f063..4304c4fb 100644 --- a/src/quicktemplates2/qquickpage.cpp +++ b/src/quicktemplates2/qquickpage.cpp @@ -91,7 +91,6 @@ public: QScopedPointer<QQuickPageLayout> layout; }; - QQuickPage::QQuickPage(QQuickItem *parent) : QQuickControl(*(new QQuickPagePrivate), parent) { diff --git a/src/quicktemplates2/qquickpagelayout.cpp b/src/quicktemplates2/qquickpagelayout.cpp index 16354c5a..a1747b47 100644 --- a/src/quicktemplates2/qquickpagelayout.cpp +++ b/src/quicktemplates2/qquickpagelayout.cpp @@ -140,8 +140,8 @@ void QQuickPageLayout::update() { QQuickItem *content = m_control->contentItem(); - const qreal hh = m_header ? m_header->height() : 0; - const qreal fh = m_footer ? m_footer->height() : 0; + const qreal hh = m_header && m_header->isVisible() ? m_header->height() : 0; + const qreal fh = m_footer && m_footer->isVisible() ? m_footer->height() : 0; content->setY(hh + m_control->topPadding()); content->setX(m_control->leftPadding()); diff --git a/src/quicktemplates2/qquickswipedelegate.cpp b/src/quicktemplates2/qquickswipedelegate.cpp index d266ca86..1d5d3496 100644 --- a/src/quicktemplates2/qquickswipedelegate.cpp +++ b/src/quicktemplates2/qquickswipedelegate.cpp @@ -52,6 +52,7 @@ QT_BEGIN_NAMESPACE \instantiates QQuickSwipeDelegate \inqmlmodule QtQuick.Controls \since 5.7 + \ingroup qtquickcontrols2-delegates \brief A swipable item delegate. SwipeDelegate presents a view item that can be swiped left or right to diff --git a/tests/auto/applicationwindow/data/layout.qml b/tests/auto/applicationwindow/data/layout.qml new file mode 100644 index 00000000..2174b78e --- /dev/null +++ b/tests/auto/applicationwindow/data/layout.qml @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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.6 +import QtQuick.Controls 2.0 + +ApplicationWindow { + width: 200 + height: 200 + visible: true + + header: ToolBar { } + footer: ToolBar { } +} diff --git a/tests/auto/applicationwindow/tst_applicationwindow.cpp b/tests/auto/applicationwindow/tst_applicationwindow.cpp index 97fa767f..b712075f 100644 --- a/tests/auto/applicationwindow/tst_applicationwindow.cpp +++ b/tests/auto/applicationwindow/tst_applicationwindow.cpp @@ -72,6 +72,7 @@ private slots: void activeFocusControl_data(); void activeFocusControl(); void focusAfterPopupClosed(); + void layout(); }; void tst_applicationwindow::qmlCreation() @@ -684,6 +685,53 @@ void tst_applicationwindow::focusAfterPopupClosed() QCOMPARE(spy.count(), 2); } +void tst_applicationwindow::layout() +{ + QQmlEngine engine; + QQmlComponent component(&engine); + component.loadUrl(testFileUrl("layout.qml")); + QScopedPointer<QObject> object(component.create()); + QVERIFY(!object.isNull()); + + QQuickApplicationWindow* window = qobject_cast<QQuickApplicationWindow*>(object.data()); + QVERIFY(window); + QVERIFY(QTest::qWaitForWindowExposed(window)); + + QQuickItem *content = window->contentItem(); + QVERIFY(content); + QQuickItem *header = window->header(); + QVERIFY(header); + QQuickItem *footer = window->footer(); + QVERIFY(footer); + + QCOMPARE(header->x(), 0.0); + QCOMPARE(header->y(), -header->height()); + QCOMPARE(header->width(), qreal(window->width())); + QVERIFY(header->height() > 0); + + QCOMPARE(footer->x(), 0.0); + QCOMPARE(footer->y(), content->height()); + QCOMPARE(footer->width(), qreal(window->width())); + QVERIFY(footer->height() > 0.0); + + QCOMPARE(content->x(), 0.0); + QCOMPARE(content->y(), header->height()); + QCOMPARE(content->width(), qreal(window->width())); + QCOMPARE(content->height(), window->height() - header->height() - footer->height()); + + header->setVisible(false); + QCOMPARE(content->x(), 0.0); + QCOMPARE(content->y(), 0.0); + QCOMPARE(content->width(), qreal(window->width())); + QCOMPARE(content->height(), window->height() - footer->height()); + + footer->setVisible(false); + QCOMPARE(content->x(), 0.0); + QCOMPARE(content->y(), 0.0); + QCOMPARE(content->width(), qreal(window->width())); + QCOMPARE(content->height(), qreal(window->height())); +} + QTEST_MAIN(tst_applicationwindow) #include "tst_applicationwindow.moc" diff --git a/tests/auto/controls/data/tst_combobox.qml b/tests/auto/controls/data/tst_combobox.qml index 4697eea9..53ed1cac 100644 --- a/tests/auto/controls/data/tst_combobox.qml +++ b/tests/auto/controls/data/tst_combobox.qml @@ -840,4 +840,24 @@ TestCase { control.destroy() } + + // QTBUG-55118 + function test_currentText() { + var control = comboBox.createObject(testCase, {model: listmodel}) + verify(control) + + compare(control.currentIndex, 0) + compare(control.currentText, "First") + + listmodel.setProperty(0, "text", "1st") + compare(control.currentText, "1st") + + control.currentIndex = 1 + compare(control.currentText, "Second") + + listmodel.setProperty(0, "text", "First") + compare(control.currentText, "Second") + + control.destroy() + } } diff --git a/tests/auto/controls/data/tst_page.qml b/tests/auto/controls/data/tst_page.qml index a417805e..3cd6b7b8 100644 --- a/tests/auto/controls/data/tst_page.qml +++ b/tests/auto/controls/data/tst_page.qml @@ -112,6 +112,18 @@ TestCase { compare(control.contentItem.width, control.availableWidth) compare(control.contentItem.height, control.availableHeight - control.header.height - control.footer.height) + control.header.visible = false + compare(control.contentItem.x, control.leftPadding) + compare(control.contentItem.y, control.topPadding) + compare(control.contentItem.width, control.availableWidth) + compare(control.contentItem.height, control.availableHeight - control.footer.height) + + control.footer.visible = false + compare(control.contentItem.x, control.leftPadding) + compare(control.contentItem.y, control.topPadding) + compare(control.contentItem.width, control.availableWidth) + compare(control.contentItem.height, control.availableHeight) + control.destroy() } } |