本文整理汇总了C++中QDomNode::ownerDocument方法的典型用法代码示例。如果您正苦于以下问题:C++ QDomNode::ownerDocument方法的具体用法?C++ QDomNode::ownerDocument怎么用?C++ QDomNode::ownerDocument使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDomNode
的用法示例。
在下文中一共展示了QDomNode::ownerDocument方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeXml
bool QgsActionManager::writeXml( QDomNode& layer_node ) const
{
QDomElement aActions = layer_node.ownerDocument().createElement( QStringLiteral( "attributeactions" ) );
for ( QMap<QString, QUuid>::const_iterator defaultAction = mDefaultActions.constBegin(); defaultAction != mDefaultActions.constEnd(); ++ defaultAction )
{
QDomElement defaultActionElement = layer_node.ownerDocument().createElement( QStringLiteral( "defaultAction" ) );
defaultActionElement.setAttribute( QStringLiteral( "key" ), defaultAction.key() );
defaultActionElement.setAttribute( QStringLiteral( "value" ), defaultAction.value().toString() );
aActions.appendChild( defaultActionElement );
}
Q_FOREACH ( const QgsAction& action, mActions )
{
action.writeXml( aActions );
}
示例2: addXml
void DataManagerImpl::addXml(QDomNode& parentNode)
{
QDomDocument doc = parentNode.ownerDocument();
QDomElement dataManagerNode = doc.createElement("datamanager");
parentNode.appendChild(dataManagerNode);
m_rMpr_History->addXml(dataManagerNode);
QDomElement landmarkPropsNode = doc.createElement("landmarkprops");
LandmarkPropertyMap::iterator it = mLandmarkProperties.begin();
for (; it != mLandmarkProperties.end(); ++it)
{
QDomElement landmarkPropNode = doc.createElement("landmarkprop");
it->second.addXml(landmarkPropNode);
landmarkPropsNode.appendChild(landmarkPropNode);
}
dataManagerNode.appendChild(landmarkPropsNode);
QDomElement landmarksNode = doc.createElement("landmarks");
mPatientLandmarks->addXml(landmarksNode);
dataManagerNode.appendChild(landmarksNode);
QDomElement centerNode = doc.createElement("center");
centerNode.appendChild(doc.createTextNode(qstring_cast(mCenter)));
dataManagerNode.appendChild(centerNode);
for (DataMap::const_iterator iter = mData.begin(); iter != mData.end(); ++iter)
{
QDomElement dataNode = doc.createElement("data");
dataManagerNode.appendChild(dataNode);
iter->second->addXml(dataNode);
}
}
示例3: addTextElement
void CameraData::addTextElement(QDomNode parentNode, QString name, QString value) const
{
QDomDocument doc = parentNode.ownerDocument();
QDomElement node = doc.createElement(name);
node.appendChild(doc.createTextNode(value));
parentNode.appendChild(node);
}
示例4: writeXml
void QgsAttributeTableConfig::writeXml( QDomNode& node ) const
{
QDomDocument doc( node.ownerDocument() );
QDomElement configElement = doc.createElement( "attributetableconfig" );
configElement.setAttribute( "actionWidgetStyle", mActionWidgetStyle == ButtonList ? "buttonList" : "dropDown" );
configElement.setAttribute( "sortExpression", mSortExpression );
configElement.setAttribute( "sortOrder", mSortOrder );
QDomElement columnsElement = doc.createElement( "columns" );
Q_FOREACH ( const ColumnConfig& column, mColumns )
{
QDomElement columnElement = doc.createElement( "column" );
if ( column.type == Action )
{
columnElement.setAttribute( "type", "actions" );
}
else
{
columnElement.setAttribute( "type", "field" );
columnElement.setAttribute( "name", column.name );
}
columnElement.setAttribute( "hidden", column.hidden );
columnElement.setAttribute( "width", QString::number( column.width ) );
columnsElement.appendChild( columnElement );
}
示例5: QDomDocument
QDomDocument QDomNodeProto:: ownerDocument() const
{
QDomNode *item = qscriptvalue_cast<QDomNode*>(thisObject());
if (item)
return item->ownerDocument();
return QDomDocument();
}
示例6: toSld
void QgsVectorLayerSimpleLabeling::toSld( QDomNode &parent, const QgsStringMap &props ) const
{
if ( mSettings->drawLabels )
{
QDomDocument doc = parent.ownerDocument();
QDomElement ruleElement = doc.createElement( QStringLiteral( "se:Rule" ) );
parent.appendChild( ruleElement );
// scale dependencies
if ( mSettings->scaleVisibility )
{
QgsStringMap scaleProps = QgsStringMap();
// tricky here, the max scale is expressed as its denominator, but it's still the max scale
// in other words, the smallest scale denominator....
scaleProps.insert( "scaleMinDenom", qgsDoubleToString( mSettings->maximumScale ) );
scaleProps.insert( "scaleMaxDenom", qgsDoubleToString( mSettings->minimumScale ) );
QgsSymbolLayerUtils::applyScaleDependency( doc, ruleElement, scaleProps );
}
writeTextSymbolizer( ruleElement, *mSettings, props );
}
}
示例7:
/* $Desc Add text inside the node s markups. If any already exists, it s
* over written.
* $Parm p_node Node on which to write.
* $Parm p_value Text to fill in.
* $Rtrn /.
*/
void
XmlBehavior::addText(QDomNode& p_node, const QString& p_value) const
{
if(p_node.hasChildNodes())
logE("Try to add text to a node with children");
p_node.appendChild(p_node.ownerDocument().createTextNode(p_value));
}
示例8: write_automation_path
void AutomationPathSerializer::write_automation_path(QDomNode &node, const AutomationPath &path)
{
for (auto point : path) {
auto element = node.ownerDocument().createElement("point");
element.setAttribute("x", point.first);
element.setAttribute("y", point.second);
node.appendChild(element);
}
}
示例9: qMakePair
void
PixmapCollection::load(QDomNode node)
{
QDomDocument domDoc = node.ownerDocument();
for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
QDomElement el = n.toElement();
QPair<QString, int> pair = qMakePair(el.text(), el.attribute("size").toInt());
m_pixmaps[el.attribute("name")] = pair;
}
}
示例10: addXml
void Image::addXml(QDomNode& dataNode)
{
Data::addXml(dataNode);
QDomNode imageNode = dataNode;
QDomDocument doc = dataNode.ownerDocument();
QDomElement tf3DNode = doc.createElement("transferfunctions");
this->getUnmodifiedTransferFunctions3D()->addXml(tf3DNode);
imageNode.appendChild(tf3DNode);
QDomElement lut2DNode = doc.createElement("lookuptable2D");
this->getUnmodifiedLookupTable2D()->addXml(lut2DNode);
imageNode.appendChild(lut2DNode);
QDomElement shadingNode = doc.createElement("shading");
mShading.addXml(shadingNode);
imageNode.appendChild(shadingNode);
// QDomElement landmarksNode = doc.createElement("landmarks");
// mLandmarks->addXml(landmarksNode);
// imageNode.appendChild(landmarksNode);
QDomElement cropNode = doc.createElement("crop");
cropNode.setAttribute("use", mUseCropping);
cropNode.appendChild(doc.createTextNode(qstring_cast(mCroppingBox_d)));
imageNode.appendChild(cropNode);
QDomElement clipNode = doc.createElement("clip");
for (unsigned i = 0; i < mPersistentClipPlanes.size(); ++i)
{
QDomElement planeNode = doc.createElement("plane");
Vector3D normal(mPersistentClipPlanes[i]->GetNormal());
Vector3D origin(mPersistentClipPlanes[i]->GetOrigin());
planeNode.setAttribute("normal", qstring_cast(normal));
planeNode.setAttribute("origin", qstring_cast(origin));
clipNode.appendChild(planeNode);
}
imageNode.appendChild(clipNode);
QDomElement modalityNode = doc.createElement("modality");
modalityNode.appendChild(doc.createTextNode(mModality));
imageNode.appendChild(modalityNode);
QDomElement imageTypeNode = doc.createElement("imageType");
imageTypeNode.appendChild(doc.createTextNode(mImageType));
imageNode.appendChild(imageTypeNode);
QDomElement interpolationNode = doc.createElement("vtk_interpolation");
interpolationNode.setAttribute("type", mInterpolationType);
imageNode.appendChild(interpolationNode);
QDomElement initialWindowNode = doc.createElement("initialWindow");
initialWindowNode.setAttribute("width", mInitialWindowWidth);
initialWindowNode.setAttribute("level", mInitialWindowLevel);
}
示例11: to
/* $Desc Convert the object to an XML node. The node provided
* $Parm p_sign Signature used for logging.
* $Rtrn /.
*/
void XmlBehavior::to(QDomNode& p_node, const QString& p_name) const
{
if(p_node.firstChild().nodeType() == QDomNode::TextNode)
logE("Can't create a child to a node with text");
QDomElement child = p_node.ownerDocument().createElement(p_name);
p_node.appendChild(child);
writeXml(child);
}
示例12: addXml
void ToolUsingIGSTK::addXml(QDomNode& dataNode)
{
QDomDocument doc = dataNode.ownerDocument();
dataNode.toElement().setAttribute("uid", qstring_cast(this->getUid()));
if (mProbe && mProbe->isValid())
{
QDomElement probeNode = doc.createElement("probe");
mProbe->addXml(probeNode);
dataNode.appendChild(probeNode);
}
}
示例13: addXml
void AcquisitionData::addXml(QDomNode& parentNode)
{
QDomDocument doc = parentNode.ownerDocument();
QDomElement base = doc.createElement("stateManager");
parentNode.appendChild(base);
QDomElement sessionsNode = doc.createElement("recordSessions");
std::vector<RecordSessionPtr>::iterator it = mRecordSessions.begin();
for(; it != mRecordSessions.end(); ++it)
{
QDomElement sessionNode = doc.createElement("recordSession");
(*it)->addXml(sessionNode);
sessionsNode.appendChild(sessionNode);
}
base.appendChild(sessionsNode);
}
示例14: makeTextNodeMod
void makeTextNodeMod(KBookmark bk, const QString &m_nodename, const QString &m_newText) {
QDomNode subnode = bk.internalElement().namedItem(m_nodename);
if (subnode.isNull()) {
subnode = bk.internalElement().ownerDocument().createElement(m_nodename);
bk.internalElement().appendChild(subnode);
}
if (subnode.firstChild().isNull()) {
QDomText domtext = subnode.ownerDocument().createTextNode("");
subnode.appendChild(domtext);
}
QDomText domtext = subnode.firstChild().toText();
QString m_oldText = domtext.data();
domtext.setData(m_newText);
}
示例15: addXml
void RegistrationImplService::addXml(QDomNode& parentNode)
{
QDomDocument doc = parentNode.ownerDocument();
QDomElement base = doc.createElement("registrationManager");
parentNode.appendChild(base);
QDomElement fixedDataNode = doc.createElement("fixedDataUid");
DataPtr fixedData = this->getFixedData();
if(fixedData)
{
fixedDataNode.appendChild(doc.createTextNode(fixedData->getUid()));
}
base.appendChild(fixedDataNode);
QDomElement movingDataNode = doc.createElement("movingDataUid");
DataPtr movingData = this->getMovingData();
if(movingData)
{
movingDataNode.appendChild(doc.createTextNode(movingData->getUid()));
}
base.appendChild(movingDataNode);
}