LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 01-29-2005, 05:06 AM   #1
nunation
LQ Newbie
 
Registered: Nov 2004
Posts: 7

Rep: Reputation: 0
Opening an external application using Qprocess in QT designer


I have used qt to create a form with a button. Upon clicking the button, I hope to be able to start the xsane application. I would be very grateful if anybody could walk me step by step on how to do such a task on QT designer. Inclusion of codes would help a lot since I am new to programming
 
Old 01-29-2005, 07:41 AM   #2
nixcraft
Member
 
Registered: Nov 2004
Location: BIOS
Distribution: RHEL3.0, FreeBSD 5.x, Debian 3.x, Soaris x86 v10
Posts: 379

Rep: Reputation: 30
Use QT's QProcess class
Code:
        // new process can be started using QProcess
        QProcess *proc = new QProcess( this );
      // this is command you need to start aka process
        proc->addArgument( "konsole" );

        if ( !proc->start() ) {  // look for error
              QErrorMessage *m = new QErrorMessage(this);
              m->message("Failed to start KDE konsole process");
        }
  // rest of code
Read QProcess help in QT Assitant

Happy coding!
 
Old 01-29-2005, 05:26 PM   #3
nunation
LQ Newbie
 
Registered: Nov 2004
Posts: 7

Original Poster
Rep: Reputation: 0
Do I have to put the code into the buttons slot??

Thank you very much. There is still another problem. I'd like to know whether I have to put the code in the button's slot in Designer so that when I click it, the application would open. Thank you
 
Old 01-30-2005, 03:39 AM   #4
nixcraft
Member
 
Registered: Nov 2004
Location: BIOS
Distribution: RHEL3.0, FreeBSD 5.x, Debian 3.x, Soaris x86 v10
Posts: 379

Rep: Reputation: 30
You need to create new slot i.e. your fuction in Designer and then connect it with button and then put code in that slot
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Do you use QT designer? DJOtaku Programming 6 04-24-2005 05:56 PM
how i migrate windows application to Linux base application vandarakalpesh Linux - Software 0 06-26-2004 04:34 AM
Opening file with default application from shell script? bourbon_beast Programming 4 04-13-2004 02:52 AM
qt designer nitk Linux - Newbie 1 11-03-2003 10:04 AM
qt designer help.......... nitk Linux - Software 2 10-30-2003 10:22 AM


All times are GMT -5. The time now is 05:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration