aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickpathview.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2017-01-26 11:46:56 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2017-01-26 11:46:56 +0100
commit9225ac7348c9023093b6ef8d4519087c7dddeaa2 (patch)
tree4660e25bd5cfd4a2a40b0ad97ea689c4acb22a8c /src/quick/items/qquickpathview.cpp
parent9d8fe2ac121162c15be6728495be2235b728325a (diff)
parent0076c44d3993f377ad6417d3bb08109b608dfbd2 (diff)
Merge remote-tracking branch 'origin/dev' into wip/pointerhandler
Diffstat (limited to 'src/quick/items/qquickpathview.cpp')
-rw-r--r--src/quick/items/qquickpathview.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/quick/items/qquickpathview.cpp b/src/quick/items/qquickpathview.cpp
index 11881ae0ab..53e547fe98 100644
--- a/src/quick/items/qquickpathview.cpp
+++ b/src/quick/items/qquickpathview.cpp
@@ -137,7 +137,7 @@ QQuickItem *QQuickPathViewPrivate::getItem(int modelIndex, qreal z, bool async)
if (!delegateValidated) {
delegateValidated = true;
QObject* delegate = q->delegate();
- qmlInfo(delegate ? delegate : q) << QQuickPathView::tr("Delegate must be of Item type");
+ qmlWarning(delegate ? delegate : q) << QQuickPathView::tr("Delegate must be of Item type");
}
}
} else {
@@ -704,16 +704,23 @@ void QQuickPathView::setPath(QQuickPath *path)
qmlobject_disconnect(d->path, QQuickPath, SIGNAL(changed()),
this, QQuickPathView, SLOT(pathUpdated()));
d->path = path;
- qmlobject_connect(d->path, QQuickPath, SIGNAL(changed()),
- this, QQuickPathView, SLOT(pathUpdated()));
- if (d->isValid() && isComponentComplete()) {
+
+ if (path) {
+ qmlobject_connect(d->path, QQuickPath, SIGNAL(changed()),
+ this, QQuickPathView, SLOT(pathUpdated()));
+ }
+
+ if (isComponentComplete()) {
d->clear();
- if (d->attType) {
- d->attType->release();
- d->attType = nullptr;
+ if (d->isValid()) {
+ if (d->attType) {
+ d->attType->release();
+ d->attType = nullptr;
+ }
+ d->regenerate();
}
- d->regenerate();
}
+
emit pathChanged();
}