Forked from: http://www.qtcentre.org/forum/f-qt-d...-qt4-4108.html
THANK YOU VERY MUCH
I WAS ABLE TO RUN THE APPLICATION ATLAST ....
I need to first start some processes fromthe mother application ( dialog) on the clickof the pushbutton. I tried the Q process but it didnot work out.Then I resorted to System call . This I know is not a clean process but just to check the slot thing I have put this now.
my code snippet is as
you see above the okbutton on being clicked gives signal to slot test() .test() function has system call to launch picture viewer to show the file stego.jpg.steg::steg(QWidget *parent)
: QDialog(parent)
{
ui.setupUi(this);
connect(ui.okButton, SIGNAL(clicked()), this, SLOT(test()));
connect(ui.cancelButton, SIGNAL(clicked()), this, SLOT(open_file()));
}
void steg::test()
{
system("e:\"\"\"stego.jpg");
}
Canyou suggest a better method to do this task.
Secondly I need to create , open , write , execute and close the file very often in my program on the click of buttons.
i tried the following snippets
this is simple c code .But when i run the program it crashes.void steg::writeinfile()
{
char eog_comand[]= "eog";
char space[]= " ";
FILE *fp;
fp = fopen ("e:\"\"\"trial.txt", "w+");
fputs (eog_comand,fp);
fputs (space,fp);
fclose(fp);
}
I tried Qfile commands
But that alsodoesnot workvoid steg::writeinfile()
{
QFile file;
file.setFileName("e:\"\"\"trial.txt");
file.open(QIODevice::WriteOnly);
file.write(msg, qstrlen(msg)); // write to stderr
file.close();
}
Someguidance please.
Bookmarks