Skip to content

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

@DorianScholz

Description

@DorianScholz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions