summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorStephen Kelly <stephen.kelly@kdab.com>2012-05-30 13:53:24 +0200
committerQt by Nokia <qt-info@nokia.com>2012-06-05 18:42:26 +0200
commit7d28f7772cd8f5aad63359ed0b9c57c12923dc85 (patch)
tree71e1cc4d972f7417b0d510451aacfce2e98eafa7 /src/gui
parentfa7c9bbe1cc71a16835c373095515513ab5949db (diff)
Use QPointer instead of QWeakPointer.
The use of QWeakPointer for tracking QObject pointers is to be deprecated. Change-Id: If460ca7f515db77af24030152f4bd56e1a5fae7c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qguiapplication.cpp4
-rw-r--r--src/gui/kernel/qguiapplication_p.h6
-rw-r--r--src/gui/kernel/qinputmethod_p.h2
-rw-r--r--src/gui/kernel/qwindowsysteminterface_qpa_p.h29
4 files changed, 21 insertions, 20 deletions
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<QWindow> w;
+ QPointer<QWindow> 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<QWindow>()
+ ? QPointer<QWindow>()
: 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<QWindow> window;
- QWeakPointer<QObject> target;
+ QPointer<QWindow> window;
+ QPointer<QObject> target;
QTouchEvent::TouchPoint touchPoint;
};
QHash<ActiveTouchPointsKey, ActiveTouchPointsValue> activeTouchPoints;
@@ -216,7 +216,7 @@ public:
: pos(p), screenPos(sp), window(w) { }
QPointF pos;
QPointF screenPos;
- QWeakPointer<QWindow> window;
+ QPointer<QWindow> window;
};
QHash<QWindow *, SynthesizedMouseData> 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<QObject> inputItem;
+ QPointer<QObject> 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 <QElapsedTimer>
+#include <QPointer>
QT_BEGIN_HEADER
@@ -88,7 +89,7 @@ public:
public:
explicit CloseEvent(QWindow *w)
: WindowSystemEvent(Close), window(w) { }
- QWeakPointer<QWindow> window;
+ QPointer<QWindow> window;
};
class GeometryChangeEvent : public WindowSystemEvent {
@@ -96,7 +97,7 @@ public:
GeometryChangeEvent(QWindow *tlw, const QRect &newGeometry)
: WindowSystemEvent(GeometryChange), tlw(tlw), newGeometry(newGeometry)
{ }
- QWeakPointer<QWindow> tlw;
+ QPointer<QWindow> tlw;
QRect newGeometry;
};
@@ -105,7 +106,7 @@ public:
explicit EnterEvent(QWindow *enter)
: WindowSystemEvent(Enter), enter(enter)
{ }
- QWeakPointer<QWindow> enter;
+ QPointer<QWindow> enter;
};
class LeaveEvent : public WindowSystemEvent {
@@ -113,7 +114,7 @@ public:
explicit LeaveEvent(QWindow *leave)
: WindowSystemEvent(Leave), leave(leave)
{ }
- QWeakPointer<QWindow> leave;
+ QPointer<QWindow> leave;
};
class ActivatedWindowEvent : public WindowSystemEvent {
@@ -121,7 +122,7 @@ public:
explicit ActivatedWindowEvent(QWindow *activatedWindow)
: WindowSystemEvent(ActivatedWindow), activated(activatedWindow)
{ }
- QWeakPointer<QWindow> activated;
+ QPointer<QWindow> activated;
};
class WindowStateChangedEvent : public WindowSystemEvent {
@@ -130,7 +131,7 @@ public:
: WindowSystemEvent(WindowStateChanged), window(_window), newState(_newState)
{ }
- QWeakPointer<QWindow> window;
+ QPointer<QWindow> 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<QWindow> window;
+ QPointer<QWindow> 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<QScreen> screen;
+ QPointer<QScreen> screen;
Qt::ScreenOrientation orientation;
};
@@ -217,7 +218,7 @@ public:
public:
ScreenGeometryEvent(QScreen *s, const QRect &g)
: WindowSystemEvent(ScreenGeometry), screen(s), geometry(g) { }
- QWeakPointer<QScreen> screen;
+ QPointer<QScreen> screen;
QRect geometry;
};
@@ -225,7 +226,7 @@ public:
public:
ScreenAvailableGeometryEvent(QScreen *s, const QRect &g)
: WindowSystemEvent(ScreenAvailableGeometry), screen(s), availableGeometry(g) { }
- QWeakPointer<QScreen> screen;
+ QPointer<QScreen> 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<QScreen> screen;
+ QPointer<QScreen> screen;
qreal dpiX;
qreal dpiY;
};
@@ -242,7 +243,7 @@ public:
public:
ScreenRefreshRateEvent(QScreen *s, qreal r)
: WindowSystemEvent(ScreenRefreshRate), screen(s), rate(r) { }
- QWeakPointer<QScreen> screen;
+ QPointer<QScreen> screen;
qreal rate;
};
@@ -250,13 +251,13 @@ public:
public:
explicit ThemeChangeEvent(QWindow * w)
: WindowSystemEvent(ThemeChange), window(w) { }
- QWeakPointer<QWindow> window;
+ QPointer<QWindow> window;
};
class ExposeEvent : public WindowSystemEvent {
public:
ExposeEvent(QWindow *exposed, const QRegion &region);
- QWeakPointer<QWindow> exposed;
+ QPointer<QWindow> exposed;
bool isExposed;
QRegion region;
};