schrodinger.ui.qt.standard.widgets.pop_up module

class schrodinger.ui.qt.standard.widgets.pop_up.PopUp(*args, parent: PyQt6.QtWidgets.QWidget | None = None, content: PyQt6.QtWidgets.QWidget | None = None, anchor: PyQt6.QtWidgets.QWidget | None = None, **kwargs)

Bases: QWidget

Style-agnostic popup positioned relative to an anchor widget.

The closed signal is emitted after the popup is hidden, whether it is hidden explicitly or dismissed through Qt’s popup lifecycle.

closed

A pyqtSignal emitted by instances of the class.

__init__(*args, parent: PyQt6.QtWidgets.QWidget | None = None, content: PyQt6.QtWidgets.QWidget | None = None, anchor: PyQt6.QtWidgets.QWidget | None = None, **kwargs)
setContent(content: QWidget) → None
content() → QWidget
setAnchor(anchor: QWidget) → None
anchor() → PyQt6.QtWidgets.QWidget | None
setAnchorOrigin(origin: Origin) → None
anchorOrigin() → Origin
setTargetOrigin(origin: Origin) → None
targetOrigin() → Origin
setOffset(offset: int) → None

Set the positioner offset used to anchor the popup.

The value is passed to positioner.calc_pos_at_widget when the popup is next opened. See that function for the exact origin-relative offset semantics. The default is positioner.DEFAULT_OFFSET.

Parameters:

offset – Positioner offset in pixels.

offset() → int

Return the configured anchor gap in pixels.

setAutoSized(auto_sized: bool) → None

Set whether the popup sizes itself from its layout before opening.

Automatic sizing is enabled by default and calls adjustSize() before every positioning operation. Disable it to preserve a size assigned by the caller across the first and subsequent openings.

Parameters:

auto_sized – Whether to automatically update the popup size.

isAutoSized() → bool

Return whether the popup sizes itself before opening.

setScreenConstrained(constrained: bool) → None

Set whether popup placement is constrained to the anchor’s screen.

When enabled, the popup’s calculated position is moved inside the screen’s available geometry before opening. Constraining does not resize the popup; an oversized popup is placed at the screen’s top or left boundary and may extend past the opposite boundary. Screen constraining is disabled by default.

Parameters:

constrained – Whether to constrain popup placement to the screen.

isScreenConstrained() → bool

Return whether popup placement is constrained to the screen.

setOrigins(anchor_origin: Origin, target_origin: Origin) → None

Atomically set the anchor and target origins.

Use this method when switching between automatic and explicit origins. The individual setters preserve the other origin and therefore reject a change that would leave exactly one origin as Origin.Auto.

hideEvent(self, a0: QHideEvent | None)
run() → None