[Solved] Using QmlDesktopViewer from within QtCreator
-
I'm using Qt (4.8), QtMobility and qt-components-desktop from Gitorious on Archlinux x86_64 and built with "qmake PREFIX=/usr" and all seemed to install okay but when I run a basic example all I get is...
@~/Devel/qt-components-desktop qmldesktopviewer/qmldesktopviewer examples/Gallery.qml
registerying types now
@
and it just hangs there. Any clues as to what might be happening? -
Thanks for your help Jens, you are right. I was a bit confused getting a Qt devel system set up from scratch and I see the wiki page specifically mentions to try examples/TopLevel.qml and sure enough it works as advertised. I added another Tools -> External -> Qt Quick -> QDesktopViewer option to qtcreator so now it also runs from within it as well.
-
I am a complete newbie to both Qt & Qml. I downloaded the qml desktop components and opened the project in QtCreator (by double clicking on desktop.pro).
When I tried to run the project, I get the message as given below.
Starting C:\QtProjects\desktop-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK__Release\qmldesktopviewer\release\qmldesktopviewer.exe…
registerying types nowI cannot see any windows or any other kind of outputs. When I try to close the qmldesktopviewer.exe tab (in Application Output pane), I get the message “qmldesktopviewer is still running. Force it to quit?”. So it means qmldesktopviewer started. But I don't know what else to do.
I had posted "here":http://labs.qt.nokia.com/2011/08/26/toplevel-windows-and-menus-with-qt-quick/ also the same issue and the author gave this reply:
[quote]
as i already mentioned, i believe that on windows “nmake install” should install the plugin to the right place. Unfortunately i don’t have a windows machine here right now to verify that. Once the plugin is installed in the right place, you have to run QmlDesktopViewer with the appropriate file as an argument, otherwise you will simply see nothing happening.
The appropriate files are either: TopLevel.qml or TopLevelBrowser.qml.
In case you are running QmlDesktopViewer from QtCreator, please make sure that you add the appropriate file as an argument in Run settings.
[/quote]Could you guys help me in getting this run? I am not even sure whether I am doing it the right way.
-
Yes, it's a bit confusing but the key point is the last sentence of the reply above. After loading the desktop example then go to the Projects section and note the Build|Run widget, select run then make sure "Run configuration:" is set to qmldesktopviewer and then put the full path to the TopLevel.qml demo in the Arguments field.
I got the full path of the TopLevel.qml file by going back to the Edit section and RMB on the desktop -> examples -> QML -> TopLevel.qml file and "Show Containing Folder" then did another RMB "Copy" operation on the TopLevel.qml file itself and pasted that into the Projects / Run / Arguments field. If the examples are not visible in the initial desktop project load then open desktop.pro and add "examples" to the end of the SUBDIRS line and reopen the project.
-
My project path is this: C:\QtProjects\QMLDesktopComponents\
I added the qml file path in Run configuration as you explained above. Now my Projects->Run->Arguments has "C:\QtProjects\QMLDesktopComponents\examples\TopLevel.qml" as the argument.
But when I run the project, I get this message now.
[quote]
Starting C:\QtProjects\desktop-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK__Release\qmldesktopviewer\release\qmldesktopviewer.exe...
registerying types now
file:///C:/QtProjects/QMLDesktopComponents/examples/TopLevel.qml:2:1: module "QtDesktop" is not installed
import QtDesktop 0.1
^
[/quote]I do not want to appear lazy, but can't figure out what is wrong. :(
-
A wild guess would be to try a copy of the whole examples folder in the same folder as qmldesktopviewer.exe, change the Arguments field to match, and see if that works. It might be a waste of time but I don't have a windows machine. Hopefully someone else with more windows experience can help.