Re: QStringList problem :/
deleted QStringList has operator[]
You should use iterators to iterate the list of strings
Or add the whole list into a string (with the delimiter you want), using join() and then use that string to setText in the lineEdit.
Re: QStringList problem :/
Quote:
Originally Posted by
Zlatomir
QStringList does not have the operator[]
It has: QStringList = QList<QString> => QList::operator[].
But I would prefere at() or value(). And in your case the suggested join() should be perfect.
Re: QStringList problem :/
@Lykurg: Thanks for correction, i'm used to c++ list (linked list) and keep forgetting that QList is implemented differently than QLinkedList (witch doesn't have [])
Re: QStringList problem :/
So, join() appends QStrings?
How do I use it?
Re: QStringList problem :/
Quote:
Originally Posted by
hakermania
How do I use it?
By reading the documentation or simply try?
Re: QStringList problem :/
Re: QStringList problem :/
Code:
path.join(l + ", ");
ui->lineEdit_6->setText(l);
doesn't workkkkkkkk
I am a beginner actually...:(:(
Can you help me on this?
Re: QStringList problem :/
I haven't tried it out, but reading the doc, I think you need to do:
Code:
ui->lineEdit_6->setText(l);
See if that works.
bepaald
Re: QStringList problem :/
Quote:
Originally Posted by
bepaald
I haven't tried it out, but reading the doc, I think you need to do:
Code:
ui->lineEdit_6->setText(l);
See if that works.
bepaald
Yep, thank you!