View Full Version : Running shellscript using pushbutton

3rd May 2011, 11:39

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..


int main(int argc,char **argv)
QApplication app(argc,argv);
QPushButton *button =new QPushButoon("Hello",0);

return app.exec();

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

thanks in advance..

3rd May 2011, 12:41
...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 (http://doc.qt.nokia.com/latest/signalsandslots.html)...
...and have a look e.g. at QProcess...
...also dots are not... everywhere ... meaningful...

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

3rd May 2011, 17:24
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.

3rd May 2011, 18:37
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.