How to send args to Qt Application from Qt Creator
-
wrote on 19 Aug 2023, 05:29 last edited by JacobNovitsky
Using Qt Creator for my Qt&C++ app.
I use Ctrl + R to build and run my app, it opens in Gnome Terminal (Ubuntu 20)
I need to send args before I call Ctrl + R, without re-writing any variables
Is there any kind of feature in Qt creator?Other question:
after I reinstall OS and Qt, if I have one terminal instance open and I'm trying to Ctrl + R to build and open new terminal it stops previous process and prints:qtc.process_stub: Control socket error: QLocalSocket::PeerClosedError
Press <RETURN> to close this window...Tried to look to settings, but there is no obvious solution
It also gets to non-responding state from time to time
-
wrote on 19 Aug 2023, 06:03 last edited by
-
wrote on 19 Aug 2023, 06:30 last edited by
@ChrisW67 yes, getting test:test in first line of terminal
how to manage it? -
@ChrisW67 yes, getting test:test in first line of terminal
how to manage it?wrote on 19 Aug 2023, 07:49 last edited by JonB@JacobNovitsky
Creator/Qt does not output anything to the terminal/standard output. Maybe you outputtest:test
from your code?For your questions about running two instances I see no problem under Ubuntu 22.04. Whether my application has Run in terminal or not. Don't know exactly what you are doing when you see your error. Why do you need to start a new instance/terminal when you have a previous one still running/open anyway?
-
@JacobNovitsky
Creator/Qt does not output anything to the terminal/standard output. Maybe you outputtest:test
from your code?For your questions about running two instances I see no problem under Ubuntu 22.04. Whether my application has Run in terminal or not. Don't know exactly what you are doing when you see your error. Why do you need to start a new instance/terminal when you have a previous one still running/open anyway?
wrote on 5 Sept 2023, 01:58 last edited by@JonB I need to send some args when calling Qt from cmd as per below:
~/Qt/Tools/QtCreator/bin/qtcreator /home/supernova/App/CMakeLists.txt
how to do the same? -
@JonB I need to send some args when calling Qt from cmd as per below:
~/Qt/Tools/QtCreator/bin/qtcreator /home/supernova/App/CMakeLists.txt
how to do the same?wrote on 5 Sept 2023, 07:37 last edited by JonB 9 May 2023, 07:38@JacobNovitsky
You can only do that when first launching the application. Nothing to do with running multiple copies. You can specify command line arguments for you app from Qt Creator as @ChrisW67 showed you. Don't know what your issue is. -
@JacobNovitsky
You can only do that when first launching the application. Nothing to do with running multiple copies. You can specify command line arguments for you app from Qt Creator as @ChrisW67 showed you. Don't know what your issue is.wrote on 6 Sept 2023, 10:48 last edited by@JonB solved, ./ProjectName a b c
-
@JonB solved, ./ProjectName a b c
wrote on 7 Sept 2023, 01:24 last edited by@JacobNovitsky That is how you would run it from the Terminal, not Qt Creator. In Qt Creator, you pass arguments to the application via the Command line arguments line edit in Run Settings under the Projects tab.
-