Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The rqt system uses the "LoadUi" helper function to load ui files from python_qt_binding

It is imported like so:

from python_qt_binding import loadUi

And called like this:

ui_file = *PATH TO YOUR UI FILE*
my_widget = *WIDGET TO LOAD YOUR UI FILE INTO*
loadUi(ui_file, my_widget)

Each widget is loaded as a child widget to "my_widget" and it can be accessed using the name you gave it in the ui_file as so:

my_widget.load_button.hide()
my_widget.save_button.setText('')

If you want to see a working example please look at rqt_msg here:

https://github.com/ros-visualization/rqt_common_plugins/blob/groovy-devel/rqt_msg/src/rqt_msg/messages_widget.py
https://github.com/ros-visualization/rqt_common_plugins/blob/groovy-devel/rqt_msg/resource/messages.ui

The rqt system uses the "LoadUi" helper function to load ui files from python_qt_binding

It is imported like so:

from python_qt_binding import loadUi

And called like this:

ui_file = *PATH TO YOUR UI FILE*
my_widget = *WIDGET TO LOAD YOUR UI FILE INTO*
loadUi(ui_file, my_widget)

Each widget is loaded as a child widget to "my_widget" and it can be accessed using the name you gave it in the ui_file as so:

my_widget.load_button.hide()
my_widget.save_button.setText('')

Then simply connect the relevant callbacks as so: my_widget.load_button.clicked.connect(self.load_callback_function)

If you want to see a working example please look at rqt_msg here:

https://github.com/ros-visualization/rqt_common_plugins/blob/groovy-devel/rqt_msg/src/rqt_msg/messages_widget.py
https://github.com/ros-visualization/rqt_common_plugins/blob/groovy-devel/rqt_msg/resource/messages.ui

The rqt system uses the "LoadUi" helper function to load ui files from python_qt_binding

It is imported like so:

from python_qt_binding import loadUi

And called like this:

ui_file = *PATH TO YOUR UI FILE*
my_widget = *WIDGET TO LOAD YOUR UI FILE INTO*
loadUi(ui_file, my_widget)

Each widget is loaded as a child widget to "my_widget" and it can be accessed using the name you gave it in the ui_file as so:

my_widget.load_button.hide()
my_widget.save_button.setText('')

Then simply connect the relevant callbacks as so: my_widget.load_button.clicked.connect(self.load_callback_function)so:

my_widget.load_button.clicked.connect(self.load_callback_function)

If you want to see a working example please look at rqt_msg here:

https://github.com/ros-visualization/rqt_common_plugins/blob/groovy-devel/rqt_msg/src/rqt_msg/messages_widget.py
https://github.com/ros-visualization/rqt_common_plugins/blob/groovy-devel/rqt_msg/resource/messages.ui