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


Python main_window.MainWindow類代碼示例

本文整理匯總了Python中main_window.MainWindow的典型用法代碼示例。如果您正苦於以下問題:Python MainWindow類的具體用法?Python MainWindow怎麽用?Python MainWindow使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了MainWindow類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: main

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,代碼行數:27,代碼來源:main.py

示例2: CDATGUIApp

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,代碼行數:27,代碼來源:application.py

示例3: main

def main():
    """This starts up the oricreate application.
    """
    global oricreate

    # Make sure '.' is in sys.path
    if '' not in sys.path:
        sys.path.insert(0, '')
    # Start the app.
    from traits.etsconfig.api import ETSConfig
    # Check that we have a traits backend installed
    from traitsui.toolkit import toolkit
    toolkit()  # This forces the selection of a toolkit.
    if ETSConfig.toolkit in ('null', ''):
        raise ImportError('''Could not import backend for traits
________________________________________________________________________________
Make sure that you have either the TraitsBackendWx or the TraitsBackendQt
projects installed. If you installed Oricreate with easy_install, try easy_install
<pkg_name>. easy_install Oricreate[app] will also work.
If you performed a source checkout, be sure to run 'python setup.py install'
in Traits, TraitsGUI, and the Traits backend of your choice.
Also make sure that either wxPython or PyQT is installed.
wxPython: http://www.wxpython.org/
PyQT: http://www.riverbankcomputing.co.uk/software/pyqt/intro
'''
                          )
    from main_window import MainWindow
    oricreate = MainWindow()

    oricreate.configure_traits()
開發者ID:,項目名稱:,代碼行數:30,代碼來源:

示例4: main

def main():
    app = QApplication([])

    model = Model()
    main = MainWindow(model)
    main.show()

    app.exec_()
開發者ID:Foton512,項目名稱:vk_auth,代碼行數:8,代碼來源:vk_auth.py

示例5: main

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,代碼行數:8,代碼來源:couchman.py

示例6: main

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,代碼行數:9,代碼來源:run_moos.py

示例7: main

def main():
    app = QApplication([])

    vkRequestProcessor = VkRequestProcessor()
    model = Model(vkRequestProcessor)
    main = MainWindow(model)
    main.show()

    app.exec_()
開發者ID:Foton512,項目名稱:vk_music_sampler,代碼行數:9,代碼來源:vk_music_sampler.py

示例8: __init__

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,代碼行數:11,代碼來源:app.py

示例9: main

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,代碼行數:11,代碼來源:example.py

示例10: main

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,代碼行數:11,代碼來源:main.py

示例11: __init__

    def __init__(self):
        QWidget.__init__(self)
        IDEGeneric.__init__(self)
        self.setWindowTitle('NINJA-IDE {Ninja Is Not Just Another IDE}')
        self.setWindowIcon(QIcon(resources.images['icon']))
        self.setWindowState(Qt.WindowMaximized)
        self.setMinimumSize(700, 500)

        #Opactity
        self.opacity = 1

        #ToolBar
        self._toolbar = QToolBar()
        self._toolbar.setToolTip('Press and Drag to Move')
        styles.set_style(self._toolbar, 'toolbar-default')
        self.addToolBar(Qt.LeftToolBarArea, self._toolbar)
        self._toolbar.setToolButtonStyle(Qt.ToolButtonIconOnly)

        #StatusBar
        self._status = StatusBar()
        self._status.hide()
        self.setStatusBar(self._status)

        #Main Widgets
        self.main = MainWindow(self)
        self.setCentralWidget(self.main)

        #Menu
        menubar = self.menuBar()
        styles.apply(menubar, 'menu')
        file_ = menubar.addMenu('&File')
        edit = menubar.addMenu('&Edit')
        view = menubar.addMenu('&View')
        project = menubar.addMenu('&Project')
        self.pluginsMenu = menubar.addMenu('P&lugins')
        about = menubar.addMenu('&About')

        #The order of the icons in the toolbar is defined by this calls
        self._menuFile = MenuFile(file_, self._toolbar, self.main)
        self._menuView = MenuView(view, self, self.main)
        self._menuEdit = MenuEdit(edit, self._toolbar, self.main, self._status)
        self._menuProject = MenuProject(project, self._toolbar, self.main)
        self._menuPlugins = MenuPlugins(self.pluginsMenu, self)
        self._menuAbout = MenuAbout(about, self.main)

        self.main.container.load_toolbar(self._toolbar)
        self.main._central.actual_tab().obtain_editor().setFocus()

        filenames, projects_path = core.cliparser.parse()

        for filename in filenames:
            self.main.open_document(filename)

        for project_path in projects_path:
            self.main.open_project_folder(project_path)

        self.connect(self.main, SIGNAL("fileSaved(QString)"), self.show_status_message)
開發者ID:calpe20,項目名稱:PYTHONIZANDO,代碼行數:57,代碼來源:ide.py

