def main(): app = QApplication(sys.argv) import qdarkstyle # setup stylesheet app.setStyleSheet(qdarkstyle.load_stylesheet()) pixmap = QPixmap(os.path.join(_resourcepath('images'), "splash.png")) splash = QSplashScreen(pixmap, Qt.WindowStaysOnTopHint) splash.setMask(pixmap.mask()) splash_font = splash.font() splash_font.setPixelSize(14) splash.setFont(splash_font) splash.show() splash.showMessage('Initialising...', Qt.AlignBottom | Qt.AlignLeft | Qt.AlignAbsolute, Qt.white) app.processEvents() """ for count in range(1, 6): splash.showMessage('Processing {0}...'.format(count), Qt.AlignBottom | Qt.AlignLeft, Qt.white) QApplication.processEvents() QThread.msleep(1000) """ frame = ConfiguratorWindow() frame.show_and_raise() splash.finish(frame) sys.exit(app.exec_())
def loadManager(self, methodToGetManager, *args, **kwargs): """ Show splash screen while calling `methodToGetManager(*args, **kwargs)` to get a reference to the ObsLightManager. """ pixmap = QPixmap(join(UI_PATH, "splashscreen.png")) self.splash = QSplashScreen(pixmap) self.splash.show() self.processEvents() self.splash.showMessage(u"Loading...", Qt.AlignBottom | Qt.AlignHCenter, QColor(u"white")) self.processEvents() self.__obsLightManager = methodToGetManager(*args, **kwargs) self.__logManager = LogManager(self) self.__loadMainWindow() self.__obsProjectManager = ObsProjectsManager(self) self.__micProjectsManager = MicProjectsManager(self) self.__mainWindow.callBeforeCloseEvent.append(self.__saveGeometry) self.__mainWindow.callBeforeCloseEvent.append(self.__logManager.close) self.splash.finish(self.mainWindow)
from PySide.QtGui import QApplication, QSplashScreen, QPixmap #create application and set properties app = QApplication(sys.argv) app.setOrganizationName('Chengdu University') app.setOrganizationDomain('http://www.cdu.edu.cn') app.setApplicationName('Krait') #support windows 7, 10 taskbar icon import ctypes if os.name == 'nt': myappid = 'CDU.Krait.ssr.1.0' ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid) splash_img = QPixmap(":/icons/splash.png") splash = QSplashScreen(splash_img) splash.setWindowFlags(Qt.WindowStaysOnTopHint | Qt.SplashScreen | Qt.FramelessWindowHint) splash.setStyleSheet(''' font-family:"Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; ''') splash.setEnabled(False) splash.show() def show_splash_msg(msg): splash.showMessage(msg, Qt.AlignCenter | Qt.AlignBottom, Qt.white) app.processEvents()
"pinguino_%s.qm" % sys_locale)) elif "_" in sys_locale: sys_locale = sys_locale[:sys_locale.find("_")] translations_file = "pinguino_" + sys_locale if translations_file + ".qm" in os.listdir(translations_path): translator.load( os.path.join(os.getenv("PINGUINO_DATA"), "multilanguage", "pinguino_%s.qm" % sys_locale)) app = QApplication(sys.argv) #Splash pixmap = QPixmap(":/logo/art/splash.png") splash = QSplashScreen(pixmap, QtCore.Qt.WindowStaysOnTopHint) splash.show() splash.setStyleSheet(""" font-family: inherit; font-weight: normal; font-size: 11pt; """) def splash_write(msg): if not splash is None: splash.showMessage("\t" + msg + "\n", color=QtCore.Qt.white, alignment=QtCore.Qt.AlignBottom) splash_write(NAME + " " + VERSION)
if self.donationButton.text() == 'Donate': self.copyEthAddressButton.setVisible(True) self.copyBtcAddressButton.setVisible(True) self.donationButton.setText('Hide') elif self.donationButton.text() == 'Hide': self.copyEthAddressButton.setVisible(False) self.copyBtcAddressButton.setVisible(False) self.donationButton.setText('Donate') self.worker.start() def cleanup(self): # Clears the clipboard of any copied text clip.setText('') form = MainWindow() # Define program window # Set up and display splash screen splashImage = QImage(splashByteArray) splashPixmap = QPixmap(splashImage) splashScr = QSplashScreen(splashPixmap, Qt.WindowStaysOnTopHint) splashScr.setMask(splashPixmap.mask()) splashScr.show() sleep(1) app.processEvents() splashScr.hide() splashScr.deleteLater() form.show() app.aboutToQuit.connect(form.cleanup) # Clears the clipboard when exiting app.exec_()
def about(self): """Popup a box with about message. Input: None Output: None""" QMessageBox.about( self, "About MClub Mover", """This program is designed to help make the process of copying \ files from multiple directories much easier and simpler.\n This software is provided as is with absolutely no warranties.""", WindowModility=True) if __name__ == '__main__': ##TODO: Look into setting caching to remember a users preference from previous execution if os_version == 'Windows': # Uberhack to make windows show my icon in the taskbar ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID( 'mclub.mover.%s' % __version__) app = QApplication(sys.argv) splash_img = QPixmap('splash.png') splash = QSplashScreen( splash_img ) # Need to see how to cleanly destroy the splash once the form is loaded. splash.show() frame = MainWindow() frame.show() app.setWindowIcon(QIcon('favicon.png')) app.exec_()
# self.alpha -= 15 # if self.alpha > 0: # self.repaint() # if self.alpha == 0: # self.timer.stop() # #self.close() # def paintEvent(self,pe): # super(SplashScreen, self).paintEvent(pe) # p = QPainter(self) # p.fillRect(0,0,self.width(),self.height(), QColor(255,255,255,self.alpha)) pixmap = QPixmap(os.path.join(resource_dir,"client_splash.png")) splash = QSplashScreen(pixmap) splash.setMask(pixmap.mask()) # splash.setWindowFlags(Qt.WindowStaysOnTopHint) splash.show() splash_msg( u"{} - ".format(configuration.this_version) + _("Contacting updates server")) splash_msg( _("Loading database URL")) try: configuration.load_database_param() except Exception as e: mainlog.error(e) mainlog.error( "I was unable to get the DB URL from the server {}, so I'll continue with the file configuration".format( configuration.database_url_source)) showErrorBox( _("Can't connect to the main server"), _("I was unable to contact the main server (located here : {}). It is not 100% necessary to do so but that's not normal either. You should tell your administrator about that. I will now allow you to change the network address of the server I know in the preferences panel.").format(
import sys from PySide.QtCore import Qt from PySide.QtGui import QApplication, QPixmap, QSplashScreen from dialog.directory_dialog import DirectoryDialog from indexer.indexer import Indexer from gui.mainwindow import MainWindow if __name__ == "__main__": app = QApplication(sys.argv) dir = DirectoryDialog() if dir.exec_() and dir.result() != "" and dir.result() != None: app.indexer = Indexer(dir.result()) splash_pix = QPixmap('res/SplashScreen.png') splash = QSplashScreen(splash_pix, Qt.WindowStaysOnTopHint) splash.setMask(splash_pix.mask()) splash.show() app.processEvents() app.indexer.load_data() app.doclist = None app.webview = None app.currentWord = None app.mainWindow = MainWindow() splash.finish(app.mainWindow) app.mainWindow.show() sys.exit(app.exec_()) else: app.quit()