當前位置: 首頁>>代碼示例>>Python>>正文


Python MainWindow.show方法代碼示例

本文整理匯總了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_())
開發者ID:rutsky,項目名稱:semester10,代碼行數:29,代碼來源:main.py

示例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()
開發者ID:sampsonbryce,項目名稱:cdatgui,代碼行數:29,代碼來源:application.py

示例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_()
開發者ID:Foton512,項目名稱:vk_auth,代碼行數:10,代碼來源:vk_auth.py

示例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_())
開發者ID:kolyanu4,項目名稱:couchman,代碼行數:10,代碼來源:couchman.py

示例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_())
開發者ID:ozymandium,項目名稱:survey_gui,代碼行數:11,代碼來源:run_moos.py

示例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_()
開發者ID:Foton512,項目名稱:vk_music_sampler,代碼行數:11,代碼來源:vk_music_sampler.py

示例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
開發者ID:johannilsson,項目名稱:Kvitter,代碼行數:13,代碼來源:app.py

示例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_()
開發者ID:maximerobin,項目名稱:Ufwi,代碼行數:13,代碼來源:example.py

示例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()
開發者ID:cas4ey,項目名稱:graph_test,代碼行數:13,代碼來源:main.py

示例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)
開發者ID:gem,項目名稱:qt-experiments,代碼行數:54,代碼來源:main.py

示例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_())
開發者ID:Foton512,項目名稱:lastfm_search,代碼行數:7,代碼來源:lastfm_search.py

示例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_())
開發者ID:Megalitum,項目名稱:CSM_3,代碼行數:21,代碼來源:main.py

示例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_())
開發者ID:matthew-d-jones,項目名稱:mantid-algorithm-use,代碼行數:8,代碼來源:algorithm_stats_viewer.py

示例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_())
開發者ID:jasiegel4,項目名稱:jerry,代碼行數:32,代碼來源:jerry.py

示例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_()
開發者ID:nmix,項目名稱:sgo,代碼行數:33,代碼來源:main.py


注:本文中的main_window.MainWindow.show方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。