Reputation: 151
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.
Upvotes: 7
Views: 17031
Reputation: 9464
These are alternative steps using a windows system and mingw which comes with Qt. For this example, I installed the Qt SDK to C:\QtSDK
. For these instructions, I used Qt 4.8.1.
;
then the path to Qt's mingw bin directory, in this case it is C:\QtSDK\mingw\bin
;C:\QtSDK\Desktop\Qt\4.8.1\mingw\bin
;C:\QtSDK\mingw\bin;C:\QtSDK\Desktop\Qt\4.8.1\mingw\bin
. Note that these paths could also be added anywhere and whichever order within the path variable.SET PATH=%PATH%;C:\QtSDK\Desktop\Qt\4.8.1\mingw\bin
SET PATH=%PATH%;C:\QtSDK\mingw\bin
qmake && mingw-make install
C:\QtSDK\Desktop\Qt\4.8.1\mingw\imports\QtDesktop
so there is no need to manually move or create any folders.Attempt to compile and run the following code:
import QtQuick 1.1
import QtDesktop 0.1
Rectangle {
width: 100
height: 100
Button {
id: button
text: "Push me"
onClicked: button.text = "Pressed"
}
}
At the time of these instructions, the latest version of the QtDesktop components is 0.1. To check the version you installed, navigate to C:\QtSDK\Desktop\Qt\4.8.1\mingw\imports\QtDesktop
and open the file qmldir
with a text editor and notice the version number on each line.
Upvotes: 0
Reputation: 39
Upvotes: 3
Reputation: 151
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:
Upvotes: 8