PDA

View Full Version : QXmlQuery::evaluateTo(QString) adds a line break



mentalmushroom
10th June 2011, 11:42
I noticed that QXmlQuery always adds an extra line break to the returned value (when evaluating to QString)


QXmlQuery q;
q.setQuery("'aaa'");
if (q.isValid() && q.evaluateTo(&s))
{
s.append("b");
qDebug()<<s<<endl;
}

The code above produces strange output:


"aaa
b"

instead of expected "aaab".

Is that a bug or am I doing something wrong?

@ntares
18th February 2013, 14:44
Same problem here with Qt 4.7.4 (I cannot move to earlier version), and I know I am a little late here, but if anybody know what happen ;) ?

For the moment I'm using a simple .remove('\n'), but it's crap !

mentalmushroom
18th February 2013, 16:24
I had it in 4.7.2, I have it in Qt 4.8.2. You are right, it's not really nice, but nobody cares. Perhaps, it worth to open the ticket on the bug tracker.

azalea
6th June 2018, 00:45
I still have newline in Qt 5.5...