diff options
author | Frans Englich <frans.englich@nokia.com> | 2009-09-29 14:29:20 (GMT) |
---|---|---|
committer | Frans Englich <frans.englich@nokia.com> | 2009-09-29 14:29:20 (GMT) |
commit | b1c2caf933942b3a77a0332aecb66a7f0fdd2316 (patch) | |
tree | 235991caa35a38778aa099d5eaaa3d20b8ac1807 /src/gui | |
parent | 17c17adbd706d32723ecedeb207c7e467f9fa8eb (diff) | |
parent | 75666d254304746ead69892e92fa4ab39d219df1 (diff) | |
download | Qt-b1c2caf933942b3a77a0332aecb66a7f0fdd2316.zip Qt-b1c2caf933942b3a77a0332aecb66a7f0fdd2316.tar.gz Qt-b1c2caf933942b3a77a0332aecb66a7f0fdd2316.tar.bz2 |
Merge commit 'qt/4.6' into mmfphonon
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/graphicsview/qgraphicsanchorlayout.cpp | 30 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsanchorlayout.h | 1 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsanchorlayout_p.cpp | 7 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsanchorlayout_p.h | 7 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 11 | ||||
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 1 | ||||
-rw-r--r-- | src/gui/kernel/qevent.h | 2 | ||||
-rw-r--r-- | src/gui/kernel/qsoftkeymanager.cpp | 2 | ||||
-rw-r--r-- | src/gui/math3d/qmatrix4x4.h | 40 | ||||
-rw-r--r-- | src/gui/math3d/qquaternion.h | 34 | ||||
-rw-r--r-- | src/gui/math3d/qvector2d.h | 4 | ||||
-rw-r--r-- | src/gui/math3d/qvector3d.h | 6 | ||||
-rw-r--r-- | src/gui/math3d/qvector4d.h | 8 | ||||
-rw-r--r-- | src/gui/widgets/qvalidator.h | 4 |
14 files changed, 86 insertions, 71 deletions
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout.cpp b/src/gui/graphicsview/qgraphicsanchorlayout.cpp index b3ebb2b..fdb1708 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout.cpp +++ b/src/gui/graphicsview/qgraphicsanchorlayout.cpp @@ -80,6 +80,24 @@ PM_LayoutHorizontalSpacing (or PM_LayoutVerticalSpacing for vertical anchors). */ +/*! + \class QGraphicsAnchor + \brief The QGraphicsAnchor class represents an anchor between two items in a + QGraphicsAnchorLayout. + \since 4.6 + \ingroup appearance + \ingroup geomanagement + \ingroup graphicsview-api + + The graphics anchor provides an API that enables you to query and manipulate the + properties an anchor has. When an anchor is added to the layout with + QGraphicsAnchorLayout::addAnchor(), a QGraphicsAnchor instance is returned where the properties + are initialized to their default values. The properties can then be further changed, and they + will be picked up the next time the layout is activated. + + \sa QGraphicsAnchorLayout::anchor() + +*/ #include "qgraphicsanchorlayout_p.h" QT_BEGIN_NAMESPACE @@ -288,18 +306,6 @@ void QGraphicsAnchorLayout::addAnchors(QGraphicsLayoutItem *firstItem, } /*! - Returns true if there are no arrangement that satisfies all constraints. - Otherwise returns false. - - \sa addAnchor() -*/ -bool QGraphicsAnchorLayout::hasConflicts() const -{ - Q_D(const QGraphicsAnchorLayout); - return d->hasConflicts(); -} - -/*! Sets the default horizontal spacing for the anchor layout to \a spacing. \sa horizontalSpacing(), setVerticalSpacing(), setSpacing() diff --git a/src/gui/graphicsview/qgraphicsanchorlayout.h b/src/gui/graphicsview/qgraphicsanchorlayout.h index 44074d1..d9a87ba 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout.h +++ b/src/gui/graphicsview/qgraphicsanchorlayout.h @@ -93,7 +93,6 @@ public: QGraphicsLayoutItem *secondItem, Qt::Orientations orientations = Qt::Horizontal | Qt::Vertical); - bool hasConflicts() const; void setHorizontalSpacing(qreal spacing); void setVerticalSpacing(qreal spacing); void setSpacing(qreal spacing); diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp index 49aabf5..f75118b 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp +++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp @@ -2287,6 +2287,13 @@ bool QGraphicsAnchorLayoutPrivate::solvePreferred(QList<QSimplexConstraint *> co return feasible; } +/*! + \internal + Returns true if there are no arrangement that satisfies all constraints. + Otherwise returns false. + + \sa addAnchor() +*/ bool QGraphicsAnchorLayoutPrivate::hasConflicts() const { QGraphicsAnchorLayoutPrivate *that = const_cast<QGraphicsAnchorLayoutPrivate*>(this); diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.h b/src/gui/graphicsview/qgraphicsanchorlayout_p.h index 4e1bcd4..c86bfa3 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout_p.h +++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.h @@ -343,7 +343,7 @@ public: QGraphicsAnchorLayout private methods and attributes. */ -class QGraphicsAnchorLayoutPrivate : public QGraphicsLayoutPrivate +class Q_AUTOTEST_EXPORT QGraphicsAnchorLayoutPrivate : public QGraphicsLayoutPrivate { Q_DECLARE_PUBLIC(QGraphicsAnchorLayout) @@ -370,6 +370,11 @@ public: QGraphicsAnchorLayoutPrivate(); + static QGraphicsAnchorLayoutPrivate *get(QGraphicsAnchorLayout *q) + { + return q ? q->d_func() : 0; + } + static Qt::AnchorPoint oppositeEdge( Qt::AnchorPoint edge); diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index c3934c7..d7a7bd2 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -5140,14 +5140,8 @@ void QGraphicsItem::update(const QRectF &rect) } while ((item = item->d_ptr->parent)); if (CacheMode(d_ptr->cacheMode) != NoCache) { - QGraphicsItemCache *cache = d_ptr->extraItemCache(); - if (d_ptr->discardUpdateRequest(/* ignoreVisibleBit = */ false, - /* ignoreClipping = */ false, - /* ignoreDirtyBit = */ true)) { - return; - } - // Invalidate cache. + QGraphicsItemCache *cache = d_ptr->extraItemCache(); if (!cache->allExposed) { if (rect.isNull()) { cache->allExposed = true; @@ -5161,6 +5155,9 @@ void QGraphicsItem::update(const QRectF &rect) return; } + if (d_ptr->discardUpdateRequest()) + return; + if (d_ptr->scene) d_ptr->scene->d_func()->markDirty(this, rect); } diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 71d0cd1..992e754 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1472,6 +1472,7 @@ bool QApplication::s60EventFilter(TWsEvent * /* aEvent */) */ void QApplication::symbianHandleCommand(int command) { + QScopedLoopLevelCounter counter(d_func()->threadData); switch (command) { #ifdef Q_WS_S60 case EAknSoftkeyExit: { diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index fa2b22f..4396766 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -807,7 +807,7 @@ public: // internal inline void setWidget(QWidget *awidget) { _widget = awidget; } inline void setDeviceType(DeviceType adeviceType) { _deviceType = adeviceType; } - inline void setTouchPointStates(Qt::TouchPointStates touchPointStates) { _touchPointStates = touchPointStates; } + inline void setTouchPointStates(Qt::TouchPointStates aTouchPointStates) { _touchPointStates = aTouchPointStates; } inline void setTouchPoints(const QList<QTouchEvent::TouchPoint> &atouchPoints) { _touchPoints = atouchPoints; } protected: diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp index 91f4163..45695d9 100644 --- a/src/gui/kernel/qsoftkeymanager.cpp +++ b/src/gui/kernel/qsoftkeymanager.cpp @@ -238,7 +238,7 @@ void QSoftKeyManagerPrivate::updateSoftKeys_sys(const QList<QAction*> &softkeys) } if (needsExitButton) - QT_TRAP_THROWING(nativeContainer->SetCommandL(2, EAknSoftkeyExit, qt_QString2TPtrC(QObject::tr("Exit")))); + QT_TRAP_THROWING(nativeContainer->SetCommandL(2, EAknSoftkeyExit, qt_QString2TPtrC(QSoftKeyManager::tr("Exit")))); nativeContainer->DrawDeferred(); // 3.1 needs an extra invitation } diff --git a/src/gui/math3d/qmatrix4x4.h b/src/gui/math3d/qmatrix4x4.h index cfa3f2a..b32e00a 100644 --- a/src/gui/math3d/qmatrix4x4.h +++ b/src/gui/math3d/qmatrix4x4.h @@ -228,14 +228,14 @@ Q_INLINE_TEMPLATE QMatrix4x4::QMatrix4x4 (const QGenericMatrix<N, M, qreal>& matrix) { const qreal *values = matrix.constData(); - for (int col = 0; col < 4; ++col) { - for (int row = 0; row < 4; ++row) { - if (col < N && row < M) - m[col][row] = values[col * M + row]; - else if (col == row) - m[col][row] = 1.0f; + for (int matrixCol = 0; matrixCol < 4; ++matrixCol) { + for (int matrixRow = 0; matrixRow < 4; ++matrixRow) { + if (matrixCol < N && matrixRow < M) + m[matrixCol][matrixRow] = values[matrixCol * M + matrixRow]; + else if (matrixCol == matrixRow) + m[matrixCol][matrixRow] = 1.0f; else - m[col][row] = 0.0f; + m[matrixCol][matrixRow] = 0.0f; } } flagBits = General; @@ -246,14 +246,14 @@ QGenericMatrix<N, M, qreal> QMatrix4x4::toGenericMatrix() const { QGenericMatrix<N, M, qreal> result; qreal *values = result.data(); - for (int col = 0; col < N; ++col) { - for (int row = 0; row < M; ++row) { - if (col < 4 && row < 4) - values[col * M + row] = m[col][row]; - else if (col == row) - values[col * M + row] = 1.0f; + for (int matrixCol = 0; matrixCol < N; ++matrixCol) { + for (int matrixRow = 0; matrixRow < M; ++matrixRow) { + if (matrixCol < 4 && matrixRow < 4) + values[matrixCol * M + matrixRow] = m[matrixCol][matrixRow]; + else if (matrixCol == matrixRow) + values[matrixCol * M + matrixRow] = 1.0f; else - values[col * M + row] = 0.0f; + values[matrixCol * M + matrixRow] = 0.0f; } } return result; @@ -261,17 +261,17 @@ QGenericMatrix<N, M, qreal> QMatrix4x4::toGenericMatrix() const #endif -inline const qreal& QMatrix4x4::operator()(int row, int column) const +inline const qreal& QMatrix4x4::operator()(int aRow, int aColumn) const { - Q_ASSERT(row >= 0 && row < 4 && column >= 0 && column < 4); - return m[column][row]; + Q_ASSERT(aRow >= 0 && aRow < 4 && aColumn >= 0 && aColumn < 4); + return m[aColumn][aRow]; } -inline qreal& QMatrix4x4::operator()(int row, int column) +inline qreal& QMatrix4x4::operator()(int aRow, int aColumn) { - Q_ASSERT(row >= 0 && row < 4 && column >= 0 && column < 4); + Q_ASSERT(aRow >= 0 && aRow < 4 && aColumn >= 0 && aColumn < 4); flagBits = General; - return m[column][row]; + return m[aColumn][aRow]; } inline QVector4D QMatrix4x4::column(int index) const diff --git a/src/gui/math3d/qquaternion.h b/src/gui/math3d/qquaternion.h index dd5dddc..7480a5c 100644 --- a/src/gui/math3d/qquaternion.h +++ b/src/gui/math3d/qquaternion.h @@ -138,7 +138,7 @@ private: inline QQuaternion::QQuaternion() : wp(1.0f), xp(0.0f), yp(0.0f), zp(0.0f) {} -inline QQuaternion::QQuaternion(qreal scalar, qreal xpos, qreal ypos, qreal zpos) : wp(scalar), xp(xpos), yp(ypos), zp(zpos) {} +inline QQuaternion::QQuaternion(qreal aScalar, qreal xpos, qreal ypos, qreal zpos) : wp(aScalar), xp(xpos), yp(ypos), zp(zpos) {} inline bool QQuaternion::isNull() const @@ -156,10 +156,10 @@ inline qreal QQuaternion::y() const { return qreal(yp); } inline qreal QQuaternion::z() const { return qreal(zp); } inline qreal QQuaternion::scalar() const { return qreal(wp); } -inline void QQuaternion::setX(qreal x) { xp = x; } -inline void QQuaternion::setY(qreal y) { yp = y; } -inline void QQuaternion::setZ(qreal z) { zp = z; } -inline void QQuaternion::setScalar(qreal scalar) { wp = scalar; } +inline void QQuaternion::setX(qreal aX) { xp = aX; } +inline void QQuaternion::setY(qreal aY) { yp = aY; } +inline void QQuaternion::setZ(qreal aZ) { zp = aZ; } +inline void QQuaternion::setScalar(qreal aScalar) { wp = aScalar; } inline QQuaternion QQuaternion::conjugate() const { @@ -274,14 +274,14 @@ inline bool qFuzzyCompare(const QQuaternion& q1, const QQuaternion& q2) #ifndef QT_NO_VECTOR3D -inline QQuaternion::QQuaternion(qreal scalar, const QVector3D& vector) - : wp(scalar), xp(vector.x()), yp(vector.y()), zp(vector.z()) {} +inline QQuaternion::QQuaternion(qreal aScalar, const QVector3D& aVector) + : wp(aScalar), xp(aVector.x()), yp(aVector.y()), zp(aVector.z()) {} -inline void QQuaternion::setVector(const QVector3D& vector) +inline void QQuaternion::setVector(const QVector3D& aVector) { - xp = vector.x(); - yp = vector.y(); - zp = vector.z(); + xp = aVector.x(); + yp = aVector.y(); + zp = aVector.z(); } inline QVector3D QQuaternion::vector() const @@ -291,17 +291,17 @@ inline QVector3D QQuaternion::vector() const #endif -inline void QQuaternion::setVector(qreal x, qreal y, qreal z) +inline void QQuaternion::setVector(qreal aX, qreal aY, qreal aZ) { - xp = x; - yp = y; - zp = z; + xp = aX; + yp = aY; + zp = aZ; } #ifndef QT_NO_VECTOR4D -inline QQuaternion::QQuaternion(const QVector4D& vector) - : wp(vector.w()), xp(vector.x()), yp(vector.y()), zp(vector.z()) {} +inline QQuaternion::QQuaternion(const QVector4D& aVector) + : wp(aVector.w()), xp(aVector.x()), yp(aVector.y()), zp(aVector.z()) {} inline QVector4D QQuaternion::toVector4D() const { diff --git a/src/gui/math3d/qvector2d.h b/src/gui/math3d/qvector2d.h index 570e864..cd9a12c 100644 --- a/src/gui/math3d/qvector2d.h +++ b/src/gui/math3d/qvector2d.h @@ -144,8 +144,8 @@ inline bool QVector2D::isNull() const inline qreal QVector2D::x() const { return qreal(xp); } inline qreal QVector2D::y() const { return qreal(yp); } -inline void QVector2D::setX(qreal x) { xp = x; } -inline void QVector2D::setY(qreal y) { yp = y; } +inline void QVector2D::setX(qreal aX) { xp = aX; } +inline void QVector2D::setY(qreal aY) { yp = aY; } inline QVector2D &QVector2D::operator+=(const QVector2D &vector) { diff --git a/src/gui/math3d/qvector3d.h b/src/gui/math3d/qvector3d.h index 1291c96..60bd693 100644 --- a/src/gui/math3d/qvector3d.h +++ b/src/gui/math3d/qvector3d.h @@ -160,9 +160,9 @@ inline qreal QVector3D::x() const { return qreal(xp); } inline qreal QVector3D::y() const { return qreal(yp); } inline qreal QVector3D::z() const { return qreal(zp); } -inline void QVector3D::setX(qreal x) { xp = x; } -inline void QVector3D::setY(qreal y) { yp = y; } -inline void QVector3D::setZ(qreal z) { zp = z; } +inline void QVector3D::setX(qreal aX) { xp = aX; } +inline void QVector3D::setY(qreal aY) { yp = aY; } +inline void QVector3D::setZ(qreal aZ) { zp = aZ; } inline QVector3D &QVector3D::operator+=(const QVector3D &vector) { diff --git a/src/gui/math3d/qvector4d.h b/src/gui/math3d/qvector4d.h index ad0718a..c35b536 100644 --- a/src/gui/math3d/qvector4d.h +++ b/src/gui/math3d/qvector4d.h @@ -158,10 +158,10 @@ inline qreal QVector4D::y() const { return qreal(yp); } inline qreal QVector4D::z() const { return qreal(zp); } inline qreal QVector4D::w() const { return qreal(wp); } -inline void QVector4D::setX(qreal x) { xp = x; } -inline void QVector4D::setY(qreal y) { yp = y; } -inline void QVector4D::setZ(qreal z) { zp = z; } -inline void QVector4D::setW(qreal w) { wp = w; } +inline void QVector4D::setX(qreal aX) { xp = aX; } +inline void QVector4D::setY(qreal aY) { yp = aY; } +inline void QVector4D::setZ(qreal aZ) { zp = aZ; } +inline void QVector4D::setW(qreal aW) { wp = aW; } inline QVector4D &QVector4D::operator+=(const QVector4D &vector) { diff --git a/src/gui/widgets/qvalidator.h b/src/gui/widgets/qvalidator.h index 268ecaa..a0d9534 100644 --- a/src/gui/widgets/qvalidator.h +++ b/src/gui/widgets/qvalidator.h @@ -61,7 +61,7 @@ class Q_GUI_EXPORT QValidator : public QObject { Q_OBJECT public: - explicit QValidator(QObject * parent=0); + explicit QValidator(QObject * parent = 0); ~QValidator(); enum State { @@ -100,7 +100,7 @@ class Q_GUI_EXPORT QIntValidator : public QValidator Q_PROPERTY(int top READ top WRITE setTop) public: - explicit QIntValidator(QObject * parent=0); + explicit QIntValidator(QObject * parent = 0); QIntValidator(int bottom, int top, QObject * parent); ~QIntValidator(); |