BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
SessionItemWidget.h
Go to the documentation of this file.
1
// ************************************************************************************************
2
//
3
// BornAgain: simulate and fit reflection and scattering
4
//
5
//! @file GUI/View/Common/SessionItemWidget.h
6
//! @brief Defines class ItemComboWidget
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_SESSIONITEMWIDGET_H
16
#define BORNAGAIN_GUI_VIEW_COMMON_SESSIONITEMWIDGET_H
17
18
#include <QWidget>
19
20
class
SessionItem
;
21
class
QShowEvent;
22
class
QHideEvent;
23
class
SessionItemController
;
24
25
//! The SessionItemWidget class is a base for all widgets representing the content
26
//! of SessionItem. It provides subscribe/unsibscribe mechanism on show/hide events.
27
//! The main purpose is to save performance, when item keeps changing its properties, while
28
//! widget is hidden.
29
30
class
SessionItemWidget
:
public
QWidget {
31
Q_OBJECT
32
public
:
33
explicit
SessionItemWidget
(QWidget* parent =
nullptr
);
34
~SessionItemWidget
()
override
;
35
36
virtual
void
setItem
(
SessionItem
* item);
37
virtual
QList<QAction*>
actionList
();
38
39
SessionItem
*
currentItem
();
40
const
SessionItem
*
currentItem
()
const
;
41
42
protected
:
43
virtual
void
subscribeToItem
() {}
44
virtual
void
unsubscribeFromItem
() {}
45
void
showEvent
(QShowEvent*)
override
;
46
void
hideEvent
(QHideEvent*)
override
;
47
48
private
:
49
SessionItemController
*
m_itemController
;
50
};
51
52
#endif
// BORNAGAIN_GUI_VIEW_COMMON_SESSIONITEMWIDGET_H
SessionItemController
Provides subscribe/unsubscribe mechanism for any QObject to track time of life of SessionItem....
Definition:
SessionItemController.h:26
SessionItemWidget
The SessionItemWidget class is a base for all widgets representing the content of SessionItem....
Definition:
SessionItemWidget.h:30
SessionItemWidget::subscribeToItem
virtual void subscribeToItem()
Definition:
SessionItemWidget.h:43
SessionItemWidget::showEvent
void showEvent(QShowEvent *) override
Definition:
SessionItemWidget.cpp:51
SessionItemWidget::actionList
virtual QList< QAction * > actionList()
Definition:
SessionItemWidget.cpp:36
SessionItemWidget::unsubscribeFromItem
virtual void unsubscribeFromItem()
Definition:
SessionItemWidget.h:44
SessionItemWidget::currentItem
SessionItem * currentItem()
Definition:
SessionItemWidget.cpp:41
SessionItemWidget::~SessionItemWidget
~SessionItemWidget() override
SessionItemWidget::SessionItemWidget
SessionItemWidget(QWidget *parent=nullptr)
Definition:
SessionItemWidget.cpp:18
SessionItemWidget::setItem
virtual void setItem(SessionItem *item)
Definition:
SessionItemWidget.cpp:28
SessionItemWidget::m_itemController
SessionItemController * m_itemController
Definition:
SessionItemWidget.h:49
SessionItemWidget::hideEvent
void hideEvent(QHideEvent *) override
Definition:
SessionItemWidget.cpp:56
SessionItem
Base class for a GUI data item.
Definition:
SessionItem.h:204
GUI
View
Common
SessionItemWidget.h
Generated by
1.9.1