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

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -