diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/quick/items/qquickpathview.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/quick/items/qquickpathview.cpp b/src/quick/items/qquickpathview.cpp index 11881ae0ab..03596f13e9 100644 --- a/src/quick/items/qquickpathview.cpp +++ b/src/quick/items/qquickpathview.cpp @@ -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(); } |