470,849 Members | 1,361 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,849 developers. It's quick & easy.

Implementing a QFilePreview Class with PyQt

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
Jul 18 '05 #1
1 1454
Jim
Christopher Stone wrote:
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
Py***@mats.imk.fraunhofer.de. You can sign up at:

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

Jim
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

35 posts views Thread by Vamsi Mudrageda | last post: by
8 posts views Thread by simo | last post: by
2 posts views Thread by Sibylle Koczian | last post: by
1 post views Thread by Chump Wad | last post: by
10 posts views Thread by svenn.are | last post: by
10 posts views Thread by Simon John | last post: by
4 posts views Thread by Phil Thompson | last post: by
3 posts views Thread by Phil Thompson | last post: by
9 posts views Thread by anders | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.