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. QML array alternative syntax

QML array alternative syntax

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 3 Posters 1.3k 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.
  • X Offline
    X Offline
    X-Krys
    wrote on last edited by
    #1

    In QML the regular syntax to fill an array in declarative way is :

    @states: [
    State {...},
    State {...},
    State {...}
    ]@

    I found out by accident that an alternative syntax is also supported but it didn't find any doc about it :

    @states {
    State {...}
    State {...}
    State {...}
    }@

    It doesn't seem new since it is supported also on Qt 4.8 for instance.

    Does anyone use it ?
    Is some obsloete early QML feature that would be removed at some point ?

    Thanks,
    Christopher

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

      I think it is just as valid as the other one, so it is unlikely to go away.

      (Z(:^

      1 Reply Last reply
      0
      • X Offline
        X Offline
        X-Krys
        wrote on last edited by
        #3

        Ok I should fill a bug report on the doc side then

        1 Reply Last reply
        0
        • D Offline
          D Offline
          DerMas
          wrote on last edited by
          #4

          edit: not useful anymore

          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