diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/kernel/qcursor_qpa.cpp | 3 | ||||
-rw-r--r-- | src/gui/kernel/qevent_p.h | 2 | ||||
-rw-r--r-- | src/gui/kernel/qkeysequence_p.h | 6 | ||||
-rw-r--r-- | src/gui/painting/qpainterpath.h | 3 | ||||
-rw-r--r-- | src/gui/painting/qpainterpath_p.h | 4 | ||||
-rw-r--r-- | src/gui/painting/qpen.cpp | 2 | ||||
-rw-r--r-- | src/gui/text/qfontengine_ft.cpp | 2 | ||||
-rw-r--r-- | src/gui/text/qstatictext_p.h | 2 |
8 files changed, 11 insertions, 13 deletions
diff --git a/src/gui/kernel/qcursor_qpa.cpp b/src/gui/kernel/qcursor_qpa.cpp index 40a15317ee..7b3059e1df 100644 --- a/src/gui/kernel/qcursor_qpa.cpp +++ b/src/gui/kernel/qcursor_qpa.cpp @@ -58,9 +58,8 @@ static int nextCursorId = Qt::BitmapCursor; *****************************************************************************/ QCursorData::QCursorData(Qt::CursorShape s) - : cshape(s), bm(0), bmm(0), hx(0), hy(0), id(s) + : ref(1), cshape(s), bm(0), bmm(0), hx(0), hy(0), id(s) { - ref = 1; } QCursorData::~QCursorData() diff --git a/src/gui/kernel/qevent_p.h b/src/gui/kernel/qevent_p.h index 1d65eb63be..fa6b675c86 100644 --- a/src/gui/kernel/qevent_p.h +++ b/src/gui/kernel/qevent_p.h @@ -91,7 +91,7 @@ public: inline QTouchEventTouchPointPrivate *detach() { QTouchEventTouchPointPrivate *d = new QTouchEventTouchPointPrivate(*this); - d->ref = 1; + d->ref.store(1); if (!this->ref.deref()) delete this; return d; diff --git a/src/gui/kernel/qkeysequence_p.h b/src/gui/kernel/qkeysequence_p.h index eb8527a952..7fa98dd5eb 100644 --- a/src/gui/kernel/qkeysequence_p.h +++ b/src/gui/kernel/qkeysequence_p.h @@ -69,14 +69,12 @@ struct Q_AUTOTEST_EXPORT QKeyBinding class Q_AUTOTEST_EXPORT QKeySequencePrivate { public: - inline QKeySequencePrivate() + inline QKeySequencePrivate() : ref(1) { - ref = 1; key[0] = key[1] = key[2] = key[3] = 0; } - inline QKeySequencePrivate(const QKeySequencePrivate ©) + inline QKeySequencePrivate(const QKeySequencePrivate ©) : ref(1) { - ref = 1; key[0] = copy.key[0]; key[1] = copy.key[1]; key[2] = copy.key[2]; diff --git a/src/gui/painting/qpainterpath.h b/src/gui/painting/qpainterpath.h index 9dc435f630..a558abca3d 100644 --- a/src/gui/painting/qpainterpath.h +++ b/src/gui/painting/qpainterpath.h @@ -249,6 +249,9 @@ public: friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QPainterPath &); friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QPainterPath &); #endif + + QPainterPathPrivate() : ref(1) {} + private: QAtomicInt ref; QVector<QPainterPath::Element> elements; diff --git a/src/gui/painting/qpainterpath_p.h b/src/gui/painting/qpainterpath_p.h index 93cc11c8ee..8d5bd7310f 100644 --- a/src/gui/painting/qpainterpath_p.h +++ b/src/gui/painting/qpainterpath_p.h @@ -148,13 +148,12 @@ public: dirtyControlBounds(false), pathConverter(0) { - ref = 1; require_moveTo = false; convex = false; } QPainterPathData(const QPainterPathData &other) : - QPainterPathPrivate(), cStart(other.cStart), fillRule(other.fillRule), + cStart(other.cStart), fillRule(other.fillRule), bounds(other.bounds), controlBounds(other.controlBounds), dirtyBounds(other.dirtyBounds), @@ -162,7 +161,6 @@ public: convex(other.convex), pathConverter(0) { - ref = 1; require_moveTo = false; elements = other.elements; } diff --git a/src/gui/painting/qpen.cpp b/src/gui/painting/qpen.cpp index 5a4582e31e..5358239014 100644 --- a/src/gui/painting/qpen.cpp +++ b/src/gui/painting/qpen.cpp @@ -358,7 +358,7 @@ void QPen::detach() QPenData *x = new QPenData(*static_cast<QPenData *>(d)); if (!d->ref.deref()) delete d; - x->ref = 1; + x->ref.store(1); d = x; } diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index 37bbd4ffee..7c95af31a8 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -259,7 +259,7 @@ QFreetypeFace *QFreetypeFace::getFace(const QFontEngine::FaceId &face_id, newFreetype->hbFace = qHBNewFace(face, hb_getSFntTable); Q_CHECK_PTR(newFreetype->hbFace); - newFreetype->ref = 1; + newFreetype->ref.store(1); newFreetype->xsize = 0; newFreetype->ysize = 0; newFreetype->matrix.xx = 0x10000; diff --git a/src/gui/text/qstatictext_p.h b/src/gui/text/qstatictext_p.h index c84e85396d..5f9410c31d 100644 --- a/src/gui/text/qstatictext_p.h +++ b/src/gui/text/qstatictext_p.h @@ -68,7 +68,7 @@ public: OpenGLUserData }; - QStaticTextUserData(Type t) : type(t) { ref = 0; } + QStaticTextUserData(Type t) : ref(0), type(t) {} virtual ~QStaticTextUserData() {} QAtomicInt ref; |