summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/dialogs/qprogressdialog.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/widgets/dialogs/qprogressdialog.cpp b/src/widgets/dialogs/qprogressdialog.cpp
index 35a75adea2..bcfdb03f2f 100644
--- a/src/widgets/dialogs/qprogressdialog.cpp
+++ b/src/widgets/dialogs/qprogressdialog.cpp
@@ -505,9 +505,17 @@ void QProgressDialog::setBar(QProgressBar *bar)
}
delete d->bar;
d->bar = bar;
+ if (bar) {
+ if (bar->parentWidget() == this)
+ bar->hide(); // until we resize
+ else
+ bar->setParent(this, 0);
+ }
int w = qMax(isVisible() ? width() : 0, sizeHint().width());
int h = qMax(isVisible() ? height() : 0, sizeHint().height());
resize(w, h);
+ if (bar)
+ bar->show();
}