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