forked from qt-creator/qt-creator
ManhattanStyle: Fix size of field in form layouts on OS X
The default in QMacStyle, to use FieldsStayAtSizeHint, just almost always is the wrong thing to do. Additionally this goes undetected for a while most of the time, because most people do not run their code on OS X. Override it globally to AllNonFixedFieldsGrow like in other shipped styles. Task-number: QTCREATORBUG-14337 Change-Id: I3b0719c0201871fbf0163b54b1a54823bf5d14f3 Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
#include <QApplication>
|
||||
#include <QComboBox>
|
||||
#include <QDockWidget>
|
||||
#include <QFormLayout>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QMenuBar>
|
||||
@@ -372,6 +373,11 @@ int ManhattanStyle::styleHint(StyleHint hint, const QStyleOption *option, const
|
||||
if (activationMode.isValid())
|
||||
ret = activationMode.toBool();
|
||||
}
|
||||
case QStyle::SH_FormLayoutFieldGrowthPolicy:
|
||||
// The default in QMacStyle, FieldsStayAtSizeHint, is just always the wrong thing
|
||||
// Use the same as on all other shipped styles
|
||||
if (Utils::HostOsInfo::isMacHost())
|
||||
ret = QFormLayout::AllNonFixedFieldsGrow;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user