Results 1 to 5 of 5

Thread: a program to start another program.

  1. #1
    Join Date
    Aug 2009
    Posts
    10
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question a program to start another program.

    Hello.
    I try from my program to start another program....
    with a function to call another program.
    can be done?
    only for linux, thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: a program to start another program.

    Use QProcess.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    zakis (8th December 2009)

  4. #3
    Join Date
    Aug 2009
    Posts
    10
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: a program to start another program.

    hi guys..

    i use this code to play music with VLC
    Qt Code:
    1. QString prog = "vlc";
    2. QStringList arguments;
    3. arguments<< "play" << "/home/zakis/dokimi/sound/./ll.pls";
    4. QProcess* process = new QProcess(this);
    5. process->start(prog , arguments);
    6. process->waitForFinished();
    7. process->close();
    To copy to clipboard, switch view to plain text mode 

    how i close the vlc to continue my app?

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: a program to start another program.

    You don't. You can kill it of course, if you want but VLC is probably a quite bad way of playing music from within your application. Phonon would be much better (which is what VLC is probably using too).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #5
    Join Date
    Aug 2009
    Posts
    10
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: a program to start another program.

    thanks again ...
    I read about the Phonon library but it's big for my job
    Finally install NAS and use the QSound

Similar Threads

  1. add a program to start menu
    By kpmsivachand in forum KDE Forum
    Replies: 1
    Last Post: 26th January 2009, 20:19
  2. How to hide mainwindow at program start up
    By palmer in forum Qt Programming
    Replies: 4
    Last Post: 13th September 2008, 14:35
  3. QProcess start a console program
    By Shawn in forum Qt Programming
    Replies: 2
    Last Post: 9th November 2007, 12:38
  4. I start a external fortram program, how to terminate?
    By dolphins in forum Qt Programming
    Replies: 3
    Last Post: 28th October 2007, 13:07
  5. QT MySQL
    By sabeeshcs in forum Newbie
    Replies: 6
    Last Post: 12th January 2007, 04:19

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.