PDA

View Full Version : replace string in QList<QStringList>



estanisgeyer
7th March 2008, 17:11
Good day,

I created a functional matrix using a pointer to QList<QStringList>.
I'm having a problem to exchange an item of my QStringList. I am trying:



QString s = "test";
listparc->at(0).replace(0, s);


The listparc is pointer to QList<QStringList>.

But I error in the compilation:
error: passing 'const QStringList' as 'this' argument of 'void QList<T>::replace(int, const T&) [with T = QString]' discards


What is the best way to do that?

Thanks
Marcelo E. Geyer
Brazil

wysota
7th March 2008, 17:34
QStringList slist = listparc->at(0);
slist.replace(0, s);
listparc->replace(0, slist);

estanisgeyer
7th March 2008, 17:40
Yes, before this your hint, I find the solution, the same this.
Thanks,

Marcelo E. Geyer