summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-12-23 20:34:56 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-12-23 20:34:56 (GMT)
commit51e9b191bcdd172693a3cd8c69f6ae603b788ba9 (patch)
treeaf6e565060417f893346635a94096ca784bc222a /src/gui
parent08f963176b24c4c20a96717ddb2241ba1410b0a1 (diff)
parent26d2580daab37f4a6ff595a5f18b8a49249b5da1 (diff)
downloadQt-51e9b191bcdd172693a3cd8c69f6ae603b788ba9.zip
Qt-51e9b191bcdd172693a3cd8c69f6ae603b788ba9.tar.gz
Qt-51e9b191bcdd172693a3cd8c69f6ae603b788ba9.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: 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.h68
-rw-r--r--src/gui/text/qtextengine.cpp14
-rw-r--r--src/gui/widgets/qstatusbar.cpp2
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();
}
/*!