diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-05-23 11:53:42 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-05-23 09:55:36 +0000 |
commit | f0ceecaf0b51809a076ed0add159c95cada528bf (patch) | |
tree | 482e80cc6dd707ba2858d95d6f8fe00c5dd13d78 /src | |
parent | bac9cc5b55294655ba08f424f402d21f46c00c15 (diff) |
Improve Control::background automatic resizing
- width follows only if x and width are both not specified
- height follows only if y and height are both not specified
Change-Id: Ib881daa9da339baac53f7f9d4de6e5bdad7723e2
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/controls/qquickcontrol.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/controls/qquickcontrol.cpp b/src/controls/qquickcontrol.cpp index 26e68b9f..ac4c257d 100644 --- a/src/controls/qquickcontrol.cpp +++ b/src/controls/qquickcontrol.cpp @@ -127,11 +127,11 @@ void QQuickControlPrivate::resizeBackground() Q_Q(QQuickControl); if (background) { QQuickItemPrivate *p = QQuickItemPrivate::get(background); - if (!p->widthValid) { + if (!p->widthValid && qFuzzyIsNull(background->x())) { background->setWidth(q->width()); p->widthValid = false; } - if (!p->heightValid) { + if (!p->heightValid && qFuzzyIsNull(background->y())) { background->setHeight(q->height()); p->heightValid = false; } |