diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2021-06-29 12:09:17 +0200 |
---|---|---|
committer | Igor Bugaev <freedbrt@gmail.com> | 2021-07-07 23:35:17 +0300 |
commit | 2a4ff847e8c018f31b14ecffd229d3793138ab1b (patch) | |
tree | 152451ec1f797c433a6020f35be95f28843b7f24 /src/quicktemplates2/qquicktextfield.cpp | |
parent | 7ac7ffac8582aea6c8d4a6f8de8543e6f15974a4 (diff) |
Adjust to QQuickItemPrivate::{width,height}Valid becoming a function
Task-number: QTBUG-94703
Pick-to: 6.2
Change-Id: I2c48f1cc94b8dd94cddab1d833f62299d35fe5d9
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquicktextfield.cpp')
-rw-r--r-- | src/quicktemplates2/qquicktextfield.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/quicktemplates2/qquicktextfield.cpp b/src/quicktemplates2/qquicktextfield.cpp index 06cbd5a2..32e447d7 100644 --- a/src/quicktemplates2/qquicktextfield.cpp +++ b/src/quicktemplates2/qquicktextfield.cpp @@ -184,22 +184,22 @@ void QQuickTextFieldPrivate::resizeBackground() resizingBackground = true; QQuickItemPrivate *p = QQuickItemPrivate::get(background); - if (((!p->widthValid || !extra.isAllocated() || !extra->hasBackgroundWidth) && qFuzzyIsNull(background->x())) + if (((!p->widthValid() || !extra.isAllocated() || !extra->hasBackgroundWidth) && qFuzzyIsNull(background->x())) || (extra.isAllocated() && (extra->hasLeftInset || extra->hasRightInset))) { - const bool wasWidthValid = p->widthValid; + const bool wasWidthValid = p->widthValid(); background->setX(getLeftInset()); background->setWidth(width - getLeftInset() - getRightInset()); // If the user hadn't previously set the width, that shouldn't change when we set it for them. if (!wasWidthValid) - p->widthValid = false; + p->widthValidFlag = false; } - if (((!p->heightValid || !extra.isAllocated() || !extra->hasBackgroundHeight) && qFuzzyIsNull(background->y())) + if (((!p->heightValid() || !extra.isAllocated() || !extra->hasBackgroundHeight) && qFuzzyIsNull(background->y())) || (extra.isAllocated() && (extra->hasTopInset || extra->hasBottomInset))) { - const bool wasHeightValid = p->heightValid; + const bool wasHeightValid = p->heightValid(); background->setY(getTopInset()); background->setHeight(height - getTopInset() - getBottomInset()); if (!wasHeightValid) - p->heightValid = false; + p->heightValidFlag = false; } resizingBackground = false; @@ -361,10 +361,10 @@ void QQuickTextFieldPrivate::itemGeometryChanged(QQuickItem *item, QQuickGeometr // QTBUG-71875: only allocate the extra data if we have to. // resizeBackground() relies on the value of extra.isAllocated() // as part of its checks to see whether it should resize the background or not. - if (p->widthValid || extra.isAllocated()) - extra.value().hasBackgroundWidth = p->widthValid; - if (p->heightValid || extra.isAllocated()) - extra.value().hasBackgroundHeight = p->heightValid; + if (p->widthValid() || extra.isAllocated()) + extra.value().hasBackgroundWidth = p->widthValid(); + if (p->heightValid() || extra.isAllocated()) + extra.value().hasBackgroundHeight = p->heightValid(); resizeBackground(); } @@ -476,9 +476,9 @@ void QQuickTextField::setBackground(QQuickItem *background) if (qFuzzyIsNull(background->z())) background->setZ(-1); QQuickItemPrivate *p = QQuickItemPrivate::get(background); - if (p->widthValid || p->heightValid) { - d->extra.value().hasBackgroundWidth = p->widthValid; - d->extra.value().hasBackgroundHeight = p->heightValid; + if (p->widthValid() || p->heightValid()) { + d->extra.value().hasBackgroundWidth = p->widthValid(); + d->extra.value().hasBackgroundHeight = p->heightValid(); } if (isComponentComplete()) d->resizeBackground(); |