Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Solved Invalid property name "states" (M16).

    QML and Qt Quick
    2
    3
    2411
    Loading More Posts
    • 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
      Ardjay last edited by

      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 Reply Quote 0
      • A
        Ardjay last edited by

        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 Reply Quote 4
        • A
          Arief Nur Pratomo last edited by

          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 Reply Quote 0
          • First post
            Last post