从Watchdog事件处理程序类中调用PyQt类

时间:2015-04-18 21:27:06

标签: python-3.x pyqt4 watchdog python-watchdog

我设置了监视程序来监视新文件的文件夹,我想在运行on_created函数后尝试返回主PyQt类。

from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler

class CreatedEvent(FileSystemEventHandler):

    def on_created(self, event):
        #some code

我需要能够调用someFunction

from PyQt4.QtGui import *
from PyQt4.QtCore import *

class someClass(QMainWindow):
    def someFunction(self):
        #some code

我尝试使用信号,但我总是收到此错误

QPixmap: It is not safe to use pixmaps outside the GUI thread
QPixmap: It is not safe to use pixmaps outside the GUI thread

0 个答案:

没有答案