Results 1 to 14 of 14

Thread: Some questions about qdebug, a custom debug and const approach

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: Some questions about qdebug, a custom debug and const approach

    I hope now you can to understand my problem.
    It looks to me your problem is in understanding how the operators work in C++, or perhaps int to string conversion?, I am not sure, maybe both?

    And....what I want is :
    a word 33
    Do you want "a ward 33" (everything as a string)?
    Then you need to convert your value to string.
    If its an int, then you can use:
    Qt Code:
    1. QByteArray ba = QString::number(data1).toAscii();
    2. const char *pStrData = ba.data();
    3. w_debug()<<"a word "<<pStrData;
    To copy to clipboard, switch view to plain text mode 
    for example

    But the right way would be to use safe types (which you completely ignored in my post) - why don't you just use QString or at least std::string?
    Last edited by high_flyer; 5th May 2011 at 17:42.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Questions on using custom widgets in a QTableView
    By d_stranz in forum Qt Programming
    Replies: 0
    Last Post: 25th October 2010, 23:23
  2. custom QColumnView, some questions
    By Mystical Groovy in forum Qt Programming
    Replies: 1
    Last Post: 9th October 2009, 15:03
  3. Replies: 0
    Last Post: 9th September 2009, 03:35
  4. questions re: inline implementation, const
    By Urthas in forum Newbie
    Replies: 1
    Last Post: 2nd May 2009, 23:41
  5. Some questions about custom style
    By charlse in forum Qt Programming
    Replies: 0
    Last Post: 2nd April 2009, 10:54

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
  •  
Qt is a trademark of The Qt Company.