-
Notifications
You must be signed in to change notification settings - Fork 0
/
dialog.py
32 lines (23 loc) · 873 Bytes
/
dialog.py
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
import sys
from PyQt5.QtWidgets import QApplication, QDialog, QFormLayout, QDialogButtonBox, QLineEdit, QVBoxLayout
class Dialog(QDialog):
def __init__(self, parent=None):
super().__init__(parent)
self.setWindowTitle('QDialog')
dlgLayout = QVBoxLayout()
formLayout = QFormLayout()
formLayout.addRow('Name:', QLineEdit())
formLayout.addRow('Age:', QLineEdit())
formLayout.addRow('Job:', QLineEdit())
formLayout.addRow('Hobbies:', QLineEdit())
dlgLayout.addLayout(formLayout)
btns = QDialogButtonBox()
btns.setStandardButtons(
QDialogButtonBox.Cancel | QDialogButtonBox.Ok)
dlgLayout.addWidget(btns)
self.setLayout(dlgLayout)
if __name__ == '__main__':
app = QApplication(sys.argv)
dlg = Dialog()
dlg.show()
sys.exit(app.exec_())