BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
ItemStackWidget.h
Go to the documentation of this file.
1
// ************************************************************************************************
2
//
3
// BornAgain: simulate and fit reflection and scattering
4
//
5
//! @file GUI/View/Common/ItemStackWidget.h
6
//! @brief Defines class ItemStackWidget
7
//!
8
//! @homepage http://www.bornagainproject.org
9
//! @license GNU General Public License v3 or higher (see COPYING)
10
//! @copyright Forschungszentrum Jülich GmbH 2018
11
//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12
//
13
// ************************************************************************************************
14
15
#ifndef BORNAGAIN_GUI_VIEW_COMMON_ITEMSTACKWIDGET_H
16
#define BORNAGAIN_GUI_VIEW_COMMON_ITEMSTACKWIDGET_H
17
18
#include <QWidget>
19
20
class
SessionModel
;
21
class
SessionItem
;
22
23
//! The ItemStackWidget class contains a stack of widgets presenting top level items
24
//! of SessionModel. Every item corresponds to its own widget.
25
26
//! This is the base for ItemStackPresenter, which actually contains item
27
//! specific editor's logic. Used in InstrumentView, ImportDataView, JobView to show editors for
28
//! currently selected items.
29
30
class
ItemStackWidget
:
public
QWidget {
31
Q_OBJECT
32
33
public
:
34
ItemStackWidget
(QWidget* parent =
nullptr
);
35
36
void
setModel
(
SessionModel
* model);
37
38
QSize
sizeHint
()
const override
;
39
QSize
minimumSizeHint
()
const override
;
40
41
void
setSizeHint
(
const
QSize& size_hint);
42
43
public
slots:
44
virtual
void
onModelAboutToBeReset
();
45
virtual
void
onRowsAboutToBeRemoved
(
const
QModelIndex& parent,
int
first,
int
);
46
47
protected
:
48
void
connectModel
();
49
void
disconnectModel
();
50
void
validateItem
(
SessionItem
* item);
51
virtual
void
removeWidgetForItem
(
SessionItem
* item) = 0;
52
virtual
void
removeWidgets
() = 0;
53
54
class
QStackedWidget*
m_stackedWidget
;
55
SessionModel
*
m_model
;
56
QSize
m_size_hint
;
57
};
58
59
#endif
// BORNAGAIN_GUI_VIEW_COMMON_ITEMSTACKWIDGET_H
ItemStackWidget
The ItemStackWidget class contains a stack of widgets presenting top level items of SessionModel....
Definition:
ItemStackWidget.h:30
ItemStackWidget::m_stackedWidget
class QStackedWidget * m_stackedWidget
Definition:
ItemStackWidget.h:54
ItemStackWidget::connectModel
void connectModel()
Definition:
ItemStackWidget.cpp:74
ItemStackWidget::setModel
void setModel(SessionModel *model)
Definition:
ItemStackWidget.cpp:38
ItemStackWidget::minimumSizeHint
QSize minimumSizeHint() const override
Definition:
ItemStackWidget.cpp:53
ItemStackWidget::removeWidgets
virtual void removeWidgets()=0
ItemStackWidget::setSizeHint
void setSizeHint(const QSize &size_hint)
Definition:
ItemStackWidget.cpp:58
ItemStackWidget::sizeHint
QSize sizeHint() const override
Definition:
ItemStackWidget.cpp:48
ItemStackWidget::onModelAboutToBeReset
virtual void onModelAboutToBeReset()
Definition:
ItemStackWidget.cpp:63
ItemStackWidget::removeWidgetForItem
virtual void removeWidgetForItem(SessionItem *item)=0
ItemStackWidget::validateItem
void validateItem(SessionItem *item)
Checks if model was set correctly.
Definition:
ItemStackWidget.cpp:100
ItemStackWidget::ItemStackWidget
ItemStackWidget(QWidget *parent=nullptr)
Definition:
ItemStackWidget.cpp:21
ItemStackWidget::m_model
SessionModel * m_model
Definition:
ItemStackWidget.h:55
ItemStackWidget::disconnectModel
void disconnectModel()
Definition:
ItemStackWidget.cpp:86
ItemStackWidget::onRowsAboutToBeRemoved
virtual void onRowsAboutToBeRemoved(const QModelIndex &parent, int first, int)
Definition:
ItemStackWidget.cpp:68
ItemStackWidget::m_size_hint
QSize m_size_hint
Definition:
ItemStackWidget.h:56
SessionItem
Base class for a GUI data item.
Definition:
SessionItem.h:204
SessionModel
Base class for a GUI data collection. A collection is e.g. all real data (RealDataModel)....
Definition:
SessionModel.h:42
GUI
View
Common
ItemStackWidget.h
Generated by
1.9.1