blob: e660310942b4e0f2b34309fe6076975465b142e4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
//! [0]
import sys
QApplication app(sys.argv)
tabWidget = QTabWidget()
scene = QGraphicsScene()
proxy = scene.addWidget(tabWidget)
view = QGraphicsView(scene)
view.show()
return app.exec_()
//! [0]
//! [1]
groupBox = QGroupBox("Contact Details")
numberLabel = QLabel("Telephone number")
numberEdit = QLineEdit()
layout = QFormLayout()
layout.addRow(numberLabel, numberEdit)
groupBox.setLayout(layout)
scene = QGraphicsScene()
proxy = scene.addWidget(groupBox)
view = QGraphicsView(scene)
view.show()
//! [1]
//! [2]
scene = QGraphicsScene()
edit = QLineEdit()
proxy = scene.addWidget(edit)
edit.isVisible() // returns true
proxy.isVisible() // also returns true
edit.hide()
edit.isVisible() // returns false
proxy.isVisible() // also returns false
//! [2]
|