BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
InfoPanelToolBar Class Reference

Toolbar for InfoPanel with collapse/expand buttons. More...

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

Public Slots

void setExpandStatus (bool status)
 

Signals

void expandButtonClicked ()
 

Public Member Functions

 InfoPanelToolBar (QWidget *parent=nullptr)
 

Protected Slots

void onExpandButtonClicked ()
 

Private Attributes

QAction * m_expandAction
 
bool m_expanded
 

Detailed Description

Toolbar for InfoPanel with collapse/expand buttons.

Definition at line 24 of file InfoPanelToolBar.h.

Constructor & Destructor Documentation

◆ InfoPanelToolBar()

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

Definition at line 27 of file InfoPanelToolBar.cpp.

28  : QToolBar(parent), m_expandAction(new QAction(expand_text, this)), m_expanded(false)
29 {
30  setMinimumSize(minimum_size, minimum_size);
31  setProperty("_q_custom_style_disabled", QVariant(true));
32 
33  m_expandAction->setIcon(QIcon(icon_up));
34  m_expandAction->setToolTip(expand_text);
35  connect(m_expandAction, &QAction::triggered, this, &InfoPanelToolBar::onExpandButtonClicked);
36 
37  auto empty = new QWidget();
38  empty->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
39  addWidget(empty);
40 
41  addAction(m_expandAction);
42 }
QAction * m_expandAction

References m_expandAction, and onExpandButtonClicked().

Here is the call graph for this function:

Member Function Documentation

◆ expandButtonClicked

void InfoPanelToolBar::expandButtonClicked ( )
signal

◆ onExpandButtonClicked

void InfoPanelToolBar::onExpandButtonClicked ( )
protectedslot

Definition at line 53 of file InfoPanelToolBar.cpp.

54 {
57  emit expandButtonClicked();
58 }
void expandButtonClicked()
void setExpandStatus(bool status)

References expandButtonClicked(), m_expanded, and setExpandStatus().

Referenced by InfoPanelToolBar().

Here is the call graph for this function:

◆ setExpandStatus

void InfoPanelToolBar::setExpandStatus ( bool  status)
slot

Definition at line 44 of file InfoPanelToolBar.cpp.

45 {
46  m_expanded = status;
47  if (m_expanded)
48  m_expandAction->setIcon(QIcon(icon_down));
49  else
50  m_expandAction->setIcon(QIcon(icon_up));
51 }

References m_expandAction, and m_expanded.

Referenced by onExpandButtonClicked(), and InfoPanel::setContentVisible().

Member Data Documentation

◆ m_expandAction

QAction* InfoPanelToolBar::m_expandAction
private

Definition at line 40 of file InfoPanelToolBar.h.

Referenced by InfoPanelToolBar(), and setExpandStatus().

◆ m_expanded

bool InfoPanelToolBar::m_expanded
private

Definition at line 41 of file InfoPanelToolBar.h.

Referenced by onExpandButtonClicked(), and setExpandStatus().


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