diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-12-18 13:55:09 +0100 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2021-06-03 12:19:47 +0200 |
commit | 6c12a416b7b7cd806ea37f8cc65a85ba4dd403b8 (patch) | |
tree | 14edd5922cbac2edf8534579cf20a4c90511bc90 /src/quicktemplates2 | |
parent | 5a06c1bf185274723a70393afbdfef5ddbd377e7 (diff) |
Adjust to bindable QQuickItem properties
This prepares for QQuickItem's properties becoming bindable, changing
the type of QQuickItemPrivate::{x, y, width, height}. It adds explicit
casts/types where implicit conversion or type deduction would fail after
the conversion.
Change-Id: I9e25b45d1c7de162c3e72e8ec337b198bfd29c57
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2')
-rw-r--r-- | src/quicktemplates2/qquickroundbutton.cpp | 2 | ||||
-rw-r--r-- | src/quicktemplates2/qquicksplitview.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/quicktemplates2/qquickroundbutton.cpp b/src/quicktemplates2/qquickroundbutton.cpp index 06230673..05eb53b0 100644 --- a/src/quicktemplates2/qquickroundbutton.cpp +++ b/src/quicktemplates2/qquickroundbutton.cpp @@ -76,7 +76,7 @@ void QQuickRoundButtonPrivate::setRadius(qreal newRadius) Q_Q(QQuickRoundButton); const qreal oldRadius = radius; if (newRadius < 0) - radius = qMax<qreal>(0, qMin(width, height) / 2); + radius = qMax<qreal>(0, qMin<qreal>(width, height) / 2); else radius = newRadius; diff --git a/src/quicktemplates2/qquicksplitview.cpp b/src/quicktemplates2/qquicksplitview.cpp index a9c92eaf..bc5e10d2 100644 --- a/src/quicktemplates2/qquicksplitview.cpp +++ b/src/quicktemplates2/qquicksplitview.cpp @@ -338,8 +338,8 @@ void QQuickSplitViewPrivate::layoutResizeSplitItems(qreal &usedWidth, qreal &use if (isBeingResized) { // Don't let the mouse go past either edge of the SplitView. const qreal clampedMousePos = horizontal - ? qBound(qreal(0.0), m_mousePos.x(), width) - : qBound(qreal(0.0), m_mousePos.y(), height); + ? qBound(qreal(0.0), m_mousePos.x(), qreal(width)) + : qBound(qreal(0.0), m_mousePos.y(), qreal(height)); // We also need to ensure that the item's edge doesn't go too far // out and hence give the item more space than is available. |