diff options
-rw-r--r-- | src/gui/painting/qpainterpath_p.h | 2 | ||||
-rw-r--r-- | tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/painting/qpainterpath_p.h b/src/gui/painting/qpainterpath_p.h index 731a1bcc24..738c2d382d 100644 --- a/src/gui/painting/qpainterpath_p.h +++ b/src/gui/painting/qpainterpath_p.h @@ -153,7 +153,7 @@ public: } QPainterPathData(const QPainterPathData &other) : - QPainterPathPrivate(other), cStart(other.cStart), fillRule(other.fillRule), + QPainterPathPrivate(), cStart(other.cStart), fillRule(other.fillRule), bounds(other.bounds), controlBounds(other.controlBounds), dirtyBounds(other.dirtyBounds), diff --git a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp index 33315adc06..08c08649d6 100644 --- a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp +++ b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp @@ -742,7 +742,11 @@ void tst_QPainterPath::closing() triangle.lineTo(200, 200); QCOMPARE(triangle.elementCount(), 3); + //add this line to make sure closeSubpath() also calls detach() and detached properly + QPainterPath copied = triangle; triangle.closeSubpath(); + QCOMPARE(copied.elementCount(), 3); + QCOMPARE(triangle.elementCount(), 4); QCOMPARE(triangle.elementAt(3).type, QPainterPath::LineToElement); |