Python PyQt5.QtWidgets.QSplashScreen() Examples

The following are 9 code examples of PyQt5.QtWidgets.QSplashScreen(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module PyQt5.QtWidgets , or try the search function .
Example #1
Source File: talpa.py    From kite with GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, filename=None):
        QtWidgets.QApplication.__init__(self, ['Talpa'])

        splash_img = QtGui.QPixmap(
            get_resource('talpa_splash.png'))\
            .scaled(QtCore.QSize(400, 250), QtCore.Qt.KeepAspectRatio)
        self.splash = QtWidgets.QSplashScreen(
            splash_img, QtCore.Qt.WindowStaysOnTopHint)
        self.updateSplashMessage('Talpa')
        self.splash.show()
        self.processEvents()

        self.talpa_win = TalpaMainWindow(filename=filename)

        self.talpa_win.actionExit.triggered.connect(self.exit)
        self.aboutToQuit.connect(self.talpa_win.sandbox.worker_thread.quit)
        self.aboutToQuit.connect(self.talpa_win.sandbox.deleteLater)
        self.aboutToQuit.connect(self.splash.deleteLater)
        self.aboutToQuit.connect(self.deleteLater)

        self.talpa_win.show()

        self.splash.finish(self.talpa_win)
        rc = self.exec_()
        sys.exit(rc) 
Example #2
Source File: SplashScreenHandler.py    From pyweed with GNU Lesser General Public License v3.0 5 votes vote down vote up
def __init__(self,):
        super(SplashScreenHandler, self).__init__(level=logging.INFO)
        pixmap = QtGui.QPixmap(":qrc/splash.png")
        self.splash = QtWidgets.QSplashScreen(pixmap, QtCore.Qt.WindowStaysOnTopHint)

        # Attach as handler to the root logger
        logger = logging.getLogger()
        logger.addHandler(self)

        self.splash.showMessage("Welcome to %s %s" % (pyweed.__app_name__, pyweed.__version__))
        self.splash.show()
        logger.info("Splash screen should be visible") 
Example #3
Source File: spool.py    From kite with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, scene=None, import_file=None, load_file=None):
        QtWidgets.QApplication.__init__(self, ['Spool'])
        # self.setStyle('plastique')
        splash_img = QtGui.QPixmap(get_resource('spool_splash.png'))\
            .scaled(QtCore.QSize(400, 250), QtCore.Qt.KeepAspectRatio)
        self.splash = QtWidgets.QSplashScreen(
            splash_img, QtCore.Qt.WindowStaysOnTopHint)
        self.updateSplashMessage('Scene')
        self.splash.show()
        self.processEvents()

        self.spool_win = SpoolMainWindow()
        self.spool_win.sigLoadingModule.connect(self.updateSplashMessage)

        self.spool_win.actionExit.triggered.connect(self.exit)
        self.aboutToQuit.connect(self.spool_win.model.worker_thread.quit,
                                 type=QtCore.Qt.QueuedConnection)
        self.aboutToQuit.connect(self.spool_win.model.deleteLater)
        self.aboutToQuit.connect(self.splash.deleteLater)
        self.aboutToQuit.connect(self.deleteLater)

        if scene is not None:
            self.addScene(scene)
        elif import_file is not None:
            self.importScene(import_file)
        elif load_file is not None:
            self.loadScene(load_file)

        self.spool_win.show()
        self.splash.finish(self.spool_win) 
Example #4
Source File: pychemqt.py    From pychemqt with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self):
        QtWidgets.QSplashScreen.__init__(
            self,
            QtGui.QPixmap(os.environ["pychemqt"] + "/images/splash.jpg"))
        QtWidgets.QApplication.flush() 
Example #5
Source File: pychemqt.py    From pychemqt with GNU General Public License v3.0 5 votes vote down vote up
def showMessage(self, msg):
        """Procedure to update message in splash"""
        align = QtCore.Qt.Alignment(QtCore.Qt.AlignBottom |
                                    QtCore.Qt.AlignRight |
                                    QtCore.Qt.AlignAbsolute)
        color = QtGui.QColor(QtCore.Qt.white)
        QtWidgets.QSplashScreen.showMessage(self, msg, align, color)
        QtWidgets.QApplication.processEvents() 
Example #6
Source File: pychemqt.py    From pychemqt with GNU General Public License v3.0 5 votes vote down vote up
def clearMessage(self):
        QtWidgets.QSplashScreen.clearMessage(self)
        QtWidgets.QApplication.processEvents() 
Example #7
Source File: QtApplication.py    From Uranium with GNU Lesser General Public License v3.0 5 votes vote down vote up
def _createSplashScreen(self) -> QSplashScreen:
        return QSplashScreen(QPixmap(Resources.getPath(Resources.Images, self.getApplicationName() + ".png"))) 
