[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyKDE] PyQt4 question - QFileIconProvider
From: Detlev Offenbach <detlev () die-offenbachs ! de>
Date: 2006-10-03 13:17:09
Message-ID: 200610031517.09485.detlev () die-offenbachs ! de
[Download RAW message or body]
On Tuesday 03 October 2006 09:58, Phil Thompson wrote:
> > On Monday 02 October 2006 18:36, Phil Thompson wrote:
> >> > Hi,
> >> >
> >> > I would like to have my own file icon provider for QFileDialog.
> >> > Therefore, I
> >> > created a derived class and wanted to overwrite the icon methods.
> >> > Unfortunately Python doesn't allow to have to methods with the same
> >>
> >> name
> >>
> >> > but
> >> > different signature. How do I implement the two virtual icon methods
> >>
> >> of
> >>
> >> > QFileIconProvider, so that they get called by a QFileDialog after the
> >> > icon provider of the dialog was set?
> >>
> >> You need to type check the argument yourself (eg. isinstance(arg,
> >> QFileInfo)) to work out how it was called.
> >>
> >> Phil
> >
> > I thought so. Unfortunately, my variant of the icon method doesn't get
> > called,
> > allthough the iconProvider call to the created QFileDialog shows, that my
> > IconProvider is installed. What am I doing wrongly?
>
> As ever, a small complete example that demonstrates the problem...
>
Problem solved. The icon provider for the dialog was set too late, so the
first files/directories were read already by the QDirModel of the
QFileDialog. Now I set the icon provider right after the dialog instantiation
and it works as expected.
Regards,
Detlev
--
Detlev Offenbach
detlev@die-offenbachs.de
_______________________________________________
PyKDE mailing list PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic