Don't change the size of widgets just because it is in a floating dock

When a QDockWidget was floating on macOS then it would force the size of
various widgets, such as buttons, comboboxes, to be the smallest needed
rather than the size they had when it was docked.

Task-number: QTBUG-7460
Task-number: QTBUG-52354
Change-Id: Id348180934f113f3a9a9ce5622a9af03eed04108
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
This commit is contained in:
Andy Shaw 2016-09-01 11:53:15 +02:00
parent 843247e1c5
commit e2d8c7bf22

View File

@ -1034,6 +1034,8 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg
#if defined(QMAC_QAQUASTYLE_SIZE_CONSTRAIN) || defined(DEBUG_SIZE_CONSTRAINT)
static QAquaWidgetSize qt_aqua_guess_size(const QWidget *widg, QSize large, QSize small, QSize mini)
{
Q_UNUSED(widg);
if (large == QSize(-1, -1)) {
if (small != QSize(-1, -1))
return QAquaSizeSmall;
@ -1049,7 +1051,7 @@ static QAquaWidgetSize qt_aqua_guess_size(const QWidget *widg, QSize large, QSiz
}
#ifndef QT_NO_MAINWINDOW
if (qobject_cast<QDockWidget *>(widg->window()) || qEnvironmentVariableIsSet("QWIDGET_ALL_SMALL")) {
if (qEnvironmentVariableIsSet("QWIDGET_ALL_SMALL")) {
//if (small.width() != -1 || small.height() != -1)
return QAquaSizeSmall;
} else if (qEnvironmentVariableIsSet("QWIDGET_ALL_MINI")) {