blob: 920273e1fd77aa4db2e5885e1c8b40b0092bba3b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
From 83046de497827a69bf05cd0b06ca6421b51e02b8 Mon Sep 17 00:00:00 2001
From: J-P Nurmi <jpnurmi@qt.io>
Date: Mon, 22 Jan 2018 10:58:06 +0100
Subject: [PATCH] Control: fix background size regression caused by deferred
execution
Task-number: QTBUG-65880
Change-Id: Ic4f9fb087f4a78bd4c6257828011240186b6b22e
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
---
src/quicktemplates2/qquickcontrol.cpp | 1 +
tests/auto/controls/data/tst_popup.qml | 8 ++++++++
2 files changed, 9 insertions(+)
diff --git a/src/quicktemplates2/qquickcontrol.cpp b/src/quicktemplates2/qquickcontrol.cpp
index 6fbd4c07..957936df 100644
--- a/src/quicktemplates2/qquickcontrol.cpp
+++ b/src/quicktemplates2/qquickcontrol.cpp
@@ -1343,6 +1343,7 @@ void QQuickControl::componentComplete()
d->executeBackground(true);
d->executeContentItem(true);
QQuickItem::componentComplete();
+ d->resizeBackground();
d->resizeContent();
if (!d->hasLocale)
d->locale = QQuickControlPrivate::calcLocale(d->parentItem);
diff --git a/tests/auto/controls/data/tst_popup.qml b/tests/auto/controls/data/tst_popup.qml
index bec50ad0..1f3a097f 100644
--- a/tests/auto/controls/data/tst_popup.qml
+++ b/tests/auto/controls/data/tst_popup.qml
@@ -1253,4 +1253,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)
+ compare(control.background.height, 100)
+ }
}
|