• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ parentNode函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中parentNode函数的典型用法代码示例。如果您正苦于以下问题:C++ parentNode函数的具体用法?C++ parentNode怎么用?C++ parentNode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了parentNode函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: parentNode

HTMLFormControlElement* HTMLLegendElement::associatedControl()
{
    // Check if there's a fieldset belonging to this legend.
    Node* fieldset = parentNode();
    while (fieldset && !fieldset->hasTagName(fieldsetTag))
        fieldset = fieldset->parentNode();
    if (!fieldset)
        return 0;

    // Find first form element inside the fieldset that is not a legend element.
    // FIXME: Should we consider tabindex?
    Node* node = fieldset;
    while ((node = node->traverseNextNode(fieldset))) {
        if (node->isElementNode()) {
            Element* element = static_cast<Element*>(node);
            if (!element->hasLocalName(legendTag) && element->isFormControlElement())
                return static_cast<HTMLFormControlElement*>(element);
        }
    }

    return 0;
}
开发者ID:mikedougherty,项目名称:webkit,代码行数:22,代码来源:HTMLLegendElement.cpp


示例2: parentNode

Element *HTMLLegendElement::formElement()
{
    // Check if there's a fieldset belonging to this legend.
    Node *fieldset = parentNode();
    while (fieldset && !fieldset->hasTagName(fieldsetTag))
        fieldset = fieldset->parentNode();
    if (!fieldset)
        return 0;

    // Find first form element inside the fieldset.
    // FIXME: Should we care about tabindex?
    Node *node = fieldset;
    while ((node = node->traverseNextNode(fieldset))) {
        if (node->isHTMLElement()) {
            HTMLElement *element = static_cast<HTMLElement *>(node);
            if (!element->hasLocalName(legendTag) && element->isFormControlElement())
                return element;
        }
    }

    return 0;
}
开发者ID:boyliang,项目名称:ComponentSuperAccessor,代码行数:22,代码来源:HTMLLegendElement.cpp


示例3: invalidationGuard

