Results 1 to 3 of 3

Thread: How to debug very long QString / show html source in GUI

  1. #1
    Join Date
    May 2010
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Question How to debug very long QString / show html source in GUI

    Hello,
    I'm opening a webpage in QWebView and then I need to parse the html in my program to get some data out of it. I copy the html into QString using QWebFrame->toHtml().
    Is there anyway I can see what exactly is being put into the QString? The debugger doesn't show any contents, I guess the variable is too big to fit into the debugger window. I'm using the debugger integrated with QT Creator.
    I tried to display it using QTextBrowser: ui->textBrowser->setText(robo1);
    robo1 is my QString containing HTML.
    However, the page is being rendered in the QTextBrowser. How can I make it show the source?

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: How to debug very long QString / show html source in GUI

    You can use setPlainText().

    If you use qDebug(), and you have a lot of data, you can direct the debug output to a file too. See the documentation of qDebug

  3. The following user says thank you to tbscope for this useful post:

    madwolf (16th May 2010)

  4. #3
    Join Date
    May 2010
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: How to debug very long QString / show html source in GUI

    yep, qDebug() did the trick. Sorry, I'm such a newbie in Qt. Got a mac and I'm now trying to rewrite my few C# .NET programs into QT so I can use them on both systems :-)

Similar Threads

  1. Hot do I get HTML source from a web page?
    By earendil in forum Newbie
    Replies: 9
    Last Post: 16th March 2012, 15:15
  2. How to use html to show overlapped images in QToolTip
    By LorenLiu in forum Qt Programming
    Replies: 0
    Last Post: 19th April 2010, 08:52
  3. Can't debug source file
    By oetzi in forum Newbie
    Replies: 5
    Last Post: 27th December 2007, 07:46
  4. Display '<' as HTML in QString
    By mclark in forum Qt Programming
    Replies: 4
    Last Post: 6th July 2007, 21:43
  5. WYSIWYG html, Window show png icon mac no!
    By patrik08 in forum Qt Programming
    Replies: 10
    Last Post: 25th May 2006, 12:01

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.