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:

  1. Download the tar.gz from http://qt.gitorious.org/qt-components/desktop/trees/master
  2. Extract the components anywhere (e.g. C:\qt-components-desktop).
  3. Open command prompt.
  4. 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"
  5. 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
  6. 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
  7. Navigate in command prompt to the folder where you extracted the qt desktop components.
  8. Run the following commands: qmake jom debug jom install
  9. Copy the "components" folder from where you extracted the qt desktop components.
  10. Place it in "your Qt directory"\imports\Qt\labs ... (usually C:\Qt\4.7.2\imports\Qt\labs)
  11. Open the qmldir file inside the components folder in any text editor and observe the version number on each line (e.g. 0.1)
  12. 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

  1. Download the tar.gz from http://qt.gitorious.org/qt-components/desktop/trees/master
  2. unpack
  3. launch vcvars32.bat, then go to qt-components-desktop\ folder
  4. go to qt-components-desktop\components\ folder (cd components), type "qmake && nmake install"
  5. go to qt-components-desktop\src\ folder, type "qmake && nmake install"
Share:
15,881
queuemel
Author by

queuemel

Updated on June 12, 2022

Comments

  • queuemel
    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
    Tiana987642 over 9 years
    It's a pity it works for the OP but not for me, I found an another working solution here in case someone need it