本文整理汇总了C++中QWebElement::previousSibling方法的典型用法代码示例。如果您正苦于以下问题:C++ QWebElement::previousSibling方法的具体用法?C++ QWebElement::previousSibling怎么用?C++ QWebElement::previousSibling使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QWebElement
的用法示例。
在下文中一共展示了QWebElement::previousSibling方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: findElementByCoord
bool PhpWebView::findElementByCoord(QWebElement & root, QPoint & point, QList<WebElementStruct> & list)
{
QWebElement child = root.lastChild();
bool isfind = false;
while (!child.isNull())
{
if (findElementByCoord(child, point, list))
isfind = true;
child = child.previousSibling();
}
QString display = root.styleProperty("display", QWebElement::ComputedStyle);
if (display != "none" && root.geometry().contains(point) && !isfind)
{
list.append(createWebElementStruct(root, list.count()));
return true;
}
else
return false;
}
示例2: linkClicked
void CellmlAnnotationViewMetadataNormalViewDetailsWidget::linkClicked()
{
// Retrieve some information about the link
mOutputOntologicalTerms->retrieveLinkInformation(mLink, mTextContent);
// Check whether we have clicked a resource/id link or a button link
if (mTextContent.isEmpty()) {
// Update some information
CellMLSupport::CellmlFileRdfTriple *rdfTriple = mRdfTriplesMapping.value(mLink);
QString qualifier = (rdfTriple->modelQualifier() != CellMLSupport::CellmlFileRdfTriple::ModelUnknown)?
rdfTriple->modelQualifierAsString():
rdfTriple->bioQualifierAsString();
QString rdfTripleInformation = qualifier+"|"+rdfTriple->resource()+"|"+rdfTriple->id();
mUrls.remove(rdfTripleInformation);
mRdfTripleInformationSha1s.removeOne(mLink);
mRdfTriplesMapping.remove(mLink);
--mItemsCount;
// Determine the 'new' RDF triple information to look up, based on
// whether there are RDF triples left and whether the current RDF triple
// is the one being highlighted
QWebElement rdfTripleElement = mOutputOntologicalTerms->page()->mainFrame()->documentElement().findFirst(QString("tr[id=item_%1]").arg(mLink));
if (!mItemsCount) {
mRdfTripleInformation = QString();
mInformationType = None;
} else if (!mLink.compare(mRdfTripleInformationSha1)) {
QWebElement newRdfTripleEment = rdfTripleElement.nextSibling();
if (newRdfTripleEment.isNull())
newRdfTripleEment = rdfTripleElement.previousSibling();
static const QRegularExpression ItemRegEx = QRegularExpression("^item_");
CellMLSupport::CellmlFileRdfTriple *newRdfTriple = mRdfTriplesMapping.value(newRdfTripleEment.attribute("id").remove(ItemRegEx));
QString newQualifier = (newRdfTriple->modelQualifier() != CellMLSupport::CellmlFileRdfTriple::ModelUnknown)?
newRdfTriple->modelQualifierAsString():
newRdfTriple->bioQualifierAsString();
mRdfTripleInformation = newQualifier+"|"+newRdfTriple->resource()+"|"+newRdfTriple->id();
if (!rdfTripleInformation.compare(mFirstRdfTripleInformation))
mFirstRdfTripleInformation = mRdfTripleInformation;
if (!rdfTripleInformation.compare(mLastRdfTripleInformation))
mLastRdfTripleInformation = mRdfTripleInformation;
}
// Remove the RDF triple from our GUI
rdfTripleElement.removeFromDocument();
// Do some additional GUI updates
mLookUpRdfTripleInformation = Any;
if (!mLink.compare(mRdfTripleInformationSha1))
additionalGuiUpdates(mRdfTripleInformation, mInformationType, mLookUpRdfTripleInformation);
else
// The looked up information is the same, so no need to look it up
// again
// Note: indeed, to look it up again would result in the web view
// flashing (since a 'new' web page would be loaded)...
additionalGuiUpdates(mRdfTripleInformation, mInformationType, No);
// Remove the RDF triple from the CellML file
mCellmlFile->rdfTriples().remove(rdfTriple);
// Let people know that an RDF triple has been removed
emit rdfTripleRemoved(rdfTriple);
} else {
// We have clicked on a qualifier/resource/id link, so start by enabling
// the looking up of any RDF triple information
mLookUpRdfTripleInformation = Any;
// Call our generic look up function
QStringList rdfTripleInformation = mLink.split("|");
genericLookUp(mLink,
(!rdfTripleInformation[0].compare(mTextContent))?
Qualifier:
!rdfTripleInformation[1].compare(mTextContent)?
Resource:
Id);
}
}