diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/itemviews/qheaderview.cpp | 14 | ||||
-rw-r--r-- | src/gui/painting/qdrawingprimitive_sse2_p.h | 8 |
2 files changed, 15 insertions, 7 deletions
diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp index 7eb3ddc..754e8b5 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) diff --git a/src/gui/painting/qdrawingprimitive_sse2_p.h b/src/gui/painting/qdrawingprimitive_sse2_p.h index d8f6bf5..64f17d2 100644 --- a/src/gui/painting/qdrawingprimitive_sse2_p.h +++ b/src/gui/painting/qdrawingprimitive_sse2_p.h @@ -78,7 +78,7 @@ QT_BEGIN_NAMESPACE pixelVectorAG = _mm_mullo_epi16(pixelVectorAG, alphaChannel); \ pixelVectorRB = _mm_mullo_epi16(pixelVectorRB, alphaChannel); \ \ - /* 3. devide by 255, that's the tricky part. \ + /* 3. divide by 255, that's the tricky part. \ we do it like for BYTE_MUL(), with bit shift: X/255 ~= (X + X/256 + rounding)/256 */ \ /** so first (X + X/256 + rounding) */\ pixelVectorRB = _mm_add_epi16(pixelVectorRB, _mm_srli_epi16(pixelVectorRB, 8)); \ @@ -86,7 +86,7 @@ QT_BEGIN_NAMESPACE pixelVectorAG = _mm_add_epi16(pixelVectorAG, _mm_srli_epi16(pixelVectorAG, 8)); \ pixelVectorAG = _mm_add_epi16(pixelVectorAG, half); \ \ - /** second devide by 256 */\ + /** second divide by 256 */\ pixelVectorRB = _mm_srli_epi16(pixelVectorRB, 8); \ /** for AG, we could >> 8 to divide followed by << 8 to put the \ bytes in the correct position. By masking instead, we execute \ @@ -129,7 +129,7 @@ QT_BEGIN_NAMESPACE } // Basically blend src over dst with the const alpha defined as constAlphaVector. -// nullVector, half, one, colorMask are constant accross the whole image/texture, and should be defined as: +// nullVector, half, one, colorMask are constant across the whole image/texture, and should be defined as: //const __m128i nullVector = _mm_set1_epi32(0); //const __m128i half = _mm_set1_epi16(0x80); //const __m128i one = _mm_set1_epi16(0xff); @@ -186,7 +186,7 @@ QT_BEGIN_NAMESPACE } // Basically blend src over dst with the const alpha defined as constAlphaVector. -// nullVector, half, one, colorMask are constant accross the whole image/texture, and should be defined as: +// nullVector, half, one, colorMask are constant across the whole image/texture, and should be defined as: //const __m128i nullVector = _mm_set1_epi32(0); //const __m128i half = _mm_set1_epi16(0x80); //const __m128i one = _mm_set1_epi16(0xff); |