void FormEditorView::nodeIdChanged(const ModelNode& node, const QString& newId, const QString& oldId)
{
- nodeInstanceView()->nodeIdChanged(node, newId, oldId);
+ QmlModelView::nodeIdChanged(node, newId, oldId);
}
void FormEditorView::selectedNodesChanged(const QList<ModelNode> &selectedNodeList,
m_scene->update();
}
+void FormEditorView::scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList)
+{
+ QmlModelView::scriptFunctionsChanged(node, scriptFunctionList);
+}
+
+
AbstractFormEditorTool* FormEditorView::currentTool() const
{
return m_currentTool;
void selectedNodesChanged(const QList<ModelNode> &selectedNodeList,
const QList<ModelNode> &lastSelectedNodeList);
+ void scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList);
// FormEditorView
FormEditorWidget *widget() const;
void ComponentView::variantPropertiesChanged(const QList<VariantProperty>& /*propertyList*/, PropertyChangeFlags /*propertyChange*/) {}
void ComponentView::bindingPropertiesChanged(const QList<BindingProperty>& /*propertyList*/, PropertyChangeFlags /*propertyChange*/) {}
void ComponentView::rootNodeTypeChanged(const QString &/*type*/, int /*majorVersion*/, int /*minorVersion*/) {}
+void ComponentView::scriptFunctionsChanged(const ModelNode &/*node*/, const QStringList &/*scriptFunctionList*/) {}
void variantPropertiesChanged(const QList<VariantProperty>& propertyList, PropertyChangeFlags propertyChange);
void bindingPropertiesChanged(const QList<BindingProperty>& propertyList, PropertyChangeFlags propertyChange);
void rootNodeTypeChanged(const QString &type, int majorVersion, int minorVersion);
-
+ void scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList);
void selectedNodesChanged(const QList<ModelNode> &selectedNodeList,
void DesignDocumentControllerView::nodeOrderChanged(const NodeListProperty & /*listProperty*/, const ModelNode & /*movedNode*/, int /*oldIndex*/) {};
+void DesignDocumentControllerView::scriptFunctionsChanged(const ModelNode &/*node*/, const QStringList &/*scriptFunctionList*/)
+{
+}
+
+
static QStringList arrayToStringList(const QByteArray &byteArray)
{
QString str(QString::fromLatin1(byteArray));
const QList<ModelNode> &lastSelectedNodeList);
virtual void nodeOrderChanged(const NodeListProperty &listProperty, const ModelNode &movedNode, int oldIndex);
+ virtual void scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList);
ModelNode insertModel(const ModelNode &modelNode)
{ return m_modelMerger.insertModel(modelNode); }
}
}
+void NavigatorView::scriptFunctionsChanged(const ModelNode &/*node*/, const QStringList &/*scriptFunctionList*/)
+{
+}
+
+
void NavigatorView::nodeOrderChanged(const NodeListProperty &/*listProperty*/, const ModelNode &node, int /*oldIndex*/)
{
if (m_treeModel->isInTree(node))
void selectedNodesChanged(const QList<ModelNode> &selectedNodeList,
const QList<ModelNode> &lastSelectedNodeList);
void auxiliaryDataChanged(const ModelNode &node, const QString &name, const QVariant &data);
+ void scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList);
private slots:
}
}
+void PropertyEditor::scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList)
+{
+ QmlModelView::scriptFunctionsChanged(node, scriptFunctionList);
+}
+
void PropertyEditor::select(const ModelNode &node)
{
if (QmlItemNode(node).isValid())
void bindingPropertiesChanged(const QList<BindingProperty>& propertyList, PropertyChangeFlags propertyChange);
void nodeIdChanged(const ModelNode& node, const QString& newId, const QString& oldId);
+ void scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList);
protected:
void timerEvent(QTimerEvent *event);
QmlModelView::customNotification(view, identifier, nodeList, data);
}
+void StatesEditorView::scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList)
+{
+ if (debug)
+ qDebug() << __FUNCTION__;
+
+ QmlModelView::scriptFunctionsChanged(node, scriptFunctionList);
+}
+
+
QPixmap StatesEditorView::renderState(int i)
{
if (debug)
void nodeInstancePropertyChanged(const ModelNode &node, const QString &propertyName);
-protected:
// AbstractView
void modelAttached(Model *model);
void modelAboutToBeDetached(Model *model);
void otherPropertyChanged(const QmlObjectNode &qmlObjectNode, const QString &propertyName);
void customNotification(const AbstractView *view, const QString &identifier, const QList<ModelNode> &nodeList, const QList<QVariant> &data);
+ void scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList);
protected:
virtual void customNotification(const AbstractView *view, const QString &identifier, const QList<ModelNode> &nodeList, const QList<QVariant> &data);
+ virtual void scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList) = 0;
+
QmlModelView *toQmlModelView();
void changeRootNodeType(const QString &type, int majorVersion, int minorVersion);
void auxiliaryDataChanged(const ModelNode &node, const QString &name, const QVariant &data);
+ void scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList);
protected:
void appendView(ViewType *view);
}
template <class ViewType>
+ void ForwardView<ViewType>::scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList)
+{
+ foreach (const ViewTypePointer &view, m_targetViewList)
+ view->scriptFunctionsChanged(node, scriptFunctionList);
+}
+
+template <class ViewType>
void ForwardView<ViewType>::appendView(ViewType *view)
{
m_targetViewList.append(view);
bool hasNodeProperty(const QString &name) const;
bool hasNodeListProperty(const QString &name) const;
+
+ void setScriptFunctions(const QStringList &scriptFunctionList);
+ QStringList scriptFunctions() const;
+
//###
void destroy();
void nodeIdChanged(const ModelNode& node, const QString& newId, const QString& oldId);
void nodeOrderChanged(const NodeListProperty &listProperty, const ModelNode &movedNode, int oldIndex);
void selectedNodesChanged(const QList<ModelNode> &selectedNodeList, const QList<ModelNode> &lastSelectedNodeList);
+ void scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList);
+
QList<NodeInstance> instances() const;
NodeInstance instanceForNode(const ModelNode &node);
void nodeOrderChanged(const NodeListProperty &listProperty, const ModelNode &movedNode, int oldIndex);
void rootNodeTypeChanged(const QString &type, int majorVersion, int minorVersion);
void customNotification(const AbstractView *view, const QString &identifier, const QList<ModelNode> &nodeList, const QList<QVariant> &data);
+ void scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList);
void importAdded(const Import &import);
void importRemoved(const Import &import);
{
}
+void NodeInstanceView::scriptFunctionsChanged(const ModelNode &/*node*/, const QStringList &/*scriptFunctionList*/)
+{
+
+}
//\}
return firstNode.data() < secondNode.data();
}
+void InternalNode::setScriptFunctions(const QStringList &scriptFunctionList)
+{
+ m_scriptFunctionList = scriptFunctionList;
+}
+
+QStringList InternalNode::scriptFunctions() const
+{
+ return m_scriptFunctionList;
+}
+
}
}
#include <QHash>
#include <QSharedPointer>
#include <QWeakPointer>
+#include <QStringList>
#include "internalproperty.h"
#include "internalvariantproperty.h"
#include "internalbindingproperty.h"
QList<InternalNode::Pointer> allSubNodes() const;
QList<InternalNode::Pointer> allDirectSubNodes() const;
+ void setScriptFunctions(const QStringList &scriptFunctionList);
+ QStringList scriptFunctions() const;
+
protected:
Pointer internalPointer() const;
void setInternalWeakPointer(const Pointer &pointer);
bool m_valid;
QHash<QString, InternalPropertyPointer> m_namePropertyHash;
+ QStringList m_scriptFunctionList;
};
uint qHash(const InternalNodePointer& node);
}
}
+void ModelPrivate::notifyScriptFunctionsChanged(const InternalNodePointer &internalNodePointer, const QStringList &scriptFunctionList)
+{
+ bool resetModel = false;
+ QString description;
+
+ foreach (const QWeakPointer<AbstractView> &view, m_viewList) {
+ Q_ASSERT(view != 0);
+
+
+ ModelNode node(internalNodePointer, model(), view.data());
+ try {
+ view->scriptFunctionsChanged(node, scriptFunctionList);
+ } catch (RewritingException &e) {
+ description = e.description();
+ resetModel = true;
+ }
+ }
+ if (resetModel) {
+ resetModelByRewriter(description);
+ }
+}
+
+
void ModelPrivate::notifyVariantPropertiesChanged(const InternalNodePointer &internalNodePointer, const QStringList& propertyNameList, AbstractView::PropertyChangeFlags propertyChange)
{
bool resetModel = false;
notifyRootNodeTypeChanged(type, majorVersion, minorVersion);
}
+void ModelPrivate::setScriptFunctions(const InternalNode::Pointer &internalNode, const QStringList &scriptFunctionList)
+{
+ internalNode->setScriptFunctions(scriptFunctionList);
+
+ notifyScriptFunctionsChanged(internalNode, scriptFunctionList);
+}
+
void ModelPrivate::changeNodeOrder(const InternalNode::Pointer &internalParentNode, const QString &listPropertyName, int from, int to)
{
InternalNodeListProperty::Pointer nodeList(internalParentNode->nodeListProperty(listPropertyName));
void notifyPropertiesAboutToBeRemoved(const QList<InternalPropertyPointer> &propertyList);
void notifyBindingPropertiesChanged(const QList<InternalBindingPropertyPointer> &propertyList, AbstractView::PropertyChangeFlags propertyChange);
void notifyVariantPropertiesChanged(const InternalNodePointer &internalNodePointer, const QStringList& propertyNameList, AbstractView::PropertyChangeFlags propertyChange);
+ void notifyScriptFunctionsChanged(const InternalNodePointer &internalNodePointer, const QStringList &scriptFunctionList);
void notifyNodeOrderChanged(const InternalNodeListPropertyPointer &internalListPropertyPointer, const InternalNodePointer &internalNodePointer, int oldIndex);
void notifyAuxiliaryDataChanged(const InternalNodePointer &internalNode, const QString &name, const QVariant &data);
void notifyCustomNotification(const AbstractView *senderView, const QString &identifier, const QList<ModelNode> &nodeList, const QList<QVariant> &data);
+
+
void setSelectedNodes(const QList<InternalNodePointer> &selectedNodeList);
void clearSelectedNodes();
QList<InternalNodePointer> selectedNodes() const;
void checkPropertyName(const QString &propertyName);
void clearParent(const InternalNodePointer &internalNode);
void changeRootNodeType(const QString &type, int majorVersion, int minorVersion);
+ void setScriptFunctions(const InternalNodePointer &internalNode, const QStringList &scriptFunctionList);
InternalNodePointer nodeForId(const QString &id) const;
bool hasId(const QString &id) const;
return internalNode()->hasAuxiliaryData(name);
}
+void ModelNode::setScriptFunctions(const QStringList &scriptFunctionList)
+{
+ model()->m_d->setScriptFunctions(internalNode(), scriptFunctionList);
+}
+
+QStringList ModelNode::scriptFunctions() const
+{
+ return internalNode()->scriptFunctions();
+}
+
}
}
}
+void RewriterView::scriptFunctionsChanged(const ModelNode &/*node*/, const QStringList &/*scriptFunctionList*/)
+{
+}
+
void RewriterView::selectedNodesChanged(const QList<ModelNode> & /* selectedNodeList, */, const QList<ModelNode> & /*lastSelectedNodeList */)
{
}
m_output << time() << indent("data: ") << variant.toString() << endl;
}
+void ViewLogger::scriptFunctionsChanged(const ModelNode &node, const QStringList &/*scriptFunctionList*/)
+{
+ m_output << time() << indent("function scripts changed:") << node << endl;
+
+}
+
} // namespace Internal
} // namespace QmlDesigner
void auxiliaryDataChanged(const ModelNode &node, const QString &name, const QVariant &data);
void customNotification(const AbstractView *view, const QString &identifier, const QList<ModelNode> &nodeList, const QList<QVariant> &data);
+ void scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList);
protected:
QString time() const;