The following code will fail:
# file M1/Base.py from taurus.external.qt import Qt from taurus.qt.qtgui.util.ui import UILoadable @UILoadable class BaseWidget(Qt.QWidget): def __init__(self, parent=None): super(BaseWidget, self).__init__(parent) self.loadUi()
# file M2/MyWidget.py from M1.Base import BaseWidget @class MyWidget(BaseWidget): pass app = Qt.QApplication([]) w = MyWidget() w.show() app.exec_()
A similar bug (bug-292) was found in the past and fixed for widgets in the same file. This bug report refers to two different classes defined in two different python files that reside in two different python packages.
Hi Tiago.
I am trying to reproduce this bug (in order to integrate the patch) but I cannot. Could you please send a tar.gz with all the files and directories (including any needed ui files) so that it is reproduced?
Diff:
Hi,
I forgot to mention the files must reside in two different python packages. I edited the bug description to have this missing information.
I added the tar.gz. To reproduce the problem:
$ tar xzvf taurus-bug-339.tar.gz
$ cd taurus-bug-339
$ python test.py
Diff:
Thanks, Tiago, that is what I suspected!
Now I can reproduce it. I actually added a unittest to Taurus for this bug based on your example while integrating your patch.
Thanks!
Ticket moved from /p/sardana/tickets/339/
Can't be converted: