本文整理汇总了C++中QWebFrame::title方法的典型用法代码示例。如果您正苦于以下问题:C++ QWebFrame::title方法的具体用法?C++ QWebFrame::title怎么用?C++ QWebFrame::title使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QWebFrame
的用法示例。
在下文中一共展示了QWebFrame::title方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: title
QString QWebFrameProto::title() const
{
scriptDeprecated("QWebFrame will not be available in future versions");
QWebFrame *item = qscriptvalue_cast<QWebFrame*>(thisObject());
if (item)
return item->title();
return QString();
}
示例2: getTitle
QString ForumProbe::getTitle(QString &html) {
QString title;
#ifndef NO_WEBKITWIDGETS
QWebPage *page = new QWebPage();
QWebFrame *frame = page->mainFrame();
frame->setHtml(html);
title = frame->title();
page->deleteLater();
#else
int titleBegin = html.indexOf("<title>");
if(titleBegin > 0) {
int titleEnd = html.indexOf("</", titleBegin);
title = html.mid(titleBegin + 7, titleEnd - titleBegin - 7);
}
#endif
return title;
}
示例3: printFrame
void WebTab::printFrame()
{
if (page()->isOnRekonqPage())
{
// trigger print part action instead of ours..
KParts::ReadOnlyPart *p = part();
if (p)
{
KParts::BrowserExtension *ext = p->browserExtension();
if (ext)
{
KParts::BrowserExtension::ActionSlotMap *actionSlotMap = KParts::BrowserExtension::actionSlotMapPtr();
connect(this, SIGNAL(triggerPartPrint()), ext, actionSlotMap->value("print"));
emit triggerPartPrint();
return;
}
}
}
QWebFrame *printFrame = page()->currentFrame();
if (printFrame == 0)
{
printFrame = page()->mainFrame();
}
QPrinter printer;
printer.setDocName(printFrame->title());
QPrintDialog *printDialog = KdePrint::createPrintDialog(&printer, this);
if (printDialog) //check if the Dialog was created
{
if (printDialog->exec())
printFrame->print(&printer);
delete printDialog;
}
}