self.box = QMessageBox(QMessageBox.Information, "温馨提示", "%s"% txt)qyes = self.box.addButton(self.tr("确定"), QMessageBox.YesRole).animateClick(1*1000)#1秒自动关闭self.box.exec_()