summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qcommonstyle.cpp
diff options
context:
space:
mode:
authorAlexander Volkov <a.volkov@rusbitech.ru>2014-11-12 17:13:22 +0300
committerAlexander Volkov <a.volkov@rusbitech.ru>2014-12-11 10:26:41 +0100
commit53022e04bb578c12cdc9460d7ce4eedefbc8c2e4 (patch)
tree8c70e70662ee3cb7e7922bb121f42119d570b195 /src/widgets/styles/qcommonstyle.cpp
parent6386bafb40f9d172f80d20cac824b7018e0a37a4 (diff)
Make the defaultSectionSize property of QHeaderView style dependent
Add new enum items PM_HeaderDefaultSectionSizeHorizontal and PM_HeaderDefaultSectionSizeVertical to QStyle and get corresponding values in QHeaderView. This way we get rid of some magic constants in QHeaderView and we can have reasonable values for the default section size for high-DPI displays. [ChangeLog][QtWidgets][QHeaderView] Default section size is now style-dependent by default. [ChangeLog][QtWidgets][QHeaderView] Added resetDefaultSectionSize(). Change-Id: I44e152c5cf0bec1e5d78e1e62f47a2d1f761dfbf Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Diffstat (limited to 'src/widgets/styles/qcommonstyle.cpp')
-rw-r--r--src/widgets/styles/qcommonstyle.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index 6b8cba1b18..29df1c6387 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -4592,6 +4592,12 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid
case PM_HeaderGripMargin:
ret = int(QStyleHelper::dpiScaled(4.));
break;
+ case PM_HeaderDefaultSectionSizeHorizontal:
+ ret = int(QStyleHelper::dpiScaled(100.));
+ break;
+ case PM_HeaderDefaultSectionSizeVertical:
+ ret = int(QStyleHelper::dpiScaled(30.));
+ break;
case PM_TabBarScrollButtonWidth:
ret = int(QStyleHelper::dpiScaled(16.));
break;