i tried to run a lightblue-connection in a PyQtThread.
But i am getting the following Error-Message:
2011-02-13 23:23:33.285 Python[1113:4b03] *** __NSAutoreleaseNoPool(): Object 0x1038ad3e0 of class __NSCFDate autoreleased with no pool in place - just leaking
This is just some example-code…
fromPyQt4importQtCore,QtGuiimporttime,sys,lightblueclassListener(QtGui.QWidget):def__init__(self,parent=None):QtGui.QWidget.__init__(self,parent)#setting up the main windowself.setGeometry(300,300,200,200)self.setStyleSheet("QWidget { background-color: white }")self.setWindowTitle('NSAutoReleasePool')#setting up a labelself.user_guide=QtGui.QLabel()self.user_guide.move(10,10)self.user_guide.setText("Print some stuff")hbox=QtGui.QHBoxLayout()hbox.addWidget(self.user_guide)vbox=QtGui.QVBoxLayout()vbox.addLayout(hbox)self.setLayout(vbox)self.thread=Sender()self.connect(self.thread,QtCore.SIGNAL("test(QString)"),self.user_guide.setText)self.thread.start()classSender(QtCore.QThread):def__init__(self,parent=None):QtCore.QThread.__init__(self,parent)defrun(self):t='.'devs=lightblue.finddevices(getnames=True,length=5)foriinrange(5):time.sleep(1)self.emit(QtCore.SIGNAL('test(QString)'),"I am running "+t)t+='.'self.emit(QtCore.SIGNAL('test(QString)'),"I am finished")app=QtGui.QApplication(sys.argv)acc_widget=Listener()acc_widget.show()sys.exit(app.exec_())
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
i tried to run a lightblue-connection in a PyQtThread.
But i am getting the following Error-Message:
This is just some example-code…