Skip to content

qtvcp probe help: load first help page lazily#4097

Merged
c-morley merged 1 commit into
LinuxCNC:masterfrom
grandixximo:fix/qtvcp-help-headless-startup
Jun 2, 2026
Merged

qtvcp probe help: load first help page lazily#4097
c-morley merged 1 commit into
LinuxCNC:masterfrom
grandixximo:fix/qtvcp-help-headless-startup

Conversation

@grandixximo
Copy link
Copy Markdown
Contributor

Problem

qtdragon (and any qtvcp screen using the basic-probe or versa-probe widgets) can hang or crash at startup on a headless / no-GPU Qt platform (QT_QPA_PLATFORM=offscreen, no GPU). I hit this consistently on a CI runner and reproduced it in a plain ubuntu:24.04 container with no GPU: qtvcp never finishes coming up, so the GUI fails to start.

Root cause

The basic-probe and versa-probe help dialogs preload their first help page during widget construction (buildWidget, called from hal_init). Since the help loader gained smooth image pre-scaling (_set_scaled_html, QImage with SmoothTransformation), that preload now builds and scales the raster help diagrams at startup.

That scaling on the startup path is what breaks headless: in my no-GPU container qtvcp hangs there; on the CI runner it segfaults. I confirmed it by bisecting the qtvcp Python in the container:

  • qtdragon ui-smoke as-is: fail (hang in container, segfault on CI)
  • revert versa_probe.py + basic_probe.py to before the smooth-scale change: pass
  • keep the files but stub _set_scaled_html to a plain setHtml (kill only the scaling): pass

So the regression is specifically the image scaling running during construction. It is also wasted work whenever the operator never opens the help dialog.

Fix

Defer the first-page load from buildWidget to the first showDialog() call, in both basic_probe.py and versa_probe.py. The help looks and behaves identically when opened; the image scaling just no longer runs on the startup path.

Testing

In a no-GPU ubuntu:24.04 container (RIP build, offscreen platform), running the qtdragon GUI smoke test:

  • before: qtdragon fails to come up
  • after: qtdragon UI_SMOKE_OK; touchy smoke unchanged (control)

Preloading the first help page at widget construction smooth-scales its
images then, which can hang or crash qtvcp on a headless/no-GPU Qt
platform. Defer it to the first showDialog(); help is unchanged when
opened.
@c-morley c-morley merged commit 10a20ae into LinuxCNC:master Jun 2, 2026
15 checks passed
@grandixximo grandixximo deleted the fix/qtvcp-help-headless-startup branch June 3, 2026 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants