# -*- coding: utf-8 -*-
import sys
import random
from PyQt4.QtGui import *
from PyQt4.QtCore import *
class BaseProgressDialog(QMainWindow):
    def __init__(self, parent=None):
        super(BaseProgressDialog,self).__init__()
        self.setWindowTitle(u"定时关闭消息框!")
        self.resize(400,300)
        self.show()


        
        infoBox = QMessageBox(self) ##Message Box that doesn't run
        infoBox.setIcon(QMessageBox.Information)
        infoBox.setText(u"保存完成!")
        infoBox.setWindowTitle("Information")
        infoBox.setStandardButtons(QMessageBox.Ok )
        infoBox.button(QMessageBox.Ok).animateClick(2*1000)       #3秒自动关闭
        infoBox.exec_()

        

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

pyqt4定时关闭消息框

相关文章:

  • 2022-12-23
  • 2021-06-01
  • 2021-07-13
  • 2022-12-23
  • 2021-12-12
  • 2022-12-23
  • 2021-11-05
  • 2022-12-23
猜你喜欢
  • 2021-12-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-29
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案