Skip to content

qtvcp probe help: fix broken/blurry images and typos#4088

Merged
c-morley merged 4 commits into
LinuxCNC:masterfrom
PeterStolz:fix-versaprobe-help-image-paths
May 31, 2026
Merged

qtvcp probe help: fix broken/blurry images and typos#4088
c-morley merged 4 commits into
LinuxCNC:masterfrom
PeterStolz:fix-versaprobe-help-image-paths

Conversation

@PeterStolz
Copy link
Copy Markdown

@PeterStolz PeterStolz commented May 30, 2026

Fixes the bundled help pages for the VersaProbe and Basic Probe dialogs in qtvcp. Three commits:

1. Fix broken image paths

The versaprobe (pages 4-7) and basic_probe (pages 7-8) help pages referenced their images through an absolute path baked into a developer's home directory (/home/chris/emc/share/qtvcp/images/...), so they rendered as broken-file icons on every install. basic_probe page 6 also omitted the .png extension. Pointed them at the existing assets via the relative ../images/ form the loader rewrites.

2. Render help diagrams crisp at display size

The help dialogs (QTextEdit) rescale images with no smoothing, so the diagrams looked soft or pixelated: most pages forced width=500 onto images of widely varying native sizes, and the versaprobe diagrams pointed at tiny 300px thumbnails. Shipped the diagrams pre-scaled to their 500px display width (Lanczos) in new probe_icons_help/ and basic_probe_help/ dirs and reference those, so Qt draws them 1:1 with no rescaling. Generalised the loader image-path rewrite from ../images/probe_icons/ to ../images/ so any image subdir resolves. Also centred the versaprobe page-4 image to match the other pages and dropped the width override on basic_probe page 4 (480px native, was being upscaled).

3. Fix typos in help text

Corrected several typos in the help text (then->than, imprial->imperial, clearence->clearance, a missing word, a garbled sentence rephrased to match the wording already used on page 1, and the stray EXTRA CLEARANCE references renamed to the actual field name EXTRA DEPTH).

No functional/behaviour changes - HTML, help images, and one loader string.

The versaprobe (pages 4-7) and basic_probe (pages 7-8) help pages
referenced their images through an absolute path baked into a
developer's home directory (/home/chris/emc/share/qtvcp/images/...),
which exists only on the original author's machine, so the images
rendered as broken-file icons everywhere else. basic_probe page 6 also
referenced its image without the .png extension.

Point them at the existing assets via the relative "../images/" form
the help-dialog loader rewrites to the runtime install path, matching
the other help pages.

Signed-off-by: Peter Stolz <peter@detesia.com>
The help dialogs (QTextEdit) upscale/downscale images with no smoothing,
so the diagrams looked soft or pixelated: most pages forced width=500
onto images of widely varying native sizes, and the versaprobe diagrams
even pointed at tiny 300px thumbnails.

Ship the diagrams pre-scaled to their 500px display width (Lanczos) in
new probe_icons_help/ and basic_probe_help/ dirs and reference those, so
Qt draws them 1:1 with no rescaling. Generalise the help-dialog image
path rewrite from "../images/probe_icons/" to "../images/" so any image
subdir resolves. Also centre the page-4 versaprobe image to match the
other pages, and drop the width override on basic_probe page 4 (480px
native, it was being upscaled).

Signed-off-by: Peter Stolz <peter@detesia.com>
Correct several typos in the versaprobe and basic_probe help pages:

  versa pg3:  "distance too large"        -> "distance is too large"
  versa pg4:  "farther away then"         -> "farther away than"
              "in Z .If the"              -> "in Z. If the"
              "clearence" / "lowring"     -> "clearance" / "lowering"
  versa pg8:  "will automatically rotates"-> "automatically rotate"
              garbled "Press only! corresponding to this position
              button." -> "Press only the button corresponding to this
              position." (matching the wording already on page 1)
  basic pg7:  capitalise sentence start
  basic pg8:  "imprial" -> "imperial", "These distance" -> "distances",
              "it's start position" -> "its", and rename the stray
              "EXTRA CLEARANCE" references to "EXTRA DEPTH" (the actual
              field name used elsewhere on the page).

Signed-off-by: Peter Stolz <peter@detesia.com>
@PeterStolz PeterStolz force-pushed the fix-versaprobe-help-image-paths branch from d6e368b to a2ea10d Compare May 30, 2026 22:42
@PeterStolz PeterStolz changed the title versaprobe: fix broken help images on pages 4-7 (hardcoded /home/chris path) qtvcp probe help: fix broken/blurry images and typos May 30, 2026
@BsAtHome
Copy link
Copy Markdown
Contributor

Wouldn't it be better to replace the images, that are no screen-shots, to be SVG images? Or can't QtTextDocument render SVG images linked in html <img> tags?

The earlier "render help diagrams crisp at display size" change shipped the
help diagrams pre-scaled to 500px in new probe_icons_help/ and
basic_probe_help/ dirs to dodge QTextEdit's nearest-neighbour image scaling.
That duplicated assets and orphaned the originals.

Scale in the help-dialog loader instead: each raster <img> is pre-scaled to
its requested width/height with a smooth (SmoothTransformation) filter and
registered as a document resource, so Qt draws it 1:1 with no nearest-neighbour
rescaling. SVG images are skipped so Qt's vector renderer can draw them crisply
at any size.

Point the versaprobe diagram pages back at the existing higher-resolution
probe_icons_1024x768/ sources and the basic pages at their originals under
widgets/basic_probe_help/, and drop the bundled pre-scaled copies. No new
assets are added.

Signed-off-by: Peter Stolz <peter@detesia.com>
@PeterStolz
Copy link
Copy Markdown
Author

Good question — I looked into it properly. QTextDocument does render SVG via <img> (Qt's qsvg imageformat plugin, which qtvcp already pulls in for icons — I verified it draws vector-crisp even when upscaled), and you're right that the diagrams are vector at heart: the versaprobe ones carry Software: www.inkscape.org in their PNG metadata, so they were originally drawn in Inkscape.

The snag is that the .svg sources were never committed — only the PNG exports are in the tree (I checked the full history too), and a couple of the help images are actually gnome-screenshot captures of the panel, which can't be vectorised anyway.

So instead of bundling resized PNG copies, I switched the help-dialog loader to pre-scale each raster image to its display size with a smooth filter and register it as a document resource, so Qt draws it 1:1 rather than nearest-neighbour (which was the cause of the jaggies). SVG <img> are passed straight through untouched, so if the original Inkscape sources ever surface they can just be dropped in with no further code change. Pushed as the latest commit — no new assets added.

@PeterStolz
Copy link
Copy Markdown
Author

For scope, while it's fresh: because this fix lives in the VersaProbe/BasicProbe widgets themselves, it lands everywhere those are embedded: qtaxis, qtdragon, qtdragon_hd/qtdragon_hd_vert, qtdragon_lathe, woodpecker, x1mill, plus the standalone panels/versaprobe (which embeds into any GUI, including AXIS/gmoccapy), not just one screen.

One thing I noticed in there: the two HelpDialog classes in versa_probe.py and basic_probe.py are ~80% identical (they differ only in title, page list, preference key, page step, and one fallback string). They could be collapsed into a single shared HelpDialog base, which would also let this scaling helper live in one place instead of being duplicated. Happy to do that as a follow up if there's interest.

@c-morley c-morley merged commit 1c36c76 into LinuxCNC:master May 31, 2026
15 checks passed
@c-morley
Copy link
Copy Markdown
Collaborator

Thanks for work. More pull requests will be happily welcomed.

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.

3 participants