Results 1 to 4 of 4

Thread: run a console application through a gui interface

  1. #1
    Join Date
    Feb 2008
    Posts
    3
    Thanks
    2
    Qt products
    Qt3
    Platforms
    Unix/X11

    Question run a console application through a gui interface

    Hi All ,

    I want to execute a shell script in a unix console through the click of button from GUI interface .

    I dont know how to acess & execute a particular shell script from GUI.

    Thanks in advance for your help.

    Regards
    Gurinder

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: run a console application through a gui interface

    Hi, see this thread (it's for Qt 4, but the same technique applies to Qt 3).
    J-P Nurmi

  3. #3
    Join Date
    Feb 2008
    Posts
    3
    Thanks
    2
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: run a console application through a gui interface

    hi

    i tried using Qprocess below is the code
    Qt Code:
    1. QObject *parent;
    2. QString program = "/project/tspgfeip/usr/DCU/gurinder/dcu_regression/gurinder_verif_dcu_tb_vr.11.00.00.12/dcu/tool_data/scripts/run_single";
    3. QStringList arguments;
    4. arguments << "TestSet0";
    5. QProcess *myProcess = new QProcess(parent);
    6. myProcess->start( program,arguments);
    7. }
    To copy to clipboard, switch view to plain text mode 
    it gives following error
    form1.ui.h:1062: no matching function for call to `QProcess::start(QStringList&
    )'
    /usr/lib64/qt-3.1/include/qprocess.h:77: candidates are: virtual bool
    QProcess::start(QStringList* = 0)
    make: *** [.obj/form1.o] Error 1

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: run a console application through a gui interface

    You're attempting to use QProcess the way it works in Qt 4. You're using Qt 3 so you should read docs of Qt 3: QProcess.

    PS. Do NOT pass an uninitialized pointer as parent!
    J-P Nurmi

  5. The following user says thank you to jpn for this useful post:

    gurinder (6th February 2008)

Similar Threads

  1. Replies: 8
    Last Post: 28th January 2015, 09:45
  2. QSkinWindows Classes
    By kernel_panic in forum Qt-based Software
    Replies: 45
    Last Post: 20th April 2010, 12:35
  3. Console application suspense
    By TheGrimace in forum Newbie
    Replies: 6
    Last Post: 1st October 2007, 14:52
  4. dll + application
    By fpujol in forum Qt Programming
    Replies: 11
    Last Post: 15th April 2007, 18:37
  5. build a gui ontop of a console application
    By aegis in forum Qt Programming
    Replies: 3
    Last Post: 25th March 2007, 12:16

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.