示例12: __init__

    def __init__(self):

        # build UI from glade file
        builder = Gtk.Builder()
        #builder.add_from_file(to_abs_path(PoResources.UI_TRAY))
        builder.add_from_file(to_abs_path(PoResources.UI_TRAY))
        builder.connect_signals(self)

        style.setStyle()

        # get some common used object
        self.builder = builder
        self.menu = builder.get_object('tray_menu')
        self.lb_clock = builder.get_object('mni_clock')
        self.lb_counter = builder.get_object('mni_archive_count')

        APPIND_SUPPORT = 1
        try:
            from gi.repository import AppIndicator3
        except:
            APPIND_SUPPORT = 0

        if APPIND_SUPPORT == 1:
            self.ind = AppIndicator3.Indicator.new_with_path("domor-indicator", 'app_icon_64',
                                                             AppIndicator3.IndicatorCategory.APPLICATION_STATUS,
                                                             to_abs_path('img'))
            self.ind.set_status(AppIndicator3.IndicatorStatus.ACTIVE)
            self.ind.set_menu(self.menu)
        else:
            self.myStatusIcon = Gtk.StatusIcon()
            self.myStatusIcon.set_from_file(
                to_abs_path(PoResources.ICON_APP_64))
            self.myStatusIcon.connect(
                'popup-menu', self.right_click_event_statusicon)

        # 6 load config
        self.settings = settings = Settings()
        settings.load_config()

        # 7 init class state
        self.btn_state = State.STOP
        self.state = State.IDLE
        self.time = settings.short_work_time
        self.work_time = 0
        self.count = 0

        # create main screen
        self.main_window = MainWindow(self.on_mni_start_activate)
        self.main_window.update(self.state, self.btn_state)

        # create rest screen
        self.break_screen = BreakScreen(self.on_skip_break)

        self.reset()

        # register timer callback
        GObject.timeout_add_seconds(1, self.count_down)
開發者ID:bluzky,項目名稱:domor-gtk,代碼行數:57,代碼來源:domor_indicator.py

示例13: main

def main():
    app = QtGui.QApplication(sys.argv)
    
#    deliver_widget = DeliverWindow()
#    sale_widget = SaleWindow()
    
    mw = MainWindow()
#    mw.windows.append(deliver_widget)
#    mw.windows.append(sale_widget)
    
    mapper = QSignalMapper()
    

    QObject.connect(mw.ui.deliver_action, SIGNAL("activated()"), mapper,SLOT("map()"))
    QObject.connect(mw.ui.sale_action, SIGNAL("activated()"), mapper,SLOT("map()"))
    QObject.connect(mw.ui.all_drugs_action, SIGNAL("activated()"), mapper,SLOT("map()"))
    QObject.connect(mw.ui.all_delivers_action, SIGNAL("activated()"), mapper,SLOT("map()"))
    QObject.connect(mw.ui.all_sales_action, SIGNAL("activated()"), mapper,SLOT("map()"))
    QObject.connect(mw.ui.all_patients_action, SIGNAL("activated()"), mapper,SLOT("map()"))
    QObject.connect(mw.ui.all_distributors_action, SIGNAL("activated()"), mapper,SLOT("map()"))
    QObject.connect(mw.ui.all_medorg_action, SIGNAL("activated()"), mapper,SLOT("map()"))
    QObject.connect(mw.ui.all_doctors_action, SIGNAL("activated()"), mapper,SLOT("map()"))
    QObject.connect(mw.ui.all_manufacters_action, SIGNAL("activated()"), mapper,SLOT("map()"))
    QObject.connect(mw.ui.all_ills_action, SIGNAL("activated()"), mapper,SLOT("map()"))
    QObject.connect(mw.ui.all_recipes_action, SIGNAL("activated()"), mapper,SLOT("map()"))
 
    mapper.setMapping(mw.ui.deliver_action, 0)
    mapper.setMapping(mw.ui.sale_action, 1)
    mapper.setMapping(mw.ui.all_drugs_action, 2)
    mapper.setMapping(mw.ui.all_delivers_action, 3)
    mapper.setMapping(mw.ui.all_sales_action, 4)
    mapper.setMapping(mw.ui.all_patients_action, 5)
    mapper.setMapping(mw.ui.all_distributors_action, 6)
    mapper.setMapping(mw.ui.all_medorg_action, 7)
    mapper.setMapping(mw.ui.all_doctors_action, 8)
    mapper.setMapping(mw.ui.all_manufacters_action, 9)
    mapper.setMapping(mw.ui.all_ills_action, 10)
    mapper.setMapping(mw.ui.all_recipes_action, 11)
 
    QObject.connect(mapper,SIGNAL("mapped(int)"), mw,SLOT("show_child_window(int)"))
    mw.showMaximized()
    os.popen('soffice -invisible "-accept=socket,host=localhost,port=2002;urp;"')
    sys.exit(app.exec_())
開發者ID:thefrolov,項目名稱:open-drug-store,代碼行數:43,代碼來源:main.py

示例14: __init__

 def __init__( self ):
     self.window = MainWindow( self )
     
     path_input = os.path.dirname(__file__) + "\\relatorios_rpt"
     path_output = os.path.dirname(__file__) + "\\saida_excel"
     
     if os.path.isdir(path_input):
         self.window.set_input_folder(path_input)
         
     if os.path.isdir(path_output):
         self.window.set_output_folder(path_output)
開發者ID:gstiebler,項目名稱:ptw_report_processor,代碼行數:11,代碼來源:main_presenter.py

示例15: __init__

    def __init__(self):
        QtCore.QCoreApplication.setApplicationName("PSSOptimisation")
        QtCore.QCoreApplication.setApplicationVersion(str(VERSION))
        QtCore.QCoreApplication.setOrganizationName("Hubert Grzeskowiak")

        self.settings = QtCore.QSettings()
        self.main_window = MainWindow(True)
        self.grades_model = GradesModel(self.main_window)
        self.proxy_model = GradesModelProxy()
        self.proxy_model.setSourceModel(self.grades_model)

        self.initUI()
開發者ID:amrni,項目名稱:PSSOptimisation2,代碼行數:12,代碼來源:main.py


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