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. Invalid property name "states" (M16).

Invalid property name "states" (M16).

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

    Quite new to Qt5 programming I tried getting some feeling for QML and Qt Quick by following one of the embedded tutorials in Qt Creator on the subject.
    But when asked to add states in QMLDesigner by clicking the "+" sign I instantly got the error message "Invalid property name "states" (M16)." and no states are added. So I effectively cannot use QtQuick. I tried adding them manually to the QML file itself, but then they dont show up in de designer either.
    What am I doing wrong if anything?

    Windows 10 - Qt Creator 4.13.0 - Qt 5.15.0 - building for MSVC 19 64 bit.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Ardjay
      wrote on last edited by
      #2

      Solved. I already found that I was using a Window type which indeed does not have a "states" property.
      Would have liked another message to tell me that though.

      1 Reply Last reply
      4
      • A Offline
        A Offline
        Arief Nur Pratomo
        wrote on last edited by
        #3

        In the Qt tutorial said that:

        Qt Creator generates a QML file, main.qml, and opens it in Text Editor. The wizard template uses the Window type, which does not support adding states. Because we want to use states in this example, we first replace the Window type with a Rectangle type. We must also remove the line that sets the title property, which the Rectangle type does not have. If you change the value of the Type property in the Properties view, Qt Creator offers to automatically remove the title property.

        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