本文整理汇总了C++中parentNode函数的典型用法代码示例。如果您正苦于以下问题:C++ parentNode函数的具体用法?C++ parentNode怎么用?C++ parentNode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了parentNode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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();
}
示例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);
}
示例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);
}
}
}
示例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.");
}
}
示例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;
}
示例8: ASSERT
SVGFontElement* SVGFontFaceElement::associatedFontElement() const
{
ASSERT(parentNode() == m_fontElement);
ASSERT(!parentNode() || isSVGFontElement(*parentNode()));
return m_fontElement;
}
示例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();
}
示例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);
}
示例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);
}
}
示例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
}
示例13: notifyParentOfPathChange
void SVGMPathElement::targetPathChanged() {
notifyParentOfPathChange(parentNode());
}
示例14: attach
void HTMLOptionElement::attach()
{
if (parentNode()->renderStyle())
setRenderStyle(styleForRenderer());
HTMLFormControlElement::attach();
}
示例15: item
UIChooserNodeGlobal::~UIChooserNodeGlobal()
{
delete item();
if (parentNode())
parentNode()->removeNode(this);
}