Results 1 to 20 of 33

Thread: Both a command line and GUI application at the same time?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2010
    Posts
    319
    Thanks
    1
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Question Both a command line and GUI application at the same time?

    Hi,

    I have a GUI application to which I would like to add command line support. Basically, if I was, from a command prompt, to enter something like

    $ ./myApp
    then the GUI would just show up. However, if I was to enter something like

    $ ./myApp -i myInputFile -o myOutputFile
    then my application would execute in 'silence', i.e. without the GUI ever showing up.

    I thought I would use the QxtCommandOptions class (from LibQxt) to do this, but the only way I have got that class to work was by having a 'pure' Qt console application. As soon as the Qt application is a GUI application, then I am not able to use the class.

    Any idea of what I might be doing wrong or what I would need to do get what I am after?

    EDIT: I can do what I am after on Linux (and, I would assume, on Mac OS X), but not on Windows and I believe this is due to the way Windows handles console applications. Still working on finding a solution though...
    Last edited by agarny; 26th January 2011 at 16:27.

Similar Threads

  1. Replies: 1
    Last Post: 7th September 2010, 15:49
  2. Replies: 3
    Last Post: 23rd February 2010, 04:33
  3. QProcess and the command line
    By auba in forum Qt Programming
    Replies: 17
    Last Post: 27th May 2009, 10:39
  4. Replies: 0
    Last Post: 28th February 2009, 23:18
  5. Retrieving command line arguments inside a Qt application
    By prykHetQuo in forum Qt Programming
    Replies: 5
    Last Post: 14th February 2009, 14:28

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
  •  
Qt is a trademark of The Qt Company.