本文整理汇总了Python中PyQt4.QtGui.QSplashScreen.setWindowFlags方法的典型用法代码示例。如果您正苦于以下问题:Python QSplashScreen.setWindowFlags方法的具体用法?Python QSplashScreen.setWindowFlags怎么用?Python QSplashScreen.setWindowFlags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui.QSplashScreen
的用法示例。
在下文中一共展示了QSplashScreen.setWindowFlags方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt4.QtGui import QSplashScreen [as 别名]
# 或者: from PyQt4.QtGui.QSplashScreen import setWindowFlags [as 别名]
class SplashScreen:
def __init__(self, image_resource=":/images/splash_wait.png", text=None):
pixmap = QPixmap(image_resource)
self.splash = QSplashScreen(pixmap)
self.splash.setMask(QRegion(pixmap.mask()));
self.splash.setPixmap(pixmap);
flags = self.splash.windowFlags()
flags |= Qt.WindowStaysOnTopHint
self.splash.setWindowFlags(flags)
self._text = None
if text is not None:
self.setText(text)
def show(self):
self.splash.show()
def hide(self):
self.splash.hide()
def setText(self, text):
self._text = text
self.splash.showMessage(text, Qt.AlignBottom | Qt.AlignHCenter);
def getText(self):
return self._text
示例2: showSplash
# 需要导入模块: from PyQt4.QtGui import QSplashScreen [as 别名]
# 或者: from PyQt4.QtGui.QSplashScreen import setWindowFlags [as 别名]
def showSplash(app):
# splash pixmap
logo = QPixmap(RES + ICONS + SPLASH)
splash = QSplashScreen(logo, Qt.WindowStaysOnTopHint)
splash.setWindowFlags(Qt.WindowStaysOnTopHint)
# alpha mask
splash.show()
splash.setMask(logo.mask())
# status message
labelAlignment = Qt.Alignment(Qt.AlignBottom | Qt.AlignCenter | Qt.AlignAbsolute)
newline = '<br/>'
family = FONTS_DICT['splash'][0]
size = str(FONTS_DICT['splash'][2])
font = "<font style='font-family: " + family + "; font-size: " + size + "pt; color: white;'>"
info = newline * 10 + font + 'Loading...<br/>' + __name__ + ' ' + __version__ + '</font'
splash.showMessage(info, labelAlignment) #NB: html tags completely break alignment and color settings
# checking for mouse click
app.processEvents()
return splash