diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2019-05-13 19:07:54 +0200 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2019-05-14 19:36:03 +0200 |
commit | 0060ff674910fd7e81f36c508547367d3c5d4a8c (patch) | |
tree | 8f5b502337e850313191f94fab6066a247af96b6 /src/gui/painting/qpainterpath_p.h | |
parent | f946c9fb78e9a267647e9fd1b397d9b7ca2b6664 (diff) |
QPainterPathPrivate: code tidies
* Honor the RO3, doing copies of the members where it belongs
(and not in its subclass), and properly handling the refcounting
by disabling the copy assignment
* Clean up construction of QPainterPathData by using ctor-init-lists,
getting rid of a warning because the base class copy constructor
wasn't being called by the subclass' copy constructor.
* Mark everything for cleanup in Qt 6.
Change-Id: I143a322dc816e2e12b454a9e5ffe63f1a86009a5
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/gui/painting/qpainterpath_p.h')
-rw-r--r-- | src/gui/painting/qpainterpath_p.h | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/src/gui/painting/qpainterpath_p.h b/src/gui/painting/qpainterpath_p.h index 98056483bc..8af811499b 100644 --- a/src/gui/painting/qpainterpath_p.h +++ b/src/gui/painting/qpainterpath_p.h @@ -64,6 +64,7 @@ QT_BEGIN_NAMESPACE +// ### Qt 6: merge with QPainterPathData class QPainterPathPrivate { public: @@ -80,7 +81,19 @@ public: friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QPainterPath &); #endif - QPainterPathPrivate() : ref(1) {} + QPainterPathPrivate() noexcept + : ref(1) + { + } + + QPainterPathPrivate(const QPainterPathPrivate &other) noexcept + : ref(1), + elements(other.elements) + { + } + + QPainterPathPrivate &operator=(const QPainterPathPrivate &) = delete; + ~QPainterPathPrivate() = default; private: QAtomicInt ref; @@ -166,28 +179,32 @@ public: QPainterPathData() : cStart(0), fillRule(Qt::OddEvenFill), + require_moveTo(false), dirtyBounds(false), dirtyControlBounds(false), + convex(false), pathConverter(nullptr) { - require_moveTo = false; - convex = false; } QPainterPathData(const QPainterPathData &other) : - QPainterPathPrivate(), cStart(other.cStart), fillRule(other.fillRule), + QPainterPathPrivate(other), + cStart(other.cStart), + fillRule(other.fillRule), bounds(other.bounds), controlBounds(other.controlBounds), + require_moveTo(false), dirtyBounds(other.dirtyBounds), dirtyControlBounds(other.dirtyControlBounds), convex(other.convex), pathConverter(nullptr) { - require_moveTo = false; - elements = other.elements; } - ~QPainterPathData() { + QPainterPathData &operator=(const QPainterPathData &) = delete; + + ~QPainterPathData() + { delete pathConverter; } |