diff options
| author | Christian Kolset <ckolset@colostate.edu> | 2026-08-11 10:40:12 -0600 |
|---|---|---|
| committer | Christian Kolset <ckolset@colostate.edu> | 2026-08-11 10:40:12 -0600 |
| commit | 57a5e6be6d581710d7eeaadc91c3b5742fb81b53 (patch) | |
| tree | 10b7188fbe885d6d26a95d3c94d75c856d1888c2 /ui/control_panel.py | |
| parent | e81b74d7faf0ec884749795153124a2fa31411fc (diff) | |
Fix native-style Qt warning; add a few tooltips; trim Namespace hint text
Root cause of "QFont::setPointSize: Point size <= 0 (-1)" on some
dropdowns: the app never sets an explicit widget style, so it defaults to
native windowsvista, whose popup code calls setPointSize() on fonts
resolved from our QSS's pixel-based font-size (pointSize() is -1 by
design for px fonts). Tried app.setStyle("Fusion") first — silences it,
but Fusion doesn't render buttons/dropdowns to match the QSS the way the
native style does. Kept native style, filtered just that one message via
qInstallMessageHandler instead — it's cosmetic Qt console noise (the
rejected setPointSize call is a no-op, doesn't affect rendering), not a
real bug.
Also adds a handful of tooltips (Control Editor's Check Syntax/Cancel/
Create Control, device Configure dialog's Close, main toolbar's View/
Configure/RUN/LOG/Settings, a few Control Panel widgets) from an
in-progress app-wide tooltip pass, paused partway through by request —
remaining buttons are being done manually.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Diffstat (limited to 'ui/control_panel.py')
| -rw-r--r-- | ui/control_panel.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ui/control_panel.py b/ui/control_panel.py index adf48e6..f0e18ef 100644 --- a/ui/control_panel.py +++ b/ui/control_panel.py @@ -252,6 +252,7 @@ class OnOffSwitch(ControlWidget): # Big toggle button self._btn = QPushButton("OFF") + self._btn.setToolTip("Toggle this output on/off") self._btn.setObjectName("switchBtn") self._btn.setCheckable(True) self._btn.setMinimumHeight(52) @@ -338,12 +339,14 @@ class MotorControl(ControlWidget): btn_row = QHBoxLayout() self._dir_btn = QPushButton("▶ FWD") + self._dir_btn.setToolTip("Toggle motor direction (forward/reverse)") self._dir_btn.setObjectName("motorDirBtn") self._dir_btn.setCheckable(True) self._dir_btn.toggled.connect(self._on_dir) btn_row.addWidget(self._dir_btn) self._run_btn = QPushButton("START") + self._run_btn.setToolTip("Start/stop the motor at the speed set by the slider above") self._run_btn.setObjectName("motorRunBtnOff") self._run_btn.setCheckable(True) self._run_btn.toggled.connect(self._on_run) @@ -410,6 +413,7 @@ class SetpointControl(ControlWidget): sp_lbl.setFixedWidth(24) self._minus_btn = QPushButton("−") + self._minus_btn.setToolTip(f"Decrease setpoint by {self.step} {self.unit}") self._minus_btn.setObjectName("spStepBtn") self._minus_btn.setFixedWidth(32) self._minus_btn.clicked.connect(self._decrement) @@ -422,6 +426,7 @@ class SetpointControl(ControlWidget): self._sp_spin.valueChanged.connect(self._on_sp_changed) self._plus_btn = QPushButton("+") + self._plus_btn.setToolTip(f"Increase setpoint by {self.step} {self.unit}") self._plus_btn.setObjectName("spStepBtn") self._plus_btn.setFixedWidth(32) self._plus_btn.clicked.connect(self._increment) |
