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. QtQuick 2.2 and states
Forum Updated to NodeBB v4.3 + New Features

QtQuick 2.2 and states

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

    Hi,

    I try to write simple window with few states and when i try to set Rectangle or Item element as root instead of default Window element application doesn't open. In Qt Designer I can manipulate states panel then and preview looks nice.

    When I set Window element as root I get error that Window element doesn't contains states property so I put Rectangle one level below Window, setted it states and it works good, but unfortunately I can't manipulate into states panel in Designer (I can't even see any states besides default there).

    How can I make this in the newest version?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      There are several ways you can run a QML app, but mixing them is not supported. Qt Creator's default template uses Window by default, but you can change this. Here is how:

      Change Window to Rectangle, like you've already tried

      In c++ code, use QQuickView class to display your QML file

      An alternative would be to leave everything as-is, and just add a root Rectangle element (that is, add a rectangle to Window, make use anchors.fill = parent), and handle states there.

      (Z(:^

      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