KWidgetsAddons

kcollapsiblegroupbox.h
1 /*
2  This file is part of the KDE project
3  SPDX-FileCopyrightText: 2015 David Edmundson <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7 
8 #ifndef KCOLLAPSIBLEGROUPBOX_H
9 #define KCOLLAPSIBLEGROUPBOX_H
10 
11 #include <kwidgetsaddons_export.h>
12 
13 #include <QWidget>
14 
15 class KCollapsibleGroupBoxPrivate;
16 
27 class KWIDGETSADDONS_EXPORT KCollapsibleGroupBox : public QWidget
28 {
29  Q_OBJECT
30  Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged)
31  Q_PROPERTY(bool expanded READ isExpanded WRITE setExpanded NOTIFY expandedChanged)
32 
33 public:
34  explicit KCollapsibleGroupBox(QWidget *parent = nullptr);
35  ~KCollapsibleGroupBox() override;
36 
41  void setTitle(const QString &title);
42 
46  QString title() const;
47 
53  void setExpanded(bool expanded);
54 
59  bool isExpanded() const;
60 
61  QSize sizeHint() const override;
62  QSize minimumSizeHint() const override;
63 
64 public Q_SLOTS:
68  void toggle();
69 
73  void expand();
74 
78  void collapse();
79 
80 Q_SIGNALS:
84  void titleChanged();
85 
89  void expandedChanged();
90 
91 protected:
92  void paintEvent(QPaintEvent*) override;
93 
94  bool event(QEvent*) override;
95  void mousePressEvent(QMouseEvent*) override;
96  void mouseMoveEvent(QMouseEvent*) override;
97  void leaveEvent(QEvent*) override;
98  void keyPressEvent(QKeyEvent*) override;
99  void resizeEvent(QResizeEvent*) override;
100 
101 private Q_SLOTS:
102  void overrideFocusPolicyOf(QWidget *widget);
103 
104 private:
105  KCollapsibleGroupBoxPrivate *const d;
106 
108 };
109 
110 #endif
virtual QSize minimumSizeHint() const const
virtual void paintEvent(QPaintEvent *event)
virtual void mousePressEvent(QMouseEvent *event)
virtual void mouseMoveEvent(QMouseEvent *event)
Q_PROPERTY(...)
virtual QSize sizeHint() const const
Q_DISABLE_COPY(Class)
virtual void keyPressEvent(QKeyEvent *event)
virtual void resizeEvent(QResizeEvent *event)
A groupbox featuring a clickable header and arrow indicator that can be expanded and collapsed to rev...
virtual void leaveEvent(QEvent *event)
virtual bool event(QEvent *event) override
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Aug 5 2020 22:42:23 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.