當前位置: 首頁>>代碼示例>>Python>>正文


Python QtWidgets.QSplashScreen方法代碼示例

本文整理匯總了Python中PyQt5.QtWidgets.QSplashScreen方法的典型用法代碼示例。如果您正苦於以下問題:Python QtWidgets.QSplashScreen方法的具體用法?Python QtWidgets.QSplashScreen怎麽用?Python QtWidgets.QSplashScreen使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PyQt5.QtWidgets的用法示例。


在下文中一共展示了QtWidgets.QSplashScreen方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from PyQt5 import QtWidgets [as 別名]
# 或者: from PyQt5.QtWidgets import QSplashScreen [as 別名]
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) 
開發者ID:pyrocko,項目名稱:kite,代碼行數:27,代碼來源:talpa.py

示例2: __init__

# 需要導入模塊: from PyQt5 import QtWidgets [as 別名]
# 或者: from PyQt5.QtWidgets import QSplashScreen [as 別名]
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") 
開發者ID:iris-edu,項目名稱:pyweed,代碼行數:14,代碼來源:SplashScreenHandler.py

示例3: __init__

# 需要導入模塊: from PyQt5 import QtWidgets [as 別名]
# 或者: from PyQt5.QtWidgets import QSplashScreen [as 別名]
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) 
開發者ID:pyrocko,項目名稱:kite,代碼行數:32,代碼來源:spool.py

示例4: __init__

# 需要導入模塊: from PyQt5 import QtWidgets [as 別名]
# 或者: from PyQt5.QtWidgets import QSplashScreen [as 別名]
def __init__(self):
        QtWidgets.QSplashScreen.__init__(
            self,
            QtGui.QPixmap(os.environ["pychemqt"] + "/images/splash.jpg"))
        QtWidgets.QApplication.flush() 
開發者ID:jjgomera,項目名稱:pychemqt,代碼行數:7,代碼來源:pychemqt.py

示例5: showMessage

# 需要導入模塊: from PyQt5 import QtWidgets [as 別名]
# 或者: from PyQt5.QtWidgets import QSplashScreen [as 別名]
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() 
開發者ID:jjgomera,項目名稱:pychemqt,代碼行數:10,代碼來源:pychemqt.py

示例6: clearMessage

# 需要導入模塊: from PyQt5 import QtWidgets [as 別名]
# 或者: from PyQt5.QtWidgets import QSplashScreen [as 別名]
def clearMessage(self):
        QtWidgets.QSplashScreen.clearMessage(self)
        QtWidgets.QApplication.processEvents() 
開發者ID:jjgomera,項目名稱:pychemqt,代碼行數:5,代碼來源:pychemqt.py

示例7: _createSplashScreen

# 需要導入模塊: from PyQt5 import QtWidgets [as 別名]
# 或者: from PyQt5.QtWidgets import QSplashScreen [as 別名]
def _createSplashScreen(self) -> QSplashScreen:
        return QSplashScreen(QPixmap(Resources.getPath(Resources.Images, self.getApplicationName() + ".png"))) 
開發者ID:Ultimaker,項目名稱:Uranium,代碼行數:4,代碼來源:QtApplication.py

示例8: __init__

# 需要導入模塊: from PyQt5 import QtWidgets [as 別名]
# 或者: from PyQt5.QtWidgets import QSplashScreen [as 別名]
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) 
開發者ID:getavalon,項目名稱:launcher,代碼行數:45,代碼來源:app.py

示例9: loadProgress

# 需要導入模塊: from PyQt5 import QtWidgets [as 別名]
# 或者: from PyQt5.QtWidgets import QSplashScreen [as 別名]
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) 
開發者ID:hustlei,項目名稱:QssStylesheetEditor,代碼行數:57,代碼來源:splash.py


注:本文中的PyQt5.QtWidgets.QSplashScreen方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。