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

Editing files from qt-creator

asked 2016-04-04 14:24:21 -0600

Randerson gravatar image

updated 2016-04-05 07:06:33 -0600

Hello all, does someone know how can I allow qt-creator to edit and delete files from the ros packages?


Edit: Just to clarify, I am not asking about how to import a ros package as a qt-creator. This task, is well documented in . My question is: In the qt-creator environment, I can not either create or delete a file directly. What I mean is: In the qt-creator project tree, the mentioned options (new and delete) are blocked. Actually, to work around this issue, I am creating or deleting the files directly from my file manager, and then going to the qt-creator editor the created files.

From the aforementioned, I would like to know if there are some way to perform the creating and deleting tasks directly from q-creator editor.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-04-05 04:46:16 -0600

JohnDoe2991 gravatar image

updated 2016-04-05 07:57:56 -0600

The QtCreator doesn't support cmake-projects very well as far as I know. You can add a new file with "file -> new ..." or by pressing ctrl+n, then specify the path and add it manually to your CMakeLists.txt. After that you can run cmake from the menu. That's the way I do it at the moment.

The only evidence for this bad support I have found is this forum post. It seems that nothing has changed since then.

If you want to change your IDE, maybe have a look at KDevelop as it seems to have a better cmake support (I haven't tested it yet)

//Before Edit:



As QtCreator supports opening CMake projects out of the box ,it does not require a setup procedure if started from a terminal. Note that this is absolutely crucial, because otherwise the environment will not be set correctly and functionality related to rosbuild or catkin will fail when running cmake.

Note that instead of starting QtCreator from a terminal, you can use the following desktop file and use it in your launcher:

$ cat qtcreator.desktop 
[Desktop Entry]
Exec=bash -i -c qtcreator %F
Name=Qt Creator
GenericName=Integrated Development Environment

In Ubuntu 13.04 and later, the third line must read:


This is the standard QtCreator desktop file, except for the Exec line that has been modified with "bash -i -c". More about desktop files and their locations for Ubuntu can be found here. Note also that the same trick can be used with eclipse.

If you are experiencing issues with the qtcreator package shipped by Ubuntu when opening the CMakeLists, then try installing QtCreator from Nokia's installer.


To open a rosbuild ROS package code as a project, use "Open File or Project" and select the CMakeLists.txt of your ROS package. Take care to select the "[package_name]/build" directory as the build directory, which is the ROS default. On the next screen click 'Run Cmake' and then Finish. This may not show all the folders such as launch and include in the project tree. If you want to choose the files manually, goto File->New File or Project->Import Project->Import Existing Project and selected to choose all files/folders included in the project.


To open a catkin code as a project, use "Open File or Project" and select the top level CMakeLists.txt of the catkin workspace (e.g. "src/CMakeLists.txt"). Select the catkin build folder as the build directory and 'Run CMake' (in order to enable debugging add following line into arguments edit box: -DCMAKE_BUILD_TYPE=Debug).

Recently this has started to fail, because the main CMakeLists is a symlink to a non writtable location. The workaround is to make a copy ... (more)

edit flag offensive delete link more


This as not my question!!!

Randerson gravatar image Randerson  ( 2016-04-05 06:59:19 -0600 )edit

could you then clarify your question?

JohnDoe2991 gravatar image JohnDoe2991  ( 2016-04-05 07:07:03 -0600 )edit

I edited the question. :)

Randerson gravatar image Randerson  ( 2016-04-05 07:34:25 -0600 )edit

Question Tools

1 follower


Asked: 2016-04-04 14:24:21 -0600

Seen: 978 times

Last updated: Apr 05 '16