Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [Solved] Using QmlDesktopViewer from within QtCreator
Forum Updated to NodeBB v4.3 + New Features

[Solved] Using QmlDesktopViewer from within QtCreator

Scheduled Pinned Locked Moved QML and Qt Quick
9 Posts 4 Posters 4.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    markc
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jens
      wrote on last edited by
      #2

      The Gallery example is not a Window, hence it will not show up in the QmlDesktopViewer. There is a different TopLevel example you can use to try out that. The Gallery example should open fine in the regular QMLViewer.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        markc
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • U Offline
          U Offline
          unni
          wrote on last edited by
          #4

          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 now

          I 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.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            markc
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            • U Offline
              U Offline
              unni
              wrote on last edited by
              #6

              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. :(

              1 Reply Last reply
              0
              • M Offline
                M Offline
                markc
                wrote on last edited by
                #7

                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.

                1 Reply Last reply
                0
                • J Offline
                  J Offline
                  Jens
                  wrote on last edited by
                  #8

                  unni: Did you do a make install after compiling the desktop component project itself? This should copy the relevant files into QTDIR/imports/Qt/labs/QtDesktop and allow you to import QtDesktop into the project.

                  1 Reply Last reply
                  0
                  • J Offline
                    J Offline
                    Juanin
                    wrote on last edited by
                    #9

                    Does anybody tried to use it with SDK 1.2.

                    It compliles fine, but Qt Quick (inside QtCretor) crashes if you try to see the designer with it.

                    Any idea why?

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved