spacr.qt.widgets.test_data_chooser

A popup that explains each test-data route before either is started.

Instruction of 2026-09-01, for Annotate and then Classify: one “Load test data” button opening a dialog with two buttons, a description that fills in on hover, and a Close button.

It lives here rather than on a screen because two screens now use it and a third is asked for. It fetches NOTHING itself – it reports the chosen route and the screen does the work, which keeps it testable without a network.

Classes

TestDataChooser

Pick which half of the example plate to fetch, and read why first.

Module Contents

class spacr.qt.widgets.test_data_chooser.TestDataChooser(parent=None)[source]

Bases: PySide6.QtWidgets.QDialog

Pick which half of the example plate to fetch, and read why first.

The two routes need different halves of the plate and differ in size, and the old pair of buttons named the choice (“crops” / “streaming”) without room to explain it – the difference lived in a tooltip that had to be hunted for. Here the description sits UNDER the buttons and fills in on hover, so both routes can be compared before either is started. A download of several hundred megabytes deserves that much.

Nothing is fetched by this dialog. It reports the chosen route and the screen does the work, so the dialog stays testable without a network.

Parameters:

parent – parent widget.

Build the test-data chooser.

The minimum width is set before the description pane is measured: the measurement asks how tall the longest description is AT A GIVEN WIDTH, and measuring at one width while displaying at another is what left the pane sized for a column it never had.

Parameters:

parent – parent widget, or None.

description_text() → str[source]

What the pane currently says. For tests and the accessibility tree.

eventFilter(watched, event)[source]

Fill the pane on hover, and empty it on leave.

Parameters:
  • watched – the route button the event is for; its routeKey property picks the description shown.

  • event – the event; Enter shows the route’s description and Leave restores the resting text. It is always passed on to the base class.

every_description() → tuple[source]

Every string the pane can ever show, resting text included.

Public because it is what a clipping check wants to iterate: any sweep asking whether text fits its container needs exactly this list, and building a second one risks measuring a different set of strings than the pane can actually display.

resizeEvent(event)[source]

Re-measure when the dialog is resized.

A wider pane needs fewer lines and a narrower one needs more, so a height measured at one width clips at another. The user can resize this dialog, so this is reachable.

Parameters:

event – the resize event, passed to the base class before the description pane is re-measured.