BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
collapsiblebar.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // qt-mvvm: Model-view-view-model framework for large GUI applications
4 //
5 //! @file mvvm/view/mvvm/widgets/collapsiblebar.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 Gennady Pospelov et al, Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_MVVM_VIEW_MVVM_WIDGETS_COLLAPSIBLEBAR_H
16 #define BORNAGAIN_MVVM_VIEW_MVVM_WIDGETS_COLLAPSIBLEBAR_H
17 
18 #include "mvvm/view_export.h"
19 #include <QFrame>
20 
21 class QLabel;
22 class QString;
23 
24 namespace ModelView {
25 
26 //! Horizontal collapsible bar, part of CollapsibleListWidget.
27 //! Intended for placement into the QSplitter, makes client widget visible/invisible on clicks.
28 
29 class MVVM_VIEW_EXPORT CollapsibleBar : public QFrame {
30  Q_OBJECT
31 
32 public:
33  CollapsibleBar(QWidget* parent = nullptr);
34 
35  void setWidget(QWidget* widget, const QString& title);
36 
37 protected:
38  void mousePressEvent(QMouseEvent* event) override;
39 
40 private:
41  bool eventFilter(QObject* obj, QEvent* event) override;
42  void updatePixmap();
43 
44  QWidget* m_controlledWidget{nullptr};
45  QLabel* m_pixmapLabel{nullptr};
46  QLabel* m_titleLabel{nullptr};
47 };
48 
49 } // namespace ModelView
50 
51 #endif // BORNAGAIN_MVVM_VIEW_MVVM_WIDGETS_COLLAPSIBLEBAR_H
Horizontal collapsible bar, part of CollapsibleListWidget.
materialitems.h Collection of materials to populate MaterialModel.