diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-12-30 00:26:40 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-12-30 00:26:40 (GMT) |
commit | 735f7ac62a6919bb8ce23cf33c9819af29dd8428 (patch) | |
tree | 1f87b9b0a1f44582855fd0ba1ed90ee7d54056dd /src/gui | |
parent | 9e26955ab926afe1bc3306d5f6fcab0c5dfe4db1 (diff) | |
parent | b7ac9ed56ff8bfb3158d115ea7c6e3eef250f4bc (diff) | |
download | Qt-735f7ac62a6919bb8ce23cf33c9819af29dd8428.zip Qt-735f7ac62a6919bb8ce23cf33c9819af29dd8428.tar.gz Qt-735f7ac62a6919bb8ce23cf33c9819af29dd8428.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
Add compiler optimization for QtScript/JSC on Symbian
improve performance of QTextEngine, esp. setBoundary by using non-detaching operator[]
Improve docs for QTEST_MAIN macro.
Work around an apparent GCC optimiser bug accessing arrays beyond end
Do not crash in case a future version of libdbus has a new kind of message.
Docs: QTBUG-9150 Incorrect snippet in class doc.
tst_headers: make failure more detailed when failing to open a file
Fix number of chapters in qtestlib tutorial.
Fixed QStatusBar not to repaint itself too early
QNAM HTTP: Fix missing error() signal
Make it clear which security updates are needed for Visual Studio 2005.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/math3d/qgenericmatrix.h | 68 | ||||
-rw-r--r-- | src/gui/text/qtextengine.cpp | 14 | ||||
-rw-r--r-- | src/gui/widgets/qstatusbar.cpp | 2 |
3 files changed, 48 insertions, 36 deletions
diff --git a/src/gui/math3d/qgenericmatrix.h b/src/gui/math3d/qgenericmatrix.h index 3224ae2..f91bce7 100644 --- a/src/gui/math3d/qgenericmatrix.h +++ b/src/gui/math3d/qgenericmatrix.h @@ -198,52 +198,58 @@ Q_OUTOFLINE_TEMPLATE QGenericMatrix<M, N, T> QGenericMatrix<N, M, T>::transposed template <int N, int M, typename T> Q_OUTOFLINE_TEMPLATE QGenericMatrix<N, M, T>& QGenericMatrix<N, M, T>::operator+=(const QGenericMatrix<N, M, T>& other) { - for (int index = 0; index < N * M; ++index) - m[0][index] += other.m[0][index]; + for (int row = 0; row < M; ++row) + for (int col = 0; col < N; ++col) + m[col][row] += other.m[col][row]; return *this; } template <int N, int M, typename T> Q_OUTOFLINE_TEMPLATE QGenericMatrix<N, M, T>& QGenericMatrix<N, M, T>::operator-=(const QGenericMatrix<N, M, T>& other) { - for (int index = 0; index < N * M; ++index) - m[0][index] -= other.m[0][index]; + for (int row = 0; row < M; ++row) + for (int col = 0; col < N; ++col) + m[col][row] -= other.m[col][row]; return *this; } template <int N, int M, typename T> Q_OUTOFLINE_TEMPLATE QGenericMatrix<N, M, T>& QGenericMatrix<N, M, T>::operator*=(T factor) { - for (int index = 0; index < N * M; ++index) - m[0][index] *= factor; + for (int row = 0; row < M; ++row) + for (int col = 0; col < N; ++col) + m[col][row] *= factor; return *this; } template <int N, int M, typename T> Q_OUTOFLINE_TEMPLATE bool QGenericMatrix<N, M, T>::operator==(const QGenericMatrix<N, M, T>& other) const { - for (int index = 0; index < N * M; ++index) { - if (m[0][index] != other.m[0][index]) - return false; - } + for (int row = 0; row < M; ++row) + for (int col = 0; col < N; ++col) { + if (m[col][row] != other.m[col][row]) + return false; + } return true; } template <int N, int M, typename T> Q_OUTOFLINE_TEMPLATE bool QGenericMatrix<N, M, T>::operator!=(const QGenericMatrix<N, M, T>& other) const { - for (int index = 0; index < N * M; ++index) { - if (m[0][index] != other.m[0][index]) - return true; - } + for (int row = 0; row < M; ++row) + for (int col = 0; col < N; ++col) { + if (m[col][row] != other.m[col][row]) + return true; + } return false; } template <int N, int M, typename T> Q_OUTOFLINE_TEMPLATE QGenericMatrix<N, M, T>& QGenericMatrix<N, M, T>::operator/=(T divisor) { - for (int index = 0; index < N * M; ++index) - m[0][index] /= divisor; + for (int row = 0; row < M; ++row) + for (int col = 0; col < N; ++col) + m[col][row] /= divisor; return *this; } @@ -251,8 +257,9 @@ template <int N, int M, typename T> Q_OUTOFLINE_TEMPLATE QGenericMatrix<N, M, T> operator+(const QGenericMatrix<N, M, T>& m1, const QGenericMatrix<N, M, T>& m2) { QGenericMatrix<N, M, T> result(1); - for (int index = 0; index < N * M; ++index) - result.m[0][index] = m1.m[0][index] + m2.m[0][index]; + for (int row = 0; row < M; ++row) + for (int col = 0; col < N; ++col) + result.m[col][row] = m1.m[col][row] + m2.m[col][row]; return result; } @@ -260,8 +267,9 @@ template <int N, int M, typename T> Q_OUTOFLINE_TEMPLATE QGenericMatrix<N, M, T> operator-(const QGenericMatrix<N, M, T>& m1, const QGenericMatrix<N, M, T>& m2) { QGenericMatrix<N, M, T> result(1); - for (int index = 0; index < N * M; ++index) - result.m[0][index] = m1.m[0][index] - m2.m[0][index]; + for (int row = 0; row < M; ++row) + for (int col = 0; col < N; ++col) + result.m[col][row] = m1.m[col][row] - m2.m[col][row]; return result; } @@ -284,8 +292,9 @@ template <int N, int M, typename T> Q_OUTOFLINE_TEMPLATE QGenericMatrix<N, M, T> operator-(const QGenericMatrix<N, M, T>& matrix) { QGenericMatrix<N, M, T> result(1); - for (int index = 0; index < N * M; ++index) - result.m[0][index] = -matrix.m[0][index]; + for (int row = 0; row < M; ++row) + for (int col = 0; col < N; ++col) + result.m[col][row] = -matrix.m[col][row]; return result; } @@ -293,8 +302,9 @@ template <int N, int M, typename T> Q_OUTOFLINE_TEMPLATE QGenericMatrix<N, M, T> operator*(T factor, const QGenericMatrix<N, M, T>& matrix) { QGenericMatrix<N, M, T> result(1); - for (int index = 0; index < N * M; ++index) - result.m[0][index] = matrix.m[0][index] * factor; + for (int row = 0; row < M; ++row) + for (int col = 0; col < N; ++col) + result.m[col][row] = matrix.m[col][row] * factor; return result; } @@ -302,8 +312,9 @@ template <int N, int M, typename T> Q_OUTOFLINE_TEMPLATE QGenericMatrix<N, M, T> operator*(const QGenericMatrix<N, M, T>& matrix, T factor) { QGenericMatrix<N, M, T> result(1); - for (int index = 0; index < N * M; ++index) - result.m[0][index] = matrix.m[0][index] * factor; + for (int row = 0; row < M; ++row) + for (int col = 0; col < N; ++col) + result.m[col][row] = matrix.m[col][row] * factor; return result; } @@ -311,8 +322,9 @@ template <int N, int M, typename T> Q_OUTOFLINE_TEMPLATE QGenericMatrix<N, M, T> operator/(const QGenericMatrix<N, M, T>& matrix, T divisor) { QGenericMatrix<N, M, T> result(1); - for (int index = 0; index < N * M; ++index) - result.m[0][index] = matrix.m[0][index] / divisor; + for (int row = 0; row < M; ++row) + for (int col = 0; col < N; ++col) + result.m[col][row] = matrix.m[col][row] / divisor; return result; } diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 3bd6122..17d5fc1 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -894,16 +894,16 @@ void QTextEngine::shapeText(int item) const if (letterSpacingIsAbsolute) glyphs.advances_x[i-1] += letterSpacing; else { - const QFixed advance = glyphs.advances_x[i-1]; - glyphs.advances_x[i-1] += (letterSpacing - 100) * advance / 100; + QFixed &advance = glyphs.advances_x[i-1]; + advance += (letterSpacing - 100) * advance / 100; } } } if (letterSpacingIsAbsolute) glyphs.advances_x[si.num_glyphs-1] += letterSpacing; else { - const QFixed advance = glyphs.advances_x[si.num_glyphs-1]; - glyphs.advances_x[si.num_glyphs-1] += (letterSpacing - 100) * advance / 100; + QFixed &advance = glyphs.advances_x[si.num_glyphs-1]; + advance += (letterSpacing - 100) * advance / 100; } } if (wordSpacing != 0) { @@ -2521,14 +2521,14 @@ void QTextEngine::setBoundary(int strPos) const return; int itemToSplit = 0; - while (itemToSplit < layoutData->items.size() && layoutData->items[itemToSplit].position <= strPos) + while (itemToSplit < layoutData->items.size() && layoutData->items.at(itemToSplit).position <= strPos) itemToSplit++; itemToSplit--; - if (layoutData->items[itemToSplit].position == strPos) { + if (layoutData->items.at(itemToSplit).position == strPos) { // already a split at the requested position return; } - splitItem(itemToSplit, strPos - layoutData->items[itemToSplit].position); + splitItem(itemToSplit, strPos - layoutData->items.at(itemToSplit).position); } void QTextEngine::splitItem(int item, int pos) const diff --git a/src/gui/widgets/qstatusbar.cpp b/src/gui/widgets/qstatusbar.cpp index c88d2a1..c60913e 100644 --- a/src/gui/widgets/qstatusbar.cpp +++ b/src/gui/widgets/qstatusbar.cpp @@ -575,7 +575,7 @@ void QStatusBar::reformat() d->savedStrut = maxH; vbox->addSpacing(2); d->box->activate(); - repaint(); + update(); } /*! |