From 7d28f7772cd8f5aad63359ed0b9c57c12923dc85 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 30 May 2012 13:53:24 +0200 Subject: Use QPointer instead of QWeakPointer. The use of QWeakPointer for tracking QObject pointers is to be deprecated. Change-Id: If460ca7f515db77af24030152f4bd56e1a5fae7c Reviewed-by: Thiago Macieira --- src/gui/kernel/qguiapplication.cpp | 4 ++-- src/gui/kernel/qguiapplication_p.h | 6 +++--- src/gui/kernel/qinputmethod_p.h | 2 +- src/gui/kernel/qwindowsysteminterface_qpa_p.h | 29 ++++++++++++++------------- 4 files changed, 21 insertions(+), 20 deletions(-) (limited to 'src/gui/kernel') diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 05e1274fef..f71e611303 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -1604,7 +1604,7 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To touchPoint.d = touchPoint.d->detach(); // update state - QWeakPointer w; + QPointer w; QTouchEvent::TouchPoint previousTouchPoint; ActiveTouchPointsKey touchInfoKey(e->device, touchPoint.id()); ActiveTouchPointsValue &touchInfo = d->activeTouchPoints[touchInfoKey]; @@ -1613,7 +1613,7 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To if (e->device->type() == QTouchDevice::TouchPad) { // on touch-pads, send all touch points to the same widget w = d->activeTouchPoints.isEmpty() - ? QWeakPointer() + ? QPointer() : d->activeTouchPoints.constBegin().value().window; } diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h index 8b7977e87a..e79c2afdf2 100644 --- a/src/gui/kernel/qguiapplication_p.h +++ b/src/gui/kernel/qguiapplication_p.h @@ -205,8 +205,8 @@ public: int touchPointId; }; struct ActiveTouchPointsValue { - QWeakPointer window; - QWeakPointer target; + QPointer window; + QPointer target; QTouchEvent::TouchPoint touchPoint; }; QHash activeTouchPoints; @@ -216,7 +216,7 @@ public: : pos(p), screenPos(sp), window(w) { } QPointF pos; QPointF screenPos; - QWeakPointer window; + QPointer window; }; QHash synthesizedMousePoints; diff --git a/src/gui/kernel/qinputmethod_p.h b/src/gui/kernel/qinputmethod_p.h index ad3d2141c1..7b24ebe33d 100644 --- a/src/gui/kernel/qinputmethod_p.h +++ b/src/gui/kernel/qinputmethod_p.h @@ -85,7 +85,7 @@ public: bool objectAcceptsInputMethod(QObject *object); QTransform inputItemTransform; - QWeakPointer inputItem; + QPointer inputItem; QPlatformInputContext *testContext; }; diff --git a/src/gui/kernel/qwindowsysteminterface_qpa_p.h b/src/gui/kernel/qwindowsysteminterface_qpa_p.h index 3eebaf2dfc..919a7de39b 100644 --- a/src/gui/kernel/qwindowsysteminterface_qpa_p.h +++ b/src/gui/kernel/qwindowsysteminterface_qpa_p.h @@ -44,6 +44,7 @@ #include "qwindowsysteminterface_qpa.h" #include +#include QT_BEGIN_HEADER @@ -88,7 +89,7 @@ public: public: explicit CloseEvent(QWindow *w) : WindowSystemEvent(Close), window(w) { } - QWeakPointer window; + QPointer window; }; class GeometryChangeEvent : public WindowSystemEvent { @@ -96,7 +97,7 @@ public: GeometryChangeEvent(QWindow *tlw, const QRect &newGeometry) : WindowSystemEvent(GeometryChange), tlw(tlw), newGeometry(newGeometry) { } - QWeakPointer tlw; + QPointer tlw; QRect newGeometry; }; @@ -105,7 +106,7 @@ public: explicit EnterEvent(QWindow *enter) : WindowSystemEvent(Enter), enter(enter) { } - QWeakPointer enter; + QPointer enter; }; class LeaveEvent : public WindowSystemEvent { @@ -113,7 +114,7 @@ public: explicit LeaveEvent(QWindow *leave) : WindowSystemEvent(Leave), leave(leave) { } - QWeakPointer leave; + QPointer leave; }; class ActivatedWindowEvent : public WindowSystemEvent { @@ -121,7 +122,7 @@ public: explicit ActivatedWindowEvent(QWindow *activatedWindow) : WindowSystemEvent(ActivatedWindow), activated(activatedWindow) { } - QWeakPointer activated; + QPointer activated; }; class WindowStateChangedEvent : public WindowSystemEvent { @@ -130,7 +131,7 @@ public: : WindowSystemEvent(WindowStateChanged), window(_window), newState(_newState) { } - QWeakPointer window; + QPointer window; Qt::WindowState newState; }; @@ -138,7 +139,7 @@ public: public: UserEvent(QWindow * w, ulong time, EventType t) : WindowSystemEvent(t), window(w), nullWindow(w == 0), timestamp(time) { } - QWeakPointer window; + QPointer window; bool nullWindow; unsigned long timestamp; }; @@ -209,7 +210,7 @@ public: public: ScreenOrientationEvent(QScreen *s, Qt::ScreenOrientation o) : WindowSystemEvent(ScreenOrientation), screen(s), orientation(o) { } - QWeakPointer screen; + QPointer screen; Qt::ScreenOrientation orientation; }; @@ -217,7 +218,7 @@ public: public: ScreenGeometryEvent(QScreen *s, const QRect &g) : WindowSystemEvent(ScreenGeometry), screen(s), geometry(g) { } - QWeakPointer screen; + QPointer screen; QRect geometry; }; @@ -225,7 +226,7 @@ public: public: ScreenAvailableGeometryEvent(QScreen *s, const QRect &g) : WindowSystemEvent(ScreenAvailableGeometry), screen(s), availableGeometry(g) { } - QWeakPointer screen; + QPointer screen; QRect availableGeometry; }; @@ -233,7 +234,7 @@ public: public: ScreenLogicalDotsPerInchEvent(QScreen *s, qreal dx, qreal dy) : WindowSystemEvent(ScreenLogicalDotsPerInch), screen(s), dpiX(dx), dpiY(dy) { } - QWeakPointer screen; + QPointer screen; qreal dpiX; qreal dpiY; }; @@ -242,7 +243,7 @@ public: public: ScreenRefreshRateEvent(QScreen *s, qreal r) : WindowSystemEvent(ScreenRefreshRate), screen(s), rate(r) { } - QWeakPointer screen; + QPointer screen; qreal rate; }; @@ -250,13 +251,13 @@ public: public: explicit ThemeChangeEvent(QWindow * w) : WindowSystemEvent(ThemeChange), window(w) { } - QWeakPointer window; + QPointer window; }; class ExposeEvent : public WindowSystemEvent { public: ExposeEvent(QWindow *exposed, const QRegion ®ion); - QWeakPointer exposed; + QPointer exposed; bool isExposed; QRegion region; }; -- cgit v1.2.3