-
Notifications
You must be signed in to change notification settings - Fork 82
Description
Describe the bug
When using Qt Designer to add a PyDMDrawingRectangle, setting the penStyle property to something like "SolidLine" causes an error at runtime:
AttributeError: 'PyDMDrawingRectangle' object has no attribute 'setPenStyle'. Did you mean: 'setStyle'?
This happens because Qt Designer saves the penStyle property as a string, which PyDM (and PyQt5's uic) cannot interpret as a valid enum.
Steps to reproduce
Open Qt Designer and place a PyDMDrawingRectangle widget.
Set the penStyle to something other than NoPen (e.g., SolidLine).
Save the .ui file and inspect the output.
You will see:
<property name="penStyle" stdset="0">
<string>Solid</string>
</property>
Run this .ui file with PyDM and observe the crash.
Expected behavior
Qt Designer should output the property using a valid enum format like this:
<property name="penStyle" stdset="0">
<enum>Qt::SolidLine</enum>
</property>
This would allow PyDM to load the file without runtime errors.
Operating System
Linux
OS Version Details
No response