BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
SessionItemWidget Class Reference

Description

The SessionItemWidget class is a base for all widgets representing the content of SessionItem. It provides subscribe/unsibscribe mechanism on show/hide events. The main purpose is to save performance, when item keeps changing its properties, while widget is hidden.

Definition at line 30 of file SessionItemWidget.h.

Inheritance diagram for SessionItemWidget:
[legend]
Collaboration diagram for SessionItemWidget:
[legend]

Public Member Functions

 SessionItemWidget (QWidget *parent=nullptr)
 
 ~SessionItemWidget () override
 
virtual QList< QAction * > actionList ()
 
SessionItemcurrentItem ()
 
const SessionItemcurrentItem () const
 
virtual void setItem (SessionItem *item)
 

Protected Member Functions

void hideEvent (QHideEvent *) override
 
void showEvent (QShowEvent *) override
 
virtual void subscribeToItem ()
 
virtual void unsubscribeFromItem ()
 

Private Attributes

SessionItemControllerm_itemController
 

Constructor & Destructor Documentation

◆ SessionItemWidget()

SessionItemWidget::SessionItemWidget ( QWidget *  parent = nullptr)
explicit

Definition at line 18 of file SessionItemWidget.cpp.

19  : QWidget(parent)
21 {
24 }
Provides subscribe/unsubscribe mechanism for any QObject to track time of life of SessionItem....
void setUnsubscribeCallback(callback_t fun)
void setSubscribeCallback(callback_t fun)
virtual void subscribeToItem()
virtual void unsubscribeFromItem()
SessionItemController * m_itemController

References m_itemController, SessionItemController::setSubscribeCallback(), SessionItemController::setUnsubscribeCallback(), subscribeToItem(), and unsubscribeFromItem().

Here is the call graph for this function:

◆ ~SessionItemWidget()

SessionItemWidget::~SessionItemWidget ( )
overridedefault

Member Function Documentation

◆ actionList()

QList< QAction * > SessionItemWidget::actionList ( )
virtual

◆ currentItem() [1/2]

◆ currentItem() [2/2]

const SessionItem * SessionItemWidget::currentItem ( ) const

Definition at line 46 of file SessionItemWidget.cpp.

47 {
48  return m_itemController->currentItem();
49 }

References SessionItemController::currentItem(), and m_itemController.

Here is the call graph for this function:

◆ hideEvent()

void SessionItemWidget::hideEvent ( QHideEvent *  )
overrideprotected

Definition at line 56 of file SessionItemWidget.cpp.

57 {
59 }
void unsubscribe()
Fully unsubscribes the parent from listening item's signals. Controller stays active to track item de...

References m_itemController, and SessionItemController::unsubscribe().

Here is the call graph for this function:

◆ setItem()

◆ showEvent()

void SessionItemWidget::showEvent ( QShowEvent *  )
overrideprotected

Definition at line 51 of file SessionItemWidget.cpp.

52 {
54 }

References m_itemController, and SessionItemController::subscribe().

Here is the call graph for this function:

◆ subscribeToItem()

◆ unsubscribeFromItem()

virtual void SessionItemWidget::unsubscribeFromItem ( )
inlineprotectedvirtual

Member Data Documentation

◆ m_itemController

SessionItemController* SessionItemWidget::m_itemController
private

Definition at line 49 of file SessionItemWidget.h.

Referenced by SessionItemWidget(), currentItem(), hideEvent(), setItem(), and showEvent().


The documentation for this class was generated from the following files: