QStringList与QString互转

QStringList fonts;
fonts << "Arial" << "Helvetica" << "Times" << "Courier";
QString str = fonts.join(","); 


QString str = "name1,path1;name2,path2;name3,path3"; 
QStringList list1 = str.split(";"); // 注意,如果str是空字符串,list1会增加一个空字符串到列表里,其size=1,我为此吃过苦头~
for(int i=0;i

 

参考:

https://www.yuque.com/docs/share/778f181c-1efb-4e3f-8a19-703c45df2f02

你可能感兴趣的:(QT,C++,QStringList,QString)