当前位置: 首页>>代码示例>>Python>>正文


Python QtCore.QCoreApplication方法代码示例

本文整理汇总了Python中PyQt4.QtCore.QCoreApplication方法的典型用法代码示例。如果您正苦于以下问题:Python QtCore.QCoreApplication方法的具体用法?Python QtCore.QCoreApplication怎么用?Python QtCore.QCoreApplication使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt4.QtCore的用法示例。


在下文中一共展示了QtCore.QCoreApplication方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _pyside2

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import QCoreApplication [as 别名]
def _pyside2():
    import PySide2
    from PySide2 import QtGui, QtWidgets, QtCore, QtUiTools

    _remap(QtCore, "QStringListModel", QtGui.QStringListModel)

    _add(PySide2, "__binding__", PySide2.__name__)
    _add(PySide2, "load_ui", lambda fname: QtUiTools.QUiLoader().load(fname))
    _add(PySide2, "translate", lambda context, sourceText, disambiguation, n: (
        QtCore.QCoreApplication(context, sourceText,
                                disambiguation, None, n)))
    _add(PySide2,
         "setSectionResizeMode",
         QtWidgets.QHeaderView.setSectionResizeMode)

    _maintain_backwards_compatibility(PySide2)

    return PySide2 
开发者ID:liorbenhorin,项目名称:pipeline,代码行数:20,代码来源:Qt.py

示例2: zipdb

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import QCoreApplication [as 别名]
def zipdb(self):
        filename_tuple = widgets.QFileDialog.getSaveFileName(self, _("Save database (keep '.zip' extension)"),
                                                   "./ecu.zip", "*.zip")
        if qt5:
            filename = str(filename_tuple[0])
        else:
            filename = str(filename_tuple)
        
        if not filename.endswith(".zip"):
            filename += ".zip"

        if not isWritable(str(os.path.dirname(filename))):
            mbox = widgets.QMessageBox()
            mbox.setText("Cannot write to directory " + os.path.dirname(filename))
            mbox.exec_()
            return

        self.logview.append(_("Zipping XML database... (this can take a few minutes"))
        core.QCoreApplication.processEvents()
        parameters.zipConvertXML(filename)
        self.logview.append(_("Zip job finished")) 
开发者ID:cedricp,项目名称:ddt4all,代码行数:23,代码来源:ddt4all.py

示例3: test

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import QCoreApplication [as 别名]
def test():
    """测试函数"""
    from datetime import datetime
    try:
        from PyQt5.QtCore import QCoreApplication
    except ImportError:
        from PyQt4.QtCore import QCoreApplication
    
    def simpletest(event):
        print(u'处理每秒触发的计时器事件:%s' % str(datetime.now()))
    
    app = QCoreApplication('VnTrader')
    
    ee = EventEngine2()
    ee.register(EVENT_TIMER, simpletest)
    ee.start()
    
    app.exec_()


# 直接运行脚本可以进行测试 
开发者ID:quantOS-org,项目名称:TradeSim,代码行数:23,代码来源:eventEngine.py

示例4: _pyqt5

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import QCoreApplication [as 别名]
def _pyqt5():
    import PyQt5.Qt
    from PyQt5 import QtCore, QtWidgets, uic

    _remap(QtCore, "Signal", QtCore.pyqtSignal)
    _remap(QtCore, "Slot", QtCore.pyqtSlot)
    _remap(QtCore, "Property", QtCore.pyqtProperty)

    _add(PyQt5, "__binding__", PyQt5.__name__)
    _add(PyQt5, "load_ui", lambda fname: uic.loadUi(fname))
    _add(PyQt5, "translate", lambda context, sourceText, disambiguation, n: (
        QtCore.QCoreApplication(context, sourceText,
                                disambiguation, n)))
    _add(PyQt5,
         "setSectionResizeMode",
         QtWidgets.QHeaderView.setSectionResizeMode)

    _maintain_backwards_compatibility(PyQt5)

    return PyQt5 
开发者ID:chrisevans3d,项目名称:uExport,代码行数:22,代码来源:Qt.py

示例5: test

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import QCoreApplication [as 别名]
def test():
    """测试函数"""
    import sys
    from datetime import datetime
    from PyQt4.QtCore import QCoreApplication
    
    def simpletest(event):
        print u'处理每秒触发的计时器事件:%s' % str(datetime.now())
    
    app = QCoreApplication(sys.argv)
    
    ee = EventEngine()
    ee.register(EVENT_TIMER, simpletest)
    ee.start()
    
    app.exec_()
    
    
