Results 1 to 3 of 3

Thread: QTest and Command Line Arguments

  1. #1

    Post QTest and Command Line Arguments

    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?

  2. #2

    Default Re: QTest and Command Line Arguments

    Nevermind, it was too simple.

    Qt Code:
    1. argv[1]="-o";
    2. argv[2]="c:\mytest.logt";
    3. argc += 2;
    4. QCoreApplication app(argc, argv );
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    507
    Thanks
    11
    Thanked 76 Times in 74 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QTest and Command Line Arguments

    Quote Originally Posted by ManuMies View Post
    Qt Code:
    1. argv[1]="-o";
    2. argv[2]="c:\mytest.logt";
    To copy to clipboard, switch view to plain text mode 
    Is this safe? Or does argv just contain argc elements?

    Ginsengelf

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.