Results 1 to 5 of 5

Thread: Opening a program instead of a file

  1. #1
    Join Date
    Jan 2010
    Posts
    20
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Opening a program instead of a file

    I'm wondering if there is a way to open a program instead of a file using python, qt, or qt4 designer? For example, I would like to have a button in my GUI that when clicked, it opens a media player. Thx.

  2. #2
    Join Date
    Jan 2009
    Location
    The Netherlands and Spain
    Posts
    150
    Thanks
    6
    Thanked 18 Times in 18 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Opening a program instead of a file

    You can use QProcess to do that.

  3. #3
    Join Date
    Jan 2010
    Posts
    20
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Opening a program instead of a file

    Ok, great, I will look up that function in the docs. Thank you!

  4. #4
    Join Date
    Jan 2010
    Posts
    20
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Opening a program instead of a file

    For future reference for anyone else with this question, I have attached some simple code for being able to open programs:

    Qt Code:
    1. def process(self):
    2. p = QtCore.QProcess(self)
    3. p.setWorkingDirectory('/usr/bin/vlc') #this is where your program is located
    4. p.start('vlc') #p.start('insert program name here')
    To copy to clipboard, switch view to plain text mode 

  5. #5
    Join Date
    Jan 2010
    Posts
    20
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Opening a program instead of a file

    I have another question, is there a way to embed the video within a created GUI? Instead of just opening a media player in another window?

Similar Threads

  1. Launch app by opening a file
    By Windsoarer in forum Qt Programming
    Replies: 2
    Last Post: 28th May 2009, 06:22
  2. Problem in opening a file
    By Abc in forum Qt Programming
    Replies: 2
    Last Post: 12th August 2008, 12:40
  3. Opening pdf file in Qt application
    By jyoti kumar in forum Qt Programming
    Replies: 2
    Last Post: 20th June 2007, 18:35
  4. Opening file
    By Salazaar in forum Newbie
    Replies: 5
    Last Post: 5th June 2007, 18:15
  5. How to rename a file after opening ?
    By npc in forum Newbie
    Replies: 2
    Last Post: 1st June 2006, 13:36

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.