Results 1 to 5 of 5

Thread: How to use main args

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2014
    Posts
    82
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default How to use main args

    Hi,

    I'm amking a Qt Gui application so the main its like:

    Qt Code:
    1. int main(int argc, char *argv[])
    2. {
    3. QApplication a(argc, argv); //Maybe I can do something with this line?
    4. }
    To copy to clipboard, switch view to plain text mode 

    I need to use those arguments (argc, argv[]) in the mainwindow. So my question is: How can I use them there? The only solution I can think of is to create a new class which receives them, put them in global variables and then inherite mainwindow from the new class but I don't really like it and I suposse there is an easer way to do it.

    Thanks!
    Last edited by roseicollis; 23rd December 2014 at 11:19.

Similar Threads

  1. Replies: 4
    Last Post: 6th March 2019, 20:57
  2. Pass a QString as args for commandProcess
    By mikemakus in forum Newbie
    Replies: 2
    Last Post: 3rd December 2009, 23:03
  3. va_start used in function with fixed args
    By stinos in forum General Programming
    Replies: 5
    Last Post: 28th November 2008, 00:49
  4. Replies: 11
    Last Post: 11th August 2008, 09:14
  5. Bring va_list args; to a QStringList or a qmap
    By patrik08 in forum General Programming
    Replies: 8
    Last Post: 18th June 2006, 12:31

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.