PyQt/界面美化/QMessageBox样式/方案一/warning.py
2018-01-17 22:47:55 +08:00

39 lines
1.1 KiB
Python

#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on 2018年1月17日
@author: Irony."[讽刺]
@site: http://alyl.vip, http://orzorz.vip, https://coding.net/u/892768447, https://github.com/892768447
@email: 892768447@qq.com
@file: warning
@description:
'''
__Author__ = "By: Irony.\"[讽刺]\nQQ: 892768447\nEmail: 892768447@qq.com"
__Copyright__ = "Copyright (c) 2018 Irony.\"[讽刺]"
__Version__ = "Version 1.0"
import sys
from PyQt5.QtWidgets import QApplication, QMessageBox
app = QApplication(sys.argv)
app.setStyleSheet('''QDialogButtonBox {
dialogbuttonbox-buttons-have-icons: 1;
dialog-no-icon: url(../icons/No.png);
dialog-abort-icon: url(../icons/Abort.png);
dialog-retry-icon: url(../icons/Retry.png);
dialog-ignore-icon: url(../icons/Ignore.png);
}
QMessageBox {
messagebox-warning-icon: url(../icons/Ok.png);
}
''')
QMessageBox.warning(None, "提示warning", "消息",
QMessageBox.No |
QMessageBox.NoToAll |
QMessageBox.Abort |
QMessageBox.Retry |
QMessageBox.Ignore)
sys.exit()