Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing Qt Quick Components for Desktop for use with Qt Creator

Tags:

qt

qt-creator

qml

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.

like image 993
queuemel Avatar asked Jun 09 '11 20:06

queuemel


People also ask

Is Qt and Qt Creator same?

Qt Creator is just an IDE used to build QT applications; both Qt Widgets and Qt Quick can be composed. When writing Qt Widgets applications you can edit your GUI in Qt Designer but in case of Qt Quick applications you use Qt Quick Designer, both integrated into Qt Creator.

How do I add components to Qt?

You can just use Qt Maintenance tool to to add components and to update or remove installed components. Launch Qt Maintenance Tool and choose Add or remove components. Add a tick to the Qt Charts component in your currently installed version of Qt. Click the update button and wait for the process to complete.

Where is Qt Creator installed?

For the per user install, the default installation will be a subdirectory called Qt in the current working directory. For the global install, the default location is /opt/Qt. Determine whether you want to install per user or global and then run the installer.


2 Answers

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)
like image 58
queuemel Avatar answered Oct 11 '22 13:10

queuemel


  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"
like image 40
Andrew Avatar answered Oct 11 '22 15:10

Andrew