2 This file is part of the KDE libraries
3 Copyright (C) 2005 Daniel Molkentin <molkentin@kde.org>
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License version 2 as published by the Free Software Foundation.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
21 * file copied from playground/libs/ui/collabsiblewidget
23 #ifndef COLLAPSIBLEWIDGET_H
24 #define COLLAPSIBLEWIDGET_H
26 #include <QScrollArea>
29 #include <QAbstractButton>
33 class ClickableLabel
: public QLabel
37 ClickableLabel( QWidget
* parent
= 0 );
40 void mouseReleaseEvent( QMouseEvent
*e
);
46 class ArrowButton
: public QAbstractButton
49 ArrowButton(QWidget
*parent
= 0);
52 QSize
sizeHint() const { return QSize(16, 16); }
55 void paintEvent( QPaintEvent
* );
61 @short A widget that has a caption and a collapsible widget
62 @author Daniel Molkentin <molkentin@kde.org>
64 class Q_GUI_EXPORT CollapsibleWidget
: public QWidget
68 CollapsibleWidget(QWidget
*parent
= 0);
69 explicit CollapsibleWidget(const QString
& caption
, QWidget
*parent
= 0);
72 QString
caption() const;
73 bool isExpanded() const;
75 QWidget
* innerWidget() const;
76 void setInnerWidget( QWidget
*w
);
79 void setExpanded(bool collapsed
);
80 void setCaption(const QString
& caption
);
87 void animateCollapse(qreal
);
90 Q_DISABLE_COPY( CollapsibleWidget
)
99 @short A scrollable container that contains groups of settings,
100 usually in the form of CollapsibleWidgets.
101 @author Daniel Molkentin <molkentin@kde.org>
103 class Q_GUI_EXPORT SettingsContainer
: public QScrollArea
105 Q_ENUMS( CollapseState
)
108 enum CollapseState
{ Collapsed
, Uncollapsed
};
109 SettingsContainer( QWidget
*parent
= 0 );
110 ~SettingsContainer();
112 CollapsibleWidget
* insertWidget( QWidget
* w
, const QString
& name
);
115 Q_DISABLE_COPY( SettingsContainer
)
122 #endif // COLLAPSIBLEWIDGET_H