-
Notifications
You must be signed in to change notification settings - Fork 4
/
MainWindow.py
40 lines (36 loc) · 1.09 KB
/
MainWindow.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
33
34
35
36
37
38
39
40
#main window
import sys
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from SubWindow import Window
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
self.setWindowTitle('Main Window')
self.setGeometry(100, 100, 300, 200)
layout = QVBoxLayout()
layout.addStretch(1)
label = QLabel("미지정")
label.setAlignment(Qt.AlignCenter)
font = label.font()
font.setPointSize(30)
label.setFont(font)
self.label = label
btn = QPushButton("벤처기업 검색")
btn.clicked.connect(self.onButtonClicked)
layout.addWidget(label)
layout.addWidget(btn)
layout.addStretch(1)
centralWidget = QWidget()
centralWidget.setLayout(layout)
self.setCentralWidget(centralWidget)
def onButtonClicked(self):
self.win = Window()
r = self.win.showModal()
if r:
text = self.win.edit.text()
self.label.setText(text)
def show(self):
super().show()