[PyQt] Strange bug in PyQt

Roberto Alsina ralsina at kde.org
Sat Aug 9 22:12:12 BST 2008


On Saturday 09 August 2008 15:57:01 Andreas Pakulat wrote:
> On 09.08.08 14:09:17, Roberto Alsina wrote:
> > On Saturday 09 August 2008 09:40:31 Andreas Pakulat wrote:
> > > On 08.08.08 19:42:19, Roberto Alsina wrote:
> > > > On Friday 08 August 2008 18:43:12 Andreas Pakulat wrote:
> > > > > On 08.08.08 16:36:35, Roberto Alsina wrote:
> > > > > > I don't know how to explain it, si I have to use pictures.
> > > > >
> > > > > Are you talking about the cut-off menu items? Or what? Which parts
> > > > > of the pictures should we look into/
> > > >
> > > > Cutoff menu items, varying font sizes, the "Search" label, even the
> > > > left qtreeview's header is weird.
> > > >
> > > > Loos like font metrics were all cray.
> > >
> > > Hmm, can you produce a small example that demonstrates the problem? Its
> > > quite weird that loading an icon in a different way has such an effect.
> > > I'm suspecting a bit that this might be an issue on your machine, so it
> > > would be good to test it on other machines/different setups.
> >
> > Attached is an example, and it got even weirder.
> >
> > 1) It doesn't depend on actually using the QIcon, only on creating it
> > before there's a QApplication.
>
> Thats a bug in your application, Qt doesn't support doing much - if
> anything at all - with it until a QApp is created.

Sure, but it's a bug that should give an error instead of messing the UI :-)

> > 2) On windows you can't do that. (gives an error "Must construct a
> > QApplication before a QPaintDevice" which looks reasonable to me) [Qt
> > 4.4.1]
> >
> > 3) On Arch Linux I get cutoff menus and small fonts on the QTreeView
> > [4.4.1]
>
> Indeed. I can confirm the problem, however it only appears with the
> complete example. Just using a static QIcon before creating a QApp
> doesn't produce it (i.e. just creating a mainwindow and adding a few
> menus is not triggering the problem). So I can just guess its got
> something to do with the icon + .ui file.

I tested it with several different SVG icons and the behaviour is the same.

The UI file is created with designer, just a menu with three items and a 
treewidget, no properties set on anything.

> I also noticed that Qt and PyQt bail out if you use actual files in the
> filesystem, as opposed to resources.

That's interesting.

I am leaning now towards believing it's a unix-specific Qt bug and not a PyQt 
bug. I should do a C++ project to test it (ugh)

-- 
 ("\''/").__..-''"`-. .         Roberto Alsina
 `9_ 9  )   `-. (    ).`-._.`)  KDE Developer (MFCH)
 (_Y_.)' ._   ) `._`.  " -.-'  http://lateral.netmanagers.com.ar 
  _..`-'_..-_/ /-'_.'     The 6,855th most popular site of Slovenia   
(l)-'' ((i).' ((!.'       according to alexa.com (27/5/2007) 
                    
Debugging is twice as hard as writing the code in the first place. 
Therefore, if you write the code as cleverly as possible, you are, 
by definition, not smart enough to debug it. --Brian W. Kernighan



More information about the PyQt mailing list