PySide(Qt) + PyQtGraph thread question

43 views
Skip to first unread message

Andrew Messier

unread,
Sep 3, 2017, 5:16:41 PM9/3/17
to pyqtgraph

Hello, I get the following error:

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

when I do this:

    def _scope_display_thread(self):
        global scope_running
       
        while (scope_running == 1):
            data = {load in some data from somewhere}
            self.graphicsView.plot(data)

    def scope_display_thread(self):
        threading.Thread(target=self._scope_display_thread).start()

graphicsView is the PyQtGraph plot object as promoted in my Qt Creator .ui project. I can access it just fine out of the thread. It seems that even if I'm using another thread to manage my data I need to somehow do the actual graphics updating in the main "Qt UI" thread ... not sure how to do this as most examples use timers instead of threads. Ultimately my data will be getting pushed in so timers aren't really what I want.

Any help would be appreciated. Thanks!!
Reply all
Reply to author
Forward
0 new messages