Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
src_gui_widgets_qlabel.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
//! [0]
5
QLabel
*
label
=
new
QLabel(
this
);
6
label->setFrameStyle(QFrame::Panel | QFrame::Sunken);
7
label->setText(
"first line\nsecond line"
);
8
label->setAlignment(Qt::AlignBottom | Qt::AlignRight);
9
//! [0]
10
11
12
//! [1]
13
QLineEdit
*
phoneEdit
=
new
QLineEdit(
this
);
14
QLabel
*
phoneLabel
=
new
QLabel(
"&Phone:"
,
this
);
15
phoneLabel->setBuddy(phoneEdit);
16
//! [1]
17
18
19
//! [2]
20
QLineEdit
*
nameEdit
=
new
QLineEdit(
this
);
21
QLabel
*
nameLabel
=
new
QLabel(
"&Name:"
,
this
);
22
nameLabel->setBuddy(nameEdit);
23
QLineEdit
*
phoneEdit
=
new
QLineEdit(
this
);
24
QLabel
*
phoneLabel
=
new
QLabel(
"&Phone:"
,
this
);
25
phoneLabel->setBuddy(phoneEdit);
26
// (layout setup not shown)
27
//! [2]
nameLabel
nameLabel
Definition
src_gui_kernel_qformlayout.cpp:17
label
QLabel * label
[0]
Definition
src_gui_widgets_qlabel.cpp:5
phoneEdit
QLineEdit * phoneEdit
[0]
Definition
src_gui_widgets_qlabel.cpp:13
phoneLabel
QLabel * phoneLabel
Definition
src_gui_widgets_qlabel.cpp:14
nameEdit
QLineEdit * nameEdit
[1]
Definition
src_gui_widgets_qlabel.cpp:20
qtbase
src
widgets
doc
snippets
code
src_gui_widgets_qlabel.cpp
Generated on
for Qt by
1.14.0