|
@@ -1,19 +1,14 @@
|
1
|
1
|
import sys
|
2
|
2
|
from PyQt5.QtWidgets import *
|
3
|
|
-from PyQt5.QtGui import QIcon
|
4
|
|
-from PyQt5.QtCore import Qt
|
5
|
|
-
|
|
3
|
+
|
6
|
4
|
app = QApplication(sys.argv)
|
7
|
5
|
window = QMainWindow()
|
|
6
|
+button = QPushButton("눌러봐", window)
|
|
7
|
+button.move(50, 30)
|
8
|
8
|
|
9
|
|
-window.setWindowTitle("SWH")
|
10
|
|
-window.setWindowIcon(QIcon('favicon.ico'))
|
11
|
|
-window.setGeometry(400, 300, 300, 100)
|
12
|
|
-
|
13
|
|
-window.setAutoFillBackground(True)
|
14
|
|
-p = window.palette()
|
15
|
|
-p.setColor(window.backgroundRole(), Qt.darkRed)
|
16
|
|
-window.setPalette(p)
|
17
|
|
-
|
|
9
|
+def click():
|
|
10
|
+ QMessageBox.about(button, "메세지 박스", "눌렀어요.")
|
|
11
|
+
|
|
12
|
+button.clicked.connect(click)
|
18
|
13
|
window.show()
|
19
|
14
|
app.exec_()
|