BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
fancytab.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file gui2/mainwindow/fancytab.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_FANCYTAB_H
16 #define BORNAGAIN_GUI2_MAINWINDOW_FANCYTAB_H
17 
18 #include "darefl_export.h"
19 #include <QColor>
20 #include <QWidget>
21 
22 class QLabel;
23 class QString;
24 
25 namespace gui2 {
26 
27 class DAREFLCORE_EXPORT FancyTab : public QWidget {
28  Q_OBJECT
29 
30 public:
31  FancyTab(const QString& title, QWidget* parent = nullptr);
32 
33  void setSelected(bool value);
34 
35 signals:
36  void clicked();
37 
38 protected:
39  void paintEvent(QPaintEvent*) override;
40  void mousePressEvent(QMouseEvent* event) override;
41  void enterEvent(QEvent*) override;
42  void leaveEvent(QEvent*) override;
43 
44 private:
45  QLabel* m_label{nullptr};
46  bool m_isSelected{false};
47  QColor m_widgetColor;
48 };
49 
50 } // namespace gui2
51 
52 #endif // BORNAGAIN_GUI2_MAINWINDOW_FANCYTAB_H
QColor m_widgetColor
Definition: fancytab.h:47
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.
Definition: app_constants.h:20