本文整理汇总了Python中PyQt4.QtGui.QSplashScreen类的典型用法代码示例。如果您正苦于以下问题:Python QSplashScreen类的具体用法?Python QSplashScreen怎么用?Python QSplashScreen使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QSplashScreen类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: launchShell
def launchShell(workflowClass, testFunc = None, windowTitle="ilastikShell", workflowKwargs=None):
"""
Start the ilastik shell GUI with the given workflow type.
Note: A QApplication must already exist, and you must call this function from its event loop.
workflowClass - the type of workflow to instantiate for the shell.
"""
if workflowKwargs is None:
workflowKwargs = dict()
# Splash Screen
splashImage = QPixmap("../ilastik-splash.png")
splashScreen = QSplashScreen(splashImage)
splashScreen.show()
# Create workflow
workflow = workflowClass(**workflowKwargs)
# Create the shell and populate it
shell = IlastikShell(workflow=workflow, sideSplitterSizePolicy=SideSplitterSizePolicy.Manual)
shell.setWindowTitle(windowTitle)
shell.setImageNameListSlot( workflow.imageNameListSlot )
# Start the shell GUI.
shell.show()
# Hide the splash screen
splashScreen.finish(shell)
# Run a test (if given)
if testFunc:
QTimer.singleShot(0, functools.partial(testFunc, shell, workflow) )
示例2: showSplashScreen
def showSplashScreen():
splash_path = os.path.join(os.path.split(ilastik.__file__)[0], 'ilastik-splash.png')
splashImage = QPixmap(splash_path)
global splashScreen
splashScreen = QSplashScreen(splashImage)
splashScreen.showMessage( ilastik.__version__, Qt.AlignBottom | Qt.AlignRight )
splashScreen.show()
示例3: __init__
def __init__(self, pixmap, waitTime=0, textColor=Qt.black, *args, **kwargs):
"""
Initializes the class.
:param pixmap: Current pixmap path.
:type pixmap: unicode
:param waitTime: wait time.
:type waitTime: int
:param \*args: Arguments.
:type \*args: \*
:param \*\*kwargs: Keywords arguments.
:type \*\*kwargs: \*\*
"""
LOGGER.debug("> Initializing '{0}()' class.".format(self.__class__.__name__))
QSplashScreen.__init__(self, pixmap, *args, **kwargs)
self.setWindowFlags(self.windowFlags() | Qt.WindowStaysOnTopHint)
# --- Setting class attributes. ---
self.__waitTime = None
self.waitTime = waitTime
self.__textColor = None
self.textColor = textColor
示例4: show
def show():
message = "{0} {1} ".format(appinfo.appname, appinfo.version)
pixmap = QPixmap(os.path.join(__path__[0], 'splash.png'))
if QApplication.desktop().screenGeometry().height() < 640:
fontsize = 23
pixmap = pixmap.scaledToHeight(240, Qt.SmoothTransformation)
else:
fontsize = 40
splash = QSplashScreen(pixmap, Qt.SplashScreen)
font = splash.font()
font.setPixelSize(fontsize)
font.setWeight(QFont.Bold)
splash.setFont(font)
splash.showMessage(message, Qt.AlignRight | Qt.AlignTop, Qt.white)
splash.show()
splash.repaint()
def hide():
splash.deleteLater()
app.appStarted.disconnect(hide)
app.appStarted.connect(hide)
示例5: __init__
def __init__(self,qgisPrefix):
p = qgisPrefix + "//data//icimod.png"
pic = QPixmap(p)
self.labelAlignment = Qt.Alignment(Qt.AlignBottom | Qt.AlignRight | Qt.AlignAbsolute)
QSplashScreen.__init__(self, pic)
self.show()
QApplication.flush()
示例6: showMessage
def showMessage( self, msg ):
""" Show the message in the bottom part of the splashscreen """
QSplashScreen.showMessage( self, msg,
self.labelAlignment, QColor( Qt.black ) )
QApplication.processEvents()
return
示例7: __init__
def __init__(self, parent=None):
from radiance import __version__
self.__version = __version__
self.parent = parent
pixmap = QPixmap(QString(':/Radiance/splashscreen.png'))
flags = Qt.WindowStaysOnTopHint
QSplashScreen.__init__(self, pixmap, flags)
self.setMask(pixmap.mask())
# Custom progress bar stylesheet
progressbar_stylesheet = """
QProgressBar:horizontal {
border: 1px solid black;
background: white;
padding: 1px;
}
QProgressBar::chunk:horizontal {
background-color: qlineargradient(spread: pad, x1: 1, y1: 0.5, x2: 0, y2: 0.5, stop: 0 black, stop: 1 white);
}
"""
# Place progress bar to bottom of splash screen.
progressbar = QProgressBar(self)
progressbar.setRange(0, 0)
progressbar.setGeometry(10, self.height() - 20, self.width() - 20, 10)
progressbar.setTextVisible(False)
progressbar.setStyleSheet(progressbar_stylesheet)
self.progressbar = progressbar
self.show()
示例8: show_splash
def show_splash():
"""Show the splash screen"""
splashImage = QPixmap( "images/splash.png" )
splashScreen = QSplashScreen( splashImage )
splashScreen.showMessage( "Loading . . . " )
splashScreen.show()
return splashScreen
示例9: launchShell
def launchShell(workflowClass=None, *testFuncs):
"""
Start the ilastik shell GUI with the given workflow type.
Note: A QApplication must already exist, and you must call this function from its event loop.
workflowClass - the type of workflow to instantiate for the shell.
"""
# Splash Screen
splashImage = QPixmap("../ilastik-splash.png")
splashScreen = QSplashScreen(splashImage)
splashScreen.show()
# Create the shell and populate it
global shell
shell = IlastikShell(workflowClass=workflowClass, sideSplitterSizePolicy=SideSplitterSizePolicy.Manual)
assert QApplication.instance().thread() == shell.thread()
# Start the shell GUI.
shell.show()
# Hide the splash screen
splashScreen.finish(shell)
# Run a test (if given)
for testFunc in testFuncs:
QTimer.singleShot(0, functools.partial(testFunc, shell))
示例10: showMessage
def showMessage(self, msg):
"""
Public method to show a message in the bottom part of the splashscreen.
@param msg message to be shown (string or QString)
"""
QSplashScreen.showMessage(self, msg, self.labelAlignment, QColor(Qt.white))
QApplication.processEvents()
示例11: __init__
def __init__( self ):
self.labelAlignment = \
Qt.Alignment( Qt.AlignBottom | Qt.AlignRight | Qt.AlignAbsolute )
QSplashScreen.__init__( self, PixmapCache().getPixmap( 'splash.png' ) )
self.show()
QApplication.flush()
return
示例12: setPixmap
def setPixmap(self, pixmap):
self.setAttribute(Qt.WA_TranslucentBackground,
pixmap.hasAlpha() and \
is_transparency_supported())
self.__pixmap = pixmap
QSplashScreen.setPixmap(self, pixmap)
if pixmap.hasAlpha() and not is_transparency_supported():
self.setMask(pixmap.createHeuristicMask())
示例13: __init__
def __init__(self):
"""
Constructor
"""
img_path = os.path.join(os.getcwd(), 'gui', 'images', 'splash.png')
pixmap = QPixmap(img_path)
self.labelAlignment = Qt.Alignment(Qt.AlignBottom | Qt.AlignRight | Qt.AlignAbsolute)
QSplashScreen.__init__(self, pixmap)
self.show()
QApplication.flush()
示例14: showMessage
def showMessage(self, message, alignment=Qt.AlignLeft, color=Qt.black):
"""
Show the `message` with `color` and `alignment`.
"""
# Need to store all this arguments for drawContents (no access
# methods)
self.__alignment = alignment
self.__color = color
self.__message = message
QSplashScreen.showMessage(self, message, alignment, color)
QApplication.instance().processEvents()
示例15: main
def main():
app = QApplication(sys.argv)
start = time()
splash = QSplashScreen(QPixmap("images/login.png"))
splash.show()
while time() - start < 1:
sleep(0.001)
app.processEvents()
win = MainWindow()
splash.finish(win)
win.show()
app.exec_()