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_graphicsview_qgraphicsproxywidget.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]
5int main(int argc, char **argv)
6{
7 QApplication app(argc, argv);
8
9 QTabWidget *tabWidget = new QTabWidget;
10
11 QGraphicsScene scene;
12 QGraphicsProxyWidget *proxy = scene.addWidget(tabWidget);
13
14 QGraphicsView view(&scene);
15 view.show();
16
17 return app.exec();
18}
19//! [0]
20
21//! [1]
22QGroupBox *groupBox = new QGroupBox("Contact Details");
23QLabel *numberLabel = new QLabel("Telephone number");
24QLineEdit *numberEdit = new QLineEdit;
25
26QFormLayout *layout = new QFormLayout(groupBox);
27layout->addRow(numberLabel, numberEdit);
28
30QGraphicsProxyWidget *proxy = scene.addWidget(groupBox);
31
32QGraphicsView view(&scene);
33view.show();
34//! [1]
35
36//! [2]
38
39QLineEdit *edit = new QLineEdit;
40QGraphicsProxyWidget *proxy = scene.addWidget(edit);
41
42edit->isVisible(); // returns true
43proxy->isVisible(); // also returns true
44
45edit->hide();
46
47edit->isVisible(); // returns false
48proxy->isVisible(); // also returns false
49//! [2]
int main(int argc, char *argv[])
[2]
Definition buffer.cpp:77
QVBoxLayout * layout
QGraphicsScene scene
[0]
QNetworkProxy proxy
[0]
QQuickView * view
[0]