summaryrefslogtreecommitdiffstats
path: root/src/declarative/util/qdeclarativeview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/util/qdeclarativeview.cpp')
-rw-r--r--src/declarative/util/qdeclarativeview.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/declarative/util/qdeclarativeview.cpp b/src/declarative/util/qdeclarativeview.cpp
index 22a7873..c0425ef 100644
--- a/src/declarative/util/qdeclarativeview.cpp
+++ b/src/declarative/util/qdeclarativeview.cpp
@@ -204,7 +204,7 @@ void QDeclarativeViewPrivate::execute()
QDeclarativeView *view = new QDeclarativeView(this);
vbox->addWidget(view);
- QUrl url(fileName);
+ QUrl url = QUrl::fromLocalFile(fileName);
view->setSource(url);
view->show();
\endcode
@@ -279,11 +279,17 @@ QDeclarativeView::~QDeclarativeView()
\brief The URL of the source of the QML component.
Changing this property causes the QML component to be reloaded.
+
+ Ensure that the URL provided is full and correct, in particular, use
+ \l QUrl::fromLocalFile() when loading a file from the local filesystem.
*/
/*!
Sets the source to the \a url, loads the QML component and instantiates it.
+ Ensure that the URL provided is full and correct, in particular, use
+ \l QUrl::fromLocalFile() when loading a file from the local filesystem.
+
Calling this methods multiple times with the same url will result
in the QML being reloaded.
*/