Ask Your Question
0

Editing files from qt-creator

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

Randerson gravatar image

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

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

att

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 http://wiki.ros.org/IDEs . 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
1

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

JohnDoe2991 gravatar image

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

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:

source: http://wiki.ros.org/IDEs

QtCreator

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
Icon=qtcreator
Type=Application
Terminal=false
Name=Qt Creator
GenericName=Integrated Development Environment
MimeType=text/x-c++src;text/x-c++hdr;text/x-xsrc;application/x-designer;application/vnd.nokia.qt.qmakeprofile;application/vnd.nokia.xml.qt.resource;
Categories=Qt;Development;IDE;
InitialPreference=9

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

Icon=QtProject-qtcreator

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.

rosbuild

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.

catkin_make

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

Comments

This as not my question!!!

Randerson gravatar imageRanderson ( 2016-04-05 06:59:19 -0500 )edit

could you then clarify your question?

JohnDoe2991 gravatar imageJohnDoe2991 ( 2016-04-05 07:07:03 -0500 )edit

I edited the question. :)

Randerson gravatar imageRanderson ( 2016-04-05 07:34:25 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 624 times

Last updated: Apr 05 '16