Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qsplitter.h
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
// Qt-Security score:significant reason:default
4
5
#
ifndef
QSPLITTER_H
6
#
define
QSPLITTER_H
7
8
#
include
<
QtWidgets
/
qtwidgetsglobal
.
h
>
9
#
include
<
QtWidgets
/
qframe
.
h
>
10
#
include
<
QtWidgets
/
qsizepolicy
.
h
>
11
12
QT_REQUIRE_CONFIG
(
splitter
);
13
14
QT_BEGIN_NAMESPACE
15
16
class
QSplitterPrivate;
17
class
QTextStream;
18
19
class
QSplitterHandle;
20
21
class
Q_WIDGETS_EXPORT
QSplitter
:
public
QFrame
22
{
23
Q_OBJECT
24
25
Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation)
26
Q_PROPERTY(
bool
opaqueResize READ opaqueResize WRITE setOpaqueResize)
27
Q_PROPERTY(
int
handleWidth READ handleWidth WRITE setHandleWidth)
28
Q_PROPERTY(
bool
childrenCollapsible READ childrenCollapsible WRITE setChildrenCollapsible)
29
30
public
:
31
explicit
QSplitter(QWidget* parent =
nullptr
);
32
explicit
QSplitter(Qt::Orientation, QWidget* parent =
nullptr
);
33
~QSplitter();
34
35
void
addWidget(QWidget *widget);
36
void
insertWidget(
int
index, QWidget *widget);
37
QWidget *replaceWidget(
int
index, QWidget *widget);
38
39
void
setOrientation(Qt::Orientation);
40
Qt::Orientation orientation()
const
;
41
42
void
setChildrenCollapsible(
bool
);
43
bool
childrenCollapsible()
const
;
44
45
void
setCollapsible(
int
index,
bool
);
46
bool
isCollapsible(
int
index)
const
;
47
void
setOpaqueResize(
bool
opaque =
true
);
48
bool
opaqueResize()
const
;
49
void
refresh();
50
51
QSize sizeHint()
const
override;
52
QSize minimumSizeHint()
const
override;
53
54
QList<
int
> sizes()
const
;
55
void
setSizes(
const
QList<
int
> &list);
56
57
QByteArray saveState()
const
;
58
bool
restoreState(
const
QByteArray &state);
59
60
int
handleWidth()
const
;
61
void
setHandleWidth(
int
);
62
63
int
indexOf(QWidget *w)
const
;
64
QWidget *widget(
int
index)
const
;
65
int
count()
const
;
66
67
void
getRange(
int
index,
int
*,
int
*)
const
;
68
QSplitterHandle *handle(
int
index)
const
;
69
70
void
setStretchFactor(
int
index,
int
stretch);
71
72
Q_SIGNALS:
73
void
splitterMoved(
int
pos,
int
index);
74
75
protected
:
76
virtual
QSplitterHandle *createHandle();
77
78
void
childEvent(QChildEvent *) override;
79
80
bool
event(QEvent *) override;
81
void
resizeEvent(QResizeEvent *) override;
82
83
void
changeEvent(QEvent *) override;
84
void
moveSplitter(
int
pos,
int
index);
85
void
setRubberBand(
int
position);
86
int
closestLegalPosition(
int
,
int
);
87
88
89
private
:
90
Q_DISABLE_COPY(QSplitter)
91
Q_DECLARE_PRIVATE(QSplitter)
92
private
:
93
friend
class
QSplitterHandle;
94
};
95
96
97
class
QSplitterHandlePrivate
;
98
class
Q_WIDGETS_EXPORT
QSplitterHandle
:
public
QWidget
99
{
100
Q_OBJECT
101
public
:
102
explicit
QSplitterHandle(Qt::Orientation o, QSplitter *parent);
103
~QSplitterHandle();
104
105
void
setOrientation(Qt::Orientation o);
106
Qt::Orientation orientation()
const
;
107
bool
opaqueResize()
const
;
108
QSplitter *splitter()
const
;
109
110
QSize sizeHint()
const
override;
111
112
protected
:
113
void
paintEvent(QPaintEvent *) override;
114
void
mouseMoveEvent(QMouseEvent *) override;
115
void
mousePressEvent(QMouseEvent *) override;
116
void
mouseReleaseEvent(QMouseEvent *) override;
117
void
resizeEvent(QResizeEvent *) override;
118
bool
event(QEvent *) override;
119
120
void
moveSplitter(
int
p);
121
int
closestLegalPosition(
int
p);
122
123
private
:
124
Q_DISABLE_COPY(QSplitterHandle)
125
Q_DECLARE_PRIVATE(QSplitterHandle)
126
};
127
128
QT_END_NAMESPACE
129
130
#
endif
// QSPLITTER_H
QSplitterHandlePrivate
Definition
qsplitter_p.h:107
QSplitterHandle
The QSplitterHandle class provides handle functionality for the splitter.
Definition
qsplitter.h:99
QSplitter
The QSplitter class implements a splitter widget.
Definition
qsplitter.h:22
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
SplitterMagic
static const qint32 SplitterMagic
Definition
qsplitter.cpp:1656
QT_REQUIRE_CONFIG
QT_REQUIRE_CONFIG(splitter)
qtbase
src
widgets
widgets
qsplitter.h
Generated on
for Qt by
1.18.0