当前位置: 首页>>代码示例>>Python>>正文


Python QSplashScreen.setWindowFlags方法代码示例

本文整理汇总了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
开发者ID:maximerobin,项目名称:Ufwi,代码行数:27,代码来源:splash.py

示例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
开发者ID:Xifax,项目名称:muscale,代码行数:26,代码来源:guiSplash.py


注:本文中的PyQt4.QtGui.QSplashScreen.setWindowFlags方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。