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]
5QLabel *label = new QLabel(this);
6label->setFrameStyle(QFrame::Panel | QFrame::Sunken);
7label->setText("first line\nsecond line");
8label->setAlignment(Qt::AlignBottom | Qt::AlignRight);
9//! [0]
10
11
12//! [1]
13QLineEdit *phoneEdit = new QLineEdit(this);
14QLabel *phoneLabel = new QLabel("&Phone:", this);
15phoneLabel->setBuddy(phoneEdit);
16//! [1]
17
18
19//! [2]
20QLineEdit *nameEdit = new QLineEdit(this);
21QLabel *nameLabel = new QLabel("&Name:", this);
22nameLabel->setBuddy(nameEdit);
23QLineEdit *phoneEdit = new QLineEdit(this);
24QLabel *phoneLabel = new QLabel("&Phone:", this);
25phoneLabel->setBuddy(phoneEdit);
26// (layout setup not shown)
27//! [2]
QLabel * label
[0]
QLineEdit * phoneEdit
[0]
QLabel * phoneLabel
QLineEdit * nameEdit
[1]