-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLineEdits.py
More file actions
40 lines (29 loc) · 823 Bytes
/
LineEdits.py
File metadata and controls
40 lines (29 loc) · 823 Bytes
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
import sys
from PyQt5.QtWidgets import QLabel, QLineEdit, QWidget, QApplication, QGridLayout, QTextEdit
class Grid(QWidget):
def __init__(self):
super().__init__();
self.initUI();
def initUI(self):
title=QLabel('Title');
author=QLabel('Author');
review=QLabel('Review');
titleEdit=QLineEdit();
authorEdit=QLineEdit();
reviewEdit=QTextEdit();
grid=QGridLayout();
grid.setSpacing(20);
grid.addWidget(title, 1, 0);
grid.addWidget(titleEdit, 1, 1);
grid.addWidget(author, 2, 0);
grid.addWidget(authorEdit, 2, 1);
grid.addWidget(review, 3, 0);
grid.addWidget(reviewEdit, 3, 1, 5, 1);
self.setLayout(grid);
self.setGeometry(300, 300, 350, 300);
self.setWindowTitle('Form');
self.show();
if __name__=='__main__':
app=QApplication(sys.argv);
g=Grid();
sys.exit(app.exec_());