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. Noob Question: What's up with QtQuick.Window ?
Forum Updated to NodeBB v4.3 + New Features

Noob Question: What's up with QtQuick.Window ?

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

    Hi... coming from the C++ side of Qt, I'm now looking at QtQuick, and going through the examples. One Caveat I've found is that the template in QtCreator imports QtQuick.Window, and apparently the root element needs to be called Window. Not having this, my programs execute but nothing comes up.

    As per the docs:
    [quote]Omitting this import will allow you to have a QML environment without access to window system features.
    [/quote]

    Most of the examples don't have this. They don't import QtQuick.Window, start with Rectangle, and go from there. I generally like following tutorials to a T with something new, and am wondering if I"m missing something. The tutorials states you should be able to view these, but when I run them from Creator, I don't. :-/

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi,

      AFAIK, From Qt 5.3, QtCreator creates a project with Window component as default root Object.
      Since Window is just a container you should add an Item to it For eg. a Rectangle. Try adding it and you will see a Rectangle.

      Also if you want don't want Window as root object you can replace it with Rectangle but then you will have to use QQuickView instead of QQmlApplicationEngine to load the QML.

      157

      1 Reply Last reply
      0
      • G Offline
        G Offline
        gaijinpunch
        wrote on last edited by
        #3

        Thanks for the reply. I assume QQuickView is used you make a "QT Quick UI" as opposed to a "QT Quick Application" in creator. I can probably live either way for now. :)

        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