Qt creator: howto pass command line arguments to the program you are writing?
-
wrote on 8 Sept 2016, 13:19 last edited by
Hi All,
I am writing a console Qt application that accepts command-line options. Therefore I'm using QCommandLineParser. I write the program in Qt creator, and use the F5 key to start debugging. Now my program is started in the debugger, but this way I'm not able to set any command line options, and I cannot see if my program handles them correctly.
Second option is to build the program in Qt creator, then open cmd.exe, goto the build directory, and then run the program from there. This way I can set command line options for my application, but then I can not debug the program.
Is there a way to tell QtCreator to give my program a set of command line options?
Is there a way to set a breakpoint my program, so I can start it with command line options from cmd.exe, and then attach with the debugger in QtCreator, and then step trough the program?
My versions:
Windows 7 enterprise SP1 64 bit
Qt Creator 3.6.0 Based on Qt 5.5.1 (MSVC 2013, 32 bit)
QT5.5, mingw492_32
Cheers,
Cedric -
-
wrote on 8 Sept 2016, 13:47 last edited by
Thank you.
I feel a bit stupid for not finding that myself, but I'm very glad you answered me this fast.
Cheers,
Cedric -
Thank you.
I feel a bit stupid for not finding that myself, but I'm very glad you answered me this fast.
Cheers,
CedricLifetime Qt Championwrote on 8 Sept 2016, 13:49 last edited by mrjj 9 Aug 2016, 13:50@cdwijs
oh no worries you provided good info on platform and versions so
+1 for that anyways :) -
wrote on 26 Sept 2017, 16:18 last edited by
Just to be sure, my question is for QtCreator 4.2.
This topic "Qt creator: how to pass command line arguments to the program you are writing" is marked as SOLVED, but the solution is not available to view or read.
Can you please re-post the solution?
Thanks,
Jeff -
Just to be sure, my question is for QtCreator 4.2.
This topic "Qt creator: how to pass command line arguments to the program you are writing" is marked as SOLVED, but the solution is not available to view or read.
Can you please re-post the solution?
Thanks,
JeffHi and welcome
If you mean where to write the command line arguments , the image i posted higher up
shows where to find it. -
wrote on 26 Sept 2017, 16:49 last edited by
I cannot see a solution image. Apparently, my secure work environment is blocking some image types again on the non-secure network. Normally, I can see PNG and JPG.
I will check it again from home.
Thanks. -
I cannot see a solution image. Apparently, my secure work environment is blocking some image types again on the non-secure network. Normally, I can see PNG and JPG.
I will check it again from home.
Thanks.@jheyob
oh that was new :)
its
Projects (left side, under debug)
Then Run Settings
then there is an edit "command line arguments" -
wrote on 27 Sept 2017, 13:43 last edited by
Yes, found it. Problem solved.
Thanks.