Results 1 to 6 of 6

Thread: Is there any common interface for running applications with arguments?

  1. #1
    Join Date
    May 2011
    Location
    London
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Is there any common interface for running applications with arguments?

    Hello,
    I want to start an application with QProcess with some files as arguments.
    As every application has it's own parameters, I was wondering if there is a common interface which can be used to ease the pain?
    k3b runs like this :
    Qt Code:
    1. k3b --data file1 file2 file3
    To copy to clipboard, switch view to plain text mode 
    and file-roller has this :
    Qt Code:
    1. file-roller -d file1 file2 file3
    To copy to clipboard, switch view to plain text mode 

    Thank you.

  2. #2
    Join Date
    Apr 2011
    Posts
    124
    Thanks
    1
    Thanked 10 Times in 10 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows Symbian S60

    Default Re: Is there any common interface for running applications with arguments?

    It's up to applications to parse their own parameters -- a major deficiency of both *nix and DOS/Windows, IMO (And Symbian copies DOS). Therefore there can be no common calling scheme (that doesn't require the calling programmer to know, eg, whether to insert one '-' or two).

  3. #3
    Join Date
    May 2011
    Location
    London
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Is there any common interface for running applications with arguments?

    Maybe I could extract the information from what the applications registered in the system's context menu.
    Any suggestions?

  4. #4
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Is there any common interface for running applications with arguments?

    How much "pain" is involved in this? It typically takes only a few minutes to write a command-line processing loop, if that.

  5. #5
    Join Date
    May 2011
    Location
    London
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Is there any common interface for running applications with arguments?

    I am making an application which sends a bunch of files to the unknown application to work on them.
    The problem is we don't know what kind of cd burner/archiver is installed, and the application could be run on windows or linux.

    Thanks for the reply.

  6. #6
    Join Date
    Apr 2011
    Posts
    124
    Thanks
    1
    Thanked 10 Times in 10 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows Symbian S60

    Default Re: Is there any common interface for running applications with arguments?

    Quote Originally Posted by Arsham View Post
    Maybe I could extract the information from what the applications registered in the system's context menu.
    Any suggestions?
    You might be able to do that on some systems. Or simply use the in-built facilities of the system to "send" work to the default receiver of that work. Would of course depend a lot on the specific system you're using.


    Added after 5 minutes:


    Quote Originally Posted by Arsham View Post
    I am making an application which sends a bunch of files to the unknown application to work on them.
    The problem is we don't know what kind of cd burner/archiver is installed, and the application could be run on windows or linux.

    Thanks for the reply.
    Probably your best (simplest, most flexible, most general) bet is to allow the command line to be defined in your app, using substitution variables of some sort (eg, "&file.", "&drive.") to specify where in the command line the variable parms would be inserted. eg:

    glibnix -f &file. -d &drive. -write-upside-down
    Last edited by DanH; 22nd May 2011 at 23:38.

Similar Threads

  1. Problems running applications .exe
    By croussou in forum Installation and Deployment
    Replies: 8
    Last Post: 25th March 2011, 19:07
  2. Running Qt applications on windows
    By Maluko_Da_Tola in forum Newbie
    Replies: 2
    Last Post: 12th September 2010, 21:51
  3. running external applications via QT?
    By cruisx in forum Newbie
    Replies: 1
    Last Post: 11th August 2009, 07:34
  4. Common slot on some widgets [Qt3]
    By Opilki_Inside in forum Newbie
    Replies: 4
    Last Post: 27th March 2006, 15:26
  5. Qt interface running extremely slowly...
    By jazztpt in forum Qt Programming
    Replies: 1
    Last Post: 4th February 2006, 12:12

Tags for this Thread

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.