Qt Creator: Run in Terminal

你。 提交于 2019-12-20 10:52:06

问题


I want to get full console functionality running the program in Qt Creator, the same problem as described here: Console input with Qt Creator

When I check "Run in Terminal" in configuration properties, empty terminal window is opened, without my program output. Tools - Options - General - Terminal has this value: "x-terminal-emulator -e". How can I get this working? My OS is Ubuntu 10.4.

Note: Please don't close this question, it is not duplicated! I need solution for Ubuntu OS.


回答1:


Under Tools-Options-Environment-General, change the terminal value from x-terminal-emulator -e to /usr/bin/xterm -e. This did the trick for me.

(Found this fix here: https://bugs.launchpad.net/ubuntu/+source/qtcreator/+bug/566387)




回答2:


Another nice trick to avoid having to do console commands, or running a bash script is to just modify the .desktop file.

On Ubuntu those are located here:

ls /usr/share/applications/

If you wanted to edit Qt Creator for example you could do.

nano /usr/share/applications/qtcreator.desktop

Edit the variable "Exec" should look like "Exec=/usr/bin/qtcreator" and change it to.

bash -i -c /usr/bin/qtcreator

Or whatever your path to the application you want to change is.

This will enable your different environmental variables with this method as well which is what I assume you are trying to do.



来源:https://stackoverflow.com/questions/3255035/qt-creator-run-in-terminal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!