Important: Please read the Qt Code of Conduct -

How to define a StringList (QStringList)

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


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

Log in to reply