Qt 5.10 Book Examples
chapter06
Splitter
main.cpp
Go to the documentation of this file.
1
// ======================================================================
2
// main.cpp
3
// ======================================================================
4
// This file is a part of the book
5
// "Qt 5.10 Professional programming with C++"
6
// http://qt-book.com
7
// ======================================================================
8
// Copyright (c) 2017 by Max Schlee
9
// ======================================================================
10
11
#include <QtWidgets>
12
13
// ----------------------------------------------------------------------
14
int
main
(
int
argc,
char
** argv)
15
{
16
QApplication app(argc, argv);
17
18
QSplitter spl(Qt::Vertical);
19
QTextEdit* ptxt1 =
new
QTextEdit;
20
QTextEdit* ptxt2 =
new
QTextEdit;
21
spl.addWidget(ptxt1);
22
spl.addWidget(ptxt2);
23
24
ptxt1->setPlainText(
"Line1\n"
25
"Line2\n"
26
"Line3\n"
27
"Line4\n"
28
"Line5\n"
29
"Line6\n"
30
"Line7\n"
31
);
32
ptxt2->setPlainText(ptxt1->toPlainText());
33
34
spl.resize(200, 220);
35
spl.show();
36
37
return
app.exec();
38
}
main
int main(int argc, char **argv)
Definition:
main.cpp:15
Generated by
1.8.14