Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. What is "State" used for?
Qt 6.12 LTS is out! See what's new in the release blog

What is "State" used for?

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 3 Posters 1.9k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Guys am kinda confused about the use of "Qt State"...is it some kind of tabpage, I mean it switches controls on it?

    And how do I use it on a mainPage? Could it be...

    @mainPage.state = 'State1'@

    mine don't work

    1 Reply Last reply
    0
    • T Offline
      T Offline
      twsimpson
      wrote on last edited by
      #2

      The state attribute, as you may expect, stores and sets what state something is in. This is the QML equivalent of the "Qt C++ State Machine Framework":http://qt-project.org/doc/qt-4.8/statemachine-api.html.
      You define some states in your QML object, usually define some transitions which should happen on entering each state, and set up the logic of your application to enter certain states on certain events.
      This "example":http://qt-project.org/doc/qt-4.8/declarative-animation-states.html shows how you could go about using states in your application.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andre
        wrote on last edited by
        #3

        It is not really equivalent. It is a much simpler solution than the state machine framework in Qt offers, but on the other hand every item can have it's own state.

        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
        • Unsolved