Ask Your Question
3

Creating own widgets for rqt

asked 2013-06-20 02:27:06 -0500

da-na gravatar image

updated 2013-06-20 08:46:41 -0500

130s gravatar image

Hello again :)

I have one more question regarding documentation of rqt: In the tutorial Writing Python Plugin there's a paragraph 3.2 Using a UI file, which I don't really understand. It says:

The example uses an Qt Designer UI file to describe the widget tree. Instead of hand-coding the widget tree the python_qt_binding.loadUi function creates the widgets at runtime based on the description from the file.

Does it mean that now I have to create a project with Qt Designer and afterwards just copy the .ui file? (A project like based on an example Creating a Qt Widget Based Application ?) But how will all the functions copy themselves to Python?

I managed to write some simple widget based on rqt_robot_steering (and add it to RosGui :)), but I had to write all callback functions by hand. Is there a way of doing it automagically?

Cheers, da-na

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-06-20 10:34:48 -0500

130s gravatar image

updated 2013-06-20 14:06:13 -0500

Does it mean that now I have to create a project with Qt Designer and afterwards just copy the .ui file? (A project like based on an example Creating a Qt Widget Based Application ?)

No it's not mandatory. There's another rqt tutorial page that explains (sorry the link was missing from python tutorial you cited); in a nutshell, it's up to developers to use Qt Designer / .ui files or not. Although personally I highly recommend using it for better maintenance, if you choose not to use .ui files in your rqt plugin, there's still a portion of document about non-ui files.

But how will all the functions copy themselves to Python?

That tutorial should explain the idea too.

I managed to write some simple widget based on rqt_robot_steering (and add it to RosGui :)), but I had to write all callback functions by hand. Is there a way of doing it automagically?

In Qt in general you use Signal-Slot feature for callback mechanism, which is applicable to rqt as well.

Please add comments / modify your OP if something is still unclear.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-06-20 02:27:06 -0500

Seen: 962 times

Last updated: Jun 20 '13