本文整理汇总了Python中PySide2.QtWidgets.QApplication.processEvents方法的典型用法代码示例。如果您正苦于以下问题:Python QApplication.processEvents方法的具体用法?Python QApplication.processEvents怎么用?Python QApplication.processEvents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide2.QtWidgets.QApplication
的用法示例。
在下文中一共展示了QApplication.processEvents方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from PySide2.QtWidgets import QApplication [as 别名]
# 或者: from PySide2.QtWidgets.QApplication import processEvents [as 别名]
def main():
if parser.lang:
sys_locale = parser.lang[0]
else:
sys_locale = QtCore.QLocale.system().name()
translator = QtCore.QTranslator()
#load intern dialogs translations
qtTranslator = QtCore.QTranslator()
qtTranslator.load("qt_" + sys_locale, QtCore.QLibraryInfo.location(QtCore.QLibraryInfo.TranslationsPath))
#load translations files
translations_path = os.path.join(os.getenv("PINGUINO_LIB"), "multilanguage")
trasnlations = os.path.exists(translations_path)
if trasnlations and (os.getenv("PINGUINO_MODE") == "NORMAL"):
translations_file = "pinguino_" + sys_locale
if translations_file + ".qm" in os.listdir(translations_path):
translator.load(os.path.join(os.getenv("PINGUINO_LIB"), "multilanguage", "pinguino_{}.qm".format(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_LIB"), "multilanguage", "pinguino_{}.qm".format(sys_locale)))
app = QApplication(sys.argv)
#Splash (pinguino\qtgui\resources\art)
#pixmap = QPixmap(":/logo/art/splash.png")
pixmap = QPixmap("pinguino/qtgui/resources/art/splash.png")
#pixmap = QPixmap("pinguino/qtgui/resources/art/pinguino_logo_background_blue-256x256.png")
#pixmap = QPixmap(760, 256)
#pixmap.fill(QtGui.QColor("#4d4d4d"))
# keep the splash screen above all the other windows on the desktop
splash = QSplashScreen(pixmap, QtCore.Qt.WindowStaysOnTopHint)
splash.show()
splash.setStyleSheet("""
font-family: inherit;
font-weight: normal;
font-size: 11pt;
""")
# update the splash screen with messages
def splash_write(msg):
if not splash is None:
splash.showMessage("\t" + msg, color=QtGui.QColor("#4d4d4d"), alignment=QtCore.Qt.AlignBottom)
splash_write(NAME + " " + MAJOR)
app.processEvents()
app.installTranslator(qtTranslator)
if trasnlations:
app.installTranslator(translator)
frame = PinguinoIDE(splash_write=splash_write)
frame.show()
if not splash is None:
splash.finish(frame)
app.exec_()