summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpaintengineex.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-06-10 10:13:06 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2009-06-10 14:49:48 (GMT)
commit9eeec42f67e3e5c344d024eb28ac4f09d7c96c41 (patch)
tree819b9e2a61274acb792084bcb10042fbf16775e7 /src/gui/painting/qpaintengineex.cpp
parent32f32ee3e752a6cc03505ddaa48d2849eaedc2a6 (diff)
downloadQt-9eeec42f67e3e5c344d024eb28ac4f09d7c96c41.zip
Qt-9eeec42f67e3e5c344d024eb28ac4f09d7c96c41.tar.gz
Qt-9eeec42f67e3e5c344d024eb28ac4f09d7c96c41.tar.bz2
Make QVectorPath::controlPointRect() return a QRectF.
This makes debugging etc much easier, plus most of the places controlPointRect() was called the caller had to convert the rect to a QRectF manually.
Diffstat (limited to 'src/gui/painting/qpaintengineex.cpp')
-rw-r--r--src/gui/painting/qpaintengineex.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp
index d2671c8..67a3fa9 100644
--- a/src/gui/painting/qpaintengineex.cpp
+++ b/src/gui/painting/qpaintengineex.cpp
@@ -56,15 +56,15 @@ QT_BEGIN_NAMESPACE
*
*/
-const QRealRect &QVectorPath::controlPointRect() const
+QRectF QVectorPath::controlPointRect() const
{
if (m_hints & ControlPointRect)
- return m_cp_rect;
+ return QRectF(QPointF(m_cp_rect.x1, m_cp_rect.y1), QPointF(m_cp_rect.x2, m_cp_rect.y2));
if (m_count == 0) {
m_cp_rect.x1 = m_cp_rect.x2 = m_cp_rect.y1 = m_cp_rect.y2 = 0;
m_hints |= ControlPointRect;
- return m_cp_rect;
+ return QRectF(QPointF(m_cp_rect.x1, m_cp_rect.y1), QPointF(m_cp_rect.x2, m_cp_rect.y2));
}
Q_ASSERT(m_points && m_count > 0);
@@ -88,7 +88,7 @@ const QRealRect &QVectorPath::controlPointRect() const
}
m_hints |= ControlPointRect;
- return m_cp_rect;
+ return QRectF(QPointF(m_cp_rect.x1, m_cp_rect.y1), QPointF(m_cp_rect.x2, m_cp_rect.y2));
}
const QVectorPath &qtVectorPathForPath(const QPainterPath &path)
@@ -100,9 +100,7 @@ const QVectorPath &qtVectorPathForPath(const QPainterPath &path)
#ifndef QT_NO_DEBUG_STREAM
QDebug Q_GUI_EXPORT &operator<<(QDebug &s, const QVectorPath &path)
{
- QRealRect vectorPathBounds = path.controlPointRect();
- QRectF rf(vectorPathBounds.x1, vectorPathBounds.y1,
- vectorPathBounds.x2 - vectorPathBounds.x1, vectorPathBounds.y2 - vectorPathBounds.y1);
+ QRectF rf = path.controlPointRect();
s << "QVectorPath(size:" << path.elementCount()
<< " hints:" << hex << path.hints()
<< rf << ')';