I want to update the text in slicer extension by Qtimer and QTextBrower, but nothing happon after run the main(). The code as follows:
self.data += 1
except Exception as ex:
Can you give a full example? It is not clear from your snippets how you use
The problem is qt.QTimer.singleShot().
I changed to
self.timer = qt.QTimer()
But another problem is there is a slowly runing
What are you trying to achieve? Displaying real-time data that you receive via OpenIGTLink?
I try to connecte my single chip computer and display in slicer.
Can I use the Qthread in slicer to deal with the slow-problem? And is there any example for that?
You need to make sure that communication does not block the main thread for too long.
If you use serial (USB, RS-232,…) communication then you can use this work-in-progress Arduino extension for simple single-threaded serial communication implementation or Plus toolkit for multi-threaded, networked configuration (communicate with many Arduinos, potentially connected to other computers - not directly to the one that runs Slicer).