summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-06-19 11:49:18 +0200
committerQt by Nokia <qt-info@nokia.com>2012-06-19 12:24:05 +0200
commit89db9a3b1c42e793a5da1eaf9cb3eff2569aaed7 (patch)
treef1a817a11bd0e672ef81dc0afeeae1a1d9746ed4 /src/plugins
parent1037b85ddb17859f341ad083553f56f9efaaade4 (diff)
Finish the conversion from QWeakPointer back to QPointer
Use QPointer to store classes derived from QObject that weren't initially shared with QSharedPointer. QWeakPointer must be used only with QSharedPointer. Change-Id: I28705055bb0167300fee2dee45a8f05cc8f818f3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter.h4
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator.cpp4
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator.h6
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionrectangle.h4
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.cpp2
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.h2
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector.cpp8
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector_p.h6
8 files changed, 18 insertions, 18 deletions
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter.h b/src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter.h
index 38e724ed..1bfead79 100644
--- a/src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter.h
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter.h
@@ -45,7 +45,7 @@
#include "livelayeritem.h"
#include <QtCore/QObject>
-#include <QtCore/QWeakPointer>
+#include <QtCore/QPointer>
QT_FORWARD_DECLARE_CLASS(QGraphicsItem)
QT_FORWARD_DECLARE_CLASS(QPainter)
@@ -95,7 +95,7 @@ public:
explicit BoundingBox(QGraphicsObject *itemToHighlight, QGraphicsItem *parentItem,
QObject *parent = 0);
~BoundingBox();
- QWeakPointer<QGraphicsObject> highlightedObject;
+ QPointer<QGraphicsObject> highlightedObject;
QGraphicsPolygonItem *highlightPolygon;
QGraphicsPolygonItem *highlightPolygonEdge;
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator.cpp
index d1aee7b3..82b52548 100644
--- a/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator.cpp
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator.cpp
@@ -90,11 +90,11 @@ void LiveSelectionIndicator::clear()
}
-void LiveSelectionIndicator::setItems(const QList<QWeakPointer<QGraphicsObject> > &itemList)
+void LiveSelectionIndicator::setItems(const QList<QPointer<QGraphicsObject> > &itemList)
{
clear();
- foreach (const QWeakPointer<QGraphicsObject> &object, itemList) {
+ foreach (const QPointer<QGraphicsObject> &object, itemList) {
if (object.isNull())
continue;
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator.h b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator.h
index 3d5e10d7..c86698b9 100644
--- a/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator.h
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator.h
@@ -42,7 +42,7 @@
#ifndef LIVESELECTIONINDICATOR_H
#define LIVESELECTIONINDICATOR_H
-#include <QtCore/QWeakPointer>
+#include <QtCore/QPointer>
#include <QtCore/QHash>
QT_BEGIN_NAMESPACE
@@ -68,11 +68,11 @@ public:
void clear();
- void setItems(const QList<QWeakPointer<QGraphicsObject> > &itemList);
+ void setItems(const QList<QPointer<QGraphicsObject> > &itemList);
private:
QHash<QGraphicsItem*, QGraphicsRectItem *> m_indicatorShapeHash;
- QWeakPointer<QGraphicsObject> m_layerItem;
+ QPointer<QGraphicsObject> m_layerItem;
QDeclarativeViewInspector *m_view;
};
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionrectangle.h b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionrectangle.h
index de1dadb0..9e5d7fc6 100644
--- a/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionrectangle.h
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionrectangle.h
@@ -42,7 +42,7 @@
#ifndef LIVESELECTIONRECTANGLE_H
#define LIVESELECTIONRECTANGLE_H
-#include <QtCore/QWeakPointer>
+#include <QtCore/QPointer>
QT_FORWARD_DECLARE_CLASS(QGraphicsObject)
QT_FORWARD_DECLARE_CLASS(QGraphicsRectItem)
@@ -70,7 +70,7 @@ public:
private:
QGraphicsRectItem *m_controlShape;
- QWeakPointer<QGraphicsObject> m_layerItem;
+ QPointer<QGraphicsObject> m_layerItem;
};
} // namespace QtQuick1
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.cpp
index 77cba9cf..c6a65924 100644
--- a/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.cpp
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.cpp
@@ -378,7 +378,7 @@ void LiveSelectionTool::clear()
void LiveSelectionTool::selectedItemsChanged(const QList<QGraphicsItem*> &itemList)
{
- foreach (const QWeakPointer<QGraphicsObject> &obj, m_selectedItemList) {
+ foreach (const QPointer<QGraphicsObject> &obj, m_selectedItemList) {
if (!obj.isNull()) {
disconnect(obj.data(), SIGNAL(xChanged()), this, SLOT(repaintBoundingRects()));
disconnect(obj.data(), SIGNAL(yChanged()), this, SLOT(repaintBoundingRects()));
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.h b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.h
index c3fcaa5f..e5a1f87b 100644
--- a/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.h
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.h
@@ -115,7 +115,7 @@ private:
QTime m_mousePressTimer;
bool m_selectOnlyContentItems;
- QList<QWeakPointer<QGraphicsObject> > m_selectedItemList;
+ QList<QPointer<QGraphicsObject> > m_selectedItemList;
#ifndef QT_NO_CONTEXTMENU
QList<QGraphicsItem*> m_contextMenuItemList;
diff --git a/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector.cpp b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector.cpp
index 257c5659..d08b82b1 100644
--- a/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector.cpp
+++ b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector.cpp
@@ -235,7 +235,7 @@ void QDeclarativeViewInspectorPrivate::_q_removeFromSelection(QObject *obj)
void QDeclarativeViewInspectorPrivate::setSelectedItemsForTools(const QList<QGraphicsItem *> &items)
{
- foreach (const QWeakPointer<QGraphicsObject> &obj, currentSelection) {
+ foreach (const QPointer<QGraphicsObject> &obj, currentSelection) {
if (QGraphicsItem *item = obj.data()) {
if (!items.contains(item)) {
QObject::disconnect(obj.data(), SIGNAL(destroyed(QObject*)),
@@ -260,11 +260,11 @@ void QDeclarativeViewInspectorPrivate::setSelectedItemsForTools(const QList<QGra
void QDeclarativeViewInspectorPrivate::setSelectedItems(const QList<QGraphicsItem *> &items)
{
- QList<QWeakPointer<QGraphicsObject> > oldList = currentSelection;
+ QList<QPointer<QGraphicsObject> > oldList = currentSelection;
setSelectedItemsForTools(items);
if (oldList != currentSelection) {
QList<QObject*> objectList;
- foreach (const QWeakPointer<QGraphicsObject> &graphicsObject, currentSelection) {
+ foreach (const QPointer<QGraphicsObject> &graphicsObject, currentSelection) {
if (graphicsObject)
objectList << graphicsObject.data();
}
@@ -276,7 +276,7 @@ void QDeclarativeViewInspectorPrivate::setSelectedItems(const QList<QGraphicsIte
QList<QGraphicsItem *> QDeclarativeViewInspectorPrivate::selectedItems() const
{
QList<QGraphicsItem *> selection;
- foreach (const QWeakPointer<QGraphicsObject> &selectedObject, currentSelection) {
+ foreach (const QPointer<QGraphicsObject> &selectedObject, currentSelection) {
if (selectedObject.data())
selection << selectedObject.data();
}
diff --git a/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector_p.h b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector_p.h
index 596bfe13..47186d12 100644
--- a/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector_p.h
+++ b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector_p.h
@@ -46,7 +46,7 @@
#include <QtCore/QScopedPointer>
#include <QtQuick1/QDeclarativeView>
-#include <QtCore/QWeakPointer>
+#include <QtCore/QPointer>
#include <QtCore/QPointF>
#include <QtQuick1/private/qdeclarativeinspectorservice_p.h>
@@ -71,9 +71,9 @@ public:
QDeclarativeView *view;
QDeclarativeViewInspector *q;
- QWeakPointer<QWidget> viewport;
+ QPointer<QWidget> viewport;
- QList<QWeakPointer<QGraphicsObject> > currentSelection;
+ QList<QPointer<QGraphicsObject> > currentSelection;
LiveSelectionTool *selectionTool;
ZoomTool *zoomTool;