rviz panel plugin update QLabel
Hello I wanted to know if its possible to constant update a label in the rviz::Panel plugin class. I have informaiton on a variety of nodes that are being published and wish to show then on a Panel plugin for rviz, its possible to access the main loop or how do I create a signal that can trigger the change? Thanks in advance.
Asked by WicketSick on 2017-10-10 10:37:35 UTC
Answers
Just use Qt resources.
You could integrate a Qtimer
with a Q_SLOTS
that simply wraps a spinOnce
call into your custom panel class ( Q_OBJECT
).
So when the timer hits timeout, it calls for spinOnce()
. Then, through subscriber callbacks, your Qt elements get updated.
Example for integration of timer and wrapper call:
QObject::connect(QTimer_instance_name, SIGNAL(timeout()), this, SLOT(spinOnce_Wrapper()));
Asked by Bogdar_ on 2019-04-26 06:30:31 UTC
Comments