schrodinger.ui.qt.style module

Module to manage Schrodinger-wide Qt style sheet. The function apply_style_sheet() will read the

Copyright Schrodinger, LLC. All rights reserved.

schrodinger.ui.qt.style.apply_styles()
schrodinger.ui.qt.style.apply_style_sheet(inmodule=False)

Read the schrodinger-wide style sheet and set that as the Application-level style sheet. If running in Maestro then we don’t bother doing that as Maestro will have already performed this operation.

Parameters

immodule – True when called from inside style.py. This is the only valid way to call this function

schrodinger.ui.qt.style.get_style_sheet_text(style_file_name)

Return the contents of the style sheet file at $SCHRODINGER/mmshare-v*/data/{style_file_name}.

Parameters

style_file_name (str) – the name of a .sty file in the mmshare build data directory

Returns

the contents of the style file, if it can be retrieved

Return type

str or NoneType

schrodinger.ui.qt.style.apply_legacy_spacing_style(widget)

Attempt to set the legacy spacing style sheet on the supplied widget.

Parameters

widget (QtWidgets.QWidget) – a widget

schrodinger.ui.qt.style.skip_legacy_spacing_style(widget: PyQt6.QtWidgets.QWidget)

Instruct the given widget to ignore legacy spacing styling from the legacy spacing style sheet.

Parameters

widget – a widget

schrodinger.ui.qt.style.apply_panelx_style(widget)

Apply the PanelX style sheet on the supplied widget and ignore the legacy spacing style sheet.

Parameters

widget (QtWidgets.QWidget) – a widget

schrodinger.ui.qt.style.apply_panelx_combo_settings(combo_box: PyQt6.QtWidgets.QComboBox)

Apply necessary settings for PanelX on the given combo box.

Parameters

combo_box – A QComboBox

schrodinger.ui.qt.style.apply_panelx_button_settings(button: PyQt6.QtWidgets.QPushButton, button_type: schrodinger.ui.qt.standard.design_tokens.ButtonTypes) None

Apply PanelX-specific settings to the supplied button so that it can display the desired visuals.

Note

This function does not apply the PanelX style sheet to the button. Make sure the button is the child of a widget that has the PanelX style already applied or use apply_panelx_style().

Parameters

button – The button to apply the properties to.

Raises
  • TypeError – If the button is not an instance of QPushButton.

  • ValueError – If the button type is not in the ButtonTypes enum.