-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathmsg_box.py
More file actions
27 lines (21 loc) · 921 Bytes
/
msg_box.py
File metadata and controls
27 lines (21 loc) · 921 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
# coding=utf-8
from PySide2.QtGui import QIcon, QPixmap
from PySide2.QtWidgets import QMessageBox
class MsgSuccess(QMessageBox):
"""提示(操作成功)对话框,使用的时候设置提示信息即可"""
def __init__(self):
super(MsgSuccess, self).__init__()
self.setWindowTitle('注意')
self.setWindowIcon(QIcon('img/yologo.png'))
pix = QPixmap('img/success.svg').scaled(48, 48)
self.setIconPixmap(pix)
self.setStyleSheet('font: 16px Microsoft YaHei')
class MsgWarning(QMessageBox):
"""注意对话框,使用的时候设置提示信息即可"""
def __init__(self):
super(MsgWarning, self).__init__()
self.setWindowTitle('注意')
self.setWindowIcon(QIcon('img/yologo.png'))
pix = QPixmap('img/warn.svg').scaled(48, 48)
self.setIconPixmap(pix)
self.setStyleSheet('font: 16px Microsoft YaHei')