c++ - QString functions giving incorrect results on CentOS -


i using c++ qt library , following code working on windows not working on centos :

if(line.startswith("[", qt::caseinsensitive)) {     int index = line.indexof(']', 0, qt::caseinsensitive);     qstring subline = line.mid(index+1);     subline = subline.trimmed();     tokenlist = subline.split("\t"); } else {     tokenlist = line.split("\t"); } 

i have line [ x.x.x.x ] ../dir/file.extension , want ignore [x.x.x.x] part while breaking line tokens. using vc9 on windows debug , working fine.

edit: have removed mid() , used right() still same problem persists, working on windows not on centos.

edit: after debugging on linux using qmessagebox have concluded control never going inside if block, tried using if(line.data()[0] == '[') same results.

your code can simplified.

line.remove(qregexp("\\[\\s+\\d+\\.\\d+\\.\\d+\\.\\d+\\s+\\]")); tokenlist = line.split("\t"); 

Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -