spacr.qt.widgets.test_data_chooser

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

Used by Annotate and Classify: one “Load test data” button opens a dialog with two buttons, a description that fills in on hover, and a Close button.

It is shared by several screens, so it lives here rather than on one screen. 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. The description sits under the buttons and fills in on hover, so both routes, each a download of several hundred megabytes, can be compared before either is started.

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 would size the pane for the wrong width.

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.