summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-06-18 11:28:01 (GMT)
committerBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-06-18 13:02:01 (GMT)
commit450a9c97aba21db04df4af281312e4262529691a (patch)
tree392d2dbad27c91a20acdf349ce1e0b518a063b2f
parentcc4935dc0641336813925b3892ffd6695d709d19 (diff)
downloadQt-450a9c97aba21db04df4af281312e4262529691a.zip
Qt-450a9c97aba21db04df4af281312e4262529691a.tar.gz
Qt-450a9c97aba21db04df4af281312e4262529691a.tar.bz2
Make construction of unitialized QTransform/QMatrix a no-op.
These constructors are useful when you have to create a temporary uninitialized QTransform/QMatrix and later initialize it to something else. Done with Lars. Reviewed-by: samuel
-rw-r--r--doc/src/qnamespace.qdoc6
-rw-r--r--src/corelib/global/qnamespace.h4
-rw-r--r--src/gui/painting/qmatrix.cpp4
-rw-r--r--src/gui/painting/qmatrix.h1
-rw-r--r--src/gui/painting/qtransform.cpp5
-rw-r--r--src/gui/painting/qtransform.h1
6 files changed, 21 insertions, 0 deletions
diff --git a/doc/src/qnamespace.qdoc b/doc/src/qnamespace.qdoc
index d46236f..8a24764 100644
--- a/doc/src/qnamespace.qdoc
+++ b/doc/src/qnamespace.qdoc
@@ -2685,3 +2685,9 @@
\value Round Like Repeat, but scales the images down to ensure that
the last image is not cropped.
*/
+
+/*!
+ \enum Uninitialized
+ \internal
+*/
+
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 46ac40b..398cd48 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -1542,6 +1542,10 @@ public:
BottomLeftSection,
TitleBarArea // For move
};
+
+ enum Uninitialized {
+ Uninitialized
+ };
}
#ifdef Q_MOC_RUN
;
diff --git a/src/gui/painting/qmatrix.cpp b/src/gui/painting/qmatrix.cpp
index 7c50b80..62addd3 100644
--- a/src/gui/painting/qmatrix.cpp
+++ b/src/gui/painting/qmatrix.cpp
@@ -197,6 +197,10 @@ QT_BEGIN_NAMESPACE
/*****************************************************************************
QMatrix member functions
*****************************************************************************/
+/*!
+ \fn QMatrix::QMatrix(Qt::Uninitialized)
+ \internal
+*/
/*!
Constructs an identity matrix.
diff --git a/src/gui/painting/qmatrix.h b/src/gui/painting/qmatrix.h
index e28c950..b2e5d70 100644
--- a/src/gui/painting/qmatrix.h
+++ b/src/gui/painting/qmatrix.h
@@ -61,6 +61,7 @@ class QVariant;
class Q_GUI_EXPORT QMatrix // 2D transform matrix
{
public:
+ inline explicit QMatrix(enum Qt::Uninitialized) {}
QMatrix();
QMatrix(qreal m11, qreal m12, qreal m21, qreal m22,
qreal dx, qreal dy);
diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp
index 5b1ae07..85adb27 100644
--- a/src/gui/painting/qtransform.cpp
+++ b/src/gui/painting/qtransform.cpp
@@ -232,6 +232,11 @@ QT_BEGIN_NAMESPACE
*/
/*!
+ \fn QTransform::QTransform(Qt::Uninitialized)
+ \internal
+*/
+
+/*!
Constructs an identity matrix.
All elements are set to zero except \c m11 and \c m22 (specifying
diff --git a/src/gui/painting/qtransform.h b/src/gui/painting/qtransform.h
index bb04f7b..f99b0e7 100644
--- a/src/gui/painting/qtransform.h
+++ b/src/gui/painting/qtransform.h
@@ -71,6 +71,7 @@ public:
TxProject = 0x10
};
+ inline explicit QTransform(enum Qt::Uninitialized) : affine(Qt::Uninitialized) {}
QTransform();
QTransform(qreal h11, qreal h12, qreal h13,
qreal h21, qreal h22, qreal h23,