本文整理汇总了C++中QDomNode::insertAfter方法的典型用法代码示例。如果您正苦于以下问题:C++ QDomNode::insertAfter方法的具体用法?C++ QDomNode::insertAfter怎么用?C++ QDomNode::insertAfter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDomNode
的用法示例。
在下文中一共展示了QDomNode::insertAfter方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setModified
void
ItemXML::moveTo(QDomNode& _parent, QDomNode& _predecessor)
{
// the corresponding syntax in DOM looks slightly different:
_parent.insertAfter(node_, _predecessor);
setModified();
}
示例2: QDomNode
QDomNode QDomNodeProto:: insertAfter(const QDomNode& newChild, const QDomNode& refChild)
{
QDomNode *item = qscriptvalue_cast<QDomNode*>(thisObject());
if (item)
return item->insertAfter(newChild, refChild);
return QDomNode();
}
示例3: addHistory
void PathMapper::addHistory(const QString &localpath, const QString &serverpath, bool saveinproject)
{
bool exists = false;
for (unsigned int cnt = 0; cnt < m_serverlist.count() && !exists; cnt++ )
if(m_serverlist[cnt] == serverpath && m_locallist[cnt] == localpath)
exists = true;
if(!exists)
{
if(saveinproject)
{
QDomNode node = pathMapperNode();
QDomNode newnode = Project::ref()->dom()->createElement("mapping");
QDomAttr serverattr = Project::ref()->dom()->createAttribute("serverpath");
serverattr.setValue(serverpath);
QDomAttr localattr = Project::ref()->dom()->createAttribute("localpath");
localattr.setValue(localpath);
newnode.attributes().setNamedItem(serverattr);
newnode.attributes().setNamedItem(localattr);
node = node.namedItem("mappings");
node.insertAfter(newnode, node.lastChild());
}
m_serverlist.append(serverpath);
m_locallist.append(localpath);
}
}
示例4: behaviourDown
void PolicyDocumentClass::behaviourDown(const QString& patternName,
const QString& behaviourName)
{
// get DOM node of the given pattern and behaviour //
QDomNode patternNode = getPatternNode(patternName);
QDomNode behaviourNode = getBehaviourNode(patternName, behaviourName);
QDomNode nextBehaviourNode = getNextBehaviourNode(patternName,behaviourName);
if (nextBehaviourNode.isNull()) return;
// remove DOM node //
patternNode.insertAfter(behaviourNode, nextBehaviourNode);
}
示例5: reassignPosition
//===========================================================================
void detectorTabWidget::reassignPosition(int from, int to)
{
int direction = from - to ;
std::string tabLabelFrom = this->tabText(from).toStdString() ;
std::string tabLabelTo = this->tabText(to ).toStdString() ;
QDomNode parentNode = detectorMap_[tabLabelFrom].parentNode() ;
if( direction > 0 ) // Insert after
{
parentNode.insertAfter(detectorMap_[tabLabelFrom],detectorMap_[tabLabelTo]) ;
}
else // Insert before
{
parentNode.insertBefore(detectorMap_[tabLabelFrom],detectorMap_[tabLabelTo]) ;
}
}