Example #1
0
bool QmlRefactoring::removeProperty(int parentLocation, const PropertyName &name)
{
    if (parentLocation < 0 || name.isEmpty())
        return false;

    RemovePropertyVisitor visit(*textModifier, parentLocation, QString::fromUtf8(name));
    return visit(qmlDocument->qmlProgram());
}
Example #2
0
static void removeAliasExports(const QmlObjectNode &node)
{

    PropertyName propertyName = node.id().toUtf8();

    ModelNode rootNode = node.view()->rootModelNode();
    bool hasAliasExport = !propertyName.isEmpty()
            && rootNode.isValid()
            && rootNode.hasBindingProperty(propertyName)
            && rootNode.bindingProperty(propertyName).isAliasExport();

    if (hasAliasExport)
        rootNode.removeProperty(propertyName);

    foreach (const ModelNode &childNode, node.modelNode().directSubModelNodes()) {
        removeAliasExports(childNode);
    }

}
InternalProperty::InternalProperty(const PropertyName &name, const InternalNode::Pointer &propertyOwner)
     : m_name(name),
     m_propertyOwner(propertyOwner)
{
    Q_ASSERT_X(!name.isEmpty(), Q_FUNC_INFO, "Name of property cannot be empty");
}