Convert QList<int> to QString

  • Hi,

    At the moment i am working on my first big project. But now i'm stuck, i need to convert a QList<int> to a QString. The String should be like this: "int,int,int,int". I need to convert it for saving the list in a database. I tried it with a QListIterator, but it doesnt work. Hope u understand what i mean;)

  • @
    QList<int> list;
    QString string;
    for(int i=0; i<list.size(); i++)
    string += QString::number(list[i]);
    string += "," ;

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.