demo.py 839 字节
Newer Older
之一Yo's avatar
之一Yo 已提交
1 2 3 4
# coding:utf-8
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton

5
from mask_dialog import MaskDialog
之一Yo's avatar
之一Yo 已提交
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29


class Window(QWidget):

    def __init__(self, parent=None):
        super().__init__(parent=parent)
        self.resize(1000, 500)
        self.btn = QPushButton('点我', parent=self)
        self.btn.move(425, 25)
        self.btn.clicked.connect(self.showDialog)
        with open('resource/demo.qss', encoding='utf-8') as f:
            self.setStyleSheet(f.read())

    def showDialog(self):
        content = '如果将"音乐"文件夹从音乐中移除,则该文件夹不会再出现在音乐中。'
        w = MaskDialog('删除此文件夹吗?', content, self)
        w.exec()


if __name__ == '__main__':
    app = QApplication(sys.argv)
    w = Window()
    w.show()
    sys.exit(app.exec_())