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. How to define a StringList (QStringList)
Qt 6.11 is out! See what's new in the release blog

How to define a StringList (QStringList)

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 3.2k 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

    Hello.

    How can I create a Stringlist in a Qt Quick Application ?

    @
    property int xx:0 // this works
    property int yy: 0 // this too

    property qstringlist sl1: nil   // error
    

    @

    How can I create a StringList, it should not be seen be the user, just a variable with data and the ability to add lines.

    Thanks

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      qstringList is not a qml type.

      If you want to use one only with qml, use javascript array, or from Cpp using setContextProperty(... and then you can use it with the model of a hidden ListView, for example.

      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