本文整理汇总了Python中PyQt4.QtGui.QSplashScreen.hide方法的典型用法代码示例。如果您正苦于以下问题:Python QSplashScreen.hide方法的具体用法?Python QSplashScreen.hide怎么用?Python QSplashScreen.hide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui.QSplashScreen
的用法示例。
在下文中一共展示了QSplashScreen.hide方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt4.QtGui import QSplashScreen [as 别名]
# 或者: from PyQt4.QtGui.QSplashScreen import hide [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: MainWindow
# 需要导入模块: from PyQt4.QtGui import QSplashScreen [as 别名]
# 或者: from PyQt4.QtGui.QSplashScreen import hide [as 别名]
class MainWindow(QMainWindow):
def __init__(self, parent = None):
super(MainWindow, self).__init__(parent)
self.dirty = False
self.isLoaded = False
self.calibration_enabled = False
self.aggregate_enabled = False
self.setObjectName("MainWindow")
self.resize(800, 600)
self.setWindowTitle("OpenFisca")
app_icon = get_icon('OpenFisca22.png')
self.setWindowIcon(app_icon)
self.setLocale(QLocale(QLocale.French, QLocale.France))
self.setDockOptions(QMainWindow.AllowNestedDocks|QMainWindow.AllowTabbedDocks|QMainWindow.AnimatedDocks)
self.centralwidget = QWidget(self)
self.gridLayout = QGridLayout(self.centralwidget)
self.setCentralWidget(self.centralwidget)
self.centralwidget.hide()
self.statusbar = QStatusBar(self)
self.statusbar.setObjectName("statusbar")
self.setStatusBar(self.statusbar)
# Showing splash screen
pixmap = QPixmap(':/images/splash.png', 'png')
self.splash = QSplashScreen(pixmap)
font = self.splash.font()
font.setPixelSize(10)
self.splash.setFont(font)
self.splash.show()
self.splash.showMessage("Initialisation...", Qt.AlignBottom | Qt.AlignCenter |
Qt.AlignAbsolute, QColor(Qt.black))
# if CONF.get('main', 'current_version', '') != __version__:
# CONF.set('main', 'current_version', __version__)
# Execute here the actions to be performed only once after
# each update (there is nothing there for now, but it could
# be useful some day...
self.scenario = Scenario()
# Preferences
self.general_prefs = [SimConfigPage, PathConfigPage, CalConfigPage]
self.oldXAXIS = 'sal'
self.reforme = False
self.apply_settings()
# Dockwidgets creation
self.splash.showMessage("Creating widgets...", Qt.AlignBottom | Qt.AlignCenter |
Qt.AlignAbsolute, QColor(Qt.black))
self.create_dockwidgets()
self.populate_mainwidow()
#################################################################
## Menu initialization
#################################################################
self.splash.showMessage("Creating menubar...", Qt.AlignBottom | Qt.AlignCenter |
Qt.AlignAbsolute, QColor(Qt.black))
# Menu Fichier
self.file_menu = self.menuBar().addMenu("Fichier")
action_export_png = create_action(self, 'Exporter le graphique', icon = 'document-save png.png', triggered = self._graph.save_figure)
action_export_csv = create_action(self, 'Exporter la table', icon = 'document-save csv.png', triggered = self._table.saveCsv)
action_pref = create_action(self, u'Préférences', QKeySequence.Preferences, icon = 'preferences-desktop.png', triggered = self.edit_preferences)
action_quit = create_action(self, 'Quitter', QKeySequence.Quit, icon = 'process-stop.png', triggered = SLOT('close()'))
file_actions = [action_export_png, action_export_csv,None, action_pref, None, action_quit]
add_actions(self.file_menu, file_actions)
# Menu Edit
self.edit_menu = self.menuBar().addMenu(u"Édition")
action_copy = create_action(self, 'Copier', QKeySequence.Copy, triggered = self.global_callback, data = 'copy')
edit_actions = [None, action_copy]
add_actions(self.edit_menu, edit_actions)
# Menu Simulation
self.simulation_menu = self.menuBar().addMenu(u"Simulation")
self.action_refresh_bareme = create_action(self, u'Calculer barèmes', shortcut = 'F8', icon = 'view-refresh.png', triggered = self.refresh_bareme)
self.action_refresh_calibration = create_action(self, u'Calibrer', shortcut = 'F9', icon = 'view-refresh.png', triggered = self.refresh_calibration)
self.action_refresh_aggregate = create_action(self, u'Calculer aggrégats', shortcut = 'F10', icon = 'view-refresh.png', triggered = self.refresh_aggregate)
action_bareme = create_action(self, u'Barème', icon = 'bareme22.png', toggled = self.modeBareme)
action_cas_type = create_action(self, u'Cas type', icon = 'castype22.png', toggled = self.modeCasType)
action_mode_reforme = create_action(self, u'Réforme', icon = 'comparison22.png', toggled = self.modeReforme, tip = u"Différence entre la situation simulée et la situation actuelle")
mode_group = QActionGroup(self)
mode_group.addAction(action_bareme)
mode_group.addAction(action_cas_type)
self.mode = 'bareme'
action_bareme.trigger()
simulation_actions = [self.action_refresh_bareme, self.action_refresh_calibration, self.action_refresh_aggregate , None, action_bareme, action_cas_type, None, action_mode_reforme]
add_actions(self.simulation_menu, simulation_actions)
# Menu Help
help_menu = self.menuBar().addMenu("&Aide")
action_about = create_action(self, u"&About OpenFisca", triggered = self.helpAbout)
action_help = create_action(self, "&Aide", QKeySequence.HelpContents, triggered = self.helpHelp)
help_actions = [action_about, action_help]
add_actions(help_menu, help_actions)
#.........这里部分代码省略.........
示例3: MainWindow
# 需要导入模块: from PyQt4.QtGui import QSplashScreen [as 别名]
# 或者: from PyQt4.QtGui.QSplashScreen import hide [as 别名]
class MainWindow(QMainWindow):
def __init__(self, parent = None):
super(MainWindow, self).__init__(parent)
self.dirty = False
self.setObjectName("MainWindow")
self.resize(800, 600)
self.setWindowTitle("GA") # TODO
# TODO app_icon = get_icon('OpenFisca22.png')
# self.setWindowIcon(app_icon)
self.setLocale(QLocale(QLocale.French, QLocale.France))
self.setDockOptions(QMainWindow.AllowNestedDocks|QMainWindow.AllowTabbedDocks|QMainWindow.AnimatedDocks)
self.centralwidget = QWidget(self)
self.gridLayout = QGridLayout(self.centralwidget)
self.setCentralWidget(self.centralwidget)
self.centralwidget.hide()
self.statusbar = QStatusBar(self)
self.statusbar.setObjectName("statusbar")
self.setStatusBar(self.statusbar)
# Showing splash screen
pixmap = QPixmap(':/images/splash.png', 'png')
self.splash = QSplashScreen(pixmap)
font = self.splash.font()
font.setPixelSize(10)
self.splash.setFont(font)
self.splash.show()
self.splash.showMessage("Initialisation...", Qt.AlignBottom | Qt.AlignCenter |
Qt.AlignAbsolute, QColor(Qt.black))
# if CONF.get('main', 'current_version', '') != __version__:
# CONF.set('main', 'current_version', __version__)
# Execute here the actions to be performed only once after
# each update (there is nothing there for now, but it could
# be useful some day...
self.start()
def start(self, restart = False):
'''
Starts main process
'''
# Preferences
self.general_prefs = [PathConfigPage]
self.apply_settings()
# Dockwidgets creation
self.splash.showMessage("Creating widgets...", Qt.AlignBottom | Qt.AlignCenter |
Qt.AlignAbsolute, QColor(Qt.black))
self.create_dockwidgets()
self.populate_mainwidow()
#################################################################
## Menu initialization
#################################################################
self.splash.showMessage("Creating menubar...", Qt.AlignBottom | Qt.AlignCenter |
Qt.AlignAbsolute, QColor(Qt.black))
# Menu Fichier
self.file_menu = self.menuBar().addMenu("Fichier")
action_export_png = create_action(self, 'Exporter le graphique', icon = 'document-save png.png') #, triggered = None)
action_export_csv = create_action(self, 'Exporter la table', icon = 'document-save csv.png') #, triggered = None)
action_pref = create_action(self, u'Préférences', QKeySequence.Preferences, icon = 'preferences-desktop.png', triggered = self.edit_preferences)
action_quit = create_action(self, 'Quitter', QKeySequence.Quit, icon = 'process-stop.png', triggered = SLOT('close()'))
file_actions = [action_export_png, action_export_csv,None, action_pref, None, action_quit]
add_actions(self.file_menu, file_actions)
# Menu Edit
self.edit_menu = self.menuBar().addMenu(u"Édition")
action_copy = create_action(self, 'Copier', QKeySequence.Copy, triggered = self.global_callback, data = 'copy')
edit_actions = [None, action_copy]
add_actions(self.edit_menu, edit_actions)
# Menu Projection
self.projection_menu = self.menuBar().addMenu(u"Projection")
#
self.action_refresh_project_population = create_action(self, u'Calculer les projections de population', shortcut = 'F9', icon = 'calculator_green.png', triggered = self.project_population)
projection_actions = [self.action_refresh_project_population, None ]
add_actions(self.projection_menu, projection_actions)
# Menu Help
help_menu = self.menuBar().addMenu("&Aide")
action_about = create_action(self, u"&About GA", triggered = self.helpAbout)
action_help = create_action(self, "&Aide", QKeySequence.HelpContents, triggered = self.helpHelp)
help_actions = [action_about, action_help]
add_actions(help_menu, help_actions)
# Display Menu
view_menu = self.createPopupMenu()
view_menu.setTitle("&Affichage")
self.menuBar().insertMenu(help_menu.menuAction(),
view_menu)
#.........这里部分代码省略.........