summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpainterpath_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/painting/qpainterpath_p.h')
-rw-r--r--src/gui/painting/qpainterpath_p.h46
1 files changed, 41 insertions, 5 deletions
diff --git a/src/gui/painting/qpainterpath_p.h b/src/gui/painting/qpainterpath_p.h
index 94d6a5b..94be339 100644
--- a/src/gui/painting/qpainterpath_p.h
+++ b/src/gui/painting/qpainterpath_p.h
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtGui module of the Qt Toolkit.
@@ -21,9 +20,10 @@
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this
+** package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
@@ -124,7 +124,7 @@ private:
Q_DISABLE_COPY(QVectorPathConverter)
};
-class Q_GUI_EXPORT QPainterPathData : public QPainterPathPrivate
+class QPainterPathData : public QPainterPathPrivate
{
public:
QPainterPathData() :
@@ -176,6 +176,42 @@ public:
};
+inline const QPainterPath QVectorPath::convertToPainterPath() const
+{
+ QPainterPath path;
+ path.ensureData();
+ QPainterPathData *data = path.d_func();
+ data->elements.reserve(m_count);
+ int index = 0;
+ data->elements[0].x = m_points[index++];
+ data->elements[0].y = m_points[index++];
+
+ if (m_elements) {
+ data->elements[0].type = m_elements[0];
+ for (int i=1; i<m_count; ++i) {
+ QPainterPath::Element element;
+ element.x = m_points[index++];
+ element.y = m_points[index++];
+ element.type = m_elements[i];
+ data->elements << element;
+ }
+ } else {
+ data->elements[0].type = QPainterPath::MoveToElement;
+ for (int i=1; i<m_count; ++i) {
+ QPainterPath::Element element;
+ element.x = m_points[index++];
+ element.y = m_points[index++];
+ element.type = QPainterPath::LineToElement;
+ data->elements << element;
+ }
+ }
+
+ if (m_hints & OddEvenFill)
+ data->fillRule = Qt::OddEvenFill;
+ else
+ data->fillRule = Qt::WindingFill;
+ return path;
+}
void Q_GUI_EXPORT qt_find_ellipse_coords(const QRectF &r, qreal angle, qreal length,
QPointF* startPoint, QPointF *endPoint);