BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ItemComboToolBar.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/Views/CommonWidgets/ItemComboToolBar.h
6 //! @brief Defines class ItemComboToolBar
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_COREGUI_VIEWS_COMMONWIDGETS_ITEMCOMBOTOOLBAR_H
16 #define BORNAGAIN_GUI_COREGUI_VIEWS_COMMONWIDGETS_ITEMCOMBOTOOLBAR_H
17 
19 #include <QList>
20 
21 class QAction;
22 class QComboBox;
23 
24 //! The ItemComboToolBar class is a styled toolbar on top of ItemComboWidget. Contains
25 //! ComboBox to switch ItemComboWidget, and dynamic list of actions, which are updated
26 //! according to current state of ItemComboWidget.
27 
29  Q_OBJECT
30 
31 public:
32  explicit ItemComboToolBar(QWidget* parent = 0);
33 
34  void setPresentation(const QString& name);
35 
36  void setPresentationList(const QStringList& presentationList,
37  const QStringList& activeList = {});
38 
39  QString currentPresentation() const;
40 
41  void setActionList(const QList<QAction*>& actionList);
42 
43 signals:
44  void comboChanged(const QString& presentation);
45 
46 private:
47  void setComboConnected(bool value);
48  void makeItemsEnabled(const QStringList& activePresentations);
49 
50  QComboBox* m_comboBox;
51  QAction* m_comboBoxAction;
52 };
53 
54 #endif // BORNAGAIN_GUI_COREGUI_VIEWS_COMMONWIDGETS_ITEMCOMBOTOOLBAR_H
Defines class StyledToolBar.
The ItemComboToolBar class is a styled toolbar on top of ItemComboWidget.
void comboChanged(const QString &presentation)
void setActionList(const QList< QAction * > &actionList)
Sets external actions to tool bar (previous actions will be removed).
ItemComboToolBar(QWidget *parent=0)
QComboBox * m_comboBox
void setComboConnected(bool value)
void setPresentation(const QString &name)
void setPresentationList(const QStringList &presentationList, const QStringList &activeList={})
QAction * m_comboBoxAction
QString currentPresentation() const
void makeItemsEnabled(const QStringList &activePresentations)
All items in QComboBox which are not in given list, will be disabled (gray and unselectable).
The StyledToolBar class represents our standard narrow toolbar with the height 24 pixels.
Definition: StyledToolBar.h:22
QString const & name(EShape k)
Definition: particles.cpp:21