当前位置: 首页>>代码示例>>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;未经允许,请勿转载。