BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
|
The ItemStackPresenter templated class extends ItemStackWidget so it could operate with SesionItem editor's of specified type, while still keeping signal/slots alive.
Definition at line 29 of file ItemStackPresenter.h.
Public Slots | |
virtual void | onModelAboutToBeReset () |
virtual void | onRowsAboutToBeRemoved (const QModelIndex &parent, int first, int) |
Public Member Functions | |
ItemStackPresenter (bool single_widget=false) | |
T * | currentWidget () |
void | hideWidgets () |
T * | itemWidget (SessionItem *item) |
QSize | minimumSizeHint () const override |
template<class U > | |
void | setItem (U *item, bool *isNew=nullptr) |
Shows the widget for given item (and hides previous one). If no widget yet exists, it will be created (flag isNew will become 'true' in this case). More... | |
void | setModel (SessionModel *model) |
void | setSizeHint (const QSize &size_hint) |
QSize | sizeHint () const override |
Protected Member Functions | |
void | connectModel () |
void | disconnectModel () |
void | removeWidgetForItem (SessionItem *item) override |
void | removeWidgets () override |
void | validateItem (SessionItem *item) |
Checks if model was set correctly. More... | |
Protected Attributes | |
SessionModel * | m_model |
QSize | m_size_hint |
class QStackedWidget * | m_stackedWidget |
Private Attributes | |
QMap< SessionItem *, T * > | m_itemToWidget |
bool | m_single_widget |
Different items will be served by same widget. More... | |
|
inline |
Definition at line 31 of file ItemStackPresenter.h.
|
protectedinherited |
Definition at line 74 of file ItemStackWidget.cpp.
References ItemStackWidget::m_model, ItemStackWidget::onModelAboutToBeReset(), and ItemStackWidget::onRowsAboutToBeRemoved().
Referenced by ItemStackWidget::setModel().
T * ItemStackPresenter< T >::currentWidget |
Definition at line 86 of file ItemStackPresenter.h.
|
protectedinherited |
Definition at line 86 of file ItemStackWidget.cpp.
References ItemStackWidget::m_model, ItemStackWidget::onModelAboutToBeReset(), and ItemStackWidget::onRowsAboutToBeRemoved().
Referenced by ItemStackWidget::setModel().
void ItemStackPresenter< T >::hideWidgets |
Definition at line 105 of file ItemStackPresenter.h.
Referenced by JobRealTimeWidget::setItem().
T * ItemStackPresenter< T >::itemWidget | ( | SessionItem * | item | ) |
Definition at line 92 of file ItemStackPresenter.h.
Referenced by JobRealTimeWidget::parameterTuningWidget().
|
overrideinherited |
Definition at line 53 of file ItemStackWidget.cpp.
|
virtualslotinherited |
Definition at line 63 of file ItemStackWidget.cpp.
References ItemStackWidget::removeWidgets().
Referenced by ItemStackWidget::connectModel(), and ItemStackWidget::disconnectModel().
|
virtualslotinherited |
Definition at line 68 of file ItemStackWidget.cpp.
References SessionModel::index(), SessionModel::itemForIndex(), ItemStackWidget::m_model, and ItemStackWidget::removeWidgetForItem().
Referenced by ItemStackWidget::connectModel(), and ItemStackWidget::disconnectModel().
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
void ItemStackPresenter< T >::setItem | ( | U * | item, |
bool * | isNew = nullptr |
||
) |
Shows the widget for given item (and hides previous one). If no widget yet exists, it will be created (flag isNew will become 'true' in this case).
Definition at line 56 of file ItemStackPresenter.h.
Referenced by ImportDataView::onSelectionChanged(), and JobRealTimeWidget::setItem().
|
inherited |
Definition at line 38 of file ItemStackWidget.cpp.
References ItemStackWidget::connectModel(), ItemStackWidget::disconnectModel(), and ItemStackWidget::m_model.
Referenced by ImportDataView::ImportDataView(), JobRealTimeWidget::JobRealTimeWidget(), and ItemStackWidget::validateItem().
|
inherited |
Definition at line 58 of file ItemStackWidget.cpp.
References ItemStackWidget::m_size_hint.
Referenced by ImportDataView::ImportDataView().
|
overrideinherited |
Definition at line 48 of file ItemStackWidget.cpp.
References ItemStackWidget::m_size_hint.
|
protectedinherited |
Checks if model was set correctly.
Definition at line 100 of file ItemStackWidget.cpp.
References Error, ItemStackWidget::m_model, SessionItem::model(), and ItemStackWidget::setModel().
|
private |
Definition at line 50 of file ItemStackPresenter.h.
|
protectedinherited |
Definition at line 55 of file ItemStackWidget.h.
Referenced by ItemStackWidget::connectModel(), ItemStackWidget::disconnectModel(), ItemStackWidget::onRowsAboutToBeRemoved(), ItemStackWidget::setModel(), and ItemStackWidget::validateItem().
|
private |
Different items will be served by same widget.
Definition at line 51 of file ItemStackPresenter.h.
|
protectedinherited |
Definition at line 56 of file ItemStackWidget.h.
Referenced by ItemStackWidget::setSizeHint(), and ItemStackWidget::sizeHint().
|
protectedinherited |
Definition at line 54 of file ItemStackWidget.h.
Referenced by ItemStackWidget::ItemStackWidget().