diff options
Diffstat (limited to 'src/quick/items/qquickpathview.cpp')
-rw-r--r-- | src/quick/items/qquickpathview.cpp | 23 |
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(); } |