[Moved] Qt Quick Components for Desktop

  • Hi, guys. Could you explain me, how does this code works? I downloaded it. I compiled it. It has just qmldesktopviewer.exe. How to run my application in this viewer?

    "Qml components for Desktop?":http://labs.qt.nokia.com/2011/03/10/qml-components-for-desktop/

  • Hi,

    there are examples. Just pass path to files as argument to qmldesktopviewer.exe

    On my computer it looks like this:
    nikolay@task-struct:~/Development/Download/desktop/qmldesktopviewer$ ./qmldesktopviewer ../examples/TopLevel.qml

  • Is there any possibility to create it as one executable file, without viewer?

  • I`m not sure but I think that if qt components for desktop can run without qmldesktopviewer. qmldesktopviewer would not be writen.

    qmldesktopviewer is opensource, so you can use it`s code, add your qml code and create a single application.

  • Moderators

    You can of course also integrate the components into your stand-alone application.

  • I am the lead developer so I might be able to help you out. The QMLDesktopViewer is simply an alternative to the qmlviewer. The way you run normal Qt Quick applications is to do:
    "qmlviewer qmlfile.qml" and it will launch in it's own window. qmldesktopviewer works the same way.

    The reason you get qmldesktopviewer with the desktop components is that you might not want the default QMLViewer window with it's own menubar to be part of your desktop application so the only difference between qmlviewer and qmldesktop viewer is that it will not show a Window by default. Note that this means that you have to wrap your application inside a Window element for anything to show at all. To try it out, you simply run "qmldesktopviewer examples/TopLevel.qml"

    And of course you do not need to use the qmldesktopviewer when you compile your own application. You can just use a normal QDeclarativeView then, like any other Qt Quick application. There is no other magic involved to use desktop components. But if you use your own QDeclarativeWindow with your root item, you will not be able to control it's window properties.

  • Moderators

    Might be a good idea to add a short Readme to desktop component's sources on gitorious. Last time I've checked, there was none, and I remember it took me a while to figure out how to run it, too.

  • sierdzio: will do :)

  • We've put together a little tutorial and some startup code to build the "QML Desktop Components":http://labs.qt.nokia.com/2011/03/10/qml-components-for-desktop/ on Windows with Visual Studio 2010 and our favorite build support tool "CMake":http://www.cmake.org/.

    See our blog entry with the "detailed description":http://sharedrealitynews.blogspot.com/2012/02/building-qml-desktop-components-with.html

    Have fun,


Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.