BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Utility functions to add/remove widgets to the layout on the fly. Taken from https://stackoverflow.com/questions/5395266/removing-widgets-from-qgridlayout.
Functions | |
void | clearGridLayout (QGridLayout *layout, bool deleteWidgets=true) |
Clear layout completely. More... | |
void | clearLayout (QLayout *layout, bool deleteWidgets=true) |
Removes content from box layout. More... | |
QWidget * | placeHolder () |
Returns empty widget to occupy place in layout. More... | |
void | removeColumn (QGridLayout *layout, int column, bool deleteWidgets=true) |
Removes column from grid layout. More... | |
void | removeRow (QGridLayout *layout, int row, bool deleteWidgets=true) |
Removes row from grid layout (important: doesn't change row count). More... | |
void GUI::Util::Layout::clearGridLayout | ( | QGridLayout * | layout, |
bool | deleteWidgets = true |
||
) |
Clear layout completely.
Definition at line 115 of file LayoutUtils.cpp.
References removeRow().
void GUI::Util::Layout::clearLayout | ( | QLayout * | layout, |
bool | deleteWidgets = true |
||
) |
Removes content from box layout.
Definition at line 68 of file LayoutUtils.cpp.
Referenced by AbstractSelectionContainerForm::clear(), MinimizerSettingsWidget::createMimimizerEdits(), MultiLayerForm::onAboutToRemoveLayer(), MaterialInplaceForm::selectMaterial(), SpecularDataPropertyWidget::setCurrentItem(), MaskEditorPropertyPanel::setCurrentMaskItem(), IntensityDataPropertyWidget::setItem(), MinimizerSettingsWidget::setItem(), and WelcomeView::updateRecentProjectPanel().
QWidget * GUI::Util::Layout::placeHolder | ( | ) |
Returns empty widget to occupy place in layout.
Definition at line 121 of file LayoutUtils.cpp.
void GUI::Util::Layout::removeColumn | ( | QGridLayout * | layout, |
int | column, | ||
bool | deleteWidgets = true |
||
) |
Removes column from grid layout.
Removes all layout items on the given column from the given grid layout. If deleteWidgets is true, all concerned child widgets become not only removed from the layout, but also deleted. Note that this function doesn't actually remove the column itself from the grid layout, as this isn't possible (i.e. the columnCount() and column indices will stay the same after this function has been called).
Definition at line 108 of file LayoutUtils.cpp.
void GUI::Util::Layout::removeRow | ( | QGridLayout * | layout, |
int | row, | ||
bool | deleteWidgets = true |
||
) |
Removes row from grid layout (important: doesn't change row count).
Removes all layout items on the given row from the given grid layout. If deleteWidgets is true, all concerned child widgets become not only removed from the layout, but also deleted. Note that this function doesn't actually remove the row itself from the grid layout, as this isn't possible (i.e. the rowCount() and row indices will stay the same after this function has been called).
Definition at line 92 of file LayoutUtils.cpp.
Referenced by clearGridLayout().