diff options
author | Jens Bache-Wiig <jens.bache-wiig@digia.com> | 2014-03-31 16:42:56 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-09 11:01:16 +0200 |
commit | 112b8e49c291a2ee6a1d67dccf368e53c9bd19cd (patch) | |
tree | c1d357b00222193697853a0f72826e30992a15b2 | |
parent | 9cfdd66b6452704349b5f986f31b7f1f03748cb5 (diff) |
Fix widget margins on Mac with style sheets
Previously we have rejected this issue as you can work around it
by setting Qt::WA_LayoutUsesWidgetRect per widget. However there
is no reason to apply the negative mac style layout margins on any
custom style so I think we should completely bypass it unless the
native border is used.
Task-number: QTBUG-13050
Change-Id: I8923e07d868c51a13587993c9b2ce79c51beaeee
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
-rw-r--r-- | src/widgets/styles/qstylesheetstyle.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index 5eea903773..a22d0a3dca 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -5805,6 +5805,25 @@ QRect QStyleSheetStyle::subElementRect(SubElement se, const QStyleOption *opt, c break; #endif //QT_NO_TOOLBAR + // On mac we make pixel adjustments to layouts which are not + // desireable when you have custom style sheets on them + case SE_CheckBoxLayoutItem: + case SE_ComboBoxLayoutItem: + case SE_DateTimeEditLayoutItem: + case SE_LabelLayoutItem: + case SE_ProgressBarLayoutItem: + case SE_PushButtonLayoutItem: + case SE_RadioButtonLayoutItem: + case SE_SliderLayoutItem: + case SE_SpinBoxLayoutItem: + case SE_ToolButtonLayoutItem: + case SE_FrameLayoutItem: + case SE_GroupBoxLayoutItem: + case SE_TabWidgetLayoutItem: + if (!rule.hasNativeBorder()) + return opt->rect; + break; + default: break; } |