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

Description

Definition at line 24 of file SpecularDataWidget.h.

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

Public Member Functions

 SpecularDataWidget (QWidget *parent=nullptr)
 
QList< QAction * > actionList () override
 
SessionItemcurrentItem ()
 
const SessionItemcurrentItem () const
 
void setItem (SessionItem *jobItem) override
 

Protected Member Functions

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

Private Slots

void onContextMenuRequest (const QPoint &point)
 

Private Member Functions

SpecularDataItemspecularDataItem ()
 

Private Attributes

SpecularDataCanvasm_intensity_canvas
 
SessionItemControllerm_itemController
 
SpecularDataPropertyWidgetm_propertyWidget
 
QAction * m_togglePropertiesAction
 

Constructor & Destructor Documentation

◆ SpecularDataWidget()

SpecularDataWidget::SpecularDataWidget ( QWidget *  parent = nullptr)

Definition at line 24 of file SpecularDataWidget.cpp.

25  : SessionItemWidget(parent)
28 {
29  setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
30  m_propertyWidget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::MinimumExpanding);
31 
32  auto* hlayout = new QHBoxLayout(this);
33  hlayout->setMargin(0);
34  hlayout->setSpacing(0);
35  hlayout->addWidget(m_intensity_canvas);
36  hlayout->addWidget(m_propertyWidget);
37 
38  connect(m_intensity_canvas, &SpecularDataCanvas::customContextMenuRequested, this,
40 
43 
44  m_propertyWidget->setVisible(false);
45 }
static QAction * createTogglePropertiesPanelAction(QObject *parent, QWidget *toggledWidget=nullptr)
Create "toggle properties panel" action.
SessionItemWidget(QWidget *parent=nullptr)
Widget to edit properties of a SpecularDataItem or a Data1DViewItem.
SpecularDataPropertyWidget * m_propertyWidget
void onContextMenuRequest(const QPoint &point)
SpecularDataCanvas * m_intensity_canvas
QAction * m_togglePropertiesAction

References ActionFactory::createTogglePropertiesPanelAction(), m_intensity_canvas, m_propertyWidget, m_togglePropertiesAction, and onContextMenuRequest().

Here is the call graph for this function:

Member Function Documentation

◆ actionList()

QList< QAction * > SpecularDataWidget::actionList ( )
overridevirtual

Reimplemented from SessionItemWidget.

Definition at line 56 of file SpecularDataWidget.cpp.

57 {
58  return m_intensity_canvas->actionList() + QList<QAction*>{m_togglePropertiesAction};
59 }
QList< QAction * > actionList() override

References SpecularDataCanvas::actionList(), m_intensity_canvas, and m_togglePropertiesAction.

Referenced by onContextMenuRequest().

Here is the call graph for this function:

◆ currentItem() [1/2]

◆ currentItem() [2/2]

const SessionItem * SessionItemWidget::currentItem ( ) const
inherited

Definition at line 46 of file SessionItemWidget.cpp.

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

References SessionItemController::currentItem(), and SessionItemWidget::m_itemController.

Here is the call graph for this function:

◆ hideEvent()

void SessionItemWidget::hideEvent ( QHideEvent *  )
overrideprotectedinherited

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 SessionItemWidget::m_itemController, and SessionItemController::unsubscribe().

Here is the call graph for this function:

◆ onContextMenuRequest

void SpecularDataWidget::onContextMenuRequest ( const QPoint &  point)
privateslot

Definition at line 61 of file SpecularDataWidget.cpp.

62 {
63  QMenu menu;
64  for (auto* action : actionList())
65  menu.addAction(action);
66  menu.exec(point);
67 }
QList< QAction * > actionList() override

References actionList().

Referenced by SpecularDataWidget().

Here is the call graph for this function:

◆ setItem()

void SpecularDataWidget::setItem ( SessionItem jobItem)
overridevirtual

Reimplemented from SessionItemWidget.

Definition at line 47 of file SpecularDataWidget.cpp.

48 {
52 
54 }
virtual void setItem(SessionItem *item)
void setItem(SessionItem *intensityItem) override
void setItem(SpecularDataItem *item)
SpecularDataItem * specularDataItem()

References SpecularDataCanvas::initScatter(), m_intensity_canvas, m_propertyWidget, SpecularDataCanvas::setItem(), SessionItemWidget::setItem(), SpecularDataPropertyWidget::setItem(), and specularDataItem().

Here is the call graph for this function:

◆ showEvent()

void SessionItemWidget::showEvent ( QShowEvent *  )
overrideprotectedinherited

Definition at line 51 of file SessionItemWidget.cpp.

52 {
54 }
void subscribe()
Subscribe parent to item's signals.

References SessionItemWidget::m_itemController, and SessionItemController::subscribe().

Here is the call graph for this function:

◆ specularDataItem()

SpecularDataItem * SpecularDataWidget::specularDataItem ( )
private

Definition at line 69 of file SpecularDataWidget.cpp.

70 {
72 }
SpecularDataItem * specularDataItem(SessionItem *parent)
Returns SpecularDataItem contained as a child in givent parent.

References SessionItemWidget::currentItem(), and GUI::Model::DataItemUtils::specularDataItem().

Referenced by setItem().

Here is the call graph for this function:

◆ subscribeToItem()

◆ unsubscribeFromItem()

virtual void SessionItemWidget::unsubscribeFromItem ( )
inlineprotectedvirtualinherited

Member Data Documentation

◆ m_intensity_canvas

SpecularDataCanvas* SpecularDataWidget::m_intensity_canvas
private

Definition at line 40 of file SpecularDataWidget.h.

Referenced by SpecularDataWidget(), actionList(), and setItem().

◆ m_itemController

◆ m_propertyWidget

SpecularDataPropertyWidget* SpecularDataWidget::m_propertyWidget
private

Definition at line 41 of file SpecularDataWidget.h.

Referenced by SpecularDataWidget(), and setItem().

◆ m_togglePropertiesAction

QAction* SpecularDataWidget::m_togglePropertiesAction
private

Definition at line 42 of file SpecularDataWidget.h.

Referenced by SpecularDataWidget(), and actionList().


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