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

The StyledToolBar class represents our standard narrow toolbar with the height 24 pixels. More...

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

Public Member Functions

 StyledToolBar (QWidget *parent=nullptr)
 
void addSpacing (int width=2)
 Width of the spacing between buttons. More...
 
void addStyledExpand ()
 
void addStyledSeparator ()
 

Protected Member Functions

void contextMenuEvent (QContextMenuEvent *)
 

Detailed Description

The StyledToolBar class represents our standard narrow toolbar with the height 24 pixels.

Definition at line 22 of file StyledToolBar.h.

Constructor & Destructor Documentation

◆ StyledToolBar()

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

Definition at line 19 of file StyledToolBar.cpp.

19  : QToolBar(parent)
20 {
21  setMovable(false);
22  const int size = style()->pixelMetric(QStyle::PM_ToolBarIconSize);
23  setIconSize(QSize(size, size));
24  setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
25  setContentsMargins(0, 0, 0, 0);
26 }

Member Function Documentation

◆ addSpacing()

void StyledToolBar::addSpacing ( int  width = 2)

Width of the spacing between buttons.

Definition at line 37 of file StyledToolBar.cpp.

38 {
39  QString space;
40  space.fill(' ', width);
41  addWidget(new QLabel(space));
42 }

Referenced by ItemComboToolBar::setActionList().

◆ addStyledExpand()

void StyledToolBar::addStyledExpand ( )

Definition at line 44 of file StyledToolBar.cpp.

45 {
46  QWidget* empty = new QWidget();
47  empty->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
48  addWidget(empty);
49 }

Referenced by ItemComboToolBar::setActionList().

◆ addStyledSeparator()

void StyledToolBar::addStyledSeparator ( )

Definition at line 28 of file StyledToolBar.cpp.

29 {
30  addWidget(new QLabel(" "));
31  addSeparator();
32  addWidget(new QLabel(" "));
33 }

Referenced by SampleToolBar::SampleToolBar().

◆ contextMenuEvent()

void StyledToolBar::contextMenuEvent ( QContextMenuEvent *  )
protected

Definition at line 51 of file StyledToolBar.cpp.

52 {
53  // Context menu reimplemented to suppress the default one
54 }

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