void SVGFELightElement::svgAttributeChanged(const QualifiedName& attrName)
{
    if (!isSupportedAttribute(attrName)) {
        SVGElement::svgAttributeChanged(attrName);
        return;
    }

    SVGElement::InvalidationGuard invalidationGuard(this);

    if (attrName == SVGNames::azimuthAttr
        || attrName == SVGNames::elevationAttr
        || attrName == SVGNames::xAttr
        || attrName == SVGNames::yAttr
        || attrName == SVGNames::zAttr
        || attrName == SVGNames::pointsAtXAttr
        || attrName == SVGNames::pointsAtYAttr
        || attrName == SVGNames::pointsAtZAttr
        || attrName == SVGNames::specularExponentAttr
        || attrName == SVGNames::limitingConeAngleAttr) {
        ContainerNode* parent = parentNode();
        if (!parent)
            return;

        RenderObject* renderer = parent->renderer();
        if (!renderer || !renderer->isSVGResourceFilterPrimitive())
            return;

        if (isSVGFEDiffuseLightingElement(*parent)) {
            toSVGFEDiffuseLightingElement(*parent).lightElementAttributeChanged(this, attrName);
            return;
        }
        if (isSVGFESpecularLightingElement(*parent)) {
            toSVGFESpecularLightingElement(*parent).lightElementAttributeChanged(this, attrName);
            return;
        }
    }

    ASSERT_NOT_REACHED();
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:39,代码来源:SVGFELightElement.cpp


示例4: parentNode

void HTMLElement::setOuterHTML(const String& html, ExceptionState& es)
{
    Node* p = parentNode();
    if (!p || !p->isHTMLElement()) {
        es.throwDOMException(NoModificationAllowedError);
        return;
    }
    RefPtr<HTMLElement> parent = toHTMLElement(p);
    RefPtr<Node> prev = previousSibling();
    RefPtr<Node> next = nextSibling();

    RefPtr<DocumentFragment> fragment = createFragmentForInnerOuterHTML(html, parent.get(), AllowScriptingContent, es);
    if (es.hadException())
        return;

    parent->replaceChild(fragment.release(), this, es);
    RefPtr<Node> node = next ? next->previousSibling() : 0;
    if (!es.hadException() && node && node->isTextNode())
        mergeWithNextTextNode(node.release(), es);

    if (!es.hadException() && prev && prev->isTextNode())
        mergeWithNextTextNode(prev.release(), es);
}
开发者ID:halton,项目名称:blink-crosswalk,代码行数:23,代码来源:HTMLElement.cpp


示例5: deleteNode

void
deleteNode(Node *n) {
  Node *parent;
  Node *prev;
  Node *next;

  parent = parentNode(n);
  prev = previousSibling(n);
  next = nextSibling(n);
  if (prev) {
    set_nextSibling(prev,next);
  } else {
    if (parent) {
      set_firstChild(parent,next);
    }
  }
  if (next) {
    set_previousSibling(next,prev);
  } else {
    if (parent) {
      set_lastChild(parent,prev);
    }
  }
}
开发者ID:janearc,项目名称:posixnap_old,代码行数:24,代码来源:tree.c


示例6: parentNode

void AuthoringHandler::view_EntityLocationChanged(Eris::Entity* newLocation, EmberEntity* entity)
{
	VisualizationStore::iterator I = mVisualizations.find(entity);
	if (I != mVisualizations.end()) {
		if (I->second->getSceneNode()->getParent()) {
			I->second->getSceneNode()->getParent()->removeChild(I->second->getSceneNode());
		}
		if (newLocation) {
			VisualizationStore::iterator parentI = mVisualizations.find(static_cast<EmberEntity*> (newLocation));

			Ogre::SceneNode* parentNode(0);
			if (parentI != mVisualizations.end()) {
				parentNode = parentI->second->getSceneNode();
			} else {
				parentNode = mWorld.getScene().getSceneManager().getRootSceneNode();
				S_LOG_WARNING("Could not find new parent for entity, it will be attached to the root node.");
			}
			parentNode->addChild(I->second->getSceneNode());
			I->second->updatePositionAndOrientation();
		}
	} else {
		S_LOG_WARNING("Got location changed signal for entity which doesn't has an authoring visualization. This should not happen.");
	}
}
开发者ID:jekin-worldforge,项目名称:ember,代码行数:24,代码来源:AuthoringHandler.cpp


示例7: NS_ENSURE_ARG_POINTER

nsresult
sbFileSystemTreeState::AssignRelationships(sbFileSystemNode *aChildNode,
                                           sbNodeIDMap & aParentGuidMap)
{
  NS_ENSURE_ARG_POINTER(aChildNode);

  nsresult rv;
  PRUint32 parentID;
  rv = aChildNode->GetParentID(&parentID);
  NS_ENSURE_SUCCESS(rv, rv);

  sbNodeIDMapIter found = aParentGuidMap.find(parentID);
  if (found == aParentGuidMap.end()) {
    return NS_ERROR_UNEXPECTED;
  }

  nsRefPtr<sbFileSystemNode> parentNode(found->second);
  NS_ENSURE_TRUE(parentNode, NS_ERROR_UNEXPECTED);
  
  rv = parentNode->AddChild(aChildNode);
  NS_ENSURE_SUCCESS(rv, rv);
  
  return NS_OK;
}
开发者ID:AntoineTurmel,项目名称:nightingale-hacking,代码行数:24,代码来源:sbFileSystemTreeState.cpp


示例8: ASSERT

SVGFontElement* SVGFontFaceElement::associatedFontElement() const
{
    ASSERT(parentNode() == m_fontElement);
    ASSERT(!parentNode() || isSVGFontElement(*parentNode()));
    return m_fontElement;
}
开发者ID:335969568,项目名称:Blink-1,代码行数:6,代码来源:SVGFontFaceElement.cpp


示例9: toSVGFontFaceElement

void SVGFontFaceSrcElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
{
    SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
    if (isSVGFontFaceElement(parentNode()))
        toSVGFontFaceElement(*parentNode()).rebuildFontFace();
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:6,代码来源:SVGFontFaceSrcElement.cpp


示例10: nodeType

Node *Swig_methodclass(Node *n) {
    Node *nodetype = nodeType(n);
    if (Cmp(nodetype, "class") == 0)
        return n;
    return GetFlag(n, "feature:extend") ? parentNode(parentNode(n)) : parentNode(n);
}
开发者ID:sunaku,项目名称:swig-ruby-ffi,代码行数:6,代码来源:cwrap.c


示例11: m_changedProps

ViewProperties::ViewProperties(KURL url) :
      m_changedProps(false),
      m_autoSave(true),
      m_subDirValidityHidden(false)
{
    url.cleanPath(true);
    m_filepath = url.path();

    if ((m_filepath.length() < 1) || (m_filepath.at(0) != QChar('/'))) {
        return;
    }

    // we try and save it to a file in the directory being viewed
    // if the directory is not writable by the user or the directory is not local
    // we store the properties information in a local file
    DolphinSettings& settings = DolphinSettings::instance();
    if (settings.isSaveView()) {
    QString rootDir("/"); // TODO: should this be set to the root of the bookmark, if any?
    if (url.isLocalFile()) {
        QFileInfo info(m_filepath);

        if (!info.isWritable()) {
            QString basePath = KGlobal::instance()->instanceName();
            basePath.append("/view_properties/local");
            rootDir = locateLocal("data", basePath);
            m_filepath = rootDir + m_filepath;
        }
    }
    else { 
        QString basePath = KGlobal::instance()->instanceName();
        basePath.append("/view_properties/remote/").append(url.host());
        rootDir = locateLocal("data", basePath);
        m_filepath = rootDir + m_filepath;
    }

    QDir dir(m_filepath);
    QFile file(m_filepath + FILE_NAME);

    
        PropertiesNode node(&file);
    
        const bool isValidForSubDirs = !node.isEmpty() && node.isValidForSubDirs();
        while ((dir.path() != rootDir) && dir.cdUp()) {
            QFile file(dir.path() + FILE_NAME);
            PropertiesNode parentNode(&file);
            if (!parentNode.isEmpty()) {
                const bool inheritProps = parentNode.isValidForSubDirs() &&
                                        (parentNode.subDirProperties().m_timeStamp >
                                        node.localProperties().m_timeStamp);
    
                if (inheritProps) {
                    node.setLocalProperties(parentNode.subDirProperties());
				    break;
                }
            }
        } 
    
        m_node = node;
    
        if (isValidForSubDirs) {
            m_subDirValidityHidden = true;
        }
        m_node.setValidForSubDirs(false);
    }
}
开发者ID:serghei,项目名称:kde3-apps-dolphin,代码行数:65,代码来源:viewproperties.cpp


示例12: rowCount

bool NavigatorTreeModel::dropMimeData(const QMimeData *data,
                  Qt::DropAction action,
                  int row,
                  int column,
                  const QModelIndex &dropIndex)
{
    if (action == Qt::IgnoreAction)
        return true;
    if (action != Qt::LinkAction)
        return false;
    if (!data->hasFormat("application/vnd.modelnode.list"))
        return false;
    if (column > 1)
        return false;
    if (dropIndex.model() != this)
        return false;

    QModelIndex parentIndex, parentItemIndex;
    PropertyName parentPropertyName;
    int targetIndex;

    parentIndex = dropIndex.sibling(dropIndex.row(), 0);
    targetIndex = (row > -1)? row : rowCount(parentIndex);

    if (this->data(parentIndex, NavigatorRole).isValid()) {
        parentItemIndex = parentIndex;
        ModelNode parentNode = nodeForIndex(parentItemIndex);
        if (!parentNode.metaInfo().hasDefaultProperty())
            return false;
        targetIndex -= visibleProperties(parentNode).count();
        parentPropertyName = parentNode.metaInfo().defaultPropertyName();
    } else {
        parentItemIndex = parentIndex.parent();
        parentPropertyName = parentIndex.data(Qt::DisplayRole).toByteArray();
    }

    // Disallow dropping items between properties, which are listed first.
    if (targetIndex < 0)
        return false;

    Q_ASSERT(parentItemIndex.isValid());

    QByteArray encodedData = data->data("application/vnd.modelnode.list");
    QDataStream stream(&encodedData, QIODevice::ReadOnly);

    QList<ModelNode> nodeList;
    while (!stream.atEnd()) {
        uint nodeHash;
        stream >> nodeHash;
        if (containsNodeHash(nodeHash)) {
            ModelNode node(nodeForHash(nodeHash));
            nodeList.append(node);
        }
    }

    ModelNode parentNode(nodeForIndex(parentItemIndex));
    NodeAbstractProperty parentProperty = parentNode.nodeAbstractProperty(parentPropertyName);

    if (parentProperty.isNodeProperty() &&
        nodeList.count() > 1) {
        return false;
    }

    moveNodesInteractive(parentProperty, nodeList, targetIndex);
    propagateInvisible(parentNode, isNodeInvisible(parentNode));

    return false; // don't let the view do drag&drop on its own
}
开发者ID:darksylinc,项目名称:qt-creator,代码行数:68,代码来源:navigatortreemodel.cpp


示例13: notifyParentOfPathChange

void SVGMPathElement::targetPathChanged() {
    notifyParentOfPathChange(parentNode());
}
开发者ID:mirror,项目名称:chromium,代码行数:3,代码来源:SVGMPathElement.cpp


示例14: attach

void HTMLOptionElement::attach()
{
    if (parentNode()->renderStyle())
        setRenderStyle(styleForRenderer());
    HTMLFormControlElement::attach();
}
开发者ID:0omega,项目名称:platform_external_webkit,代码行数:6,代码来源:HTMLOptionElement.cpp


示例15: item

UIChooserNodeGlobal::~UIChooserNodeGlobal()
{
    delete item();
    if (parentNode())
        parentNode()->removeNode(this);
}
开发者ID:mdaniel,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:6,代码来源:UIChooserNodeGlobal.cpp


示例16: toString

string Tree::toString (TreeNodeIndex n) const {
  return toString (n, parentNode(n));
}
开发者ID:ihh,项目名称:indelhistorian,代码行数:3,代码来源:tree.cpp


示例17: nodeToString

string Tree::nodeToString (TreeNodeIndex root) const {
  return nodeToString (root, parentNode(root));
}
开发者ID:ihh,项目名称:indelhistorian,代码行数:3,代码来源:tree.cpp


示例18: nodeAndAncestors

TreeNodeIndex Tree::mostRecentCommonAncestor (TreeNodeIndex node1, TreeNodeIndex node2) const {
  const auto anc1 = nodeAndAncestors(node1);
  while (!anc1.count(node2) && node2 >= 0)
    node2 = parentNode(node2);
  return node2;
}
开发者ID:ihh,项目名称:indelhistorian,代码行数:6,代码来源:tree.cpp


示例19: ownElementDisabled

bool HTMLOptionElement::disabled() const
{
    return ownElementDisabled() || (parentNode() && static_cast<HTMLFormControlElement*>(parentNode())->disabled());
}
开发者ID:0omega,项目名称:platform_external_webkit,代码行数:4,代码来源:HTMLOptionElement.cpp


示例20: ASSERT

HTMLInputElement* SliderThumbElement::hostInput()
{
    ASSERT(parentNode());
    return static_cast<HTMLInputElement*>(parentNode()->shadowHost());
}
开发者ID:ACSOP,项目名称:android_external_webkit,代码行数:5,代码来源:SliderThumbElement.cpp



注:本文中的parentNode函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ parentProcessConnection函数代码示例发布时间:2022-05-30
下一篇:
C++ parentItem函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap