Hi, I had some previous experience with non-Gui Qt development and now I would like to try the fresh and hot QtQuick 2. Yesterday I built Qt5 Beta1 on my Ubuntu 12.04 32 bit by following the guidelines at http://qt-project.org/wiki/Building_Qt_5_from_Git:
git clone git://gitorious.org/qt/qt5 qt5
perl init-repository --no-webkit
unset QTDIR; export PATH="$PWD/qtbase/bin:$PWD/qtrepotools/bin:$PATH"
./build -j 4
PATH=/media/MediaExt4/Qt5Beta_1:$PATH QTDIR=/media/MediaExt4/Qt5Beta_1 make -j 4 install
Then I built QtCreator 2.6, which I assume should work OK with Qt5:
git clone git://gitorious.org/qt-creator/qt-creator.git .
git checkout -t remotes/origin/2.6
time make -j 4
With this setup I have got the following (silly? ;) questions:
I did not have any other Qt installations prior to this one (Qt5Beta_1). In Tools->Options->Build and run->Qt Versions I've set Qt version to point to /media/MediaExt4/Qt5Beta_1/bin/qmake in the "Manual" field. Got "No qmlviewer installed" warning, however QML dump and qmake were located fine by QtCreator.
I rolled up my sleeves and dived into the code. In ../src/plugins/qtsupport I found that QtCreator parses $QTDIR/mkspecs/default/qmake.conf to get "QT.qml.bins" as a location directory of qmlviewer (for QT >= 5 this is qmlscene actually). I added "QT.qml.bins = /media/MediaExt4/Qt5Beta_1/bin" to the qmake.conf and the warning in QtCreator was gone. But, I assume there is a nicer way to avoid this warning. Probably my build/installation was not properly made...
(Related to 1?) When I click "File->New file or project->Qt Gui Application", and reach the "Target setup" window, I see "No valid targets found", but below this text I can actually choose the "Desktop" target and click Next. The created "Gui Application" would compile and run just fine. But when I try to "File->New file or project->Qt Quick Application (Build in elements)", the "No valid targets found" text is again there and this time there are no targets listed in the window and I can't press "next".
In "Build and run->Targets" I have:
Device type: Desktop
Device: Run locally
Toolchain: GCC (x86 32bit)
Debugger command: /usr/bin/gdb
Qt version: Qt 5.0.0 (Qt5Beta_1)
Qt mkspec: <empty>
(Btw, when I try to enter "linux-g++" to "Qt mkspec" and press "Apply", the field wont save my changes and remain empty. Should I leave it empty?)
Any ideas? I have not found any instructions on setting up the Desktop target in QtCreator...
- When I configure Qt5 with "-developer-build", the built $QTDIR/bin won't contain assistant, designer, etc. I guess developers don't need all that stuff, right? So, I used "-release" and got much more executables, including qmlviewer, which I though was phased out by qmlscene (but probably left for older qml versions?). Also, "make install" for Qt5 actually took quite a lot of time to complete: it built qtdeclarative and some other stuff, if my memory serves. Is this normal? I expected everything to be built by "./build -j 4"...
- Typing "$BUILD_DIRECTORY/bin/qtcreator" in shell gives:
Failed to load platform plugin "-no-gtkstyle". Available platforms are:
Aborted (core dumped)
Same thing is with the executables in $QTDIR/bin: assistant, qmlscene, etc.
I can fix this by passing "-platform xcb" as a parameter to the executables, but this is more like hacking than finding the root cause. Qmlscene won't start from within QtCreator for .qml files due to this issue. Any ideas on what I did wrong during the build/install?
- Just to make sure I am using the right version of QtCreator: "Help"->"About Qt Creator" shows version 2.5.81. Is this a soon-to-become 2.6 version? I've built it from remotes/origin/2.6, so I assume it is "2.6", right?
- I also tried to launch QtCreator and other executables in QTDIR/bin on Kubuntu (KDE), but their style is still GTK-alike, not a native Plasma look. Can it be fixed? What is "-no-gtkstyle" for then?
Sorry for too wordy questions. Hopefully with your help I would get my hands on QtQuick2 soon =)