def main(argv=None): '''Entry point if executing as standalone''' if argv is None: argv = sys.argv app = QApplication(argv) app.processEvents() pixmap = QPixmap(os.path.abspath(os.path.join("res", "CLEED_logo.png"))) splash = QSplashScreen(pixmap, QtCore.Qt.WindowStaysOnTopHint) splash.setMask(pixmap.mask()) # this is useful if splash isn't a rectangle splash.showMessage((u'Starting %s...' % __APP_NAME__), QtCore.Qt.AlignRight | QtCore.Qt.AlignBottom, QtCore.Qt.yellow) splash.show() # make sure Qt really display the splash screen app.processEvents() app.setQuitOnLastWindowClosed(False) window = MainWindow() if not QtGui.QSystemTrayIcon.isSystemTrayAvailable(): window.logger.warning("Unable to create a Systray on this system") # now kill the splash screen splash.finish(window) splash.close() window.show() sys.exit(app.exec_())
def main(): app = QApplication(sys.argv) # Show SplashScreen splash_pixmap = QPixmap(':/cover.png') splash_screen = QSplashScreen(splash_pixmap, Qt.WindowStaysOnTopHint) splash_screen.show() app.processEvents() # Runtime imports import Valves_Main import time app.processEvents() app.setOrganizationName('Gatituz PK') app.setOrganizationDomain('http://gatituzmes-server.duckdns.org/') app.setApplicationName('VAL 518') app.processEvents() window = Valves_Main.MainWindowStart() app.setWindowIcon(QIcon(":/logo.png")) app.processEvents() app.processEvents() time.sleep(2) app.processEvents() time.sleep(1) app.processEvents() time.sleep(1) window.showMaximized() splash_screen.close() # Execute app app.exec_()