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. #8
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

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

    Ufff.
    Thanks for your patience....
    I already have a int to string converter , the std::stringstream does the work.
    I use this stringstream to store the elements I want to show later (to a file, to a listbox, to QtCreator application output, etc. )
    I have << operator for every type (including QString), so when I call W_debug()<< 33; I store the data into my stringstream.
    Qt Code:
    1. W_debug & operator << (const QString data) ;
    2. W_debug & operator << (const std::string data);
    3. W_debug & operator << (const char data) ;
    4. W_debug & operator << (const char * data) ;
    5. .....
    To copy to clipboard, switch view to plain text mode 
    I have to use const char * data to accept <<"hello" .

    If I implement an ' output'(to file, to listbox,etc) on every << , w_debug()<<"1"<<"2"<<"3"; will gives me 3 lines and I want 1.
    To avoid this, my idea is to store the information into the stringstream while I have << << << and output when I finish the calls to W_debug.
    Now, the 'magic' is how can I know when a '<<' are the last ?

    I hope you understand me now and thanks again.
    Last edited by tonnot; 5th May 2011 at 19:58.

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, 22:23
  2. custom QColumnView, some questions
    By Mystical Groovy in forum Qt Programming
    Replies: 1
    Last Post: 9th October 2009, 14:03
  3. Replies: 0
    Last Post: 9th September 2009, 02:35
  4. questions re: inline implementation, const
    By Urthas in forum Newbie
    Replies: 1
    Last Post: 2nd May 2009, 22:41
  5. Some questions about custom style
    By charlse in forum Qt Programming
    Replies: 0
    Last Post: 2nd April 2009, 09: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.