Allow to minimize frameless MDI subwindows

It is possible to create a frameless QMdiSubWindow to customize its title,
but currently we can not minimize it because it disappears in result.

This fix turn on minimizing of frameless MDI subwindows and exclude
hiding of base widget in this case, so we can display shaded window correctly.

Change-Id: I62c417b24e8528cf033fe5edce163d2eb46a4994
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
Serge Lysenko 2015-08-28 16:33:41 +03:00
parent 4555c94599
commit b1dac5efce
2 changed files with 3 additions and 3 deletions

View File

@ -380,7 +380,7 @@ void IconTiler::rearrange(QList<QWidget *> &widgets, const QRect &domain) const
return;
const int n = widgets.size();
const int width = widgets.at(0)->width();
const int width = qMax(widgets.at(0)->width(), 1);
const int height = widgets.at(0)->height();
const int ncols = qMax(domain.width() / width, 1);
const int nrows = n / ncols + ((n % ncols) ? 1 : 0);
@ -938,7 +938,7 @@ void QMdiAreaPrivate::rearrange(Rearranger *rearranger)
if (!sanityCheck(child, "QMdiArea::rearrange") || !child->isVisible())
continue;
if (rearranger->type() == Rearranger::IconTiler) {
if (child->isMinimized() && !child->isShaded() && !(child->windowFlags() & Qt::FramelessWindowHint))
if (child->isMinimized() && !child->isShaded())
widgets.append(child);
} else {
if (child->isMinimized() && !child->isShaded())

View File

@ -2655,7 +2655,7 @@ void QMdiSubWindow::showShaded()
resize(d->internalMinimumSize);
// Hide the internal widget if not already hidden by the user.
if (d->baseWidget && !d->baseWidget->isHidden()) {
if (d->baseWidget && !d->baseWidget->isHidden() && !(windowFlags() & Qt::FramelessWindowHint)) {
d->baseWidget->hide();
d->isWidgetHiddenByUs = true;
}