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


Python QtCore.QThread方法代码示例

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


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

示例1: __init__

# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.QtCore import QThread [as 别名]
def __init__(self):
        QtCore.QObject.__init__(self)
        self.WorkerThread = WorkerThread(self)
        self.t = QtCore.QThread(self, objectName='workerThread')
        self.WorkerThread.moveToThread(self.t)
        self.t.start()
        self.PassedHere = False
        self.currency = None
        self.soldcount = 0
        self.start = 0
        self.logging = 0

        self.WorkerThread.progresscount = 0
        self.WorkerThread.SetStatus.connect(lambda x: self.StatusLabel.setText(x))
        self.WorkerThread.progressSignal.connect(lambda x: self.progressBar_2.setProperty("value", x))
        self.WorkerThread.StartEn.connect(lambda x: self.StartButton.setEnabled(x))
        self.WorkerThread.StartDis.connect(lambda x: self.StartButton.setDisabled(x))
        self.WorkerThread.PauseEn.connect(lambda x: self.PauseButton.setEnabled(x))
        self.WorkerThread.PauseDis.connect(lambda x: self.PauseButton.setDisabled(x))
        self.WorkerThread.RetrieveEn.connect(lambda x: self.RetrieveButton.setEnabled(x))
        self.WorkerThread.RetrieveDis.connect(lambda x: self.RetrieveButton.setDisabled(x))
        self.WorkerThread.TableSorting.connect(lambda x: self.tableWidget.setSortingEnabled(x))
        self.WorkerThread.NewRow.connect(lambda x: self.tableWidget.insertRow(x))
        self.WorkerThread.SetTableItem.connect(self.SetTable)

        self.WorkerThread.ShowError.connect(self.showError)
        self.WorkerThread.ShowInfo.connect(self.showInfo)
        self.WorkerThread.SetCurrHeader.connect(self.setCurrHeader)

        self.WorkerThread.display_error.connect(lambda x: self.display_error(x))
        self.WorkerThread.log_event.connect(lambda x: self.logEvent(x))
        self.WorkerThread.MainLogin.connect(self.login)

        self.init_login.emit(True) 
开发者ID:adamb70,项目名称:CSGO-Market-Float-Finder,代码行数:36,代码来源:ui.py

示例2: run

# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.QtCore import QThread [as 别名]
def run(self):
        QtCore.QThread.sleep(4)
        print('Done sleeping') 
开发者ID:fabioz,项目名称:PyDev.Debugger,代码行数:5,代码来源:_debugger_case_qthread4.py

示例3: __init__

# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.QtCore import QThread [as 别名]
def __init__(self, session, parent=None):
        QtCore.QThread.__init__(self, parent)
        self.session = session

        self.file_path = None
        self.incoming_file = () 
开发者ID:DroidTest,项目名称:TimeMachine,代码行数:8,代码来源:fileloading.py

示例4: load

# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.QtCore import QThread [as 别名]
def load(self, file_path):
        self.file_path = file_path
        if file_path.endswith(".ag"):
            self.incoming_file = (file_path, 'SESSION')
        else:
            file_type = androconf.is_android(file_path)
            self.incoming_file = (file_path, file_type)
        self.start(QtCore.QThread.LowestPriority) 
开发者ID:DroidTest,项目名称:TimeMachine,代码行数:10,代码来源:fileloading.py

示例5: __init__

# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.QtCore import QThread [as 别名]
def __init__(self, receivePipe, tableModel, rawData, useTimestamp=True):
        # Call the superclass constructor
        QtCore.QThread.__init__(self)
        # Attributes to manage the sniffer process
        self.receivePipe = receivePipe
        self.tableModel = tableModel
        self.useTimestamp = useTimestamp
        self.rawData = rawData
        self.enabled = True 
开发者ID:schutzwerk,项目名称:CANalyzat0r,代码行数:11,代码来源:ItemAdderThread.py

示例6: __init__

# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.QtCore import QThread [as 别名]
def __init__(self, packets, sleepTime, CANData, threadName):
        QtCore.QThread.__init__(self)
        self.packets = packets
        self.sleepTime = sleepTime
        self.CANData = CANData
        self.threadName = threadName
        self.enabled = True

        self.logger = Logger(Strings.senderThreadLoggerName + " (" +
                             self.threadName + ")").getLogger() 
开发者ID:schutzwerk,项目名称:CANalyzat0r,代码行数:12,代码来源:SenderThread.py

示例7: __init__

# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.QtCore import QThread [as 别名]
def __init__(self, snifferReceivePipe, sharedEnabledFlag, curSampleIndex):
        # Call the superclass constructor
        QtCore.QThread.__init__(self)
        self.curSampleIndex = curSampleIndex
        # Attributes to manage the sniffer process
        self.sharedEnabledFlag = sharedEnabledFlag
        self.snifferReceivePipe = snifferReceivePipe 
开发者ID:schutzwerk,项目名称:CANalyzat0r,代码行数:9,代码来源:FilterTab.py

示例8: _simulate

# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.QtCore import QThread [as 别名]
def _simulate(self):
        ''' Starts the simulation of the current model with the current settings in the GUI '''
        self.models[self.currentNumberedModelName].integrationStatistics.finished = False
        self.run.setEnabled(False)
        self.closebutton.setEnabled(False)
        # Delete pluginData because new simulation will start
        self.models[self.currentNumberedModelName].pluginData.clear()
        self._setSettingsFromIntegratorControlGUI(self.currentNumberedModelName)
        # Close the corresponding result file to have write access
        self.models[self.currentNumberedModelName].integrationResults.close()
        try:
            os.remove(self.models[self.currentNumberedModelName].integrationResults.fileName)
        except:
            pass

        self.models[self.currentNumberedModelName].integrationResultFileSemaphore = threading.Semaphore()
        if hasattr(self.models[self.currentNumberedModelName], 'integrationResults'):
            self.models[self.currentNumberedModelName].integrationResults.fileName = ''

        # Define some variables before simulation can start
        self.models[self.currentNumberedModelName].integrationStatistics.cpuTime = None
        self.models[self.currentNumberedModelName].integrationStatistics.nTimeEvents = 0
        self.models[self.currentNumberedModelName].integrationStatistics.nStateEvents = 0
        self.models[self.currentNumberedModelName].integrationStatistics.nGridPoints = 0
        self.models[self.currentNumberedModelName].integrationStatistics.reachedTime = self.models[self.currentNumberedModelName].integrationSettings.startTime

        # Define Timers for result updates and simulation info updates
        self.updateData = QtCore.QTimer()
        self.updateData.timeout.connect(self.triggerdResultUpdate)

        self.updateSimulationInfo = QtCore.QTimer()
        self.updateSimulationInfo.timeout.connect(self.showSimulationInfo)

        # Define a new thread for the simulation task
        self._simThread = simulationThread(self)

        self._simThread.model = self.models[self.currentNumberedModelName]
        self._simThread.model.simulationStopRequest = False

        self.lastCurrentTime = self._simThread.model.integrationStatistics.reachedTime
        self.showSimulationInfo()

        # Start the timers and the simulation thread
        self._simThread.SimulationFinished = self.SimulationFinished
        self.updateData.start(1000)
        self.updateSimulationInfo.start(500)
        self._cpuStartTime = time.clock()
        self.stop.setEnabled(True)
        self._simThread.start(QtCore.QThread.LowPriority) 
开发者ID:PySimulator,项目名称:PySimulator,代码行数:51,代码来源:IntegratorControl.py


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