diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-02-24 15:13:37 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-02-24 15:13:36 +0000 |
commit | 22624517ccbe780937ec2ba0b4264b71e38484bb (patch) | |
tree | 670113a73de4bca1af1375505d0ca11760185ae7 /tests | |
parent | 8a4db8ec31426a3ca2697ec868f566ba43bbe597 (diff) |
Fix QQuickPopup to respect explicit size
Don't resize the popup (clamping to its implicit size) unless
the popup really has to be resized in order to fit the screen.
Change-Id: I81201b77a1001ac22291ede1fc685f7208ff2916
Task-number: QTBUG-51322
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/controls/data/tst_popup.qml | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/tests/auto/controls/data/tst_popup.qml b/tests/auto/controls/data/tst_popup.qml index 20859dac..7a34834e 100644 --- a/tests/auto/controls/data/tst_popup.qml +++ b/tests/auto/controls/data/tst_popup.qml @@ -52,11 +52,16 @@ TestCase { name: "Popup" Component { - id: popup + id: popupTemplate T.Popup { } } Component { + id: popupControl + Popup { } + } + + Component { id: rect Rectangle { } } @@ -97,7 +102,7 @@ TestCase { } function test_padding() { - var control = popup.createObject(testCase) + var control = popupTemplate.createObject(testCase) verify(control) paddingSpy.target = control @@ -205,7 +210,7 @@ TestCase { } function test_availableSize() { - var control = popup.createObject(testCase) + var control = popupTemplate.createObject(testCase) verify(control) availableWidthSpy.target = control @@ -277,7 +282,7 @@ TestCase { } function test_background() { - var control = popup.createObject(testCase) + var control = popupTemplate.createObject(testCase) verify(control) control.background = rect.createObject(testCase) @@ -591,4 +596,20 @@ TestCase { control.destroy() } + + function test_size() { + var control = popupControl.createObject(testCase) + verify(control) + + control.width = 200 + control.height = 200 + + control.open() + waitForRendering(control.contentItem) + + compare(control.width, 200) + compare(control.height, 200) + + control.destroy() + } } |