Results 1 to 5 of 5

Thread: Tried to redirect cout & cerr to QTextEdit instead of Console, but not working!

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Aug 2006
    Location
    Switzerland
    Posts
    52
    Thanked 13 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Tried to redirect cout & cerr to QTextEdit instead of Console, but not working!

    Quote Originally Posted by Krish View Post
    Qt Code:
    1. QDebugStream cout(std::cout, textEdit);
    2. QDebugStream cerr(std::cerr, textEdit);
    3. cout <<"Hello! We are ready for working" << endl;
    To copy to clipboard, switch view to plain text mode 
    You are trying to write to QDebugStream and you should write to std::cout, so try this:
    Qt Code:
    1. std::cout <<"Hello! We are ready for working" << std::endl;
    To copy to clipboard, switch view to plain text mode 
    instead.
    The Wheel weaves as the Wheel wills.

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

    Krish (27th March 2008)

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.