Olive
ui
collapsiblewidget.h
Go to the documentation of this file.
1
/***
2
3
Olive - Non-Linear Video Editor
4
Copyright (C) 2019 Olive Team
5
6
This program is free software: you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation, either version 3 of the License, or
9
(at your option) any later version.
10
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
15
16
You should have received a copy of the GNU General Public License
17
along with this program. If not, see <http://www.gnu.org/licenses/>.
18
19
***/
20
21
#ifndef COLLAPSIBLEWIDGET_H
22
#define COLLAPSIBLEWIDGET_H
23
24
#include <QWidget>
25
class
QLabel;
26
class
QCheckBox;
27
class
QHBoxLayout;
28
class
QVBoxLayout;
29
class
QPushButton;
30
class
QFrame;
31
class
CheckboxEx
;
32
33
class
CollapsibleWidgetHeader
:
public
QWidget {
34
Q_OBJECT
35
public
:
36
CollapsibleWidgetHeader
(QWidget* parent = 0);
37
bool
selected
;
38
protected
:
39
void
mousePressEvent
(QMouseEvent* event);
40
void
paintEvent
(QPaintEvent *event);
41
signals:
42
void
select
(
bool
,
bool
);
43
};
44
45
class
CollapsibleWidget
:
public
QWidget
46
{
47
Q_OBJECT
48
public
:
49
CollapsibleWidget
(QWidget* parent = 0);
50
void
setContents
(QWidget* c);
51
void
setText
(
const
QString &);
52
bool
is_focused
();
53
bool
is_expanded
();
54
55
CheckboxEx
*
enabled_check
;
56
bool
selected
;
57
QWidget*
contents
;
58
CollapsibleWidgetHeader
*
title_bar
;
59
private
:
60
QLabel*
header
;
61
QVBoxLayout*
layout
;
62
QPushButton*
collapse_button
;
63
QFrame*
line
;
64
QHBoxLayout*
title_bar_layout
;
65
void
set_button_icon
(
bool
open);
66
67
signals:
68
void
deselect_others
(QWidget*);
69
void
visibleChanged
();
70
71
private
slots:
72
void
on_enabled_change
(
bool
b);
73
void
on_visible_change
();
74
75
public
slots:
76
void
header_click
(
bool
s,
bool
deselect);
77
};
78
79
#endif // COLLAPSIBLEWIDGET_H
CollapsibleWidget::is_focused
bool is_focused()
Definition:
collapsiblewidget.cpp:82
CollapsibleWidget::title_bar
CollapsibleWidgetHeader * title_bar
Definition:
collapsiblewidget.h:58
CollapsibleWidget
Definition:
collapsiblewidget.h:45
CollapsibleWidget::is_expanded
bool is_expanded()
Definition:
collapsiblewidget.cpp:87
CollapsibleWidget::selected
bool selected
Definition:
collapsiblewidget.h:56
CollapsibleWidgetHeader::paintEvent
void paintEvent(QPaintEvent *event)
Definition:
collapsiblewidget.cpp:135
CollapsibleWidget::header_click
void header_click(bool s, bool deselect)
Definition:
collapsiblewidget.cpp:69
CollapsibleWidget::CollapsibleWidget
CollapsibleWidget(QWidget *parent=0)
Definition:
collapsiblewidget.cpp:37
CollapsibleWidget::header
QLabel * header
Definition:
collapsiblewidget.h:60
CollapsibleWidget::on_enabled_change
void on_enabled_change(bool b)
Definition:
collapsiblewidget.cpp:109
CheckboxEx
Definition:
checkboxex.h:26
CollapsibleWidget::collapse_button
QPushButton * collapse_button
Definition:
collapsiblewidget.h:62
CollapsibleWidgetHeader
Definition:
collapsiblewidget.h:33
CollapsibleWidgetHeader::select
void select(bool, bool)
CollapsibleWidget::deselect_others
void deselect_others(QWidget *)
CollapsibleWidget::set_button_icon
void set_button_icon(bool open)
Definition:
collapsiblewidget.cpp:91
CollapsibleWidget::enabled_check
CheckboxEx * enabled_check
Definition:
collapsiblewidget.h:55
CollapsibleWidget::contents
QWidget * contents
Definition:
collapsiblewidget.h:57
CollapsibleWidget::layout
QVBoxLayout * layout
Definition:
collapsiblewidget.h:61
CollapsibleWidgetHeader::CollapsibleWidgetHeader
CollapsibleWidgetHeader(QWidget *parent=0)
Definition:
collapsiblewidget.cpp:119
CollapsibleWidgetHeader::mousePressEvent
void mousePressEvent(QMouseEvent *event)
Definition:
collapsiblewidget.cpp:123
CollapsibleWidget::visibleChanged
void visibleChanged()
CollapsibleWidget::setText
void setText(const QString &)
Definition:
collapsiblewidget.cpp:105
CollapsibleWidget::line
QFrame * line
Definition:
collapsiblewidget.h:63
CollapsibleWidget::title_bar_layout
QHBoxLayout * title_bar_layout
Definition:
collapsiblewidget.h:64
CollapsibleWidgetHeader::selected
bool selected
Definition:
collapsiblewidget.h:37
CollapsibleWidget::setContents
void setContents(QWidget *c)
Definition:
collapsiblewidget.cpp:95
CollapsibleWidget::on_visible_change
void on_visible_change()
Definition:
collapsiblewidget.cpp:113
Generated by
1.8.15