SlackClipper

Ready-to-run robot software for hobby robotics.

Inherits QWidget

Declared in src/libs/libwidgets/layout/SlackClipper.hpp.

Detailed description

A clipper that lets its child keep its size through small shrinks.

The child normally matches this widget exactly. When this widget shrinks by no more than the slack on an axis, the child KEEPS its size on that axis and is centered, so the parent clips a centered crop of it and the child never sees a resize event. When the shrink exceeds the slack, or the widget grows, the child is resized to match and the crop ends.

Made for a render widget whose resize is a retarget costing tens of milliseconds (windows-field-defects §WFD-RL-43): the toolbar's scroll strip appearing took 36 px off the viewport, the retarget changed the batch chip, the chip's width hid the strip again, and the scene rebuilt four times a second for as long as the window was open. With the slack the strip costs nothing: the render keeps its size and 18 rows at the top and bottom go out of view.

visibleSizeChanged() reports the visible size while a crop is held and an invalid size when the child matches again, so the renderer can pin its camera to the visible crop (SceneWidget::setViewportOverride) and the overlays that anchor to the host (DocumentTabBar) read the child's negative offset inside this widget the way they already do for the PanelSplitter's drag clipper.

In this section