schrodinger.ui.qt.layout module

Contains helpers for creating layouts.

Copyright Schrodinger, LLC. All rights reserved.

schrodinger.ui.qt.layout.get_widgets(layout)

Helper function to generate each widget in the supplied layout.

schrodinger.ui.qt.layout.vbox(objects, margins=None, spacing=5)

Function used to create a QtWidgets.QVBoxLayout object.

Parameters
  • objects (mixed (list or single object)) – Objects (widget, item, layout) to add

  • margins (tuple) – Margins used in QtWidgets.QHBoxLayout.setContentsMargins

schrodinger.ui.qt.layout.hbox(objects, margins=None, spacing=5)

Function used to create a QtWidgets.QHBoxLayout object.

Parameters
  • objects (mixed (list or single object)) – Objects (widget, item, layout) to add

  • margins (tuple) – Margins used in QtWidgets.QHBoxLayout.setContentsMargins

schrodinger.ui.qt.layout.grid(objects, stretch=False, margins=None, hspace=5, vspace=5)

Function used to create a QtWidgets.QGridLayout object. The objects is a list of objects that will populate the grid. The grid’s row count will equal the length of objects and it’s column count will equal the length of the row with the most items. If you want to skip a column, set it to None, and if you want a column to span multiple columns add a schrodinger.application.bioluminate.layout.ROW_SPAN to all the preceding columns you want it to occupy.

Example:

`objects = [
    [ layout.ROW_SPAN, layout.ROW_SPAN, label, None, line_edit],
    [ double_spinner,  push_button, line_edit ]
  ]
  grid = layout.grid(objects)
`

The above will return a grid layout like:

--------------------------------------------------------------
|                 label                    |   |  line_edit  |
-------------------------------------------------------------
| double_spinner | push_button | line_edit |   |             |
--------------------------------------------------------------
Parameters

objects (list of lists) – Objects (widget, item, or layout) to add to a single QtWidgets.QGridLayout