How to send args to Qt Application from Qt Creator
-
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
-
@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?@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?
@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? -
@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.@JonB solved, ./ProjectName a b c
-
@JonB solved, ./ProjectName a b c
@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.
-
A aha_1980 has marked this topic as solved on