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
splitter.cpp
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4
#
include
<
QtGui
>
5
#
include
<
QtWidgets
>
6
7
void
processSize
(
int
)
8
{
9
}
10
11
int
main
()
12
{
13
QWidget *parent =
nullptr
;
14
15
//! [0]
16
QSplitter *splitter =
new
QSplitter(parent);
17
QListView *listview =
new
QListView;
18
QTreeView *treeview =
new
QTreeView;
19
QTextEdit *textedit =
new
QTextEdit;
20
splitter->addWidget(listview);
21
splitter->addWidget(treeview);
22
splitter->addWidget(textedit);
23
//! [0]
24
25
{
26
// SAVE STATE
27
//! [1]
28
QSettings settings;
29
settings.setValue(
"splitterSizes"
, splitter->saveState());
30
//! [1]
31
}
32
33
{
34
// RESTORE STATE
35
//! [2]
36
QSettings settings;
37
splitter->restoreState(settings.value(
"splitterSizes"
).toByteArray());
38
//! [2]
39
}
40
41
return
0;
42
}
main
int main()
[open]
Definition
doc_src_objecttrees.cpp:7
processSize
void processSize(int)
Definition
splitter.cpp:7
qtbase
src
widgets
doc
snippets
splitter
splitter.cpp
Generated on
for Qt by
1.18.0