[PyKDE] QPixmap.grabWidget() damages icons and QFilePreview doesn't work

Hans-Peter Jansen hpj at urpla.net
Fri Feb 11 19:40:55 GMT 2005


On Friday 11 February 2005 19:29, Phil Thompson wrote:
> On Thursday 10 February 2005 5:04 pm, Hans-Peter Jansen wrote:
>
> It seemed to work fine for me (with enablePreview = 0).

Hmm, strange. Thanks for testing.

> > While at it, I discovered the QFilePreview ability, and tried to
> > add it, but failed. When enabled (set enablePreview = 1), it just
> > issues a SystemError with this confusing message:
> >
> > Traceback (most recent call last):
> >   File "iconfactory.py", line 165, in saveScreenshot
> >     fd.setContentsPreview(p, p)
> > SystemError: error return without exception set
> >
> > Puzzled! According to your docs, it is fully implemented.
>
> You are creating a Python class that multiply inherits from two C++
> classes - you can't do that.

From the QFilePreview docs:

This class is an abstract base class which is used to implement 
widgets that can display a preview of a file in a QFileDialog. 
You must derive the preview widget from both QWidget and from this 
class. Then you must reimplement this class's previewUrl() function, 
which is called by the file dialog if the preview of a file 
(specified as a URL) should be shown. 

Any idea, how this could be done, while complying with sip's first 
law?

TIA,
Pete




More information about the PyQt mailing list