Commit c7b1ae1e authored by Marco Bubke's avatar Marco Bubke
Browse files

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
......@@ -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>
#include <QList>
#include <QVariant>
......@@ -196,8 +196,8 @@ private: // functions
private: // variables
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 ModelNode &firstNode, const ModelNode &secondNode);
......
......@@ -31,7 +31,7 @@
#define NODEANCHORS_H
#include <QWeakPointer>
#include <QPointer>
#include <QSharedPointer>
#include "corelib_global.h"
#include <anchorline.h>
......@@ -103,7 +103,7 @@ private: // functions
private: //variables
Internal::InternalNodePointer m_internalNode;
Internal::InternalNodeStatePointer m_internalNodeState;
QWeakPointer<Model> m_model;
QPointer<Model> m_model;
};
CORESHARED_EXPORT QDebug operator<<(QDebug debug, const NodeAnchors &anchors);
......
......@@ -40,7 +40,7 @@
#include <QHash>
#include <QImage>
#include <QWeakPointer>
#include <QPointer>
#include <QRectF>
#include <QTime>
......@@ -212,7 +212,7 @@ private: //variables
QHash<ModelNode, QImage> m_statePreviewImage;
uint m_blockUpdates;
QWeakPointer<NodeInstanceServerInterface> m_nodeInstanceServer;
QPointer<NodeInstanceServerInterface> m_nodeInstanceServer;
QImage m_baseStatePreviewImage;
QTime m_lastCrashTime;
NodeInstanceServerInterface::RunModus m_runModus;
......
......@@ -38,7 +38,7 @@
#include <QString>
#include <QUrl>
#include <QFileSystemWatcher>
#include <QWeakPointer>
#include <QPointer>
#include <QFileInfo>
namespace QmlDesigner {
......@@ -76,7 +76,7 @@ private: // variables
// key: canonical directory path
QMultiHash<QString,QString> m_dirToQualifier;
QUrl m_filePath;
QWeakPointer<Model> m_model;
QPointer<Model> m_model;
};
} // namespace QmlDesigner
......
......@@ -32,7 +32,7 @@
#include "nodeinstanceserverinterface.h"
#include <QWeakPointer>
#include <QPointer>
#include <QProcess>
#include <QFile>
......@@ -94,14 +94,14 @@ private slots:
void printRenderProcessOutput();
private:
QFile m_captureFileForTest;
QWeakPointer<QLocalServer> m_localServer;
QWeakPointer<QLocalSocket> m_firstSocket;
QWeakPointer<QLocalSocket> m_secondSocket;
QWeakPointer<QLocalSocket> m_thirdSocket;
QWeakPointer<NodeInstanceView> m_nodeInstanceView;
QWeakPointer<QProcess> m_qmlPuppetEditorProcess;
QWeakPointer<QProcess> m_qmlPuppetPreviewProcess;
QWeakPointer<QProcess> m_qmlPuppetRenderProcess;
QPointer<QLocalServer> m_localServer;
QPointer<QLocalSocket> m_firstSocket;
QPointer<QLocalSocket> m_secondSocket;
QPointer<QLocalSocket> m_thirdSocket;
QPointer<NodeInstanceView> m_nodeInstanceView;
QPointer<QProcess> m_qmlPuppetEditorProcess;
QPointer<QProcess> m_qmlPuppetPreviewProcess;
QPointer<QProcess> m_qmlPuppetRenderProcess;
quint32 m_firstBlockSize;
quint32 m_secondBlockSize;
quint32 m_thirdBlockSize;
......
......@@ -53,10 +53,6 @@ class MetaInfoPrivate
{
Q_DISABLE_COPY(MetaInfoPrivate)
public:
typedef QSharedPointer<MetaInfoPrivate> Pointer;
typedef QWeakPointer<MetaInfoPrivate> WeakPointer;
MetaInfoPrivate(MetaInfo *q);
void clear();
......
......@@ -34,7 +34,7 @@
#include "invalidpropertyexception.h"
#include "invalidargumentexception.h"
#include <QWeakPointer>
#include <QPointer>
#include <QHashIterator>
......@@ -94,7 +94,7 @@ ModelPrivate::~ModelPrivate()
void ModelPrivate::detachAllViews()
{
foreach (const QWeakPointer<AbstractView> &view, m_viewList)
foreach (const QPointer<AbstractView> &view, m_viewList)
detachView(view.data(), true);
m_viewList.clear();
......@@ -162,7 +162,7 @@ void ModelPrivate::notifyImportsChanged(const QList<Import> &addedImports, const
if (nodeInstanceView())
nodeInstanceView()->importsChanged(addedImports, removedImports);
foreach (const QWeakPointer<AbstractView> &view, m_viewList)
foreach (const QPointer<AbstractView> &view, m_viewList)
view->importsChanged(addedImports, removedImports);
if (resetModel)
......@@ -181,7 +181,7 @@ void ModelPrivate::setFileUrl(const QUrl &fileUrl)
if (oldPath != fileUrl) {
m_fileUrl = fileUrl;
foreach (const QWeakPointer<AbstractView> &view, m_viewList)
foreach (const QPointer<AbstractView> &view, m_viewList)
view->fileUrlChanged(oldPath, fileUrl);
}
}
......@@ -337,7 +337,7 @@ void ModelPrivate::notifyAuxiliaryDataChanged(const InternalNodePointer &interna
resetModel = true;
}
foreach (const QWeakPointer<AbstractView> &view, m_viewList) {
foreach (const QPointer<AbstractView> &view, m_viewList) {
Q_ASSERT(view != 0);
ModelNode node(internalNode, model(), view.data());
view->auxiliaryDataChanged(node, name, data);
......@@ -368,7 +368,7 @@ void ModelPrivate::notifyNodeSourceChanged(const InternalNodePointer &internalNo
resetModel = true;
}
foreach (const QWeakPointer<AbstractView> &view, m_viewList) {
foreach (const QPointer<AbstractView> &view, m_viewList) {
Q_ASSERT(view != 0);
ModelNode node(internalNode, model(), view.data());
view->nodeSourceChanged(node, newNodeSource);
......@@ -400,7 +400,7 @@ void ModelPrivate::notifyRootNodeTypeChanged(const QString &type, int majorVersi
if (nodeInstanceView())
nodeInstanceView()->rootNodeTypeChanged(type, majorVersion, minorVersion);
foreach (const QWeakPointer<AbstractView> &view, m_viewList) {
foreach (const QPointer<AbstractView> &view, m_viewList) {
Q_ASSERT(view != 0);
view->rootNodeTypeChanged(type, majorVersion, minorVersion);
......@@ -415,7 +415,7 @@ void ModelPrivate::notifyInstancePropertyChange(const QList<QPair<ModelNode, Pro
// no need to notify the rewriter or the instance view
typedef QPair<ModelNode, PropertyName> ModelNodePropertyPair;
foreach (const QWeakPointer<AbstractView> &view, m_viewList) {
foreach (const QPointer<AbstractView> &view, m_viewList) {
Q_ASSERT(view != 0);
QList<QPair<ModelNode, PropertyName> > adaptedPropertyList;
......@@ -443,7 +443,7 @@ void ModelPrivate::notifyInstancesCompleted(const QVector<ModelNode> &nodeVector
resetModel = true;
}
foreach (const QWeakPointer<AbstractView> &view, m_viewList) {
foreach (const QPointer<AbstractView> &view, m_viewList) {
Q_ASSERT(view != 0);
view->instancesCompleted(toModelNodeVector(internalVector, view.data()));
}
......@@ -481,7 +481,7 @@ void ModelPrivate::notifyInstancesInformationsChange(const QMultiHash<ModelNode,
resetModel = true;
}
foreach (const QWeakPointer<AbstractView> &view, m_viewList) {
foreach (const QPointer<AbstractView> &view, m_viewList) {
Q_ASSERT(view != 0);
view->instanceInformationsChange(convertModelNodeInformationHash(informationChangeHash, view.data()));
}
......@@ -508,7 +508,7 @@ void ModelPrivate::notifyInstancesRenderImageChanged(const QVector<ModelNode> &n
resetModel = true;
}
foreach (const QWeakPointer<AbstractView> &view, m_viewList) {
foreach (const QPointer<AbstractView> &view, m_viewList) {
Q_ASSERT(view != 0);
view->instancesRenderImageChanged(toModelNodeVector(internalVector, view.data()));
}
......@@ -535,7 +535,7 @@ void ModelPrivate::notifyInstancesPreviewImageChanged(const QVector<ModelNode> &
resetModel = true;
}
foreach (const QWeakPointer<AbstractView> &view, m_viewList) {
foreach (const QPointer<AbstractView> &view, m_viewList) {
Q_ASSERT(view != 0);
view->instancesPreviewImageChanged(toModelNodeVector(internalVector, view.data()));
}
......@@ -562,7 +562,7 @@ void ModelPrivate::notifyInstancesChildrenChanged(const QVector<ModelNode> &node
resetModel = true;
}
foreach (const QWeakPointer<AbstractView> &view, m_viewList) {
foreach (const QPointer<AbstractView> &view, m_viewList) {
Q_ASSERT(view != 0);
view->instancesChildrenChanged(toModelNodeVector(internalVector, view.data()));
}
......@@ -589,7 +589,7 @@ void ModelPrivate::notifyCurrentStateChanged(const ModelNode &node)
resetModel = true;
}
foreach (const QWeakPointer<AbstractView> &view, m_viewList) {
foreach (const QPointer<AbstractView> &view, m_viewList) {
Q_ASSERT(view != 0);
view->currentStateChanged(ModelNode(node.internalNode(), model(), view.data()));
}
......@@ -614,7 +614,7 @@ void ModelPrivate::notifyRewriterBeginTransaction()
resetModel = true;
}
foreach (const QWeakPointer<AbstractView> &view, m_viewList) {
foreach (const QPointer<AbstractView> &view, m_viewList) {
Q_ASSERT(view != 0);
view->rewriterBeginTransaction();
}
......@@ -639,7 +639,7 @@ void ModelPrivate::notifyRewriterEndTransaction()
resetModel = true;
}
foreach (const QWeakPointer<AbstractView> &view, m_viewList) {
foreach (const QPointer<AbstractView> &view, m_viewList) {
Q_ASSERT(view != 0);
view->rewriterEndTransaction();
}
......@@ -667,7 +667,7 @@ void ModelPrivate::notifyInstanceToken(const QString &token, int number, const Q
resetModel = true;
}
foreach (const QWeakPointer<AbstractView> &view, m_viewList) {
foreach (const QPointer<AbstractView> &view, m_viewList) {
Q_ASSERT(view != 0);
view->instancesToken(token, number, toModelNodeVector(internalVector, view.data()));
}
......@@ -694,7 +694,7 @@ void ModelPrivate::notifyCustomNotification(const AbstractView *senderView, cons
resetModel = true;
}
foreach (const QWeakPointer<AbstractView> &view, m_viewList) {
foreach (const QPointer<AbstractView> &view, m_viewList) {
Q_ASSERT(view != 0);
view->customNotification(senderView, identifier, toModelNodeList(internalList, view.data()), data);
}
......@@ -737,7 +737,7 @@ void ModelPrivate::notifyPropertiesRemoved(const QList<PropertyPair> &propertyPa
nodeInstanceView()->propertiesRemoved(propertyList);
}
foreach (const QWeakPointer<AbstractView> &view, m_viewList) {
foreach (const QPointer<AbstractView> &view, m_viewList) {
QList<AbstractProperty> propertyList;
Q_ASSERT(view != 0);
foreach (const PropertyPair &propertyPair, propertyPairList) {
......@@ -772,7 +772,7 @@ void ModelPrivate::notifyPropertiesAboutToBeRemoved(const QList<InternalProperty
resetModel = true;
}
foreach (const QWeakPointer<AbstractView> &view, m_viewList) {
foreach (const QPointer<AbstractView> &view, m_viewList) {
QList<AbstractProperty> propertyList;
Q_ASSERT(view != 0);
foreach (const InternalProperty::Pointer &property, internalPropertyList) {
......@@ -861,7 +861,7 @@ void ModelPrivate::notifyNodeCreated(const InternalNode::Pointer &newInternalNod
nodeInstanceView()->nodeCreated(createdNode);
}
foreach (const QWeakPointer<AbstractView> &view, m_viewList) {
foreach (const QPointer<AbstractView> &view, m_viewList) {
Q_ASSERT(view != 0);
ModelNode createdNode(newInternalNodePointer, model(), view.data());
view->nodeCreated(createdNode);
......@@ -886,7 +886,7 @@ void ModelPrivate::notifyNodeAboutToBeRemoved(const InternalNode::Pointer &inter
resetModel = true;
}
foreach (const QWeakPointer<AbstractView> &view, m_viewList) {
foreach (const QPointer<AbstractView> &view, m_viewList) {
Q_ASSERT(view != 0);
ModelNode modelNode(internalNodePointer, model(), view.data());
view->nodeAboutToBeRemoved(modelNode);
......@@ -926,7 +926,7 @@ void ModelPrivate::notifyNodeRemoved(const InternalNodePointer &internalNodePoin
nodeInstanceView()->nodeRemoved(modelNode, parentProperty, propertyChange);
}
foreach (const QWeakPointer<AbstractView> &view, m_viewList) {
foreach (const QPointer<AbstractView> &view, m_viewList) {
Q_ASSERT(view != 0);
ModelNode modelNode(internalNodePointer, model(), view.data());
NodeAbstractProperty parentProperty(parentPropertyName, parentNodePointer, model(), view.data());
......@@ -953,7 +953,7 @@ void ModelPrivate::notifyNodeIdChanged(const InternalNode::Pointer& internalNode
resetModel = true;
}
foreach (const QWeakPointer<AbstractView> &view, m_viewList) {
foreach (const QPointer<AbstractView> &view, m_viewList) {
Q_ASSERT(view != 0);
ModelNode modelNode(internalNodePointer, model(), view.data());
view->nodeIdChanged(modelNode, newId, oldId);
......@@ -987,7 +987,7 @@ void ModelPrivate::notifyBindingPropertiesChanged(const QList<InternalBindingPro
resetModel = true;
}
foreach (const QWeakPointer<AbstractView> &view, m_viewList) {
foreach (const QPointer<AbstractView> &view, m_viewList) {
Q_ASSERT(view != 0);
QList<BindingProperty> propertyList;
foreach (const InternalBindingPropertyPointer &bindingProperty, internalPropertyList) {
......@@ -1028,7 +1028,7 @@ void ModelPrivate::notifySignalHandlerPropertiesChanged(const QVector<InternalSi
resetModel = true;
}
foreach (const QWeakPointer<AbstractView> &view, m_viewList) {
foreach (const QPointer<AbstractView> &view, m_viewList) {
Q_ASSERT(view != 0);
QVector<SignalHandlerProperty> propertyList;
foreach (const InternalSignalHandlerPropertyPointer &signalHandlerProperty, internalPropertyList) {
......@@ -1070,7 +1070,7 @@ void ModelPrivate::notifyScriptFunctionsChanged(const InternalNodePointer &inter
nodeInstanceView()->scriptFunctionsChanged(node, scriptFunctionList);
}
foreach (const QWeakPointer<AbstractView> &view, m_viewList) {
foreach (const QPointer<AbstractView> &view, m_viewList) {
Q_ASSERT(view != 0);
ModelNode node(internalNodePointer, model(), view.data());
......@@ -1107,7 +1107,7 @@ void ModelPrivate::notifyVariantPropertiesChanged(const InternalNodePointer &int
}
foreach (const QWeakPointer<AbstractView> &view, m_viewList) {
foreach (const QPointer<AbstractView> &view, m_viewList) {
QList<VariantProperty> propertyList;
Q_ASSERT(view != 0);
foreach (const PropertyName &propertyName, propertyNameList) {
......@@ -1163,7 +1163,7 @@ void ModelPrivate::notifyNodeAboutToBeReparent(const InternalNodePointer &intern
resetModel = true;
}
foreach (const QWeakPointer<AbstractView> &view, m_viewList) {
foreach (const QPointer<AbstractView> &view, m_viewList) {
NodeAbstractProperty newProperty;
NodeAbstractProperty oldProperty;
......@@ -1224,7 +1224,7 @@ void ModelPrivate::notifyNodeReparent(const InternalNode::Pointer &internalNodeP
resetModel = true;
}
foreach (const QWeakPointer<AbstractView> &view, m_viewList) {
foreach (const QPointer<AbstractView> &view, m_viewList) {
NodeAbstractProperty newProperty;
NodeAbstractProperty oldProperty;
......@@ -1274,7 +1274,7 @@ void ModelPrivate::notifyNodeOrderChanged(const InternalNodeListPropertyPointer
resetModel = true;
}
foreach (const QWeakPointer<AbstractView> &view, m_viewList) {
foreach (const QPointer<AbstractView> &view, m_viewList) {
Q_ASSERT(!view.isNull());
view->nodeOrderChanged(NodeListProperty(internalListPropertyPointer, model(), view.data()),
ModelNode(internalNodePointer, model(), view.data()),
......@@ -1368,7 +1368,7 @@ QVector<Internal::InternalNode::Pointer> ModelPrivate::toInternalNodeVector(cons
void ModelPrivate::changeSelectedNodes(const QList<InternalNode::Pointer> &newSelectedNodeList,
const QList<InternalNode::Pointer> &oldSelectedNodeList)
{
foreach (const QWeakPointer<AbstractView> &view, m_viewList) {
foreach (const QPointer<AbstractView> &view, m_viewList) {
Q_ASSERT(view != 0);
view->selectedNodesChanged(toModelNodeList(newSelectedNodeList, view.data()), toModelNodeList(oldSelectedNodeList, view.data()));
}
......
......@@ -31,7 +31,7 @@
#define MODEL_P_H
#include <QList>
#include <QWeakPointer>
#include <QPointer>