View Single Post
Venemo's Avatar
Posts: 1,296 | Thanked: 1,773 times | Joined on Aug 2009 @ Budapest, Hungary
#55
Originally Posted by D-Iivil View Post
That might work, but when using progress.exec() it won't launch the script until the progress-dialog has finished (or has been canceled by user). Only way to get the script to be executed while dialog is open is to use progress.show() and then launch the script, but then I won't see the progressbar, but that's not a big deal anymore since the script runs pretty fast and notifications are informing the user that something is happening.
Create a pointer to the dialog in the class in your header file.
Code:
QProgressDialog *myProgressDialog;
In your constructor, assign a value to it, but don't show it yet.
Code:
myProgressDialog = new QProgressDialog(this);
When you start the QProcess, show the dialog.
Code:
myProgressDialog->show();
When the finished() slot of the QProcess is fired, hide the dialog.
Code:
myProgressDialog->hide();
You may also want to set this to provide a little better look and feel:
Code:
myProgressDialog->setAttribute(Qt::WA_Maemo5ShowProgressIndicator, true);
This will cause the dialog's title to show the small progress indicator circling stuff.
This requires QT += maemo5 in your .pro file and #include <QtMaemo5> in your cpp file.

If you happen to be on IRC, contact me. I can help.

Last edited by Venemo; 2010-07-17 at 09:46.
 

The Following 3 Users Say Thank You to Venemo For This Useful Post: