-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FIX: make setpoint work for original positioner widget, adjust sizing #586
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works for me, good catch. Had a few questions but no problems with the contents at large
<height>25</height> | ||
</size> | ||
</property> | ||
<property name="maximumSize"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With dynamic sizing I wonder if setting maximum sizes will ever come back to bite us. Admittedly I don't remember enough of the dynamic sizing details to answer this myself...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It turns out that these input sub-widgets don't resize at all anyway, even with the size policy set to "expanding". I don't have any idea why this is the case. Before I went to fixed mode, the widget wasn't even taking up all of the available space.
In addition:
For the row widget: we want the readback to expand instead of the setpoint
For the square widget: we don't want anything to resize, e.g. we don't want to see the whole middle section balloon out and we don't want the square to stretch up and down.
self.ui.setpoint_layout.addWidget( | ||
self.ui.set_value, | ||
alignment=QtCore.Qt.AlignHCenter, | ||
) | ||
self.ui.set_value.setObjectName('set_value') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know Ken was doing this for testing, but should we be doing this more uniformly in our UI's? What does setting the object name here do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two things this does:
- The widget now has a name when inspected via gammaray. This is the only reason I did this here, technically I could remove it. I suspect this could also be helpful for tracebacks/other debug like Ken was doing for testing.
- There are some qt functions for collecting child widgets based on their name: https://doc.qt.io/qt-6/qobject.html#findChild, and they use this qt object name rather than the python attribute name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally, it can be used as a method of differentiating widgets in the stylesheet
Description
Fixes an issue where the setpoint widgets for the detailed views were coming up with zero width.
The root cause of the issue was that the sizing of the user_setpoint placeholder widget was set to the defaults, so the
setMinimumWidth
call was setting the minimum width of the combobox to 0.The reason why these various widgets refuse to expand here despite having their size policy set to "Expanding" eludes me, so I've set them to fixed with.
This also incidentally combines some previously diverging code paths that fixes a sizing issue where the detailed view had a vestigial/unused pydm line edit taking up space.
Motivation and Context
closes #585
How Has This Been Tested?
Interactively only
Where Has This Been Documented?
I need to make a release notes docs entry
Screenshots (if appropriate):
Master:
This PR: