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. How to run te application with QtQuick.Controls?
QtWS25 Last Chance

How to run te application with QtQuick.Controls?

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 2 Posters 2.2k Views
  • 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.
  • B Offline
    B Offline
    bee.
    wrote on last edited by
    #1

    When I import QtQuick.Controls 1.0 there is an error while debugging:

    bq. Error: No widget style available.
    Qt Quick Controlscurrently depend on the widget module to function.
    Use QApplication when creating standalone executables.

    Should I add an import or maybe an include somewhere?

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

      You are probably running your app with a QGuiApplication as the application instance. Just change that to QApplication and it should work fine.

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bee.
        wrote on last edited by
        #3

        Thank you for a hint. I've change QGuiApplication for QApplication and also include <QtWidgets/QApplication> instead of <QtGui/QGuiApplication> but there are some linking problems and no main.obj file.
        I've created Qt Quick 2 Application (build-in elements). I'm also using Qt 5.1 alpha, but I had a problem during compiling it (http://qt-project.org/forums/viewthread/26325/#122803) maybe that's the ponit.

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

          Did you also add "QT += widgets" in your .pro file? There is an ApplicationTemplate example in the examples folder that should work out of the box.

          1 Reply Last reply
          0
          • B Offline
            B Offline
            bee.
            wrote on last edited by
            #5

            I run the ApplicationTemplate. There are some warnings and the
            bq.
            import QtQuick.Layouts 1.0

            is underlined (errors during typeinfo files reading), but it works. My test app also works but I had to remove qmlapplicaionviewer folder and copy the main.cpp and .pro file from the example.

            When I switch into the design mode QtCreator just dies. But at least in Edit mode it's working. So thank you, thank you, thank you! :)

            Edit: maybe it doesn't work well.. QtCreator slowed down and often dosn't answer. The MenuBar is underlined (Could not resolve the prototype 'MenuBarPrivate' of 'MenuBar' (M301) ), but it builds the application.

            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