On jeudi 03 septembre 2009, Alexey Zlobin wrote:
> Today i try to do similar thing by subclassing QUiLoader and overriding
> createWidget method:
>
> class UiLoader(QUiLoader):
>
> def __init__(self):
> self.widgets = {}
>
> def createWidget(self, className, parent=0, name=''):
> widget = QUiLoader.createWidget(self, className, parent, name)
> if name != '':
> self.widgets[name] = widget
>
> return widget
>
> but get following error:
>
> Traceback (most recent call last):
> File ".../projects/qt-designer/src/designer-sample.py", line 47, in
> <module>
> a = DesignerSample()
> File ".../projects/qt-designer/src/designer-sample.py", line 29, in
> __init__
> self.widget = self.loader.load(file)
> Boost.Python.ArgumentError: Python argument types in
> QUiLoader.load(UiLoader, QFile)
> did not match C++ signature:
> load(QUiLoader {lvalue}, QIODevice* device, QWidget*
> parentWidget=None)
>
> is it bug, or feature or i do something wrong?
It seems that inheritance does not work here: load() gets your UiLoader
class, instead of QUiLoader, and fails. The problem is in the wrapper, I
think.
--
Frédéric
http://www.gbiloba.org
_______________________________________________
PySide mailing list
[email protected]
http://lists.openbossa.org/listinfo/pyside