diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2014-11-14 17:37:34 +0100 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2014-12-09 07:48:58 +0100 |
commit | b5f8502c129c20b3aa3234a3e1c251102d36cdba (patch) | |
tree | 7956bab915737e29d908e8c429bd49cce106005d /src | |
parent | 1b548faa773a2346a63c018dcd6f6756742a2f65 (diff) |
Styles: improve SH_Header_ArrowAlignment handling
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 <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/widgets/styles/qcommonstyle.cpp | 5 | ||||
-rw-r--r-- | src/widgets/styles/qstyle.cpp | 3 | ||||
-rw-r--r-- | src/widgets/styles/qwindowsvistastyle.cpp | 3 |
3 files changed, 9 insertions, 2 deletions
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; |