SceneScreenshotService

Renders registered scenes off-screen, composes numbered callouts and marks the result.

Inherits QObject

Declared in src/libs/libcatalog/catalog/SceneScreenshotService.hpp.

Detailed description

A capture runs these steps (white-label-docs §WLO-A10f, §WLO-A11):

  1. Style the application with the seed of the scene's app.
  2. Lay the scene out at its registered width, with the height that its layout needs, up to a ceiling. A request with an explicit size gets that size.
  3. Fail when a scroll bar shows, unless the scene names its scroll area as content that scrolls.
  4. Scroll each QScrollArea around a callout, and then around the focus widget of a closeup, so that the widget shows.
  5. For a closeup (white-label-docs §WLO-S3), take the rectangle of the focus widget, add the margin, and clamp it to the frame. Then move each edge to the bounds of the widgets it cuts, so the closeup cuts no neighboring text (§WLO-5 row 34). Fail when the focus widget is hidden or not wholly inside the frame.
  6. Fail when a callout widget is hidden, or when less than half of it is in the part of the frame that the image shows.
  7. Render that part at the requested device pixel ratio (§WLO-S4), draw the callouts, and mark the image with the build's edition as the last step, or with the edition that the scene names in SceneInfo::otherEditionMarking (white-label-docs §WLO-T5). A closeup carries the full marking.

render() and renderWidget() return the failure. capture() and captureSceneWidget() give a placeholder image for the in-app help.

See also SceneRegistry, WidgetScreenshotService.

In this section