![]() |
2010-07-17
, 08:22
|
Posts: 180 |
Thanked: 76 times |
Joined on May 2010
|
#51
|
![]() |
2010-07-17
, 09:26
|
|
Posts: 2,154 |
Thanked: 2,186 times |
Joined on Dec 2009
@ Hellsinki, Finland
|
#52
|
I'm not sure what's wrong. I tried this code (without executing any script) and it worked:
Code:QProgressDialog progress("Setting up the theme, please wait...", "Abort", 0, 0, this); progress.setWindowModality(Qt::WindowModal); progress.exec();
The Following User Says Thank You to d-iivil For This Useful Post: | ||
![]() |
2010-07-17
, 09:32
|
Posts: 353 |
Thanked: 263 times |
Joined on Dec 2009
@ Finland
|
#53
|
setAttribute(Qt::WA_Maemo5ShowProgressIndicator, true); // needs "#include <QtMaemo5>"
![]() |
2010-07-17
, 09:42
|
|
Posts: 2,154 |
Thanked: 2,186 times |
Joined on Dec 2009
@ Hellsinki, Finland
|
#54
|
You can also use the progress indicator in the top bar:
And when script is done set it back to false.Code:setAttribute(Qt::WA_Maemo5ShowProgressIndicator, true); // needs "#include <QtMaemo5>"
![]() |
2010-07-17
, 09:44
|
|
Posts: 1,296 |
Thanked: 1,773 times |
Joined on Aug 2009
@ Budapest, Hungary
|
#55
|
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.
QProgressDialog *myProgressDialog;
myProgressDialog = new QProgressDialog(this);
myProgressDialog->show();
myProgressDialog->hide();
myProgressDialog->setAttribute(Qt::WA_Maemo5ShowProgressIndicator, true);
The Following 3 Users Say Thank You to Venemo For This Useful Post: | ||
![]() |
2010-07-17
, 09:44
|
Posts: 353 |
Thanked: 263 times |
Joined on Dec 2009
@ Finland
|
#56
|
QT += maemo5
The Following 2 Users Say Thank You to TNiga For This Useful Post: | ||
![]() |
2010-07-17
, 10:08
|
Posts: 180 |
Thanked: 76 times |
Joined on May 2010
|
#57
|
QProcess *process = new QProcess(this); process->start(program, arguments); progress.exec();
![]() |
2010-07-17
, 12:18
|
|
Posts: 2,154 |
Thanked: 2,186 times |
Joined on Dec 2009
@ Hellsinki, Finland
|
#58
|
You can change QProcess::execute() to QProcess::start() which doesn't wait for process to finish.
Code:QProcess *process = new QProcess(this); process->start(program, arguments); progress.exec();
arguments << ui->Transition->currentText() << ui->Font->currentText() << ui->Color->currentText() << ui->checkBoxActivate->checkState();
![]() |
2010-07-17
, 12:24
|
Posts: 180 |
Thanked: 76 times |
Joined on May 2010
|
#59
|
Got the progress bar working with this. Allthough it never close itself even my script has finished it's job. How can I tell from shell script to the QT app that it's now done, close the dialog? My script has this on the last line: exit 0
connect(process, SIGNAL(finished(int), this, SLOT(processFinished(int));
MainWindow::processFinished(int exitCode) { //Do something }
![]() |
2010-07-17
, 12:28
|
Posts: 353 |
Thanked: 263 times |
Joined on Dec 2009
@ Finland
|
#60
|
Got the progress bar working with this. Allthough it never close itself even my script has finished it's job. How can I tell from shell script to the QT app that it's now done, close the dialog? My script has this on the last line: exit 0
And one more thing, how can I read a checkbox value to arguments? I tried to do it like this (check box is the last argument):
But I'm getting this build issue:Code:arguments << ui->Transition->currentText() << ui->Font->currentText() << ui->Color->currentText() << ui->checkBoxActivate->checkState();
no match for 'operator <<'
What did I do wrong (again)?
QString checkboxstate; if ( ui->checkBoxActivate->checkState() == Qt::Checked ) { checkboxstate = "ARGUMENT WHEN CHECKED"; } else { checkboxstate = "ARGUMENT WHEN NOT CHECKED"; } arguments << ui->Transition->currentText() << ui->Font->currentText() << ui->Color->currentText() << checkboxstate;
The Following User Says Thank You to TNiga For This Useful Post: | ||