PDA

View Full Version : Using QProcess..........



sar_van81
9th December 2006, 04:30
hi....

i had created an application which has pushbuttons. when i click a pushbutton, a web browser should open(i had built konqueror embedded web browser compiled with qvfb option). this is my requirement. but when i execute the program, the web browser opens,but website is not displayed,instead a blank page is displayed. when i close the application, the webpage is displayed...

can anyone say me why is that so...?any suggestions and solutions fro this...?

thanks in advance......

wysota
9th December 2006, 08:06
We'd have to see the code you used to open the page.

sar_van81
9th December 2006, 12:48
hi

i'm sending the code............

wysota
9th December 2006, 15:39
void keyclass::enter()
{

QProcess process(QString("/home/kdeprograms/konqueror/konqueror3-embedded-0.2-20060121/konq-embed/src/konqueror"));
process.addArgument("http://www.yahoo.com");
process.start();
}
You create the process on the stack. QProcess::start() doesn't block the flow until the process exits but instead just schedules its start and continues the program. At that time the function returns and the process gets destroyed before it even had a chance to start. To avoid it, you have to create the process on heap.

sar_van81
9th December 2006, 16:44
hi....

thanks for the reply. can you say me how create the process on a heap...?

wysota
9th December 2006, 18:04
Using operator "new".

QProcess *process = new QProcess(this);

sar_van81
11th December 2006, 09:18
hi...

thank you for the reply. i'l try that and will let you know..

sar_van81
12th December 2006, 04:36
hi....

thank you. i finally got it working.....