[PyKDE] QFilePreview - cryptic RuntimeError

Martin Takeo Wiechert martin.wiechert at gmx.de
Tue Feb 10 21:50:01 GMT 2004


Hi.

I get the following error

Traceback (most recent call last):
  File "preview.py", line 19, in ?
    fd.setContentsPreview (w, p)
RuntimeError: underlying C/C++ object has been deleted

when calling the script below.
I'm completely lost with that. Any suggestions?

Thanks, Martin.


from qt import *

class preview (QFilePreview):
    def __init__ (self, widget):
        self.widget = widget
    def previewUrl (self, url):
        print url
        self.widget.setText ('Hi')

app = QApplication ([])
fd = QFileDialog ()
w = QLabel (None) 
p = preview (w)
fd.setContentsPreviewEnabled (True)
fd.setContentsPreview (w, p)
fd.setPreviewMode (QFileDialog.Contents)
fd.show ()
QObject.connect (app, SIGNAL ('lastWindowClosed ()'), app, SLOT ('quit ()'))
app.exec_loop ()




More information about the PyQt mailing list