The window manager has to get a chance to process the message queue in order
to show the Progress Indicator. It works not because is outside the if but
because it is before you show the dialog window. 

One possible approach is to set the progress indicator but start the
"processing" using a QTimer::singleShot... this will give the window manager
time to process the queue and show the progress indicator.

To double check you can just remove the "
QWidget::setAttribute(Qt::WA_Maemo5ShowProgressIndicator, false);" from your
first example and you will notice that after the processing is done you will
see the progress indicator.


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Sascha Mäkelä
Sent: Monday, June 07, 2010 5:25 PM
To: maemo-developers
Subject: Strange problem with Maemo5ShowProgressIndicator

Hi,
I'm having a strange problem with Maemo5ShowProgressIndicator. My code
looks like this:

    QMessageBox::StandardButton reply;
    reply = QMessageBox::warning(this, tr("Warning!"),
                                 QMessageBox::Yes | QMessageBox::No);
    if (reply == QMessageBox::Yes) {
        QWidget::setAttribute(Qt::WA_Maemo5ShowProgressIndicator, true);
        // do something...
        QWidget::setAttribute(Qt::WA_Maemo5ShowProgressIndicator, false);
    }

I get no progress indicator with the previous code. However, when I
take it out from the IF statement, it does work. Looking like this:

    QWidget::setAttribute(Qt::WA_Maemo5ShowProgressIndicator, true);
    QMessageBox::StandardButton reply;
    reply = QMessageBox::warning(this, tr("Warning!"),
                                 QMessageBox::Yes | QMessageBox::No);
    if (reply == QMessageBox::Yes) {
        // do something...
        QWidget::setAttribute(Qt::WA_Maemo5ShowProgressIndicator, false);
    }

But of course this way the indicator starts too early or shouldn't
start at all. Am I doing something wrong?

Cheers,

Sascha
_______________________________________________
maemo-developers mailing list
[email protected]
https://lists.maemo.org/mailman/listinfo/maemo-developers

_______________________________________________
maemo-developers mailing list
[email protected]
https://lists.maemo.org/mailman/listinfo/maemo-developers

Reply via email to