Results 1 to 4 of 4

Thread: QXmlQuery::evaluateTo(QString) adds a line break

  1. #1
    Join Date
    Feb 2011
    Posts
    354
    Thanks
    17
    Thanked 27 Times in 24 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default QXmlQuery::evaluateTo(QString) adds a line break

    I noticed that QXmlQuery always adds an extra line break to the returned value (when evaluating to QString)
    Qt Code:
    1. QXmlQuery q;
    2. q.setQuery("'aaa'");
    3. if (q.isValid() && q.evaluateTo(&s))
    4. {
    5. s.append("b");
    6. qDebug()<<s<<endl;
    7. }
    To copy to clipboard, switch view to plain text mode 
    The code above produces strange output:
    Qt Code:
    1. "aaa
    2. b"
    To copy to clipboard, switch view to plain text mode 
    instead of expected "aaab".

    Is that a bug or am I doing something wrong?

  2. The following user says thank you to mentalmushroom for this useful post:

    azalea (5th June 2018)

  3. #2
    Join Date
    Feb 2013
    Posts
    1
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: QXmlQuery::evaluateTo(QString) adds a line break

    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 !

  4. #3
    Join Date
    Feb 2011
    Posts
    354
    Thanks
    17
    Thanked 27 Times in 24 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default Re: QXmlQuery::evaluateTo(QString) adds a line break

    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.

  5. #4
    Join Date
    Jun 2014
    Posts
    2
    Thanks
    8
    Thanked 2 Times in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default Re: QXmlQuery::evaluateTo(QString) adds a line break

    I still have newline in Qt 5.5...

Similar Threads

  1. [ANN] ODB C++ ORM adds support for Qt
    By borisk in forum Qt Programming
    Replies: 0
    Last Post: 28th April 2011, 12:08
  2. PyQT QwtScaleDiv adds ticks to axis
    By mbernasocchi in forum Qwt
    Replies: 12
    Last Post: 13th April 2011, 11:29
  3. Converting QString to char* in onl line
    By hubbobubbo in forum Qt Programming
    Replies: 10
    Last Post: 11th December 2009, 11:45
  4. Replies: 3
    Last Post: 1st October 2009, 23:19
  5. Possible to execute QXmlQuery on a QString?
    By chadkeck in forum Qt Programming
    Replies: 3
    Last Post: 8th October 2008, 17:24

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.