Implementing a QFilePreview Class with PyQt

C

Christopher Stone

Does anyone have an example of how to do this? When I try to make a
class that subclasses from a QFilePreview class and a QWidget class, I
get the following error:

TypeError: Cannot sub-class from more than one wrapped class
 
J

Jim

Christopher said:
Does anyone have an example of how to do this? When I try to make a
class that subclasses from a QFilePreview class and a QWidget class, I
get the following error:
TypeError: Cannot sub-class from more than one wrapped class

I haven't tried it, but looking at the Qt source code, it appears that you
only really need to subclass QFilePreview and provide a previewUrl method.
I'd try that.

The setInfoPreview and setContentPreview methods both take (QWidget*,
QFilePreview*) and the associated comments say to provide the same pointer
for both arguments if your subclass inherits both, which seems to imply you
could just inherit QFilePreview and construct the QWidget somewhere else.

I didn't notice any place else in qfiledialog.cpp where multiple inheritance
is really required for QFilePreview. Then again, it was a pretty quick look
at the C++ code.

PyQt doesn't allow multiple inheritance of Qt classes in creating a new
Python class.

There are other possible solutions, but the above is what I'd try first.
You might also get more info from the PyKDE mailing list at
(e-mail address removed). You can sign up at:

http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

Jim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top