pqCollapsedGroup.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 
5 #ifndef pqCollapsedGroup_h
6 #define pqCollapsedGroup_h
7 
8 #include "pqWidgetsModule.h"
9 #include <QGroupBox>
10 
11 class PQWIDGETS_EXPORT pqCollapsedGroup : public QGroupBox
12 {
13  Q_OBJECT
14  Q_PROPERTY(bool collapsed READ collapsed WRITE setCollapsed)
15 public:
16  explicit pqCollapsedGroup(QWidget* p = nullptr);
17 
18  bool collapsed() const;
19  void setCollapsed(bool);
20 
21  QSize minimumSizeHint() const override;
22 
23 protected:
24  void paintEvent(QPaintEvent*) override;
25  void mousePressEvent(QMouseEvent*) override;
26  void mouseMoveEvent(QMouseEvent*) override;
27  void mouseReleaseEvent(QMouseEvent*) override;
28  void childEvent(QChildEvent* c) override;
29 
30  virtual void setChildrenEnabled(bool);
31 
32  bool Collapsed;
33  bool Pressed;
34 
35 private:
36  static QStyleOptionGroupBox pqCollapseGroupGetStyleOption(const pqCollapsedGroup* p);
37  QRect textRect();
38  QRect collapseRect();
39 };
40 
41 #endif // pqCollapsedGroup_h
#define PQWIDGETS_EXPORT