From fff6065a691061a8a61db79327a272dd49184b09 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Fri, 1 Jun 2018 10:50:37 +0200 Subject: Doc: Add a question to FAQ about QML imports not being found This results in error messages and missing functionality. Change-Id: I041ea8e61f3b4cd113964d2c5dfc609e6581c2f7 Reviewed-by: Thomas Hartmann Reviewed-by: Marco Benelli --- doc/src/howto/qtcreator-faq.qdoc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/doc/src/howto/qtcreator-faq.qdoc b/doc/src/howto/qtcreator-faq.qdoc index b6347c41fe..3bd14807ad 100644 --- a/doc/src/howto/qtcreator-faq.qdoc +++ b/doc/src/howto/qtcreator-faq.qdoc @@ -79,6 +79,29 @@ \section1 QML and Qt Quick Questions + \b {Why is there a red line below my QML import, even though I have the module?} + + By default, \QC looks in the QML import path of Qt for QML modules. + Sometimes, it does not get it right and you need to tell it where the + modules are by specifying the \c{QML_IMPORT_PATH} in the \c{.pro} file of + your application. + + This also enables code completion of QML code and removes error messages. + + The following example illustrates how to specify the import path so that + it works when switching between build and run kits for different target + platforms: + + \code + TEMPNAME = $${QMAKE_QMAKE} + MY_QTPATH = $$dirname(TEMPNAME) + QML_IMPORT_PATH += $$MY_QTPATH/../qml + message("my QML Import Path: "$$QML_IMPORT_PATH) + \endcode + + For more information about how to set the import path when using CMake, see + \l {Importing QML Modules}. + \b {What should I do when \QC complains about missing OpenGL support?} Some parts of \QC, such as \QMLD and QML Profiler, use Qt Quick 2, which -- cgit v1.2.1