ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A answers.ros.org

QT Creator and syntax highlighting/code completion


#1

Hello,

Last week for World MoveIt! day I finally started working with the project from source but my problem is I cant get syntax highlighting or code completion to work, which is making it slow and difficult to help find bugs and do general development.

I did some searching and everything I found points to Clang for QT’s parsing of the code but I cant seem to figure out the correct settings. Can anyone here help point me in the right direction to get this project properly setup in QT? (I also found the same issue with the MoveIt! tutorials code base, but assume this issue is related)

Thanks for your help!!
-Marq


#2

This should probably be addressed at answers.ros.org

Compile your code as usual using catkin build, source the workspace, open QtCreator within that sourced session, open your CMakeLists.txt in QtCreator, select WS/build/package_name/ as build dir for exactly one build configuration. Success

This is also covered in the ROS wiki btw


#3

simonschmeisser thanks for the response! I was thinking about posting this there but thought it also fits here as it is a discussion on how to get a large ROS project that has roots in QT into the IDE that ROS-I supports. I am more than happy to move the discussion there if you feel this issue does not belong here.

I tried your method and I can get syntax highlighting and code completion to work but only for one sub-package of the moveit source code (i.e. moveit_core. When I do this method the only source code I can see in the editor tree is the sub-package selected as the build space). I opened moveit/moveit/CmakeLists.txt, but when I go to select my build directory I can only select a single package directory (i.e. moveit_core, moveit_ros, … and I want to select all of them which doesn’t seem to be an option).

It would be great if I could import the project the same way the QTCreator wiki explains which is what I was hoping to discuss how to do in this post.

Thanks again!