forked from qt-creator/qt-creator
Doc: Describe adding the import path
Also add the import path to the example main.cpp file. Task-number: QDS-805 Change-Id: I990e5dc364d610a4cef5697b3355147f9e5fcde1 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -9,6 +9,7 @@ int main(int argc, char *argv[])
|
|||||||
QGuiApplication app(argc, argv);
|
QGuiApplication app(argc, argv);
|
||||||
|
|
||||||
QQuickView view;
|
QQuickView view;
|
||||||
|
view.engine->addImportPath("qrc:/qml/imports");
|
||||||
view.setSource(QUrl("qrc:/qml/ProgressBar.ui.qml"));
|
view.setSource(QUrl("qrc:/qml/ProgressBar.ui.qml"));
|
||||||
if (!view.errors().isEmpty())
|
if (!view.errors().isEmpty())
|
||||||
return -1;
|
return -1;
|
||||||
|
@@ -99,8 +99,9 @@
|
|||||||
\quotefromfile progressbar/main.cpp
|
\quotefromfile progressbar/main.cpp
|
||||||
\skipto QQuickView view;
|
\skipto QQuickView view;
|
||||||
\printuntil view.show()
|
\printuntil view.show()
|
||||||
Where \c {qml\main.qml} is the path to and the name of the main QML
|
Where \c {qrc:/qml/imports} is the import path and
|
||||||
file in the Qt Quick UI project.
|
\c {qrc:qml/ProgressBar.ui.qml} is the path to and the
|
||||||
|
name of the main QML file in the Qt Quick UI project.
|
||||||
\li Select \uicontrol Build > \uicontrol Run to build and run your
|
\li Select \uicontrol Build > \uicontrol Run to build and run your
|
||||||
project.
|
project.
|
||||||
\endlist
|
\endlist
|
||||||
|
Reference in New Issue
Block a user