Hi everyone,

I'm trying to update the text inside a TextItem object from a callback, so 
that I can stream float values that come from outside my python script.
The problem I'm facing is that once my callback is invoked from the 
framework I'm using, the following error is thrown:

QObject: Cannot create children for a parent that is in a different thread.
>

I don't know how to avoid that and I'm not sure if there is actually a way 
to do what I want,

This is the code I have written until now:

QtGui.QApplication([])
        
## Create window with GraphicsView widget
        
win = pg.GraphicsLayoutWidget()
win.show()  ## show widget alone in its own window        
win.setWindowTitle('...')
        
# ... window settings
        
## Create image item
self.vis = pg.ImageItem()
        
# ... image settings        
       
## Create obstacle histogram  
plot = pg.PlotItem()
       
# ... plot settings

self.text = pg.TextItem('Loading...')
self.view.addItem(self.text)


And from the callback mentioned above (where the problem is) I do:

self.text.setText('Hello world!')


Does anyone know how to avoid this problem and implement this behavior?

Thank you in advance for your answers, I hope the question is clear.

 


       

-- 
You received this message because you are subscribed to the Google Groups 
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyqtgraph/de33dafd-5c7b-4fdc-81fb-aa78c1658a6d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to