PDA

View Full Version : Running shellscript using pushbutton



SysExp
3rd May 2011, 11:39
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..


#include<qapplication.sh>
#include<qpushbutton.sh>

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

app.setMainWidget(button);
button->show();
return app.exec();
}

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

thanks in advance..

Lykurg
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!

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

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