Installing Qt Quick Components for Desktop for use with Qt Creator
15,881
Solution 1
I used the instructions from the answer for this question: Qt How to make and install plugins? and was able to successfully use the qt quick desktop components within qt creator qml files. Here are more detailed instructions that I made:
- Download the tar.gz from http://qt.gitorious.org/qt-components/desktop/trees/master
- Extract the components anywhere (e.g. C:\qt-components-desktop).
- Open command prompt.
- run vcvars32.bat from "your Visual Studio"\VC\bin\ directory ... (usually C:\Program Files\Microsoft Visual Studio 9.0\VC\bin) in command prompt. e.g. "C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat" You should receive a message similar to: "Setting environment for using Microsoft Visual Studio 2008 x86 tools"
- Set command prompt to use Qt Creator's bin path ... (usually C:\Qt\qtcreator-2.1.0\bin). e.g. SET PATH=%PATH%;C:\Qt\qtcreator-2.1.0\bin
- Set command prompt to use Qt's bin path ... (usually C:\Qt\4.7.2\bin). e.g. SET PATH=%PATH%;C:\Qt\4.7.2\bin
- Navigate in command prompt to the folder where you extracted the qt desktop components.
- Run the following commands: qmake jom debug jom install
- Copy the "components" folder from where you extracted the qt desktop components.
- Place it in "your Qt directory"\imports\Qt\labs ... (usually C:\Qt\4.7.2\imports\Qt\labs)
- Open the qmldir file inside the components folder in any text editor and observe the version number on each line (e.g. 0.1)
- Place the following import statement in any qml file to use Qt desktop components: import Qt.labs.components #.# where #.# is your version number (e.g. 0.1)
Solution 2
- Download the tar.gz from http://qt.gitorious.org/qt-components/desktop/trees/master
- unpack
- launch vcvars32.bat, then go to qt-components-desktop\ folder
- go to qt-components-desktop\components\ folder (cd components), type "qmake && nmake install"
- go to qt-components-desktop\src\ folder, type "qmake && nmake install"
Author by
queuemel
Updated on June 12, 2022Comments
-
queuemel about 2 years
I'm trying to use Qt Quick Components for Desktop from http://labs.qt.nokia.com/2011/03/10/qml-components-for-desktop/
I can build and install it just fine into it's own folder, and view the qmls with qmlviewer, but how do I use these qml components from my other projects in Qt Creator?
For example, I'd like to be able to use Dial.qml from the Qt Quick Components for Desktop to make a Dial element in a qml file in my project.
-
Tiana987642 over 9 yearsIt's a pity it works for the OP but not for me, I found an another working solution here in case someone need it