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.QVBoxLayoutobject.- 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.QHBoxLayoutobject.- 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.QGridLayoutobject. Theobjectsis a list of objects that will populate the grid. The grid’s row count will equal the length ofobjectsand it’s column count will equal the length of the row with the most items. If you want to skip a column, set it toNone, and if you want a column to span multiple columns add aschrodinger.application.bioluminate.layout.ROW_SPANto 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