diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-09-20 17:23:16 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-09-21 21:39:31 +0000 |
commit | 3ed4944a7e21191ee726ca31c4e50bd055f9d25b (patch) | |
tree | 32a6d49e881413b6c5758078fb039468abc4ebdf /tests/auto | |
parent | 8a4af9e87704f7b8ed269114d3ab75430bd61998 (diff) |
Fix QQuickPopup::resetWidth/Height()
When reseting the explicit size of a popup, the popup items geometry
does not necessarily change. However, it affects the positioning of
the popup whether it has explicit size or not. For that reason we
must ensure that the popup gets repositioned as appropriate.
Change-Id: I2dcd895eb7a1adc9c6a804bed4731edac1d550ec
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/controls/data/tst_popup.qml | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_popup.qml b/tests/auto/controls/data/tst_popup.qml index ae1c7185..8d8f94b7 100644 --- a/tests/auto/controls/data/tst_popup.qml +++ b/tests/auto/controls/data/tst_popup.qml @@ -355,6 +355,24 @@ TestCase { control.destroy() } + function test_resetSize() { + var control = popupControl.createObject(testCase, {visible: true, margins: 0}) + verify(control) + + control.width = control.implicitWidth = testCase.width + 10 + control.height = control.implicitHeight = testCase.height + 10 + + compare(control.width, testCase.width + 10) + compare(control.height, testCase.height + 10) + + control.width = undefined + control.height = undefined + compare(control.width, testCase.width) + compare(control.height, testCase.height) + + control.destroy() + } + function test_negativeMargins() { var control = popupControl.createObject(testCase, {implicitWidth: testCase.width, implicitHeight: testCase.height}) verify(control) |