# 直接运行脚本可以进行测试 
开发者ID:sunshinelover,项目名称:chanlun,代码行数:21,代码来源:eventEngine.py

示例6: test

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import QCoreApplication [as 别名]
def test():
    """测试"""
    from PyQt4 import QtCore
    import sys
    
    def print_log(event):
        log = event.dict_['data']
        print ':'.join([log.logTime, log.logContent])
    
    app = QtCore.QCoreApplication(sys.argv)    

    eventEngine = EventEngine()
    eventEngine.register(EVENT_LOG, print_log)
    eventEngine.start()
    
    gateway = CtpGateway(eventEngine)
    gateway.connect()
    
    sys.exit(app.exec_()) 
开发者ID:sunshinelover,项目名称:chanlun,代码行数:21,代码来源:ctpGateway.py

示例7: test

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import QCoreApplication [as 别名]
def test():
    """测试函数"""
    import sys
    from datetime import datetime
    from PyQt4.QtCore import QCoreApplication
    
    def simpletest(event):
        print u'处理每秒触发的计时器事件:%s' % str(datetime.now())
    
    app = QCoreApplication(sys.argv)
    
    ee = EventEngine2()
    ee.register(EVENT_TIMER, simpletest)
    ee.start()
    
    app.exec_()
    
    
# 直接运行脚本可以进行测试 
开发者ID:sunshinelover,项目名称:chanlun,代码行数:21,代码来源:eventEngine.py

示例8: test

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import QCoreApplication [as 别名]
def test():
    """测试"""
    from PyQt4 import QtCore
    import sys
    
    def print_log(event):
        log = event.dict_['data']
        print ':'.join([log.logTime, log.logContent])
    
    app = QtCore.QCoreApplication(sys.argv)    

    eventEngine = EventEngine()
    eventEngine.register(EVENT_LOG, print_log)
    eventEngine.start()
    
    gateway = FemasGateway(eventEngine)
    gateway.connect()
    
    sys.exit(app.exec_())

#---------------------------------------------------------------------- 
开发者ID:sunshinelover,项目名称:chanlun,代码行数:23,代码来源:femasGateway.py

示例9: test

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import QCoreApplication [as 别名]
def test():
    """测试函数"""
    import sys
    from datetime import datetime
    from PyQt4.QtCore import QCoreApplication
    
    def simpletest(event):
        print u'处理每秒触发的计时器事件:%s' % str(datetime.now())
    
    app = QCoreApplication(sys.argv)
    
    ee = EventEngine2()
    #ee.register(EVENT_TIMER, simpletest)
    ee.registerGeneralHandler(simpletest)
    ee.start()
    
    app.exec_()
    
    
# 直接运行脚本可以进行测试 
开发者ID:zhengwsh,项目名称:InplusTrader_Linux,代码行数:22,代码来源:eventEngine.py

示例10: _pyside2

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import QCoreApplication [as 别名]
def _pyside2():
    import PySide2
    from PySide2 import QtGui, QtWidgets, QtCore, QtUiTools

    _remap(QtCore, "QStringListModel", QtGui.QStringListModel)

    _add(PySide2, "__binding__", PySide2.__name__)
    _add(PySide2, "load_ui", _pyside_loadui)
    _add(PySide2, "translate", lambda context, sourceText, disambiguation, n: (
        QtCore.QCoreApplication(context, sourceText,
                                disambiguation, None, n)))
    _add(PySide2,
         "setSectionResizeMode",
         QtWidgets.QHeaderView.setSectionResizeMode)

    _maintain_backwards_compatibility(PySide2)

    return PySide2 
开发者ID:cineuse,项目名称:CNCGToolKit,代码行数:20,代码来源:Qt.py

示例11: _pyside

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import QCoreApplication [as 别名]
def _pyside():
    import PySide
    from PySide import QtGui, QtCore, QtUiTools

    _remap(PySide, "QtWidgets", QtGui)
    _remap(QtCore, "QSortFilterProxyModel", QtGui.QSortFilterProxyModel)
    _remap(QtCore, "QStringListModel", QtGui.QStringListModel)
    _remap(QtCore, "QItemSelection", QtGui.QItemSelection)
    _remap(QtCore, "QItemSelectionModel", QtGui.QItemSelectionModel)
    _remap(QtCore, "QAbstractProxyModel", QtGui.QAbstractProxyModel)

    try:
        from PySide import QtWebKit
        _remap(PySide, "QtWebKitWidgets", QtWebKit)
    except ImportError:
        # QtWebkit is optional in Qt, therefore might not be available
        pass

    _add(PySide, "__binding__", PySide.__name__)
    _add(PySide, "load_ui", lambda fname: QtUiTools.QUiLoader().load(fname))
    _add(PySide, "translate", lambda context, sourceText, disambiguation, n: (
        QtCore.QCoreApplication(context, sourceText,
                                disambiguation, None, n)))
    _add(PySide, "setSectionResizeMode", QtGui.QHeaderView.setResizeMode)

    _maintain_backwards_compatibility(PySide)

    return PySide 
