notifications.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:vidcutter 作者: ozmartian 项目源码 文件源码
def __init__(self, icon: str, parent=None, f=Qt.Dialog | Qt.FramelessWindowHint):
        super(Notification, self).__init__(parent, f)
        self.parent = parent
        self.theme = self.parent.theme
        self.setObjectName('notification')
        self.setContentsMargins(10, 10, 10, 10)
        self.shown.connect(lambda: QTimer.singleShot(self.duration * 1000, self.fadeOut))
        self.setWindowModality(Qt.ApplicationModal)
        self.setMinimumWidth(550)
        self._title, self._message = '', ''
        self.buttons = []
        self.msgLabel = QLabel(self._message, self)
        self.msgLabel.setWordWrap(True)
        logo_label = QLabel('<img src="{}" width="82" />'.format(icon), self)
        logo_label.setFixedSize(82, 82)
        self.left_layout = QVBoxLayout()
        self.left_layout.addWidget(logo_label)
        layout = QHBoxLayout()
        layout.addStretch(1)
        layout.addLayout(self.left_layout)
        layout.addSpacing(10)
        layout.addWidget(self.msgLabel, Qt.AlignVCenter)
        layout.addStretch(1)
        self.setLayout(layout)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号