We've recently noticed that our current QUILoader implementation is
broken in subtle ways, and fixing the issue will in practice require a
complete rewrite of the functionality in Python.
We're prepared to do the rewrite, but this will be post-1.0 content for
us. Hence, we recommend PySide developers to refrain from using
QUILoader for the time being. Instead, you can use pyside-uic to convert
the .ui files to Python and use them that way.
Sorry for any inconvenience.
Cheers,
ma.
_______________________________________________
PySide mailing list
PyS...@lists.openbossa.org
http://lists.openbossa.org/listinfo/pyside
2010/12/17 Matti Airas <matti....@nokia.com>:
> We've recently noticed that our current QUILoader implementation is broken
> in subtle ways, and fixing the issue will in practice require a complete
> rewrite of the functionality in Python.
>
> We're prepared to do the rewrite, but this will be post-1.0 content for us.
> Hence, we recommend PySide developers to refrain from using QUILoader for
> the time being. Instead, you can use pyside-uic to convert the .ui files to
> Python and use them that way.
Not using it personally, but I think it would be helpful for drive-by
developers if this warning was prominently placed at the top of
QUILoader's documentation (until this is fixed), so that developers
who want to use it quickly see that it has to be avoided. They won't
go looking in the mailing list archives if they should or should not
use it.
Ideally, a summary of the different ways it is broken could also be
helpful, so that developers can decide for themselves if they can use
it or not in their special use case.
HTH.
Thomas
> Not using it personally, but I think it would be helpful for drive-by
> developers if this warning was prominently placed at the top of
> QUILoader's documentation (until this is fixed), so that developers
> who want to use it quickly see that it has to be avoided. They won't
> go looking in the mailing list archives if they should or should not
> use it.
You're right, of course. I made a bug about the documentation issue (bug
553) - the warning will appear there in no time.
> Ideally, a summary of the different ways it is broken could also be
> helpful, so that developers can decide for themselves if they can use
> it or not in their special use case.
Hugo described the issue in bug 533:
"When a object, e.g.: QWidget is created by PySide it create instances
of QWidgetWrapper, not QWidget. QWidgetWrapper is a C++ class which just
inherits QWidget and have all virtual methods implemented, the
implementation of each virtual method redirect the virtual call to
Python if the there's a Python implementation otherwise calls the normal
C++ method.
As the objects returned by QUiLoader().load() were created by Qt, not by
PySide, they are instances of QWidget, not QWidgetWrapper, so they don't
have the code to redirect the virtual method calls to Python and your
code don't work.
The only way to solve this is reimplement the load() method in python,
but I don't really know how much work is needed to do this."
There might be additional related issues, e.g. bug 552.
Cheers,
ma.
I think this is not a bug and you can easily write a correct code to
replace the virtual functions, using a CustomWidget.
BR
--
Renato Araujo Oliveira Filho
Instituto Nokia de Tecnologia - INdT
Mobile: +55 (81) 8704-2144