BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
ComboSelectorDialog.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Info/ComboSelectorDialog.h
6 //! @brief Defines class ComboSelectorDialog
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_INFO_COMBOSELECTORDIALOG_H
16 #define BORNAGAIN_GUI_VIEW_INFO_COMBOSELECTORDIALOG_H
17 
18 #include <QDialog>
19 #include <QString>
20 
21 class QLabel;
22 class QComboBox;
23 class QBoxLayout;
24 
25 //! A dialog similar to standard QMessageBox with combo box selector.
26 
27 class ComboSelectorDialog : public QDialog {
28  Q_OBJECT
29 public:
30  ComboSelectorDialog(QWidget* parent = nullptr);
31 
32  void addItems(const QStringList& selection, const QString& currentItem = "");
33  void setTextTop(const QString& text);
34  void setTextBottom(const QString& text);
35 
36  QString currentText() const;
37 
38 private:
39  QBoxLayout* createLogoLayout();
40  QBoxLayout* createInfoLayout();
41  QBoxLayout* createButtonLayout();
42 
43  QLabel* m_topLabel;
44  QComboBox* m_comboSelector;
45  QLabel* m_bottomLabel;
46 };
47 
48 #endif // BORNAGAIN_GUI_VIEW_INFO_COMBOSELECTORDIALOG_H
A dialog similar to standard QMessageBox with combo box selector.
void addItems(const QStringList &selection, const QString &currentItem="")
QBoxLayout * createLogoLayout()
Returns layout with icon for left part of the widget.
QBoxLayout * createButtonLayout()
Creates button layout with buttons.
ComboSelectorDialog(QWidget *parent=nullptr)
void setTextTop(const QString &text)
void setTextBottom(const QString &text)
QString currentText() const
QBoxLayout * createInfoLayout()
Creates right layout with text and QComboBox selection.