import sys, time from PyQt4 import QtCore, QtGui, Qt class DigitalClock(QtGui.QMainWindow): def __init__(self, parent = None): QtGui.QMainWindow.__init__(self, parent) timer = QtCore.QTimer(self) self.connect(timer, QtCore.SIGNAL("timeout()"), self.showTime) timer.start(1000) self.showTime() self.setWindowTitle(self.tr("Digital Clock")) def showTime(self): time = QtCore.QTime.currentTime() text = time.toString("hh:mm:ss") self.timeLabel = QtGui.QLabel(text) layout = QtGui.QHBoxLayout() layout.addWidget(self.timeLabel) self.currentWidget = QtGui.QWidget(self) self.currentWidget.setLayout(layout) self.setCentralWidget(self.currentWidget) self.resize(self.currentWidget.sizeHint()) if __name__ == "__main__": app = QtGui.QApplication(sys.argv) pixmap = QtGui.QPixmap("splash.jpg") splash = QtGui.QSplashScreen(pixmap) splash.show() app.processEvents() time.sleep(3) clock = DigitalClock() splash.finish(clock) clock.show() sys.exit(app.exec_())