Results 1 to 4 of 4

Thread: Is it me or....

  1. #1
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Is it me or....

    For some reason I decided to refactor a piece of code of one of my projects this morning and the results I got sounded weird . After tracking errors I tried this piece of code :

    Qt Code:
    1.  
    2. val << "subdirs";
    3.  
    4. qDebug("value : \'%s\'", val.at(0).toLatin1().data());
    5.  
    6. if ( val.at(0) != "subdirs" )
    7. qFatal("Shit! what is QString doing?");
    To copy to clipboard, switch view to plain text mode 

    Guess the debug output I obtained!

    value : 'subdirs'
    Shit! what is QString doing?


    I was just wondering if there could be a rationnal reason for such a thing to happen... I tried a "make clean && qmake && make" => no changes!!! I'm about to reboot my computer re-"make clean && qmake && make", but, even it were to work again, I'd still be puzzled by this weird error...
    Current Qt projects : QCodeEdit, RotiDeCode

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Is it me or....

    It works OK on my system. Maybe the source file has some strange encoding?

  3. #3
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Is it me or....

    maybe... What's weird is that it just never happened before... maybe when i'll reboot my computer everything will be ok again... I really hope so! If it doesn't I'll try changing the encoding of the file or i'll check that QString::fromAscii works fine (it is said to be used in the comparison operator...)
    Current Qt projects : QCodeEdit, RotiDeCode

  4. #4
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default [SOLVED] Is it me or....

    I fixed it! I forgot to mention that the way I filled the list was not that simple... And there lied the problem!

    I parsed a QChar* by hand and the last word was always one char too long! And that char seemed to be some sort of unicode terminaison character (it looked like a sucribe 'x') and was not conserved by toLatin1() thus it didn't appeared in the debug output, until I used QMessageBox::warning() instead of qDebug()...
    Current Qt projects : QCodeEdit, RotiDeCode

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.