예제 #1
0
class Pool(object):
    def __init__(self):
        self.thread = QThread()
        self.thread.start()
        self.local = QObject()
        self.remote = QObject()
        self.remote.moveToThread(self.thread)

    def start(self, job):
        job.setParent(self.local)
        job = Job(job)
        job.moveToThread(self.thread)
        job.setParent(self.remote)
        QMetaObject.invokeMethod(job, 'run', Qt.QueuedConnection)

    def clear(self):
        for job in self.local.children():
            if hasattr(job, 'cancel'):
                job.cancel()
예제 #2
0
파일: worker.py 프로젝트: Answeror/lit
class Pool(object):

    def __init__(self):
        self.thread = QThread()
        self.thread.start()
        self.local = QObject()
        self.remote = QObject()
        self.remote.moveToThread(self.thread)

    def start(self, job):
        job.setParent(self.local)
        job = Job(job)
        job.moveToThread(self.thread)
        job.setParent(self.remote)
        QMetaObject.invokeMethod(
            job,
            'run',
            Qt.QueuedConnection
        )

    def clear(self):
        for job in self.local.children():
            if hasattr(job, 'cancel'):
                job.cancel()
예제 #3
0
파일: worker.py 프로젝트: Answeror/lit
 def __init__(self):
     self.thread = QThread()
     self.thread.start()
     self.local = QObject()
     self.remote = QObject()
     self.remote.moveToThread(self.thread)
예제 #4
0
파일: suggest.py 프로젝트: kazarin1alex/lit
 def __init__(self, parent):
     QObject.__init__(self, parent)
     self.editor = parent
     self.popup = None
     self.set_popup(CenterListView())
     self.content = None
예제 #5
0
 def __init__(self):
     self.thread = QThread()
     self.thread.start()
     self.local = QObject()
     self.remote = QObject()
     self.remote.moveToThread(self.thread)