Important: Please read the Qt Code of Conduct -

QStringList ->QPointF,QSizeF Coversion???

  • Hello,

    I have QStringList now I want to convert my String list element into X co-ordinate and y co-ordinate..also want to convert into QSizeF i.e Width and height

    MAny Thanks

  • Mayby just iterate through QStringList and use QString::toFloat() method?

    QStringList coordinates_list = ... //your string list
    QList <QPointF> point_list; //retrived point list
    QList <QSize> size_list; //retrived size list
    for (int i = 0; i < coordinates_list.size(); i+=2) //assuming that the list is like x,y,x,y,x,y
        float x =;
        float y =;
        point_list << QPointF(x,y);
        size_list << QSize(x,y);

Log in to reply