Debugging with Qt

Whether you are using PySide or PyQt, you will likely run into sites where you need to debug the application or script. We have already covered one way to do so, by utilizing the QWebView GUI show() method to "see" what is being rendered on the page you've loaded. You can also use the page().mainFrame().toHtml() chain (easily referenced when using the BrowserRender class via the html method to pull the HTML at any point, write it to a file and save and then open it in your browser.

In addition, there are several useful Python debuggers, such as pdb which you can integrate into your script and then use breakpoints to step through the code where the error, issue or bug is expressed. There are several different ways to set this up and specific to whichever library and Qt version you have installed, so we recommend searching for the exact setup you have and reviewing implementation to allow setting breakpoints or trace.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset