ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How do I intercept rqt plugin mouse events?

asked 2013-01-20 09:59:25 -0600

updated 2014-01-28 17:14:55 -0600

ngrennan gravatar image

I'm trying to create a virtual joystick plugin for rqt in Python. When I wrote the stand-alone python node, I just made my main window inherit QtGui.QMainWindow, then I could simply override mousePressEvent.

When I make an rqt plugin, the mousePressEvent doesn't work, I assume because there's nothing to override in the Plugin class.

Is there another way to do this? Can I connect some QT signal?

Thanks, -Jon

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
5

answered 2013-01-20 12:21:51 -0600

130s gravatar image

Yes there is a standard way.

Taking rqt python plugin tutorial as an example, you can replace QWidget with your main python modoule, give it to qt_gui.PluginContext.add_widget method.


A little more about concept, rqt framework provides:

  1. An "interface" between your own python components and rqt itself.

  2. Standard procedures for GUI (shutdown etc.)

  3. Nice features for GUI design (ex. loadUi that enables to use UI definition in xml (.ui file)

This means you can easily utilize your own stuff without even modifying. You just add a class that extends qt_gui.plugin.Plugin where you define #1 & #2 above. Currently detailed API document doesn't exist but API Review might give you more insight.

edit flag offensive delete link more

Comments

Excellent! That was exactly the tip I needed!

Jon Stephan gravatar image Jon Stephan  ( 2013-01-20 12:47:10 -0600 )edit
0

answered 2013-06-10 22:50:26 -0600

sonia gravatar image

How can I modify rxbag pluging , and how can i make it a new plugin? Dont know where to start with, what files i have to modify etc ...im working in fuerte.

edit flag offensive delete link more

Comments

Please do not ask new questions; that's not how this forum works. Instead, if you open a new question, I'm happy to answer that.

130s gravatar image 130s  ( 2013-06-10 22:54:31 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2013-01-20 09:59:25 -0600

Seen: 4,611 times

Last updated: Jun 10 '13