BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Add-on to group boxes to make them collapsible.
Also adds the possibility to show toolbuttons or widgets in the group box's title. This add-on takes the layout (plus the contained widgets) of a given group box and moves it into a newly created content area widget. A title widget will be added, and the original group box title will be hidden.
To support style sheets, the custom bool property "collapsible" will be added to the group box an set to true.
Definition at line 34 of file GroupBoxCollapser.h.
Public Member Functions | |
void | addAction (QAction *action) |
Add a tool button to the title bar, connected to the given action. More... | |
void | addWidget (QWidget *widget) |
Add a widget to the title bar. More... | |
QWidget * | contentArea () const |
The content area, to which the found group box content has been moved when the add-on has been installed. More... | |
void | setExpanded (bool expanded=true) |
Expand/collapse the content area. More... | |
void | setTitle (const QString &title) |
Set the title of the group box. Do not use the method groupBox->setTitle() any more once the add-on is installed. More... | |
Static Public Member Functions | |
static GroupBoxCollapser * | findInstalledCollapser (QGroupBox *groupBox) |
static GroupBoxCollapser * | installIntoGroupBox (QGroupBox *groupBox, bool expanded=true) |
Private Member Functions | |
GroupBoxCollapser (QGroupBox *groupBox) | |
void | toggle (bool checked) |
Private Attributes | |
QWidget * | m_contentArea |
widget to where the original group box content has been moved More... | |
QHBoxLayout * | m_titleLayout |
layout in the title widget More... | |
QWidget * | m_titleWidget |
widget used to present the new groupbox title More... | |
QToolButton * | m_toggleButton |
button to toggle between collapsed/expanded More... | |
|
private |
Definition at line 78 of file GroupBoxCollapser.cpp.
References appSettings, ApplicationSettings::currentStyle(), m_contentArea, m_titleLayout, m_titleWidget, m_toggleButton, ApplicationSettings::native, and toggle().
Referenced by installIntoGroupBox().
void GroupBoxCollapser::addAction | ( | QAction * | action | ) |
Add a tool button to the title bar, connected to the given action.
Definition at line 49 of file GroupBoxCollapser.cpp.
References m_titleLayout, and m_titleWidget.
Referenced by LayerForm::LayerForm(), ParticleCoreShellForm::ParticleCoreShellForm(), and ParticleLayoutForm::ParticleLayoutForm().
void GroupBoxCollapser::addWidget | ( | QWidget * | widget | ) |
Add a widget to the title bar.
Definition at line 62 of file GroupBoxCollapser.cpp.
References m_titleLayout.
Referenced by LayerForm::LayerForm().
QWidget * GroupBoxCollapser::contentArea | ( | ) | const |
The content area, to which the found group box content has been moved when the add-on has been installed.
Definition at line 67 of file GroupBoxCollapser.cpp.
References m_contentArea.
|
static |
|
static |
Definition at line 23 of file GroupBoxCollapser.cpp.
References GroupBoxCollapser().
Referenced by AxisPropertyEditor::AxisPropertyEditor(), DepthProbeInstrumentEditor::DepthProbeInstrumentEditor(), DetectorEditor::DetectorEditor(), DistributionEditor::DistributionEditor(), EnvironmentEditor::EnvironmentEditor(), FootprintCorrectionEditor::FootprintCorrectionEditor(), GISASBeamEditor::GISASBeamEditor(), InclinationAnglesEditor::InclinationAnglesEditor(), InterferenceForm::InterferenceForm(), LayerForm::LayerForm(), MaskEditorPropertyPanel::MaskEditorPropertyPanel(), MesoCrystalForm::MesoCrystalForm(), MultiLayerForm::MultiLayerForm(), OffspecBeamEditor::OffspecBeamEditor(), ParticleCompositionForm::ParticleCompositionForm(), ParticleCoreShellForm::ParticleCoreShellForm(), ParticleForm::ParticleForm(), ParticleLayoutForm::ParticleLayoutForm(), PolarizationAnalysisEditor::PolarizationAnalysisEditor(), ProjectSettingsView::ProjectSettingsView(), RectangularDetectorEditor::RectangularDetectorEditor(), ResolutionFunctionEditor::ResolutionFunctionEditor(), SimulationView::SimulationView(), SpecularBeamEditor::SpecularBeamEditor(), WelcomeView::WelcomeView(), InstrumentLibraryEditor::createWidgetsForCurrentInstrument(), and InstrumentView::createWidgetsForCurrentInstrument().
void GroupBoxCollapser::setExpanded | ( | bool | expanded = true | ) |
Expand/collapse the content area.
Definition at line 72 of file GroupBoxCollapser.cpp.
References m_toggleButton.
Referenced by LayerForm::expand().
void GroupBoxCollapser::setTitle | ( | const QString & | title | ) |
Set the title of the group box. Do not use the method groupBox->setTitle() any more once the add-on is installed.
Definition at line 44 of file GroupBoxCollapser.cpp.
References m_toggleButton.
Referenced by ParticleCoreShellForm::createCoreWidgets(), ParticleCoreShellForm::createShellWidgets(), InterferenceForm::updateTitle(), LayerForm::updateTitle(), and ParticleLayoutForm::updateTitle().
|
private |
Definition at line 122 of file GroupBoxCollapser.cpp.
References m_contentArea, and m_toggleButton.
Referenced by GroupBoxCollapser().
|
private |
widget to where the original group box content has been moved
Definition at line 64 of file GroupBoxCollapser.h.
Referenced by GroupBoxCollapser(), contentArea(), and toggle().
|
private |
layout in the title widget
Definition at line 62 of file GroupBoxCollapser.h.
Referenced by GroupBoxCollapser(), addAction(), and addWidget().
|
private |
widget used to present the new groupbox title
Definition at line 61 of file GroupBoxCollapser.h.
Referenced by GroupBoxCollapser(), and addAction().
|
private |
button to toggle between collapsed/expanded
Definition at line 63 of file GroupBoxCollapser.h.
Referenced by GroupBoxCollapser(), setExpanded(), setTitle(), and toggle().