本文整理汇总了C++中QWebFrame::setTextSizeMultiplier方法的典型用法代码示例。如果您正苦于以下问题:C++ QWebFrame::setTextSizeMultiplier方法的具体用法?C++ QWebFrame::setTextSizeMultiplier怎么用?C++ QWebFrame::setTextSizeMultiplier使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QWebFrame
的用法示例。
在下文中一共展示了QWebFrame::setTextSizeMultiplier方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setTextSizeMultiplier
void QWebFrameProto::setTextSizeMultiplier(qreal factor)
{
scriptDeprecated("QWebFrame will not be available in future versions");
QWebFrame *item = qscriptvalue_cast<QWebFrame*>(thisObject());
if (item)
item->setTextSizeMultiplier(factor);
}
示例2: loadViewLayout
/*!
View layout loading from XML
*/
void NmViewerView::loadViewLayout()
{
NM_FUNCTION;
// Use document loader to load the view
bool ok(false);
setObjectName(QString(NMUI_MESSAGE_VIEWER_VIEW));
QObjectList objectList;
objectList.append(this);
// Pass the view to documentloader. Document loader uses this view
// when docml is parsed, instead of creating new view.
// documentloader is created in constructor
mDocumentLoader->setObjectTree(objectList);
mWidgetList = mDocumentLoader->load(NMUI_MESSAGE_VIEWER_XML, &ok);
if (ok)
{
// Create content and content layout
// qobject_cast not work in this case, using reinterpret_cast
mViewerContent = reinterpret_cast<HbWidget *>(
mDocumentLoader->findObject(NMUI_MESSAGE_VIEWER_CONTENT));
// Find scroll area
mScrollArea = reinterpret_cast<HbScrollArea *>(
mDocumentLoader->findObject(NMUI_MESSAGE_VIEWER_SCROLL_AREA));
if (mScrollArea) {
mScrollArea->setParentItem(this);
mScrollArea->setScrollDirections(Qt::Vertical | Qt::Horizontal);
connect(mScrollArea, SIGNAL(scrollPositionChanged(QPointF)),
this, SLOT(contentScrollPositionChanged(QPointF)));
// Get scroll area contents and set layout margins
mScrollAreaContents = qobject_cast<HbWidget *>(
mDocumentLoader->findObject(NMUI_MESSAGE_VIEWER_SCROLL_AREA_CONTENTS));
if (mScrollAreaContents) {
QGraphicsLayout *layout = mScrollAreaContents->layout();
if (layout){
layout->setContentsMargins(0,0,0,0);
}
// Set white pixmap to backgrounditem
QPixmap whitePixmap(NmWhitePixmapSize,NmWhitePixmapSize);
whitePixmap.fill(Qt::white);
QGraphicsPixmapItem *pixmapItem = new QGraphicsPixmapItem(whitePixmap);
mScrollAreaContents->setBackgroundItem(pixmapItem);
}
// Load headerwidget
mHeaderWidget = qobject_cast<NmViewerHeader *>(
mDocumentLoader->findObject(NMUI_MESSAGE_VIEWER_HEADER));
if (mHeaderWidget) {
mHeaderWidget->setView(this);
mHeaderWidget->rescaleHeader(mScreenSize);
mHeaderWidget->setMessage(mMessage);
QPointF headerStartPos = mHeaderWidget->scenePos();
mHeaderStartScenePos = QPointF(0,headerStartPos.y());
}
// Load webview
mWebView = reinterpret_cast<NmMailViewerWK *>(
mDocumentLoader->findObject(QString(NMUI_MESSAGE_VIEWER_SCROLL_WEB_VIEW)));
if (mWebView) {
// Set auto load images and private browsing(no history) attributes
QWebSettings *settings = mWebView->settings();
if (settings) {
settings->setAttribute(QWebSettings::AutoLoadImages, true);
settings->setAttribute(QWebSettings::PrivateBrowsingEnabled, true);
}
QWebPage *page = mWebView->page();
if (page) {
QWebFrame *frame = page->mainFrame();
if (frame) {
frame->setScrollBarPolicy(Qt::Vertical,Qt::ScrollBarAlwaysOff);
frame->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff);
frame->setTextSizeMultiplier(NmZoomFactor);
connect(mWebView->page()->mainFrame(),
SIGNAL(contentsSizeChanged(const QSize&)),
this, SLOT(scaleWebViewWhenLoading(const QSize&)));
}
}
}
}
}
}