August 23, 2012

ivoryZ ivoryZ
Lab Rat
8 posts

QtCreator 2.6 on Qt 5: “No qmlviewer installed”, “No valid targets found” and other newbie issues

 

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:

  1. git clone git://gitorious.org/qt/qt5 qt5
  2. cd qt5
  3. perl init-repository --no-webkit
  4. unset QTDIR; export PATH="$PWD/qtbase/bin:$PWD/qtrepotools/bin:$PATH"
  5. ./configure -nomake docs -nomake examples -nomake tests -nomake demos -v -release -opensource -confirm-license -prefix /media/MediaExt4/Qt5Beta_1 -xcb -qpa -no-gtkstyle -platform linux-g++ -no-audio-backend -no-cups -no-javascript-jit -no-neon -no-wayland
  6. ./build -j 4
  7. 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:

  1. cd $SOURCE_DIRECTORY
  2. git clone git://gitorious.org/qt-creator/qt-creator.git .
  3. git checkout -t remotes/origin/2.6
  4. cd ..
  5. mkdir $BUILD_DIRECTORY
  6. cd $BUILD_DIRECTORY
  7. qmake $SOURCE_DIRECTORY/qtcreator.pro
  8. time make -j 4

With this setup I have got the following (silly? ;) questions:

1. 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…

2. (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
Sysroot: <empty>
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…

3. 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”…
4. Typing “$BUILD_DIRECTORY/bin/qtcreator” in shell gives:
Failed to load platform plugin “-no-gtkstyle”. Available platforms are:
linuxfb
minimal
xcb

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?
5. 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?
6. 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 =)

3 replies

August 23, 2012

sierdzio sierdzio
Area 51 Engineer
4107 posts

How are those “newb questions”? Judging from the configure line you have used, you are a bit more than a newbie ;)

Ad. 1. QMLViewer for Qt5 is not ready in Qt Creator. It was working in older versions, but they have dropped it, because Qt5 sources were changing too rapidly, and maintenance was too cumbersome. Search for posts by Tobias Hunger, he explained the issue several times in other topics.

Ad. 2. If you’ve added Qt5 as in 1), this one should work. Probably. I’m using projects that already exist, so maybe I just did not run into that problem.

Ad. 3. I would advise against installing Qt5. Make a local, dev build. It’s easier, safer, and often works. You can install 4.8.2 globally and that might solve some problems you have with QtCreator, actually.

Ad. 4. It might be that your configure line there was wrong, but I’m not sure here.

Ad. 5. Yes. You can build from master to get even newer code, but there is probably no need to. 2.5 works fine, too, apart from missing includes.

Ad. 6. -no-gtkstyle is there to make sure Qt4 does not get into PATH on some systems. If you want to try Qt Quick 2, you should not bother yourself with styles anyway ;)

 Signature 

(Z(:^

August 23, 2012

Tobias Hunger Tobias Hunger
Mad Scientist
3383 posts

2) The “no valid targets” is always shown, which is a bug… It did not show up a while back. I’ll fix it once I get round to it. Qt Quick applications are actually Qt Quick 1 applications: They require Qt 4. There is still some work ongoing to get Qt 5 Qt Quick application wizards, but I am currently not sure about their status.

August 26, 2012

ivoryZ ivoryZ
Lab Rat
8 posts

Thank you for your answers. 4 is solved by removing -qpa from the configure line, since it eats “-no-gtkstyle” and is not really needed on my desktop. I guess it is used in embedded devices…

 
  ‹‹ QtCreator shell script project      Problem importing .pro file into Visual Studio ››

You must log in to post a reply. Not a member yet? Register here!