From b5f8502c129c20b3aa3234a3e1c251102d36cdba Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Fri, 14 Nov 2014 17:37:34 +0100 Subject: Styles: improve SH_Header_ArrowAlignment handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The docs were wrong, and the returned values from some styles did not match reality, so fix that. Again, this style hint was not used at all within QWidgets... Task-number: QTBUG-629 Change-Id: Ie6ff80fd09bc3292ba3d787ccca4d6f4c0056e89 Reviewed-by: Friedemann Kleint Reviewed-by: Thorbjørn Lund Martsum --- src/widgets/styles/qcommonstyle.cpp | 5 ++++- src/widgets/styles/qstyle.cpp | 3 ++- src/widgets/styles/qwindowsvistastyle.cpp | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src/widgets/styles') diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 1c5dcf5f0a..aeffa6195d 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -4907,10 +4907,13 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget case SH_TabBar_Alignment: - case SH_Header_ArrowAlignment: ret = Qt::AlignLeft; break; + case SH_Header_ArrowAlignment: + ret = Qt::AlignRight | Qt::AlignVCenter; + break; + case SH_TitleBar_AutoRaise: ret = false; break; diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp index 856ec271fb..ba5bd717b6 100644 --- a/src/widgets/styles/qstyle.cpp +++ b/src/widgets/styles/qstyle.cpp @@ -1663,7 +1663,8 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, \value SH_Header_ArrowAlignment The placement of the sorting indicator may appear in list or table headers. Possible values - are Qt::Left or Qt::Right. + are Qt::Alignment values (that is, an OR combination of + Qt::AlignmentFlag flags). \value SH_Slider_SnapToValue Sliders snap to values while moving, as they do on Windows. diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp index 463b120e04..42a85e8f64 100644 --- a/src/widgets/styles/qwindowsvistastyle.cpp +++ b/src/widgets/styles/qwindowsvistastyle.cpp @@ -2112,6 +2112,9 @@ int QWindowsVistaStyle::styleHint(StyleHint hint, const QStyleOption *option, co else ret = -1; break; + case SH_Header_ArrowAlignment: + ret = Qt::AlignTop | Qt::AlignHCenter; + break; default: ret = QWindowsXPStyle::styleHint(hint, option, widget, returnData); break; -- cgit v1.2.3