Hi all, I’ve noticed a strange behavior that I could not understand if it is a bug or intended.
It seems to me that a property can sometimes shadow methods from qt objects. Example:
qgw = qt.QGraphicsWidget()
qgw.layout is None
This runs ok with no errors, and even emit the signal
qgw.layout continues to be None
if I try to
qgw.layout = qt.QGraphicsLayout()
I get an error:
Traceback (most recent call last): File "<console>", line 1, in <module> AttributeError: Property 'layout' of type 'QGraphicsLayout*' does not accept an object of type QGraphicsLayout (QGraphicsLayout (C++ object at: 0x000002187FBE0B90))
Which I can understand, because setting an object to a pointer variable can only result in a error. But the layout() method is not accessible, which is also understandable from the python point of view.
That is not the case for QWidget, which I can access the layout via layout() slot. Can you help me to understand what is happening? I know it may be more related to PythonQt than Slicer, but I wanted to use QGraphicsWidget with another lib. Thanks