Debian Codegraph @

avogadro/qtgui/containerwidget.h

raw
1 /******************************************************************************
2 This source file is part of the Avogadro project.
3 This source code is released under the 3-Clause BSD License, (see "LICENSE").
4 ******************************************************************************/
5
6 #ifndef AVOGADRO_QTGUI_CONTAINERWIDGET_H
7 #define AVOGADRO_QTGUI_CONTAINERWIDGET_H
8
9 #include "avogadroqtguiexport.h"
10
11 #include <QtWidgets/QWidget>
12
13 class QLabel;
14
15 namespace Avogadro {
16 namespace QtGui {
17
18 /**
19 * @class ContainerWidget containerwidget.h <avogadro/qtgui/containerwidget.h>
20 * @brief A widget that contains a single view widget, along with standard
21 * buttons for splitting, maximizing, closing.
22 * @author Marcus D. Hanwell
23 */
24
25 class AVOGADROQTGUI_EXPORT ContainerWidget : public QWidget
26 {
27 Q_OBJECT
28
29 public:
30 explicit ContainerWidget(QWidget* parent = nullptr,
31 Qt::WindowFlags f = Qt::WindowFlags());
32 ~ContainerWidget() override;
33
34 void setViewWidget(QWidget* widget);
35 QWidget* viewWidget();
36
37 void setActive(bool active);
38 bool isActive() const { return m_active; }
39
40 signals:
41 void splitVertical();
42 void splitHorizontal();
43 void closeView();
44
45 private:
46 QWidget* m_viewWidget;
47 QLabel* m_label;
48 bool m_active;
49 };
50
51 } // namespace QtGui
52 } // namespace Avogadro
53
54 #endif // AVOGADRO_QTGUI_CONTAINERWIDGET_H