You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Monday, July 27th 2015, 4:02am

how to split the QString quickly

QFilefile(str);
if(!file.open(QIODevice::ReadOnly))
return;
QTextStreamin(&file);
QTextCodec*codec=QTextCodec::codecForName("utf-8");
in.setCodec(codec);while(!in.atEnd()){
QString line=codec->fromUnicode(in.readLine());
QStringListstrList=line.split("",QString::SkipEmptyParts);

for(inti=0;i<strList.size();i++)
{

if(!enVector.contains(strList.at(i)))

enDicVector.append(strList.at(i));

enVector.append(strList.at(i));

}


as i said befoe,i tried to process 300,000 lines text file.
this way takes me too much time,please give me some ideas.thx!

2

Monday, July 27th 2015, 6:28am

i got the problem,now a new question is:
is there any class like "set" in c++ in QT to save no-repeat words ?thx for your help!

Similar threads

Used tags

QString, Qt5.4, split