summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qwindowsvistastyle.cpp
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2014-05-23 23:49:38 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-26 11:03:15 +0200
commitf7af9fb63244b114653c157d3eef3e6c64f3196a (patch)
treeac20f6d0b57f6d82ff2557ebc6e571012526ad0f /src/widgets/styles/qwindowsvistastyle.cpp
parent92c6bfa0b238614db328bdc7a57cd0390adc95a5 (diff)
Account for the sort indicator being placed above the text on Vista
In WindowsVista style and later the sort indicator is placed above the text as opposed to alongside it. Therefore the extra space given is moved to the common style allowing styles that have it placed differently to easily ensure it is not included. Task-number: QTBUG-19915 Change-Id: Ic21fcc1d95f4c3cc2eb9c465e1c8afb9b805389a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/widgets/styles/qwindowsvistastyle.cpp')
-rw-r--r--src/widgets/styles/qwindowsvistastyle.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp
index 9c3e1eac99..bc78ea3296 100644
--- a/src/widgets/styles/qwindowsvistastyle.cpp
+++ b/src/widgets/styles/qwindowsvistastyle.cpp
@@ -1970,6 +1970,19 @@ QSize QWindowsVistaStyle::sizeFromContents(ContentsType type, const QStyleOption
sz -= QSize(2*border, 2*border);
}
return sz;
+ case CT_HeaderSection:
+ {
+ // When there is a sort indicator it adds to the width but it is shown
+ // above the text natively and not on the side
+ if (QStyleOptionHeader *hdr = qstyleoption_cast<QStyleOptionHeader *>(const_cast<QStyleOption *>(option))) {
+ QStyleOptionHeader::SortIndicator sortInd = hdr->sortIndicator;
+ hdr->sortIndicator = QStyleOptionHeader::None;
+ sz = QWindowsXPStyle::sizeFromContents(type, hdr, size, widget);
+ hdr->sortIndicator = sortInd;
+ return sz;
+ }
+ break;
+ }
default:
break;
}