本文整理汇总了C++中QDomNode::columnNumber方法的典型用法代码示例。如果您正苦于以下问题:C++ QDomNode::columnNumber方法的具体用法?C++ QDomNode::columnNumber怎么用?C++ QDomNode::columnNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDomNode
的用法示例。
在下文中一共展示了QDomNode::columnNumber方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: qHash
uint qHash (const QDomNode& node)
{
if (node.lineNumber () == -1 ||
node.columnNumber () == -1)
{
qWarning () << Q_FUNC_INFO
<< "node is unhasheable";
return -1;
}
return (node.lineNumber () << 24) + node.columnNumber ();
}
示例2: columnNumber
int QDomNodeProto:: columnNumber() const
{
QDomNode *item = qscriptvalue_cast<QDomNode*>(thisObject());
if (item)
return item->columnNumber();
return 0;
}
示例3: findDomNodeScan
/**
* @brief XmlEditWidgetPrivate::findDomNodeScan find the nearest match to a position
* @param node
* @param nodeTarget
* @param lineSearched
* @param columnSearched
* @param lastKnownNode: last known "good" position
* @return
*/
bool XmlEditWidgetPrivate::findDomNodeScan(QDomNode node, QDomNode nodeTarget, const int lineSearched, const int columnSearched, FindNodeWithLocationInfo &info)
{
int row = node.lineNumber();
int col = node.columnNumber();
if(!node.isDocument()) {
if((lineSearched == row) && (columnSearched == col)) {
info.matchedNode = nodeTarget ;
return true ;
}
if((lineSearched == row) && (columnSearched == col)) {
info.matchedNode = nodeTarget ;
return true ;
}
if((lineSearched == row) && (columnSearched < col)) {
info.matchedNode = nodeTarget ;
return true ;
}
if((lineSearched < row)) {
info.matchedNode = nodeTarget ;
return true ;
}
if((lineSearched <= row)) {
info.lastKnownNode = nodeTarget ;
}
if(node.nodeType() == QDomNode::ElementNode) {
QDomElement element = node.toElement();
QDomNamedNodeMap attributes = element.attributes();
int numAttrs = attributes.length();
for(int i = 0 ; i < numAttrs ; i++) {
QDomNode node = attributes.item(i);
QDomAttr attr = node.toAttr();
if(findDomNodeScan(attr, nodeTarget, lineSearched, columnSearched, info)) {
return true;
}
} // for
}
}
int nodes = node.childNodes().count();
for(int i = 0 ; i < nodes ; i ++) {
QDomNode childNode = node.childNodes().item(i) ;
if(childNode.isText() || childNode.isCDATASection()) {
if(findDomNodeScan(childNode, nodeTarget, lineSearched, columnSearched, info)) {
return true;
}
} else {
if(findDomNodeScan(childNode, childNode, lineSearched, columnSearched, info)) {
return true ;
}
}
}
return false ;
}