Commit c7b1ae1e authored by Marco Bubke's avatar Marco Bubke

QmlDesigner: Exchange QWeakPointer with QPointer

Because we compile only with Qt 5.

Change-Id: I2c6496f37550438f7c8ccbf8af0090c525b87d8f
Reviewed-by: default avatarTim Jenssen <tim.jenssen@digia.com>
parent 811f74ce
......@@ -30,6 +30,7 @@
#include <qmldesignercorelib_global.h>
#include <abstractview.h>
#include <QPointF>
#include <QPointer>
#ifndef SELECTIONCONTEXT_H
#define SELECTIONCONTEXT_H
......@@ -67,7 +68,7 @@ public:
bool isValid() const;
private:
QWeakPointer<AbstractView> m_view;
QPointer<AbstractView> m_view;
ModelNode m_targetNode;
bool m_showSelectionTools;
QPointF m_scenePosition;
......
......@@ -36,7 +36,7 @@
#include <QObject>
#include <QScopedPointer>
#include <QPointer>
namespace QmlDesigner {
......@@ -121,7 +121,7 @@ private:
MoveManipulator m_moveManipulator;
SelectionIndicator m_selectionIndicator;
QWeakPointer<FormEditorItem> m_movingItem;
QPointer<FormEditorItem> m_movingItem;
RewriterTransaction m_rewriterTransaction;
QmlItemNode m_dragNode;
QScopedPointer<Internal::TimerHandler> m_timerHandler;
......
......@@ -30,7 +30,7 @@
#ifndef FORMEDITORITEM_H
#define FORMEDITORITEM_H
#include <QWeakPointer>
#include <QPointer>
#include <QGraphicsWidget>
#include <qmlitemnode.h>
#include "snappinglinecreator.h"
......@@ -125,7 +125,7 @@ private: // functions
private: // variables
SnappingLineCreator m_snappingLineCreator;
QmlItemNode m_qmlItemNode;
QWeakPointer<QTimeLine> m_attentionTimeLine;
QPointer<QTimeLine> m_attentionTimeLine;
QTransform m_inverseAttentionTransform;
QRectF m_boundingRect;
QRectF m_paintedBoundingRect;
......
......@@ -32,7 +32,7 @@
#include <QGraphicsScene>
#include <QWeakPointer>
#include <QPointer>
#include <QHash>
#include <qmlitemnode.h>
#include "abstractformeditortool.h"
......@@ -124,8 +124,8 @@ private:
FormEditorView *m_editorView;
AbstractFormEditorTool *m_currentTool;
QHash<QmlItemNode, FormEditorItem*> m_qmlItemNodeItemHash;
QWeakPointer<LayerItem> m_formLayerItem;
QWeakPointer<LayerItem> m_manipulatorLayerItem;
QPointer<LayerItem> m_formLayerItem;
QPointer<LayerItem> m_manipulatorLayerItem;
ModelNode m_dragNode;
bool m_showBoundingRects;
};
......
......@@ -143,8 +143,8 @@ private: //functions
void hideNodeFromScene(const QmlItemNode &qmlItemNode);
private: //variables
QWeakPointer<FormEditorWidget> m_formEditorWidget;
QWeakPointer<FormEditorScene> m_scene;
QPointer<FormEditorWidget> m_formEditorWidget;
QPointer<FormEditorScene> m_scene;
QList<AbstractCustomTool*> m_customToolList;
MoveTool *m_moveTool;
SelectionTool *m_selectionTool;
......
......@@ -31,6 +31,7 @@
#define FORMEDITORWIDGET_H
#include <QWidget>
#include <QPointer>
QT_BEGIN_NAMESPACE
class QActionGroup;
......@@ -89,20 +90,20 @@ private slots:
void resetNodeInstanceView();
private:
QWeakPointer<FormEditorView> m_formEditorView;
QWeakPointer<FormEditorGraphicsView> m_graphicsView;
QWeakPointer<ZoomAction> m_zoomAction;
QWeakPointer<ToolBox> m_toolBox;
QWeakPointer<QAction> m_transformToolAction;
QWeakPointer<QActionGroup> m_toolActionGroup;
QWeakPointer<QAction> m_snappingAction;
QWeakPointer<QAction> m_snappingAndAnchoringAction;
QWeakPointer<QAction> m_noSnappingAction;
QWeakPointer<QAction> m_showBoundingRectAction;
QWeakPointer<QAction> m_selectOnlyContentItemsAction;
QWeakPointer<LineEditAction> m_rootWidthAction;
QWeakPointer<LineEditAction> m_rootHeightAction;
QWeakPointer<QAction> m_resetAction;
QPointer<FormEditorView> m_formEditorView;
QPointer<FormEditorGraphicsView> m_graphicsView;
QPointer<ZoomAction> m_zoomAction;
QPointer<ToolBox> m_toolBox;
QPointer<QAction> m_transformToolAction;
QPointer<QActionGroup> m_toolActionGroup;
QPointer<QAction> m_snappingAction;
QPointer<QAction> m_snappingAndAnchoringAction;
QPointer<QAction> m_noSnappingAction;
QPointer<QAction> m_showBoundingRectAction;
QPointer<QAction> m_selectOnlyContentItemsAction;
QPointer<LineEditAction> m_rootWidthAction;
QPointer<LineEditAction> m_rootHeightAction;
QPointer<QAction> m_resetAction;
};
......
......@@ -30,7 +30,7 @@
#ifndef MOVEMANIPULATOR_H
#define MOVEMANIPULATOR_H
#include <QWeakPointer>
#include <QPointer>
#include <QGraphicsItem>
#include <QHash>
#include <QPointF>
......@@ -99,8 +99,8 @@ protected:
private:
Snapper m_snapper;
QWeakPointer<LayerItem> m_layerItem;
QWeakPointer<FormEditorView> m_view;
QPointer<LayerItem> m_layerItem;
QPointer<FormEditorView> m_view;
QList<FormEditorItem*> m_itemList;
QHash<FormEditorItem*, QRectF> m_beginItemRectInSceneSpaceHash;
QHash<FormEditorItem*, QPointF> m_beginPositionInSceneSpaceHash;
......
......@@ -31,6 +31,7 @@
#define NUMBERSERIESACTION_H
#include <QWidgetAction>
#include <QPointer>
QT_BEGIN_NAMESPACE
class QStandardItemModel;
......@@ -59,7 +60,7 @@ private slots:
void emitValueChanged(int index);
private:
QWeakPointer<QStandardItemModel> m_comboBoxModel;
QPointer<QStandardItemModel> m_comboBoxModel;
int m_comboBoxModelIndex;
};
......
......@@ -47,8 +47,8 @@ public:
~ResizeControllerData();
QWeakPointer<LayerItem> layerItem;
QWeakPointer<FormEditorItem> formEditorItem;
QPointer<LayerItem> layerItem;
QPointer<FormEditorItem> formEditorItem;
QSharedPointer<ResizeHandleItem> topLeftItem;
QSharedPointer<ResizeHandleItem> topRightItem;
QSharedPointer<ResizeHandleItem> bottomLeftItem;
......
......@@ -30,7 +30,7 @@
#ifndef RESIZEMANIPULATOR_H
#define RESIZEMANIPULATOR_H
#include <QWeakPointer>
#include <QPointer>
#include "resizehandleitem.h"
#include <snapper.h>
#include "rewritertransaction.h"
......@@ -67,7 +67,7 @@ protected:
private:
Snapper m_snapper;
QWeakPointer<FormEditorView> m_view;
QPointer<FormEditorView> m_view;
QList<QGraphicsItem*> m_graphicsLineList;
ResizeController m_resizeController; // hold the controller so that the handle cant be deleted
QTransform m_beginFromSceneToContentItemTransform;
......@@ -80,7 +80,7 @@ private:
double m_beginLeftMargin;
double m_beginRightMargin;
double m_beginBottomMargin;
QWeakPointer<LayerItem> m_layerItem;
QPointer<LayerItem> m_layerItem;
ResizeHandleItem *m_resizeHandle;
RewriterTransaction m_rewriterTransaction;
bool m_isActive;
......
......@@ -30,7 +30,7 @@
#ifndef SELECTIONINDICATOR_H
#define SELECTIONINDICATOR_H
#include <QWeakPointer>
#include <QPointer>
#include <QGraphicsPolygonItem>
#include "layeritem.h"
#include "formeditoritem.h"
......@@ -58,7 +58,7 @@ public:
private:
QHash<FormEditorItem*, QGraphicsPolygonItem *> m_indicatorShapeHash;
QWeakPointer<LayerItem> m_layerItem;
QPointer<LayerItem> m_layerItem;
QCursor m_cursor;
};
......
......@@ -30,7 +30,7 @@
#ifndef SELECTIONRECTANGLE_H
#define SELECTIONRECTANGLE_H
#include <QWeakPointer>
#include <QPointer>
#include <QGraphicsRectItem>
#include "layeritem.h"
......@@ -55,7 +55,7 @@ public:
private:
QGraphicsRectItem *m_controlShape;
QWeakPointer<LayerItem> m_layerItem;
QPointer<LayerItem> m_layerItem;
};
}
......
......@@ -31,6 +31,7 @@
#define ZOOMACTION_H
#include <QWidgetAction>
#include <QPointer>
QT_BEGIN_NAMESPACE
class QAbstractItemModel;
......@@ -60,7 +61,7 @@ private slots:
void emitZoomLevelChanged(int index);
private:
QWeakPointer<QAbstractItemModel> m_comboBoxModel;
QPointer<QAbstractItemModel> m_comboBoxModel;
double m_zoomLevel;
int m_currentComboBoxIndex;
};
......
......@@ -31,7 +31,7 @@
#define QMLDESIGNER_IMPORTMANAGERVIEW_H
#include <abstractview.h>
#include <QWeakPointer>
#include <QPointer>
namespace QmlDesigner {
......@@ -98,7 +98,7 @@ private slots:
void addImport(const Import &import);
private:
ImportsWidget *m_importsWidget;
QPointer<ImportsWidget> m_importsWidget;
};
} // namespace QmlDesigner
......
......@@ -31,7 +31,7 @@
#define COMPONENTACTION_H
#include <QWidgetAction>
#include <QWeakPointer>
#include <QPointer>
QT_BEGIN_NAMESPACE
class QComboBox;
......@@ -63,7 +63,7 @@ public slots:
void emitCurrentComponentChanged(int index);
private:
QWeakPointer<ComponentView> m_componentView;
QPointer<ComponentView> m_componentView;
bool dontEmitCurrentComponentChanged;
};
......
......@@ -147,7 +147,7 @@ private: // functions
private: // variables
QScopedPointer<Model> m_documentModel;
QScopedPointer<Model> m_inFileComponentModel;
QWeakPointer<Core::IEditor> m_textEditor;
QPointer<Core::IEditor> m_textEditor;
QScopedPointer<BaseTextEditModifier> m_documentTextModifier;
QScopedPointer<ComponentTextModifier> m_inFileComponentTextModifier;
QScopedPointer<SubComponentManager> m_subComponentManager;
......
......@@ -32,7 +32,7 @@
#include <abstractview.h>
#include <QWeakPointer>
#include <QPointer>
namespace QmlDesigner {
......@@ -106,7 +106,7 @@ protected:
void updateImports();
private:
QWeakPointer<ItemLibraryWidget> m_widget;
QPointer<ItemLibraryWidget> m_widget;
ImportManagerView *m_importManagerView;
};
......
......@@ -125,18 +125,18 @@ private:
QSize m_itemIconSize;
QSize m_resIconSize;
QWeakPointer<ItemLibraryInfo> m_itemLibraryInfo;
QPointer<ItemLibraryInfo> m_itemLibraryInfo;
QWeakPointer<Internal::ItemLibraryModel> m_itemLibraryModel;
QWeakPointer<QFileSystemModel> m_resourcesFileSystemModel;
QPointer<Internal::ItemLibraryModel> m_itemLibraryModel;
QPointer<QFileSystemModel> m_resourcesFileSystemModel;
QWeakPointer<QStackedWidget> m_stackedWidget;
QPointer<QStackedWidget> m_stackedWidget;
QWeakPointer<Utils::FancyLineEdit> m_filterLineEdit;
QPointer<Utils::FancyLineEdit> m_filterLineEdit;
QScopedPointer<QQuickView> m_itemsView;
QScopedPointer<Internal::ItemLibraryTreeView> m_resourcesView;
QWeakPointer<Model> m_model;
QPointer<Model> m_model;
FilterChangeFlag m_filterFlag;
int m_itemLibraryId;
};
......
......@@ -32,7 +32,7 @@
#include <abstractview.h>
#include <QWeakPointer>
#include <QPointer>
QT_BEGIN_NAMESPACE
class QTreeView;
......@@ -116,8 +116,8 @@ protected: //functions
private:
bool m_blockSelectionChangedSignal;
QWeakPointer<NavigatorWidget> m_widget;
QWeakPointer<NavigatorTreeModel> m_treeModel;
QPointer<NavigatorWidget> m_widget;
QPointer<NavigatorTreeModel> m_treeModel;
friend class TestNavigator;
};
......
......@@ -31,6 +31,7 @@
#define NAVIGATORWIDGET_H
#include <QFrame>
#include <QPointer>
#include "navigatortreeview.h"
......@@ -63,7 +64,7 @@ private: // functions
private: // variables
NavigatorTreeView *m_treeView;
QWeakPointer<NavigatorView> m_navigatorView;
QPointer<NavigatorView> m_navigatorView;
};
}
......
......@@ -31,7 +31,7 @@
#define PLUGINPATH_H
#include <QObject>
#include <QWeakPointer>
#include <QPointer>
#include <QList>
#include <QDir>
......@@ -56,7 +56,7 @@ struct PluginData {
QString path;
bool failed;
QString errorMessage;
QWeakPointer<QObject> instanceGuard;
QPointer<QObject> instanceGuard;
IPlugin *instance;
};
......
......@@ -35,6 +35,7 @@
#include <QQuickView>
#include <QQmlEngine>
#include <QQmlContext>
#include <QPointer>
QT_BEGIN_NAMESPACE
class QQmlError;
......@@ -75,7 +76,7 @@ private:
QWidget *m_containerWidget;
QUrl m_source;
QQuickView m_view;
QWeakPointer<QQmlComponent> m_component;
QPointer<QQmlComponent> m_component;
};
......
......@@ -33,7 +33,7 @@
#include"abstractview.h"
#include <QQuickImageProvider>
#include <QWeakPointer>
#include <QPointer>
namespace QmlDesigner {
namespace Internal {
......@@ -50,7 +50,7 @@ public:
void setNodeInstanceView(NodeInstanceView *nodeInstanceView);
private:
QWeakPointer<NodeInstanceView> m_nodeInstanceView;
QPointer<NodeInstanceView> m_nodeInstanceView;
};
} // namespace Internal
......
......@@ -31,7 +31,7 @@
#define STATESEDITORMODEL_H
#include <QAbstractListModel>
#include <QWeakPointer>
#include <QPointer>
namespace QmlDesigner {
......@@ -70,7 +70,7 @@ signals:
void changedToState(int n);
private:
QWeakPointer<StatesEditorView> m_statesEditorView;
QPointer<StatesEditorView> m_statesEditorView;
int m_updateCounter;
};
......
......@@ -116,8 +116,8 @@ private:
void checkForWindow();
private:
QWeakPointer<StatesEditorModel> m_statesEditorModel;
QWeakPointer<StatesEditorWidget> m_statesEditorWidget;
QPointer<StatesEditorModel> m_statesEditorModel;
QPointer<StatesEditorWidget> m_statesEditorWidget;
int m_lastIndex;
};
......
......@@ -31,6 +31,7 @@
#define STATESEDITORWIDGET_H
#include <QWidget>
#include <QPointer>
QT_BEGIN_NAMESPACE
class QQuickView;
......@@ -68,8 +69,8 @@ public:
private slots:
void reloadQmlSource();
private:
QWeakPointer<QQuickView> m_quickView;
QWeakPointer<StatesEditorView> m_statesEditorView;
QPointer<QQuickView> m_quickView;
QPointer<StatesEditorView> m_statesEditorView;
Internal::StatesEditorImageProvider *m_imageProvider;
QShortcut *m_qmlSourceUpdateShortcut;
};
......
......@@ -30,7 +30,7 @@
#ifndef ABSTRACTPROPERTY_H
#define ABSTRACTPROPERTY_H
#include <QWeakPointer>
#include <QPointer>
#include <QSharedPointer>
#include "qmldesignercorelib_global.h"
......@@ -115,8 +115,8 @@ protected:
private:
PropertyName m_propertyName;
Internal::InternalNodePointer m_internalNode;
QWeakPointer<Model> m_model;
QWeakPointer<AbstractView> m_view;
QPointer<Model> m_model;
QPointer<AbstractView> m_view;
};
QMLDESIGNERCORE_EXPORT bool operator ==(const AbstractProperty &property1, const AbstractProperty &property2);
......
......@@ -39,6 +39,7 @@
#include <commondefines.h>
#include <QObject>
#include <QPointer>
QT_BEGIN_NAMESPACE
class QStyle;
......@@ -116,7 +117,6 @@ class QMLDESIGNERCORE_EXPORT AbstractView : public QObject
Q_OBJECT
public:
Q_FLAGS(PropertyChangeFlag PropertyChangeFlags)
typedef QWeakPointer<AbstractView> Pointer;
enum PropertyChangeFlag {
NoAdditionalChanges = 0x0,
......@@ -261,7 +261,7 @@ private: //functions
private:
QWeakPointer<Model> m_model;
QPointer<Model> m_model;
};
QMLDESIGNERCORE_EXPORT QList<Internal::InternalNodePointer> toInternalNodeList(const QList<ModelNode> &nodeList);
......
......@@ -45,7 +45,7 @@ template <class ViewType>
class ForwardView : public AbstractView
{
public:
typedef QWeakPointer<ForwardView> Pointer;
typedef QPointer<ForwardView> Pointer;
typedef typename ViewType::Pointer ViewTypePointer;
ForwardView(QObject *parent);
......
......@@ -33,7 +33,8 @@
#include "qmldesignercorelib_global.h"
#include "propertycontainer.h"
#include <QSharedPointer>
#include <QPointer>
namespace QmlDesigner {
......@@ -119,7 +120,7 @@ private: // functions
private: // variables
QHash<QString, ItemLibraryEntry> m_nameToEntryHash;
QWeakPointer<ItemLibraryInfo> m_baseInfo;
QPointer<ItemLibraryInfo> m_baseInfo;
};
} // namespace QmlDesigner
......
......@@ -31,7 +31,7 @@
#define MODELMERGER_H
#include <QWeakPointer>
#include <QPointer>
namespace QmlDesigner {
......@@ -51,7 +51,7 @@ protected:
{ return m_view.data(); }
private:
QWeakPointer<AbstractView> m_view;
QPointer<AbstractView> m_view;
};
} //namespace QmlDesigner
......
......@@ -31,7 +31,7 @@
#define MODELNODE_H
#include "qmldesignercorelib_global.h"
#include <QWeakPointer>
#include <QPointer>