# IDEs QT Creator - Desktop Entry Troubles

Ok ROS Team, you very efficient at solving my problems last time, but this one is a real brain bender:

I have successfully integrated to ROS C++ libraries into my QT environment, and I am able to call ROS functions from within my programs, and they execute properly.

In order to run my resulting programs in QT, I either need to:

1. Run them from a terminal
2. Modify my QT .desktop [desktop entry] file

I followed the instructions for (2) from the ROS IDE page here: http://wiki.ros.org/IDEs#QtCreator

--> Essentially I added the terms "bash -i -c", to the exec line for my .desktop entry.

Here is where it gets weird:

My QT Creator will launch properly and run my ROS applications ONLY ONCE per boot. So If I launch QT Creator after a restart everything works correctly, but if I close it and relaunch it, bash hangs and never launches the app!

Further, I have created a .desktop entry for my resulting QT application and it has an even stranger behavior:

-- If place my .desktop entry on the desktop (or many other tested locations such as /usr/share/applications), it behaves the same as QT creator. It launches only once.

-- If I place my .desktop file on my home directory it works correctly!

Since catkin_ws is on my home path, I suspect it has something to do with my terminal trying to find source files in catkin_ws, but I am at a loss for how to resolve this using the .desktop file.

Specifics: ROS Melodic installed on /opt/ros/melodic/ I have 2 systems, both running Ubuntu 18.04 LTS.
Both have QT Creator QT 5.12.1.
My catkin_ws path is /home/<user>/catkin_ws in /home/<user>/ is my .bashrc, which has been modified to include the ros and catkin sources as listed in the tutorial.

Finally, my code:

[Desktop Entry]
Type=Application
Exec=bash -i -c /opt/Qt5.12.1/Tools/QtCreator/bin/qtreator**
Name=Qt Creator (Enterprise)
GenericName=The IDE of Choice for Qt developmen
Icon=QtProject-qtcreator
SytartupWMClass=qtcreator
Terminal=false
Categories=Development;IDE;Qt;
MimeType=text/x-c++src;text/x-c++hdr;text/....


I suspect the Exec line is the source of the trouble, the remaining entry was unchanged from the original QT .desktop entry file.

Does anyone know how to modify my .desktop exec line so that the resulting terminal application launched from my home directory (or with visibility to it)? Or is there some alternative way that you have solved this problem?

edit retag close merge delete

Sort by » oldest newest most voted

Ok Update!

Setting the .desktop entry for Terminal from 'false' to 'true', now allows the QT Creator to be relaunched in a session.

The application still cannot be launched from the 'favorites' sidebar in Ubuntu 18.04.

However:

• This has the annoying side effect of launching a terminal every time
• It is contrary to the IDE instructions tutorial
• It sill makes zero sense that the application can launch correctly once from a clean boot, but cannot relaunch successfully after that.

For those who might stumble on this issue, I am now able to use a desktop icon instead of the 'favorites' icon, and everything is acceptable. However I have not root caused the issue to my satisfaction. Consider this a workaround.

This workaround is also successful for .desktop entries for QT apps using ROS C++ libraries.

more

I'm having this exact same problem with the QtCreator launcher. Have you found a better workaround or a true solution?

( 2019-12-19 12:35:36 -0600 )edit