schrodinger.application.models.gui.experimental_px.item_views module

Styled item views for Qt table and tree views.

Provides styled components for a modern table/tree appearance with: - Contrasting header row with sort indicators - Rounded outlined container - Consistent cell padding - Hover row highlighting

schrodinger.application.models.gui.experimental_px.item_views.get_font(bold: bool = False) QFont

Return the standard font for styled views.

class schrodinger.application.models.gui.experimental_px.item_views.StyledHeaderView(orientation: Orientation = Orientation.Horizontal, parent: QWidget = None)

Bases: QHeaderView

Header view with contrasting background and styled sort indicators.

Responsibilities: - Custom section painting with rounded corners - Sort indicator rendering - Clipping mask for rounded corners

__init__(orientation: Orientation = Orientation.Horizontal, parent: QWidget = None)
resizeEvent(self, e: Optional[QResizeEvent])
paintSection(self, painter: Optional[QPainter], rect: QRect, logicalIndex: int)
sizeHint(self) QSize
class schrodinger.application.models.gui.experimental_px.item_views.TreeView(parent: QWidget = None)

Bases: _HoverTrackingMixin, _StyledViewMixin, QTreeView

Styled tree view with rounded border, custom header, and full-row hover/selection highlighting.

__init__(parent: QWidget = None)
mousePressEvent(event)

Handle mouse press to expand/collapse items with children.

Only toggles expansion if the row is already selected, so that clicking an unselected row selects it without expanding.

drawRow(self, painter: Optional[QPainter], options: QStyleOptionViewItem, index: QModelIndex)
class schrodinger.application.models.gui.experimental_px.item_views.TableView(parent: QWidget = None)

Bases: _HoverTrackingMixin, _StyledViewMixin, SampleDataTableViewMixin, QTableView

Styled table view with rounded border, custom header, and hover/selection highlighting.

Note: SampleDataTableViewMixin is required due to plptable implementation

__init__(parent: QWidget = None)
class schrodinger.application.models.gui.experimental_px.item_views.StatusIconMixin(*args, status_icon_column: int | None = None, **kwargs)

Bases: object

Mixin providing status icon painting for delegates.

Parameters:

status_icon_column – Column index where status icons should be displayed, or None to display in the last column (default).

__init__(*args, status_icon_column: int | None = None, **kwargs)
class schrodinger.application.models.gui.experimental_px.item_views.ItemDelegate(parent: QObject = None, status_icon_column: int | None = None, draw_separator: bool = True)

Bases: StatusIconMixin, QItemDelegate

Generic cell delegate with backgrounds, text, and optional separators.

Used by TableView (all columns) and TreeView (columns 1+).

Parameters:
  • status_icon_column – Column index where status icons should be displayed, or None to display in the last column (default).

  • draw_separator – Whether to draw row separator lines at the bottom of cells. True for TableView, False for TreeView.

__init__(parent: QObject = None, status_icon_column: int | None = None, draw_separator: bool = True)
paint(self, painter: Optional[QPainter], option: QStyleOptionViewItem, index: QModelIndex)
sizeHint(self, option: QStyleOptionViewItem, index: QModelIndex) QSize
class schrodinger.application.models.gui.experimental_px.item_views.TreeBranchDelegate(parent: QObject = None, status_icon_column: int | None = None)

Bases: StatusIconMixin, QItemDelegate

Delegate for TreeView column 0 with indentation and branch icons.

Does not paint backgrounds (TreeView.drawRow handles that) or separators.

Parameters:

status_icon_column – Column index where status icons should be displayed, or None to display in the last column (default).

__init__(parent: QObject = None, status_icon_column: int | None = None)
paint(self, painter: Optional[QPainter], option: QStyleOptionViewItem, index: QModelIndex)
sizeHint(self, option: QStyleOptionViewItem, index: QModelIndex) QSize