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. QML form in C++ class

QML form in C++ class

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 1.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.
  • S Offline
    S Offline
    Serifless
    wrote on last edited by
    #1

    I want build a new project using Qt Quick and the new native widgets available. I want to use C++ for the application logic. This is where I get a bit confusion.

    Every example just puts everything in the main.cpp of the program. This is very messy. With old widgets system, I would have a class for every window in the application.

    How do I do this with QML? How do I wrap my main.qml file in a C++ class called MainWindow that I can open from main.cpp? How would other window classes be opened from that? I have put my main.qml in a resource file.

    1 Reply Last reply
    0
    • JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      Hi, and welcome to the Qt Dev Net!

      "QQuickView":http://qt-project.org/doc/qt-5/qquickview.html is the C++ class for showing QML-based GUI elements.

      See https://blog.qt.digia.com/blog/2013/02/19/introducing-qwidgetcreatewindowcontainer/ to embed a QQuickView into QWidgets. Qt 5.3 will have a new QQuickWidget class that makes this much simpler.

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      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