[PyQt] Two QWebView == Segfault?

Andreas Pakulat apaku at gmx.de
Sun Feb 27 22:21:09 GMT 2011


On 28.02.11 03:53:16, Robert Siemer wrote:
> siemer at eee:~$ python
> Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39)
> [GCC 4.4.5] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> ~/.pystartup loaded.
> >>> from PyQt4 import QtWebKit, QtGui
> >>> q = QtGui.QApplication([])
> >>>
> >>> wv = QtWebKit.QWebView()
> >>> wv2 = QtWebKit.QWebView()
> >>> wv.setHtml('hallo')
> >>> wv2.setHtml('hallo2')
> >>> Segmentation fault
> siemer at eee:~$ j
> 
> What am I doing wrong? – The segmentation fault does not come
> immediately. I have to type something (above I typed “j”).

Just a guess, but QApplication actually stores a reference to the
argc/argv (in c++), so your problem might be that you're passing in a
temporary list there (not sure wether PyQt increases the refcount on
it). So try passing in sys.argv instead.

Andreas

-- 
You are fairminded, just and loving.


More information about the PyQt mailing list