PDA

View Full Version : QTest and Command Line Arguments



ManuMies
23rd April 2009, 10:07
I'd like to pass the command line arguments programmatically, but I don't seem to get it working.

Any example how to pass for example "-o c:\myfile.log" to qcoreapplication in int main?

ManuMies
23rd April 2009, 10:41
Nevermind, it was too simple. :D



argv[1]="-o";
argv[2]="c:\mytest.logt";
argc += 2;
QCoreApplication app(argc, argv );

Ginsengelf
23rd April 2009, 12:32
argv[1]="-o";
argv[2]="c:\mytest.logt";


Is this safe? Or does argv just contain argc elements?

Ginsengelf