aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-01-20 22:43:14 +0100
committerLiang Qi <liang.qi@qt.io>2018-01-20 22:43:14 +0100
commit205e714cf8dfba9327eaddbb52e03c1448bef047 (patch)
treeeaefe818853c0980adc3965b2447ceed49e9e048 /src
parentf8fd551aa96fa83d4cad3b43b4c84aa04cce3e7a (diff)
parentdeb779cdbaeeaea52ca0e99c9295db587c25f41c (diff)
Merge remote-tracking branch 'origin/5.10' into dev
Diffstat (limited to 'src')
-rw-r--r--src/imports/controls/Tumbler.qml2
-rw-r--r--src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-custom.qml2
-rw-r--r--src/imports/controls/fusion/Tumbler.qml2
-rw-r--r--src/imports/controls/imagine/BusyIndicator.qml6
-rw-r--r--src/imports/controls/imagine/DelayButton.qml21
-rw-r--r--src/imports/controls/imagine/GroupBox.qml9
-rw-r--r--src/imports/controls/imagine/ProgressBar.qml31
-rw-r--r--src/imports/controls/imagine/SpinBox.qml6
-rw-r--r--src/imports/controls/imagine/Switch.qml5
-rw-r--r--src/imports/controls/imagine/SwitchDelegate.qml5
-rw-r--r--src/imports/controls/imagine/Tumbler.qml2
-rw-r--r--src/imports/controls/material/Tumbler.qml2
-rw-r--r--src/imports/controls/universal/Tumbler.qml2
-rw-r--r--src/quickcontrols2/qquicktumblerview.cpp9
-rw-r--r--src/quicktemplates2/qquicktumbler.cpp91
-rw-r--r--src/quicktemplates2/qquicktumbler_p.h1
-rw-r--r--src/quicktemplates2/qquicktumbler_p_p.h1
17 files changed, 120 insertions, 77 deletions
diff --git a/src/imports/controls/Tumbler.qml b/src/imports/controls/Tumbler.qml
index 8d5546c9..b9cb51a1 100644
--- a/src/imports/controls/Tumbler.qml
+++ b/src/imports/controls/Tumbler.qml
@@ -48,7 +48,7 @@ T.Tumbler {
text: modelData
color: control.visualFocus ? control.palette.highlight : control.palette.text
font: control.font
- opacity: 1.0 - Math.abs(Tumbler.displacement) / (visibleItemCount / 2)
+ opacity: 1.0 - Math.abs(Tumbler.displacement) / (control.visibleItemCount / 2)
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-custom.qml
index b3645587..cc37d541 100644
--- a/src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-custom.qml
+++ b/src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-custom.qml
@@ -56,7 +56,7 @@ Tumbler {
font: control.font
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
- opacity: 1.0 - Math.abs(Tumbler.displacement) / (visibleItemCount / 2)
+ opacity: 1.0 - Math.abs(Tumbler.displacement) / (control.visibleItemCount / 2)
}
Rectangle {
diff --git a/src/imports/controls/fusion/Tumbler.qml b/src/imports/controls/fusion/Tumbler.qml
index 75815f15..b66e4f2d 100644
--- a/src/imports/controls/fusion/Tumbler.qml
+++ b/src/imports/controls/fusion/Tumbler.qml
@@ -50,7 +50,7 @@ T.Tumbler {
text: modelData
color: control.palette.windowText
font: control.font
- opacity: (1.0 - Math.abs(Tumbler.displacement) / (visibleItemCount / 2)) * (control.enabled ? 1 : 0.6)
+ opacity: (1.0 - Math.abs(Tumbler.displacement) / (control.visibleItemCount / 2)) * (control.enabled ? 1 : 0.6)
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
diff --git a/src/imports/controls/imagine/BusyIndicator.qml b/src/imports/controls/imagine/BusyIndicator.qml
index d373dcfd..a9a5ac40 100644
--- a/src/imports/controls/imagine/BusyIndicator.qml
+++ b/src/imports/controls/imagine/BusyIndicator.qml
@@ -53,10 +53,10 @@ T.BusyIndicator {
bottomPadding: background ? background.bottomPadding : 0
contentItem: AnimatedImage {
- playing: control.running
opacity: control.running ? 1 : 0
- visible: control.running || animator.running
- Behavior on opacity { OpacityAnimator { id: animator; duration: 250 } }
+ playing: control.running || opacity > 0
+ visible: control.running || opacity > 0
+ Behavior on opacity { OpacityAnimator { duration: 250 } }
source: Imagine.url + "busyindicator-animation"
AnimatedImageSelector on source {
diff --git a/src/imports/controls/imagine/DelayButton.qml b/src/imports/controls/imagine/DelayButton.qml
index 14db2b96..f0a2c568 100644
--- a/src/imports/controls/imagine/DelayButton.qml
+++ b/src/imports/controls/imagine/DelayButton.qml
@@ -86,8 +86,8 @@ T.DelayButton {
]
}
- NinePatchImage {
- id: progress
+ readonly property NinePatchImage progress: NinePatchImage {
+ parent: control.background
width: control.progress * parent.width
height: parent.height
visible: false
@@ -105,10 +105,9 @@ T.DelayButton {
}
}
- NinePatchImage {
- id: mask
- width: parent.width
- height: parent.height
+ readonly property NinePatchImage mask: NinePatchImage {
+ width: control.background.width
+ height: control.background.height
visible: false
source: Imagine.url + "delaybutton-mask"
@@ -124,15 +123,15 @@ T.DelayButton {
}
}
- OpacityMask {
- id: effect
+ readonly property OpacityMask effect: OpacityMask {
+ parent: control.background
width: source.width
height: source.height
- source: progress
+ source: control.background.progress
maskSource: ShaderEffectSource {
- sourceItem: mask
- sourceRect: Qt.rect(0, 0, effect.width, effect.height)
+ sourceItem: control.background.mask
+ sourceRect: Qt.rect(0, 0, control.background.effect.width, control.background.effect.height)
}
}
}
diff --git a/src/imports/controls/imagine/GroupBox.qml b/src/imports/controls/imagine/GroupBox.qml
index b2b199a3..f262fb5f 100644
--- a/src/imports/controls/imagine/GroupBox.qml
+++ b/src/imports/controls/imagine/GroupBox.qml
@@ -60,10 +60,10 @@ T.GroupBox {
label: Label {
width: control.width
- topPadding: header.topPadding
- leftPadding: header.leftPadding
- rightPadding: header.rightPadding
- bottomPadding: header.bottomPadding
+ topPadding: background.topPadding
+ leftPadding: background.leftPadding
+ rightPadding: background.rightPadding
+ bottomPadding: background.bottomPadding
text: control.title
font: control.font
@@ -73,7 +73,6 @@ T.GroupBox {
color: control.palette.windowText
background: NinePatchImage {
- id: header
width: parent.width
height: parent.height
diff --git a/src/imports/controls/imagine/ProgressBar.qml b/src/imports/controls/imagine/ProgressBar.qml
index 5cfc292c..7fd0ce1b 100644
--- a/src/imports/controls/imagine/ProgressBar.qml
+++ b/src/imports/controls/imagine/ProgressBar.qml
@@ -58,11 +58,13 @@ T.ProgressBar {
implicitHeight: control.indeterminate ? animation.implicitHeight || progress.implicitHeight : progress.implicitHeight
scale: control.mirrored ? -1 : 1
- NinePatchImage {
- id: progress
+ readonly property bool hasMask: mask.status !== Image.Null
+
+ readonly property NinePatchImage progress: NinePatchImage {
+ parent: control.contentItem
width: control.position * parent.width
height: parent.height
- visible: !control.indeterminate && mask.status === Image.Null
+ visible: !control.indeterminate && !control.contentItem.hasMask
source: Imagine.url + "progressbar-progress"
NinePatchImageSelector on source {
@@ -75,12 +77,12 @@ T.ProgressBar {
}
}
- AnimatedImage {
- id: animation
+ readonly property AnimatedImage animation: AnimatedImage {
+ parent: control.contentItem
width: parent.width
height: parent.height
playing: control.indeterminate
- visible: control.indeterminate && mask.status === Image.Null
+ visible: control.indeterminate && !control.contentItem.hasMask
source: Imagine.url + "progressbar-animation"
AnimatedImageSelector on source {
@@ -92,10 +94,9 @@ T.ProgressBar {
}
}
- NinePatchImage {
- id: mask
- width: parent.width
- height: parent.height
+ readonly property NinePatchImage mask: NinePatchImage {
+ width: control.availableWidth
+ height: control.availableHeight
visible: false
source: Imagine.url + "progressbar-mask"
@@ -109,15 +110,15 @@ T.ProgressBar {
}
}
- OpacityMask {
- id: effect
+ readonly property OpacityMask effect: OpacityMask {
+ parent: control.contentItem
width: source.width
height: source.height
- source: control.indeterminate ? animation : progress
+ source: control.indeterminate ? control.contentItem.animation : control.contentItem.progress
maskSource: ShaderEffectSource {
- sourceItem: mask
- sourceRect: Qt.rect(0, 0, effect.width, effect.height)
+ sourceItem: control.contentItem.mask
+ sourceRect: Qt.rect(0, 0, control.contentItem.effect.width, control.contentItem.effect.height)
}
}
}
diff --git a/src/imports/controls/imagine/SpinBox.qml b/src/imports/controls/imagine/SpinBox.qml
index 334b6996..1ef862f5 100644
--- a/src/imports/controls/imagine/SpinBox.qml
+++ b/src/imports/controls/imagine/SpinBox.qml
@@ -98,7 +98,6 @@ T.SpinBox {
}
up.indicator: NinePatchImage {
- id: upIndicator
x: control.mirrored ? 0 : parent.width - width
height: parent.height
@@ -106,7 +105,7 @@ T.SpinBox {
NinePatchImageSelector on source {
states: [
{"up": true},
- {"disabled": !upIndicator.enabled},
+ {"disabled": !control.up.indicator.enabled},
{"editable": control.editable},
{"pressed": control.up.pressed},
{"focused": control.activeFocus},
@@ -117,7 +116,6 @@ T.SpinBox {
}
down.indicator: NinePatchImage {
- id: downIndicator
x: control.mirrored ? parent.width - width : 0
height: parent.height
@@ -125,7 +123,7 @@ T.SpinBox {
NinePatchImageSelector on source {
states: [
{"down": true},
- {"disabled": !downIndicator.enabled},
+ {"disabled": !control.down.indicator.enabled},
{"editable": control.editable},
{"pressed": control.down.pressed},
{"focused": control.activeFocus},
diff --git a/src/imports/controls/imagine/Switch.qml b/src/imports/controls/imagine/Switch.qml
index 44e5d68e..085d6879 100644
--- a/src/imports/controls/imagine/Switch.qml
+++ b/src/imports/controls/imagine/Switch.qml
@@ -74,12 +74,13 @@ T.Switch {
]
}
- NinePatchImage {
- id: handle
+ property NinePatchImage handle: NinePatchImage {
readonly property real minPos: parent.leftPadding - leftPadding
readonly property real maxPos: parent.width - width + rightPadding - parent.rightPadding
readonly property real dragPos: control.visualPosition * parent.width - (width / 2)
+ parent: control.indicator
+
x: Math.max(minPos, Math.min(maxPos, control.visualPosition * parent.width - (width / 2)))
y: (parent.height - height) / 2
diff --git a/src/imports/controls/imagine/SwitchDelegate.qml b/src/imports/controls/imagine/SwitchDelegate.qml
index 497bc4e5..b53cf321 100644
--- a/src/imports/controls/imagine/SwitchDelegate.qml
+++ b/src/imports/controls/imagine/SwitchDelegate.qml
@@ -81,12 +81,13 @@ T.SwitchDelegate {
]
}
- NinePatchImage {
- id: handle
+ property NinePatchImage handle: NinePatchImage {
readonly property real minPos: parent.leftPadding - leftPadding
readonly property real maxPos: parent.width - width + rightPadding - parent.rightPadding
readonly property real dragPos: control.visualPosition * parent.width - (width / 2)
+ parent: control.indicator
+
x: Math.max(minPos, Math.min(maxPos, control.visualPosition * parent.width - (width / 2)))
y: (parent.height - height) / 2
diff --git a/src/imports/controls/imagine/Tumbler.qml b/src/imports/controls/imagine/Tumbler.qml
index 0fa8c137..7beb39c5 100644
--- a/src/imports/controls/imagine/Tumbler.qml
+++ b/src/imports/controls/imagine/Tumbler.qml
@@ -50,7 +50,7 @@ T.Tumbler {
text: modelData
font: control.font
color: control.palette.text
- opacity: (1.0 - Math.abs(Tumbler.displacement) / (visibleItemCount / 2)) * (control.enabled ? 1 : 0.6)
+ opacity: (1.0 - Math.abs(Tumbler.displacement) / (control.visibleItemCount / 2)) * (control.enabled ? 1 : 0.6)
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
diff --git a/src/imports/controls/material/Tumbler.qml b/src/imports/controls/material/Tumbler.qml
index eff1ff47..d5c42422 100644
--- a/src/imports/controls/material/Tumbler.qml
+++ b/src/imports/controls/material/Tumbler.qml
@@ -49,7 +49,7 @@ T.Tumbler {
text: modelData
color: control.Material.foreground
font: control.font
- opacity: (1.0 - Math.abs(Tumbler.displacement) / (visibleItemCount / 2)) * (control.enabled ? 1 : 0.6)
+ opacity: (1.0 - Math.abs(Tumbler.displacement) / (control.visibleItemCount / 2)) * (control.enabled ? 1 : 0.6)
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
diff --git a/src/imports/controls/universal/Tumbler.qml b/src/imports/controls/universal/Tumbler.qml
index 09ca5d9b..f0dbc163 100644
--- a/src/imports/controls/universal/Tumbler.qml
+++ b/src/imports/controls/universal/Tumbler.qml
@@ -50,7 +50,7 @@ T.Tumbler {
text: modelData
font: control.font
color: control.Universal.foreground
- opacity: (1.0 - Math.abs(Tumbler.displacement) / (visibleItemCount / 2)) * (control.enabled ? 1 : 0.6)
+ opacity: (1.0 - Math.abs(Tumbler.displacement) / (control.visibleItemCount / 2)) * (control.enabled ? 1 : 0.6)
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
diff --git a/src/quickcontrols2/qquicktumblerview.cpp b/src/quickcontrols2/qquicktumblerview.cpp
index e8f0c364..4469810c 100644
--- a/src/quickcontrols2/qquicktumblerview.cpp
+++ b/src/quickcontrols2/qquicktumblerview.cpp
@@ -173,14 +173,19 @@ void QQuickTumblerView::createView()
m_listView->setParentItem(this);
m_listView->setSnapMode(QQuickListView::SnapToItem);
m_listView->setHighlightRangeMode(QQuickListView::StrictlyEnforceRange);
- m_listView->setHighlightMoveDuration(1000);
m_listView->setClip(true);
- m_listView->setDelegate(m_delegate);
// Give the view a size.
updateView();
// Set the model.
updateModel();
+
+ // Set these after the model is set so that the currentItem animation
+ // happens instantly on startup/after switching models. If we set them too early,
+ // the view animates any potential currentIndex change over one second,
+ // which we don't want when the contentItem has just been created.
+ m_listView->setDelegate(m_delegate);
+ m_listView->setHighlightMoveDuration(1000);
}
}
}
diff --git a/src/quicktemplates2/qquicktumbler.cpp b/src/quicktemplates2/qquicktumbler.cpp
index bed3e400..efa61dad 100644
--- a/src/quicktemplates2/qquicktumbler.cpp
+++ b/src/quicktemplates2/qquicktumbler.cpp
@@ -120,17 +120,24 @@ namespace {
*/
QQuickItem *QQuickTumblerPrivate::determineViewType(QQuickItem *contentItem)
{
+ if (!contentItem) {
+ resetViewData();
+ return nullptr;
+ }
+
if (contentItem->inherits("QQuickPathView")) {
view = contentItem;
viewContentItem = contentItem;
viewContentItemType = PathViewContentItem;
viewOffset = 0;
+
return contentItem;
} else if (contentItem->inherits("QQuickListView")) {
view = contentItem;
viewContentItem = qobject_cast<QQuickFlickable*>(contentItem)->contentItem();
viewContentItemType = ListViewContentItem;
viewContentY = 0;
+
return contentItem;
} else {
const auto childItems = contentItem->childItems();
@@ -142,6 +149,7 @@ QQuickItem *QQuickTumblerPrivate::determineViewType(QQuickItem *contentItem)
}
resetViewData();
+ viewContentItemType = UnsupportedContentItemType;
return nullptr;
}
@@ -153,7 +161,7 @@ void QQuickTumblerPrivate::resetViewData()
viewOffset = 0;
else if (viewContentItemType == ListViewContentItem)
viewContentY = 0;
- viewContentItemType = UnsupportedContentItemType;
+ viewContentItemType = NoContentItem;
}
QList<QQuickItem *> QQuickTumblerPrivate::viewContentItemChildItems() const
@@ -257,24 +265,16 @@ void QQuickTumblerPrivate::calculateDisplacements()
}
}
-void QQuickTumblerPrivate::itemChildAdded(QQuickItem *, QQuickItem *child)
+void QQuickTumblerPrivate::itemChildAdded(QQuickItem *, QQuickItem *)
{
_q_updateItemWidths();
_q_updateItemHeights();
-
- QQuickTumblerAttached *attached = qobject_cast<QQuickTumblerAttached *>(qmlAttachedPropertiesObject<QQuickTumbler>(child, false));
- if (attached)
- QQuickTumblerAttachedPrivate::get(attached)->calculateDisplacement();
}
-void QQuickTumblerPrivate::itemChildRemoved(QQuickItem *, QQuickItem *child)
+void QQuickTumblerPrivate::itemChildRemoved(QQuickItem *, QQuickItem *)
{
_q_updateItemWidths();
_q_updateItemHeights();
-
- QQuickTumblerAttached *attached = qobject_cast<QQuickTumblerAttached *>(qmlAttachedPropertiesObject<QQuickTumbler>(child, false));
- if (attached)
- QQuickTumblerAttachedPrivate::get(attached)->calculateDisplacement();
}
void QQuickTumblerPrivate::itemGeometryChanged(QQuickItem *, QQuickGeometryChange change, const QRectF &)
@@ -527,8 +527,6 @@ void QQuickTumbler::componentComplete()
{
Q_D(QQuickTumbler);
QQuickControl::componentComplete();
- d->_q_updateItemHeights();
- d->_q_updateItemWidths();
if (!d->view) {
// Force the view to be created.
@@ -536,6 +534,17 @@ void QQuickTumbler::componentComplete()
// Determine the type of view for attached properties, etc.
d->setupViewData(d->contentItem);
}
+
+ // If there was no contentItem or it was of an unsupported type,
+ // we don't have anything else to do.
+ if (!d->view)
+ return;
+
+ // Update item heights after we've populated the model,
+ // otherwise ignoreSignals will cause these functions to return early.
+ d->_q_updateItemHeights();
+ d->_q_updateItemWidths();
+ d->_q_onViewCountChanged();
}
void QQuickTumbler::contentItemChange(QQuickItem *newItem, QQuickItem *oldItem)
@@ -554,6 +563,9 @@ void QQuickTumbler::contentItemChange(QQuickItem *newItem, QQuickItem *oldItem)
// Make sure we use the new content item and not the current one, as that won't
// be changed until after contentItemChange() has finished.
d->setupViewData(newItem);
+
+ d->_q_updateItemHeights();
+ d->_q_updateItemWidths();
}
}
}
@@ -593,6 +605,9 @@ void QQuickTumblerPrivate::setupViewData(QQuickItem *newControlContentItem)
determineViewType(newControlContentItem);
+ if (viewContentItemType == QQuickTumblerPrivate::NoContentItem)
+ return;
+
if (viewContentItemType == QQuickTumblerPrivate::UnsupportedContentItemType) {
qWarning() << "Tumbler: contentItem must contain either a PathView or a ListView";
return;
@@ -617,6 +632,8 @@ void QQuickTumblerPrivate::setupViewData(QQuickItem *newControlContentItem)
// Sync the view's currentIndex with ours.
syncCurrentIndex();
+
+ calculateDisplacements();
}
void QQuickTumblerPrivate::syncCurrentIndex()
@@ -624,17 +641,27 @@ void QQuickTumblerPrivate::syncCurrentIndex()
const int actualViewIndex = view->property("currentIndex").toInt();
Q_Q(QQuickTumbler);
+ const bool isPendingCurrentIndex = pendingCurrentIndex != -1;
+ const int indexToSet = isPendingCurrentIndex ? pendingCurrentIndex : currentIndex;
+
// Nothing to do.
- if (actualViewIndex == currentIndex)
+ if (actualViewIndex == indexToSet) {
+ pendingCurrentIndex = -1;
return;
+ }
// PathView likes to use 0 as currentIndex for empty models, but we use -1 for that.
if (q->count() == 0 && actualViewIndex == 0)
return;
ignoreCurrentIndexChanges = true;
- view->setProperty("currentIndex", currentIndex);
+ view->setProperty("currentIndex", QVariant(indexToSet));
ignoreCurrentIndexChanges = false;
+
+ if (view->property("currentIndex").toInt() == indexToSet)
+ pendingCurrentIndex = -1;
+ else if (isPendingCurrentIndex)
+ q->polish();
}
void QQuickTumblerPrivate::setCount(int newCount)
@@ -685,11 +712,17 @@ void QQuickTumblerPrivate::setWrap(bool shouldWrap, bool isExplicit)
ignoreCurrentIndexChanges = false;
- // The view should have been created now, so we can start determining its type, etc.
- // If the delegates use attached properties, this will have already been called,
- // in which case it will return early. If the delegate doesn't use attached properties,
- // we need to call it here.
- setupViewData(contentItem);
+ // If isComponentComplete() is true, we require a contentItem. If it's not
+ // true, it might not have been created yet, so we wait until
+ // componentComplete() is called.
+ //
+ // When the contentItem (usually QQuickTumblerView) has been created, we
+ // can start determining its type, etc. If the delegates use attached
+ // properties, this will have already been called, in which case it will
+ // return early. If the delegate doesn't use attached properties, we need
+ // to call it here.
+ if (q->isComponentComplete() || contentItem)
+ setupViewData(contentItem);
q->setCurrentIndex(oldCurrentIndex);
}
@@ -724,6 +757,10 @@ void QQuickTumbler::updatePolish()
{
Q_D(QQuickTumbler);
if (d->pendingCurrentIndex != -1) {
+ // Update our count, as ignoreSignals might have been true
+ // when _q_onViewCountChanged() was last called.
+ d->setCount(d->view->property("count").toInt());
+
// If the count is still 0, it's not going to happen.
if (d->count == 0) {
d->pendingCurrentIndex = -1;
@@ -789,9 +826,9 @@ void QQuickTumblerAttachedPrivate::calculateDisplacement()
const int previousDisplacement = displacement;
displacement = 0;
- // Can happen if the attached properties are accessed on the wrong type of item or the tumbler was destroyed.
if (!tumbler) {
- emitIfDisplacementChanged(previousDisplacement, displacement);
+ // Can happen if the attached properties are accessed on the wrong type of item or the tumbler was destroyed.
+ // We don't want to emit the change signal though, as this could cause warnings about Tumbler.tumbler being null.
return;
}
@@ -860,10 +897,12 @@ QQuickTumblerAttached::QQuickTumblerAttached(QObject *parent)
QQuickTumblerPrivate *tumblerPrivate = QQuickTumblerPrivate::get(d->tumbler);
tumblerPrivate->setupViewData(tumblerPrivate->contentItem);
- if (!tumblerPrivate->viewContentItem)
- return;
-
- d->calculateDisplacement();
+ if (delegateItem->parentItem() == tumblerPrivate->viewContentItem) {
+ // This item belongs to the "new" view, meaning that the tumbler's contentItem
+ // was probably assigned declaratively. If they're not equal, calling
+ // calculateDisplacement() would use the old contentItem data, which is bad.
+ d->calculateDisplacement();
+ }
}
}
diff --git a/src/quicktemplates2/qquicktumbler_p.h b/src/quicktemplates2/qquicktumbler_p.h
index c388c28d..5d4df4a7 100644
--- a/src/quicktemplates2/qquicktumbler_p.h
+++ b/src/quicktemplates2/qquicktumbler_p.h
@@ -70,7 +70,6 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickTumbler : public QQuickControl
Q_PROPERTY(bool wrap READ wrap WRITE setWrap RESET resetWrap NOTIFY wrapChanged FINAL REVISION 1)
// 2.2 (Qt 5.9)
Q_PROPERTY(bool moving READ isMoving NOTIFY movingChanged FINAL REVISION 2)
- Q_CLASSINFO("DeferredPropertyNames", "background")
public:
explicit QQuickTumbler(QQuickItem *parent = nullptr);
diff --git a/src/quicktemplates2/qquicktumbler_p_p.h b/src/quicktemplates2/qquicktumbler_p_p.h
index fe8a4ad2..75b1a396 100644
--- a/src/quicktemplates2/qquicktumbler_p_p.h
+++ b/src/quicktemplates2/qquicktumbler_p_p.h
@@ -63,6 +63,7 @@ public:
~QQuickTumblerPrivate();
enum ContentItemType {
+ NoContentItem,
UnsupportedContentItemType,
PathViewContentItem,
ListViewContentItem