开发者ID:liorbenhorin,项目名称:pipeline,代码行数:30,代码来源:Qt.py

示例12: run

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import QCoreApplication [as 别名]
def run(self):
        count = 0
        app = QtCore.QCoreApplication.instance()
        while count < 5:
            print("Increasing")  # break here
            count += 1
        app.quit() 
开发者ID:fabioz,项目名称:PyDev.Debugger,代码行数:9,代码来源:_debugger_case_qthread3.py

示例13: check_elm

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import QCoreApplication [as 别名]
def check_elm(self):
        currentitem = self.listview.currentItem()
        self.logview.show()
        if self.wifibutton.isChecked():
            port = str(self.wifiinput.text())
        else:
            if not currentitem:
                self.logview.hide()
                return
            portinfo = utf8(currentitem.text())
            port = self.ports[portinfo][0]
        speed = int(self.speedcombo.currentText())
        res = elm.elm_checker(port, speed, self.logview, core.QCoreApplication)
        if not res:
            self.logview.append(options.get_last_error()) 
开发者ID:cedricp,项目名称:ddt4all,代码行数:17,代码来源:ddt4all.py

示例14: main

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import QCoreApplication [as 别名]
def main():
    """运行在CMD中的演示程度"""
    # 创建PyQt4应用对象
    app = QtCore.QCoreApplication(sys.argv)
    
    # 创建主引擎对象
    me = MainEngine()
    
    # 注册事件监听
    me.ee.register(EVENT_LOG, print_log)
    
    # 登录
    userid = ''
    password = ''
    brokerid = ''
    mdAddress = ''
    tdAddress = ''
    
    me.login(userid, password, brokerid, mdAddress, tdAddress)
    
    # 等待10秒钟(初始化合约数据等)
    sleep(5)
    
    # 创建策略引擎对象
    se = StrategyEngine(me.ee, me)
    
    # 创建策略对象
    setting = {}
    setting['fastAlpha'] = 0.2
    setting['slowAlpha'] = 0.05
    se.createStrategy(u'EMA演示策略', 'IF1506', SimpleEmaStrategy, setting)
    
    # 启动所有策略
    se.startAll()
    
    # 让程序连续运行
    sys.exit(app.exec_()) 
开发者ID:sunshinelover,项目名称:chanlun,代码行数:39,代码来源:demoStrategy.py

示例15: _pyside

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import QCoreApplication [as 别名]
def _pyside():
    import PySide
    from PySide import QtGui, QtCore, QtUiTools

    _remap(PySide, "QtWidgets", QtGui)
    _remap(QtCore, "QSortFilterProxyModel", QtGui.QSortFilterProxyModel)
    _remap(QtCore, "QStringListModel", QtGui.QStringListModel)
    _remap(QtCore, "QItemSelection", QtGui.QItemSelection)
    _remap(QtCore, "QItemSelectionModel", QtGui.QItemSelectionModel)
    _remap(QtCore, "QAbstractProxyModel", QtGui.QAbstractProxyModel)

    try:
        from PySide import QtWebKit
        _remap(PySide, "QtWebKitWidgets", QtWebKit)
    except ImportError:
        # QtWebkit is optional in Qt, therefore might not be available
        pass

    _add(PySide, "__binding__", PySide.__name__)
    _add(PySide, "load_ui", _pyside_loadui)
    _add(PySide, "translate", lambda context, sourceText, disambiguation, n: (
        QtCore.QCoreApplication(context, sourceText,
                                disambiguation, None, n)))
    _add(PySide, "setSectionResizeMode", QtGui.QHeaderView.setResizeMode)

    _maintain_backwards_compatibility(PySide)

    return PySide 
开发者ID:cineuse,项目名称:CNCGToolKit,代码行数:30,代码来源:Qt.py


注:本文中的PyQt4.QtCore.QCoreApplication方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。