[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] Problem using promoted widgets with PyQt 4.4.2
From:       Jan Ekholm <jan.ekholm () smultron ! net>
Date:       2008-07-31 18:13:04
Message-ID: 200807312113.04590.jan.ekholm () smultron ! net
[Download RAW message or body]

On Thursday 31 July 2008 10:15:34 Jan Ekholm wrote:
> Seems that QObjectCreator.addCustomWidget
> in /usr/lib/python2.5/site-packages/PyQt4/uic/objcreator.py manages to find
> a class named KeywordTree in PyKDE4.kdeui. When that method is entered the
> data is all fine and when done it's wrong, ie when entering:
>
>     widgetClass=KeywordTree baseClass=QTreeWidget module=keyword_tree
>
> and when exiting:
>
>     widgetClass=KeywordTree baseClass=QTreeWidget module=PyKDE4.kdeui
>
> I haven't yet found what actually imports and PyKDE4 classes and why,
> because it sure ain't my code.
>
> I'll try renaming my class to something totally different and see if PyQt
> then loads the class properly.

Renaming the class and Python file to something totally different makes it 
work properly. But if I change them to, say, KeywordsTree2 
(keywords_tree2.py) or Keywords (keywords.py) the same error persists. So 
something goes wrong in PyQt4.uic.loadUi() which makes it associate promoted 
widgets that are named something like Keyword.* with PyKDE4.kdeui. Seems 
weird, but I can't track down what goes wrong.

So, it all works again now, but if someone else stumbles into this problem, 
just rename your class and hope for the best. :)

-- 
    There were no public health laws in Ankh-Morpork. It would be like
                installing smoke detectors in Hell.
                                            -- Terry Pratchett, Feet of Clay
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic