Results 1 to 4 of 4

Thread: Running shellscript using pushbutton

  1. #1
    SysExp Guest

    Default Running shellscript using pushbutton

    Hi...

    I m new to Qt...Ma platform is Fedora 13 ..nd using Qt3..
    I want to run a shell script that is in ma home directory "hello.sh"..its juz a trial ...the script on running wil print the account status information in the terminal..
    now i jus want to gve a button to this script so tht, it wil print the output in the terminal whn the push button is clicked..

    Qt Code:
    1. #include<qapplication.sh>
    2. #include<qpushbutton.sh>
    3.  
    4. int main(int argc,char **argv)
    5. {
    6. QApplication app(argc,argv);
    7. QPushButton *button =new QPushButoon("Hello",0);
    8.  
    9. app.setMainWidget(button);
    10. button->show();
    11. return app.exec();
    12. }
    To copy to clipboard, switch view to plain text mode 

    wht else should i add to meet ma purpose?? .. pls tell me the code..

    thanks in advance..
    Last edited by Lykurg; 3rd May 2011 at 12:36.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Running shellscript using pushbutton

    ...we have [code] tags here to format source code that it is more readable...
    ...you create a memory leak...
    ...you should use...let's say signal and slots...
    ...and have a look e.g. at QProcess...
    ...also dots are not... everywhere ... meaningful...


    p.s. asking for "the code" is very counterproductive!

  3. #3
    SysExp Guest

    Default Re: Running shellscript using pushbutton

    Thank u for ur reply.
    Bt i m finding it difficult to understand the concept of signals nd slots.
    thts y i askd for the xact code.

  4. #4
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Running shellscript using pushbutton

    We don't do things FOR you here, we HELP *YOU* to do them.

    Also, you stand more chance of a decent reply if you speak proper english and not things like "its juz a trial", "meet ma purpose??", "pls tell me the code", etc. That kind of writing is more likely to just get your posts ignored.

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


Similar Threads

  1. pushButton and toolButton
    By lucasbemo in forum Newbie
    Replies: 4
    Last Post: 11th February 2013, 09:37
  2. Replies: 3
    Last Post: 29th April 2011, 13:15
  3. Replies: 3
    Last Post: 29th April 2011, 08:54
  4. how to reshape pushbutton??
    By anupamgee in forum Qt Programming
    Replies: 2
    Last Post: 24th April 2009, 12:37
  5. Replies: 1
    Last Post: 17th May 2006, 00:23

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
  •  
Qt is a trademark of The Qt Company.