diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2020-07-06 11:55:39 +0200 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2020-07-07 20:35:05 +0200 |
commit | 471e4fcb226c4523efe93b1bdaf0db026495da94 (patch) | |
tree | bb963937b2446eb32d7632568433083a386f2c68 /src/gui/painting/qpainterpath.cpp | |
parent | 7f400522c39f6a1abf083dc1af49ea3109635cc8 (diff) |
Use QList instead of QVector in gui implementation
Task-number: QTBUG-84469
Change-Id: I366e845249203d80d640355a7780ac2f91a762f1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/gui/painting/qpainterpath.cpp')
-rw-r--r-- | src/gui/painting/qpainterpath.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index de0b3f3998..1d61c67d57 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -668,7 +668,7 @@ void QPainterPath::clear() Attempts to allocate memory for at least \a size elements. - \sa clear(), capacity(), QVector::reserve() + \sa clear(), capacity(), QList::reserve() \since 5.13 */ void QPainterPath::reserve(int size) @@ -1692,7 +1692,7 @@ QList<QPolygonF> QPainterPath::toFillPolygons(const QTransform &matrix) const if (count == 0) return polys; - QVector<QRectF> bounds; + QList<QRectF> bounds; bounds.reserve(count); for (int i=0; i<count; ++i) bounds += subpaths.at(i).boundingRect(); @@ -1703,7 +1703,7 @@ QList<QPolygonF> QPainterPath::toFillPolygons(const QTransform &matrix) const qDebug() << " bounds" << i << bounds.at(i); #endif - QVector< QVector<int> > isects; + QList< QList<int> > isects; isects.resize(count); // find all intersections @@ -1731,12 +1731,12 @@ QList<QPolygonF> QPainterPath::toFillPolygons(const QTransform &matrix) const // flatten the sets of intersections for (int i=0; i<count; ++i) { - const QVector<int> ¤t_isects = isects.at(i); + const QList<int> ¤t_isects = isects.at(i); for (int j=0; j<current_isects.size(); ++j) { int isect_j = current_isects.at(j); if (isect_j == i) continue; - const QVector<int> &isects_j = isects.at(isect_j); + const QList<int> &isects_j = isects.at(isect_j); for (int k = 0, size = isects_j.size(); k < size; ++k) { int isect_k = isects_j.at(k); if (isect_k != i && !isects.at(i).contains(isect_k)) { @@ -1760,7 +1760,7 @@ QList<QPolygonF> QPainterPath::toFillPolygons(const QTransform &matrix) const // Join the intersected subpaths as rewinded polygons for (int i=0; i<count; ++i) { - const QVector<int> &subpath_list = isects.at(i); + const QList<int> &subpath_list = isects.at(i); if (!subpath_list.isEmpty()) { QPolygonF buildUp; for (int j=0; j<subpath_list.size(); ++j) { @@ -2592,7 +2592,7 @@ void qt_path_stroke_cubic_to(qfixed c1x, qfixed c1y, \endlist The setDashPattern() function accepts both a Qt::PenStyle object - and a vector representation of the pattern as argument. + and a list representation of the pattern as argument. In addition you can specify a curve's threshold, controlling the granularity with which a curve is drawn, using the @@ -2811,16 +2811,16 @@ void QPainterPathStroker::setDashPattern(Qt::PenStyle style) dashPattern. This function makes it possible to specify custom dash patterns. - Each element in the vector contains the lengths of the dashes and spaces + Each element in the list contains the lengths of the dashes and spaces in the stroke, beginning with the first dash in the first element, the first space in the second element, and alternating between dashes and spaces for each following pair of elements. - The vector can contain an odd number of elements, in which case the last + The list can contain an odd number of elements, in which case the last element will be extended by the length of the first element when the pattern repeats. */ -void QPainterPathStroker::setDashPattern(const QVector<qreal> &dashPattern) +void QPainterPathStroker::setDashPattern(const QList<qreal> &dashPattern) { d_func()->dashPattern.clear(); for (int i=0; i<dashPattern.size(); ++i) @@ -2830,7 +2830,7 @@ void QPainterPathStroker::setDashPattern(const QVector<qreal> &dashPattern) /*! Returns the dash pattern for the generated outlines. */ -QVector<qreal> QPainterPathStroker::dashPattern() const +QList<qreal> QPainterPathStroker::dashPattern() const { return d_func()->dashPattern; } |