summaryrefslogtreecommitdiff
path: root/src/controls/Private/qquickwheelarea.cpp
diff options
context:
space:
mode:
authorMarco Martin <mart@kde.org>2017-03-21 16:34:48 +0100
committerMarco Martin <notmart@gmail.com>2017-04-03 15:44:52 +0000
commit378bd7b4454a5a049072ae1043981984f30e8329 (patch)
tree44a7cc08ba7b008cae6e6dce5beed320ffb0576e /src/controls/Private/qquickwheelarea.cpp
parentedc24e3cd75eaf02a587f50b14dbd0288447179d (diff)
downloadqtquickcontrols-378bd7b4454a5a049072ae1043981984f30e8329.tar.gz
Add NOTIFY signals for WheelArea5.8
the private WheelArea component didn't have any notify signals in its horizontalValue/verticalValue or minimum/maximum values as well. this caused old values to be used in ScrollView.qml. If we want to have a listView that starts scrolled right when instanced, verticalMaximumValue won't be updated when the list is populated. Also, the wheelArea.verticalValue that's assigned at the beginning will be constrained by the wrong verticalMaximumValue, causing it to go out of sync with contentY. At this point the first time the mouse wheel is moved, the list will jump back at the top. Change-Id: I4605000636be7975ba9a58e2c79e8c2351e5a292 Task-number: QTBUG-59633 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'src/controls/Private/qquickwheelarea.cpp')
-rw-r--r--src/controls/Private/qquickwheelarea.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/controls/Private/qquickwheelarea.cpp b/src/controls/Private/qquickwheelarea.cpp
index 9c0a70a2..bd77ae24 100644
--- a/src/controls/Private/qquickwheelarea.cpp
+++ b/src/controls/Private/qquickwheelarea.cpp
@@ -141,7 +141,11 @@ void QQuickWheelArea1::wheelEvent(QWheelEvent *we)
void QQuickWheelArea1::setHorizontalMinimumValue(qreal value)
{
+ if (value == m_horizontalMinimumValue)
+ return;
+
m_horizontalMinimumValue = value;
+ emit horizontalMinimumValueChanged();
}
qreal QQuickWheelArea1::horizontalMinimumValue() const
@@ -151,7 +155,11 @@ qreal QQuickWheelArea1::horizontalMinimumValue() const
void QQuickWheelArea1::setHorizontalMaximumValue(qreal value)
{
+ if (value == m_horizontalMaximumValue)
+ return;
+
m_horizontalMaximumValue = value;
+ emit horizontalMaximumValueChanged();
}
qreal QQuickWheelArea1::horizontalMaximumValue() const
@@ -161,7 +169,11 @@ qreal QQuickWheelArea1::horizontalMaximumValue() const
void QQuickWheelArea1::setVerticalMinimumValue(qreal value)
{
+ if (value == m_verticalMinimumValue)
+ return;
+
m_verticalMinimumValue = value;
+ emit verticalMinimumValueChanged();
}
qreal QQuickWheelArea1::verticalMinimumValue() const
@@ -171,7 +183,11 @@ qreal QQuickWheelArea1::verticalMinimumValue() const
void QQuickWheelArea1::setVerticalMaximumValue(qreal value)
{
+ if (value == m_verticalMaximumValue)
+ return;
+
m_verticalMaximumValue = value;
+ emit verticalMaximumValueChanged();
}
qreal QQuickWheelArea1::verticalMaximumValue() const