简体   繁体   中英

PyQt: How to create a simple information at programm-start that shutdown automatically

for a pyqt-program I want to create a simple information message for the program-start. The key is, that it should disappear automatically after a few seconds.

I tried to use a singleshot, but it didn't work:

class MainProgramm(QMainWindow):
    def __init__(self, *args):
        QWidget.__init__(self, *args)
        QTimer.singleShot(60, self.EntryMessage) 
...

def EntryMessage(self):
        QMessageBox.information(self, "About","text") 

Can anybody help?

If I've understood you right, it seems like QSplashScreen is what you need. It's actually a part of Qt, so you can use it without any limitations.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM