本文整理汇总了C++中QWebElement::removeAllChildren方法的典型用法代码示例。如果您正苦于以下问题:C++ QWebElement::removeAllChildren方法的具体用法?C++ QWebElement::removeAllChildren怎么用?C++ QWebElement::removeAllChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QWebElement
的用法示例。
在下文中一共展示了QWebElement::removeAllChildren方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initialize
void PhysiomeModelRepositoryWindowWidget::initialize(const PhysiomeModelRepositoryWindowExposures &pExposures,
const QString &pErrorMessage,
const bool &pInternetConnectionAvailable)
{
// Initialise / keep track of some properties
mExposureNames = QStringList();
mExposureDisplayed = QBoolList();
mExposureUrlId = QMap<QString, int>();
mErrorMessage = pErrorMessage;
mInternetConnectionAvailable = pInternetConnectionAvailable;
// Initialise our list of exposures
QWebElement tbodyElement = page()->mainFrame()->documentElement().findFirst("tbody[id=exposures]");
tbodyElement.removeAllChildren();
for (int i = 0, iMax = pExposures.count(); i < iMax; ++i) {
QString exposureUrl = pExposures[i].url();
QString exposureName = pExposures[i].name();
tbodyElement.appendInside("<tr id=\"exposure_"+QString::number(i)+"\">\n"
" <td class=\"exposure\">\n"
" <table class=\"fullWidth\">\n"
" <tbody>\n"
" <tr>\n"
" <td class=\"fullWidth\">\n"
" <ul>\n"
" <li class=\"exposure\">\n"
" <a href=\""+exposureUrl+"\">"+exposureName+"</a>\n"
" </li>\n"
" </ul>\n"
" </td>\n"
" <td class=\"button\">\n"
" <a class=\"noHover\" href=\"cloneWorkspace|"+exposureUrl+"|"+exposureName+"\"><img class=\"button clone\"/></a>\n"
" </td>\n"
" <td class=\"button\">\n"
" <a class=\"noHover\" href=\"showExposureFiles|"+exposureUrl+"|"+exposureName+"\"><img id=\"exposure_"+QString::number(i)+"\" class=\"button open\"/></a>\n"
" </td>\n"
" </tr>\n"
" </tbody>\n"
" </table>\n"
" <ul id=\"exposureFiles_"+QString::number(i)+"\" style=\"display: none;\">\n"
" </ul>\n"
" </td>\n"
"</tr>\n");
mExposureNames << exposureName;
mExposureDisplayed << true;
mExposureUrlId.insert(exposureUrl, i);
}
}
示例2: updateRecentFilesContainer
void WelcomePageWidget::updateRecentFilesContainer(const QString &id, const QStringList &files, const QString &message) {
static const QString divTemplate = "<div id=\"%1\" class=\"recent_items_content\">%2</div>";
static const QString linkTemplate = "<a class=\"recentLink\" href=\"#\" onclick=\"ugene.openFile('%1')\" title=\"%1\">- %2</a>";
QWebElement doc = page()->mainFrame()->documentElement();
QWebElement recentFilesDiv = doc.findFirst("#" + id);
SAFE_POINT(!recentFilesDiv.isNull(), "No recent files container", );
recentFilesDiv.removeAllChildren();
QStringList links;
foreach (const QString &file, files.mid(0, MAX_RECENT)) {
if (file.isEmpty()) {
continue;
}
links << linkTemplate.arg(file).arg(QFileInfo(file).fileName());
}
QString result = message;
if (!links.isEmpty()) {
result = links.join("\n");
}
recentFilesDiv.setOuterXml(divTemplate.arg(id).arg(result));
}
示例3: fixLinkNode
void EnmlFormatter::fixLinkNode(QWebElement e) {
QString enTag = e.attribute("en-tag", "");
if (enTag.toLower() == "en-media") {
resources.append(e.attribute("lid").toInt());
e.removeAttribute("style");
e.removeAttribute("href");
e.removeAttribute("title");
removeInvalidAttributes(e);
e.removeAllChildren();
QString newXml = e.toOuterXml();
newXml.replace("<a", "<en-media");
newXml.replace("</a>", "</en-media>");
e.setOuterXml(newXml);
}
QString latex = e.attribute("href", "");
if (latex.toLower().startsWith("latex://")) {
removeInvalidAttributes(e);
e.removeAttribute("title");
e.removeAttribute("href");
e.setOuterXml(e.toInnerXml());
}
removeInvalidAttributes(e);
}