
Originally Posted by
phillip_Qt
HI All
CAn any body tell me how to change QStringlist object to QString type.
my code is QStringList list1 = str.split(".");
i need to change list1 to Qstring type.
I tried like this reinterpret_cast<QString>(list1). but giving error.
THank you all.
Here is the solution :
strList << "bird" << "tree" << "water" ;
QString str
= strList.
join("");
// str = "birdtreewater"; str = strList.join(","); // str = "bird,tree,water";
QStringList strList;
strList << "bird" << "tree" << "water" ;
QString str = strList.join(""); // str = "birdtreewater";
str = strList.join(","); // str = "bird,tree,water";
To copy to clipboard, switch view to plain text mode
Bookmarks