ssk
ssk

Reputation: 9255

QProgressDialog don't show up in the front

I have a QProgressDialog that needs to be popped up when application does the updates. It keeps hiding behind the windows.

            dialog->setWindowTitle("Test");
            QLabel * labl  = new QLabel(this);
            labl->setPixmap(QPixmap("icon.png"));
            labl->setText("");
            dialog->setLabel(labl);
            dialog->setCancelButton(NULL);
            dialog->show();

Am I doing something wrong here?

Upvotes: 0

Views: 3501

Answers (2)

Joe Staines
Joe Staines

Reputation: 321

I had this same problem, when i had a modal QDialog and a QProgressDialog and the QDialog would always be on top despite the QProgressDialog coming from the QDialog itself. The issue was the lack of a parent assigned to QProgressDialog; just make sure that you assign the widget that spawns the QProgressDialog to be the parent.

Upvotes: 0

KCiebiera
KCiebiera

Reputation: 820

As a matter of fact you haven't provided enough information to solve the problem, my guess is you have forgotten to raise your dialog (because it was created and hidden earlier). So try to change the code to:

....
dialog->show();
dialog->raise();
dialog->activateWindow();
....

Upvotes: 2

Related Questions