Example #8
Source File: app.py    From launcher with MIT License 5 votes vote down vote up
def __init__(self, root, source):
        super(Application, self).__init__(sys.argv)
        self.setWindowIcon(QtGui.QIcon(ICON_PATH))

        pixmap = QtGui.QPixmap(SPLASH_PATH)
        splash = QtWidgets.QSplashScreen(pixmap)
        splash.show()
        self._splash = splash

        engine = QtQml.QQmlApplicationEngine()
        engine.objectCreated.connect(self.on_object_created)
        engine.warnings.connect(self.on_warnings)
        engine.addImportPath(QML_IMPORT_DIR)

        self._splash.showMessage("Connecting database...",
                                 QtCore.Qt.AlignBottom, QtCore.Qt.black)

        try:
            io.install()
        except IOError:
            raise  # Server refused to connect

        # Install actions
        from . import install
        install()

        self._splash.showMessage("Starting Avalon Launcher...",
                                 QtCore.Qt.AlignBottom, QtCore.Qt.black)

        terminal.init()

        controller = control.Controller(root, self)
        engine.rootContext().setContextProperty("controller", controller)
        engine.rootContext().setContextProperty("terminal", terminal.model)

        self._tray = None
        self.window = None
        self.engine = engine
        self.controller = controller

        engine.load(QtCore.QUrl.fromLocalFile(source))

        self.setQuitOnLastWindowClosed(False) 
Example #9
Source File: splash.py    From QssStylesheetEditor with GNU General Public License v3.0 4 votes vote down vote up
def loadProgress(self):
        """Preimport modules to improve start speed
        Following modules are imported before splash:
        PyQt5, PyQt5.QtCore, PyQt5.QtGui, PyQt5.QtWidgets are imported before Splash.
        i18n is imported before Splash, for Splash using i18n.
        config is imported before i18n, for i18n using config.
        """
        self.setProgressText(0, 0)
        time.sleep(0.1)
        self.setProgressText(5)
        time.sleep(0.1)
        self.setProgressText(10)
        time.sleep(0.1)
        self.setProgressText(15)
        time.sleep(0.1)
        self.setProgressText(20)  # PyQt5, i18n are loaded, so before 20% do nothing
        preimport(["PyQt5.Qsci"])
        self.setProgressText(40)
        preimport(["res", "res.img_rc"])
        self.setProgressText(60)
        preimport(["ui"])
        self.setProgressText(80)
        preimport(["qss_template"])
        self.setProgressText(100)


# from PyQt5.QtCore import QDate, QDateTime
#         from PyQt5.QtGui import (QBrush, QColor, QBitmap, QIcon, QImage, QPicture, QCursor, QPainter, QKeySequence,
#                                  QFont, QPen, QMovie, qGray)
#         # (Base64, Base64url,Bigfloat,DateTimeString,Decimal,QDir,QRegExp,QRegularExpression,QTimer,QUrl)
# # QtWidgets 常用控件
# from PyQt5.QtWidgets import (
#     QAction, QActionGroup, QApplication, QBoxLayout, QCalendarWidget, QCheckBox, QColorDialog, QComboBox,
#     QDesktopWidget, QDialog, QDockWidget, QDoubleSpinBox, QFileDialog, QFontComboBox, QFontDialog, QFormLayout,
#     QFrame, QGesture, QGraphicsView, QGraphicsWidget, QGridLayout, QGroupBox, QHBoxLayout, QHeaderView,
#     QInputDialog, QItemDelegate, QKeySequenceEdit, QLCDNumber, QLabel, QLineEdit, QListView, QListWidget,
#     QListWidgetItem, QMainWindow, QMdiArea, QMdiSubWindow, QMenu, QMenuBar, QMessageBox, QOpenGLWidget,
#     QProgressBar, QProgressDialog, QPushButton, QRadioButton, QRubberBand, QScrollArea, QScrollBar, QShortcut,
#     QSizeGrip, QSlider, QSpacerItem, QSpinBox, QSplashScreen, QSplitter, QSplitterHandle, QStackedLayout,
#     QStackedWidget, QStatusBar, QStyle, QStyleFactory, QSystemTrayIcon, QTabBar, QTabWidget, QTableView,
#     QTableWidget, QTableWidgetItem, QTableWidgetSelectionRange, QTextBrowser, QTextEdit, QTimeEdit, QToolBar,
#     QToolBox, QToolButton, QToolTip, QTreeView, QTreeWidget, QTreeWidgetItem, QUndoCommand, QUndoGroup,
#     QUndoStack, QUndoView, QVBoxLayout, QWhatsThis, QWidget, QWidgetAction, QWidgetItem, qApp)

# # QtSci 所有组件
# from PyQt5 import Qsci
# from PyQt5.Qsci import (QsciLexer, QsciLexerAVS, QsciLexerBash, QsciLexerBatch, QsciLexerCMake, QsciLexerCPP,
#                         QsciLexerCSS, QsciLexerCSharp, QsciLexerCoffeeScript, QsciLexerCustom, QsciLexerD,
#                         QsciLexerDiff, QsciLexerFortran, QsciLexerFortran77, QsciLexerHTML, QsciLexerIDL,
#                         QsciLexerJSON, QsciLexerJava, QsciLexerJavaScript, QsciLexerLua, QsciLexerMakefile,
#                         QsciLexerMarkdown, QsciLexerMatlab, QsciLexerOctave, QsciLexerPO, QsciLexerPOV,
#                         QsciLexerPascal, QsciLexerPerl, QsciLexerPostScript, QsciLexerProperties,
#                         QsciLexerPython, QsciLexerRuby, QsciLexerSQL, QsciLexerSpice, QsciLexerTCL,
#                         QsciLexerTeX, QsciLexerVHDL, QsciLexerVerilog, QsciLexerXML, QsciLexerYAML, QsciMacro,
#                         QsciPrinter, QsciScintilla, QsciScintillaBase, QsciStyle, QsciStyledText, QsciAPIs)