BornAgain  1.19.79
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/View/Common/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_VIEW_COMMON_ITEMCOMBOTOOLBAR_H
16 #define BORNAGAIN_GUI_VIEW_COMMON_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 = nullptr);
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_VIEW_COMMON_ITEMCOMBOTOOLBAR_H
Defines class StyledToolbar.
The ItemComboToolbar class is a styled toolbar on top of ItemComboWidget. Contains ComboBox to switch...
QString currentPresentation() const
void setPresentation(const QString &name)
void comboChanged(const QString &presentation)
void setPresentationList(const QStringList &presentationList, const QStringList &activeList={})
void setActionList(const QList< QAction * > &actionList)
Sets external actions to tool bar (previous actions will be removed).
QAction * m_comboBoxAction
QComboBox * m_comboBox
void makeItemsEnabled(const QStringList &activePresentations)
All items in QComboBox which are not in given list, will be disabled (gray and unselectable).
void setComboConnected(bool value)
ItemComboToolbar(QWidget *parent=nullptr)
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:20