本文整理汇总了Python中main_window.MainWindow.show方法的典型用法代码示例。如果您正苦于以下问题:Python MainWindow.show方法的具体用法?Python MainWindow.show怎么用?Python MainWindow.show使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类main_window.MainWindow
的用法示例。
在下文中一共展示了MainWindow.show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from main_window import MainWindow [as 别名]
# 或者: from main_window.MainWindow import show [as 别名]
def main():
# Load translator.
translator = qt4.QTranslator()
translator.load('i18n/ru_RU')
# Create Qt application.
app = qt4.QApplication(sys.argv)
# Close application when all windows closed.
app.lastWindowClosed.connect(app.quit)
# Handle exceptions in Qt threads.
sys.excepthook = excepthook
# Register a signal handler to catch ctrl+C
# TODO: Don't work
signal.signal(signal.SIGINT, handle_int_signal)
# Apply translator.
app.installTranslator(translator)
# Create main window.
main_window = MainWindow()
main_window.show()
# Main loop.
sys.exit(app.exec_())
示例2: CDATGUIApp
# 需要导入模块: from main_window import MainWindow [as 别名]
# 或者: from main_window.MainWindow import show [as 别名]
class CDATGUIApp(QtGui.QApplication):
def __init__(self):
super(CDATGUIApp, self).__init__(sys.argv)
self.setApplicationName("CDAT GUI")
self.setApplicationVersion(info.version)
self.setWindowIcon(icon(info.icon))
self.win = None
self.splash = LoadingSplash()
self.splash.show()
self.splash.raise_()
self.splash.activateWindow()
self.preloadModules()
def preloadModules(self):
self.splash.showMessage("Loading VCS")
import vcs
x = vcs.init()
x.close()
x = None
self.splash.showMessage("Loading CDMS2")
import cdms2
self.ready()
def ready(self):
self.win = MainWindow()
self.splash.finish(self.win)
self.win.show()
示例3: main
# 需要导入模块: from main_window import MainWindow [as 别名]
# 或者: from main_window.MainWindow import show [as 别名]
def main():
app = QApplication([])
model = Model()
main = MainWindow(model)
main.show()
app.exec_()
示例4: main
# 需要导入模块: from main_window import MainWindow [as 别名]
# 或者: from main_window.MainWindow import show [as 别名]
def main(argv=None):
logging.basicConfig(filename=LOG_FILENAME,level=logging.DEBUG)
logging.debug('Main:Start Application')
app = QApplication(sys.argv)
mainWindow = MainWindow()
mainWindow.show()
sys.exit(app.exec_())
示例5: main
# 需要导入模块: from main_window import MainWindow [as 别名]
# 或者: from main_window.MainWindow import show [as 别名]
def main():
#Setup QtApp
app = QtGui.QApplication(sys.argv[0])
ui_mainwindow = Ui_MainWindow()
main_window = MainWindow(app, ui_mainwindow, viz_config)
main_window.show()
sys.exit(app.exec_())
示例6: main
# 需要导入模块: from main_window import MainWindow [as 别名]
# 或者: from main_window.MainWindow import show [as 别名]
def main():
app = QApplication([])
vkRequestProcessor = VkRequestProcessor()
model = Model(vkRequestProcessor)
main = MainWindow(model)
main.show()
app.exec_()
示例7: __init__
# 需要导入模块: from main_window import MainWindow [as 别名]
# 或者: from main_window.MainWindow import show [as 别名]
class KvitterApp:
def __init__(self):
self.username_str = "username"
self.password_str = "password"
self.api = twitter.Api(username=self.username_str, password=self.password_str, input_encoding=None)
self.main_window = MainWindow()
def run(self):
self.main_window.show(self.api, self.username_str)
pass
示例8: main
# 需要导入模块: from main_window import MainWindow [as 别名]
# 或者: from main_window.MainWindow import show [as 别名]
def main():
app, client = create_nucentral_application(
name="example",
resource="example.rcc",
locale=":/locale/example",
)
from main_window import MainWindow
window = MainWindow(client)
window.show()
return app.exec_()
示例9: main
# 需要导入模块: from main_window import MainWindow [as 别名]
# 或者: from main_window.MainWindow import show [as 别名]
def main(argv):
# Create a Qt application
app = QApplication(argv)
app.setStyle('macintosh')
window = MainWindow()
window.show()
# Enter Qt application main loop
app.exec_()
sys.exit()
示例10: main
# 需要导入模块: from main_window import MainWindow [as 别名]
# 或者: from main_window.MainWindow import show [as 别名]
def main(argv):
# load plugins
if os.path.exists(PLUGIN_FILE):
imp.load_source('hmtk.plugin', PLUGIN_FILE)
# create Qt application
# Claim to be QGIS2 so that used plugins that tries to access
# QSettings will get the QGIS2 settings
QtGui.QApplication.setApplicationName('QGIS2')
QtGui.QApplication.setOrganizationDomain('qgis.org')
if QtCore.QSettings().value('locale/userLocale') is None:
QtGui.QApplication.setOrganizationDomain('QGIS')
app = QtGui.QApplication(argv, True)
# setup QGIS
QgsApplication.setPrefixPath(os.environ['QGIS_PREFIX_PATH'], True)
QgsApplication.initQgis()
# Install a custom exception hook that prints exception into a
# MessageBox
sys.excepthook = excepthook
# create main window
wnd = MainWindow() # classname
wnd.show()
if sys.platform == "darwin":
wnd.raise_()
if len(argv) > 1:
wnd.change_model(CatalogueModel.from_csv_file(argv[1]))
if len(argv) > 2:
wnd.load_fault_source(argv[2])
else:
wnd.load_catalogue()
# Connect signal for app finish
def on_quit():
QgsApplication.exitQgis()
app.quit()
app.lastWindowClosed.connect(on_quit)
# Start the app up
ret = app.exec_()
sys.exit(ret)
示例11: main
# 需要导入模块: from main_window import MainWindow [as 别名]
# 或者: from main_window.MainWindow import show [as 别名]
def main():
app = QtGui.QApplication(sys.argv)
main = MainWindow(Model())
main.show()
sys.exit(app.exec_())
示例12: QApplication
# 需要导入模块: from main_window import MainWindow [as 别名]
# 或者: from main_window.MainWindow import show [as 别名]
# coding: utf8
import sys
import matplotlib
matplotlib.use("Qt5Agg", force=True)
from PyQt5.QtWidgets import QApplication
from main_window import MainWindow
import matplotlib.pyplot as plt
app = QApplication(sys.argv)
app.setApplicationName('CSM_3')
# -----------------------------------------------------#
form = MainWindow()
form.setWindowTitle('Лабораторная работа №3')
form.show()
# -----------------------------------------------------#
sys.exit(app.exec_())
示例13: main
# 需要导入模块: from main_window import MainWindow [as 别名]
# 或者: from main_window.MainWindow import show [as 别名]
def main():
app = QtGui.QApplication(sys.argv)
widget = MainWindow()
widget.show()
widget.raise_()
sys.exit(app.exec_())
示例14: about_to_quit
# 需要导入模块: from main_window import MainWindow [as 别名]
# 或者: from main_window.MainWindow import show [as 别名]
def about_to_quit():
main.model.dump()
#main.engine_controller.stop_engine()
#main.engine_controller.thread.exit()
# set app icon
app_icon = QIcon()
app_icon.addFile('res/icons_taskbar/icon16.png', QSize(16,16))
app_icon.addFile('res/icons_taskbar/icon24.png', QSize(24,24))
app_icon.addFile('res/icons_taskbar/icon32.png', QSize(32,32))
app_icon.addFile('res/icons/taskbar/icon48.png', QSize(48,48))
app_icon.addFile('res/icons_taskbar/icon256.png',QSize(256,256))
app.setWindowIcon(app_icon)
app.setActiveWindow(main)
app.aboutToQuit.connect(about_to_quit) # myExitHandler is a callable
#main.setFocus()
# raise is only needed on osx due to
# a pyqt bug
# TODO: check os platform before calling
main.raise_()
main.show()
#splash.finish(main)
sys.exit(app.exec_())
示例15: Application
# 需要导入模块: from main_window import MainWindow [as 别名]
# 或者: from main_window.MainWindow import show [as 别名]
import sys
sys.path.append('src/')
sys.path.append('src/icons/')
sys.path.append('src/libs')
sys.path.append('src/models')
sys.path.append('src/widgets')
from main_window import MainWindow
from skfc import *
# --- класс приложения (Application)
# --- здесь будем хранить глобальные переменые данные
class Application(QApplication):
def __init__(self, args):
QApplication.__init__(self, args)
self.default_item_view_state = False
self.current_skf = Skfc.DEFAULT_SKF
# ---Точка входа в программу
if __name__ == "__main__":
codec = QTextCodec.codecForName("UTF8")
QTextCodec.setCodecForTr(codec)
QTextCodec.setCodecForCStrings(codec)
QTextCodec.setCodecForLocale(codec)
app = Application(sys.argv)
QtGui.qApp = app
widget = MainWindow()
widget.show()
app.exec_()