Strange problem just cropped up, not sure what is going on. I have a QTextEdit box where I'm funneling python logging messages.

    self.__textEdit = QtGui.QTextEdit(self)
    self.__textEdit.setReadOnly(True)
    self.__textEdit.document().setMaximumBlockCount(100)
    self.__textEdit.setLineWrapMode(QtGui.QTextEdit.NoWrap)

   class QtStreamHandler(logging.Handler):
       def __init__(self,parent):
           logging.Handler.__init__(self)
           self.__textWidget = parent
self.__formater = logging.Formatter("%(levelname)-10s %(message)s") def createLock(self):
           self.__mutex = QtCore.QMutex()
def acquire(self):
           self.__mutex.lock()
def release(self):
           self.__mutex.unlock()
def emit(self,record):
           self.__textWidget.append(self.__formater.format(record))
           self.__textWidget.ensureCursorVisible()


This line is causing the error.
self.__textWidget.append(self.__formater.format(record))

It doesn't matter what I put in, I tried a string literal, got same error.
self.__textWidget.append("bob")

Error:

QObject::connect: Cannot queue arguments of type 'QTextCursor'
(Make sure 'QTextCursor' is registed using qRegisterMetaType().)

It only happens once. From what I can see its not dropping any messages either.. Google turns up nothing, just some speculation on a threading problem.

-Matt


_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to