diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-03-22 09:08:48 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-03-22 09:08:48 (GMT) |
commit | eb018fdc114f5c4f30c19ad168dd029c8d1e98e8 (patch) | |
tree | 26311609d5064c4bd34692f4774040a4536d301d /src/gui/itemviews | |
parent | e8a56e6d49d93b552786ac2e56e82c3c178eb090 (diff) | |
parent | 6a5431fac659799496df5da3991c1a487d30b476 (diff) | |
download | Qt-eb018fdc114f5c4f30c19ad168dd029c8d1e98e8.zip Qt-eb018fdc114f5c4f30c19ad168dd029c8d1e98e8.tar.gz Qt-eb018fdc114f5c4f30c19ad168dd029c8d1e98e8.tar.bz2 |
Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qt-releng-team
* 'master' of git://scm.dev.nokia.troll.no/qt/qt-releng-team: (378 commits)
Updated DEF files for Symbian
Designer: Remember default of main container's object name.
Designer: Do not translate page object names of QMdiArea.
qmake vcproj generator: do not insert $(INHERIT)
Remove undefined symbol from tst_qwindowsurface.
Fix def files
Changes to driver workarounds.
Switch to raster also when last window is destroyed (on MeeGo).
Fixes detected by the static-check
Fix accidental population of the disk cache with partial content
Fix disk cache interaction for range retrieval HTTP requests.
Fixup license headers in Lighthouse plugins
Fixes: some text fields in PNG image files were not read
Clipboard/Windows: Fix a hang when sending to non-responsive clients.
Mac: add autorelease pools to create_sys
Don't skip remaining events on unhandled events in xcb backend.
PathView doesn't update if preferred highlight range changes.
Image.PreserveAspectFit has unexpected effect on Image's sourceSize
Doc improvement for Image.fillMode.
QDeclarativeView flickers when composited on MeeGo
...
Diffstat (limited to 'src/gui/itemviews')
-rw-r--r-- | src/gui/itemviews/qheaderview.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp index 6359f0b..d6d9536 100644 --- a/src/gui/itemviews/qheaderview.cpp +++ b/src/gui/itemviews/qheaderview.cpp @@ -3274,9 +3274,17 @@ void QHeaderViewPrivate::clear() void QHeaderViewPrivate::flipSortIndicator(int section) { Q_Q(QHeaderView); - bool ascending = (sortIndicatorSection != section - || sortIndicatorOrder == Qt::DescendingOrder); - q->setSortIndicator(section, ascending ? Qt::AscendingOrder : Qt::DescendingOrder); + Qt::SortOrder sortOrder; + if (sortIndicatorSection == section) { + sortOrder = (sortIndicatorOrder == Qt::DescendingOrder) ? Qt::AscendingOrder : Qt::DescendingOrder; + } else { + const QVariant value = model->headerData(section, orientation, Qt::InitialSortOrderRole); + if (value.canConvert(QVariant::Int)) + sortOrder = static_cast<Qt::SortOrder>(value.toInt()); + else + sortOrder = Qt::AscendingOrder; + } + q->setSortIndicator(section, sortOrder); } void QHeaderViewPrivate::cascadingResize(int visual, int newSize) |