Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Q_ macros instead of signals, slots, emit for boost signals compatability #55

Open
DorianScholz opened this issue Jun 16, 2015 · 0 comments
Milestone

Comments

@DorianScholz
Copy link
Member

Compiling a rqt_gui_cpp plugin which (transitively) depends on boost signals (e.g. via tf package) fails to compile due to macro name clashes of Qt's "signals", "slots", "emit" macros as described here:
http://wiki.ros.org/qt_ros/Tutorials/Mixing%20Qt%20and%20Boost%20Signals

For such a plugin to compile the QT_NO_KEYWORDS flag can be set in its cmake file:
ADD_DEFINITIONS(-DQT_NO_KEYWORDS)

But this breaks the current code of qt_gui_core at:
https://github.com/ros-visualization/qt_gui_core/blob/fuerte-devel/qt_gui_cpp/include/qt_gui_cpp/plugin_bridge.h#L63

And also a few other files in the rqt package are affected:
https://github.com/ros-visualization/rqt/search?l=cpp&q=signals+OR+slots+OR+emit&type=Code&utf8=%E2%9C%93

Changing the keywords as follows would resolve this issue:

  • signals -> Q_SIGNALS
  • slots -> Q_SLOTS
  • emit -> Q_EMIT
  • foreach -> Q_FOREACH

The use of the QT_NO_KEYWORDS flag should also be mentioned in the rqt cpp plugin tutorial.

@dirk-thomas dirk-thomas added this to the untargeted milestone Sep 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants