diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2018-01-31 09:04:29 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2018-01-31 13:01:04 +0100 |
commit | 5d27e14e4ca49263d9c3309b5e93d4cb386063cc (patch) | |
tree | 714832e22d596c721744fd080148856a95f6d8f5 /tests/auto | |
parent | ac6f4903aeb2e8399b5aa538b35a760f0392568c (diff) | |
parent | c3858bd53974e486e03537d1937deb0020828556 (diff) |
Merge remote-tracking branch 'origin/5.9' into 5.10
Change-Id: I697f98d5214f487c915032d744ec593da05368a8
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/controls/data/tst_popup.qml | 8 | ||||
-rw-r--r-- | tests/auto/customization/tst_customization.cpp | 14 |
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_popup.qml b/tests/auto/controls/data/tst_popup.qml index 88ec295f..3f9f5e48 100644 --- a/tests/auto/controls/data/tst_popup.qml +++ b/tests/auto/controls/data/tst_popup.qml @@ -1261,4 +1261,12 @@ TestCase { control.open() verify(control.visible) } + + function test_deferredBackgroundSize() { + var control = createTemporaryObject(popupControl, testCase, {width: 200, height: 100}) + verify(control) + + compare(control.background.width, 200 + (control.background.leftInset || 0) + (control.background.rightInset || 0)) + compare(control.background.height, 100 + (control.background.topInset || 0) + (control.background.bottomInset || 0)) + } } diff --git a/tests/auto/customization/tst_customization.cpp b/tests/auto/customization/tst_customization.cpp index 91b5706c..91646653 100644 --- a/tests/auto/customization/tst_customization.cpp +++ b/tests/auto/customization/tst_customization.cpp @@ -487,6 +487,20 @@ void tst_customization::comboPopup() QTest::mouseClick(&window, Qt::LeftButton, Qt::NoModifier, QPoint(1, 1)); QVERIFY(qt_createdQObjects()->contains("combobox-popup-simple")); } + + reset(); + + { + // test that ComboBox::popup is completed upon component completion (if appropriate) + QQmlComponent component(engine); + component.setData("import QtQuick 2.9; import QtQuick.Controls 2.2; ComboBox { id: control; contentItem: Item { visible: !control.popup.visible } popup: Popup { property bool wasCompleted: false; Component.onCompleted: wasCompleted = true } }", QUrl()); + QScopedPointer<QQuickItem> comboBox(qobject_cast<QQuickItem *>(component.create())); + QVERIFY(comboBox); + + QObject *popup = comboBox->property("popup").value<QObject *>(); + QVERIFY(popup); + QCOMPARE(popup->property("wasCompleted"), QVariant(true)); + } } QTEST_MAIN(tst_customization) |