BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
mainbarwidget.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file gui2/mainwindow/mainbarwidget.h
6 //! @brief Defines class CLASS?
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2020
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI2_MAINWINDOW_MAINBARWIDGET_H
16 #define BORNAGAIN_GUI2_MAINWINDOW_MAINBARWIDGET_H
17 
18 #include "darefl_export.h"
19 #include <QWidget>
20 #include <map>
21 
22 class QStackedWidget;
23 class QHBoxLayout;
24 class QPushButton;
25 
26 namespace gui2 {
27 
28 class FancyTab;
29 
30 //! Widget container with functionality similar to QTabWidget. Has large button bar on top,
31 //! and stacked widget at bottom.
32 
33 class DAREFLCORE_EXPORT MainBarWidget : public QWidget {
34  Q_OBJECT
35 
36 public:
37  MainBarWidget(QWidget* parent = nullptr);
39 
40  void addWidget(QWidget* widget, const QString& title, bool is_enabled = true);
41 
42  void setCurrentIndex(int index);
43 
44 private:
45  QStackedWidget* m_stackedWidget{nullptr};
46  QHBoxLayout* m_labelLayout{nullptr};
47  std::map<int, FancyTab*> m_indexToTab;
48 };
49 
50 } // namespace gui2
51 
52 #endif // BORNAGAIN_GUI2_MAINWINDOW_MAINBARWIDGET_H
Widget container with functionality similar to QTabWidget.
Definition: mainbarwidget.h:33
std::map< int, FancyTab * > m_indexToTab
Definition: mainbarwidget.h:47
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.
Definition: app_constants.h:20