PDA

View Full Version : How to debug very long QString / show html source in GUI



madwolf
16th May 2010, 13:16
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?

tbscope
16th May 2010, 14:18
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

madwolf
16th May 2010, 17:23
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 :-)