本文整理汇总了C++中QWebView::height方法的典型用法代码示例。如果您正苦于以下问题:C++ QWebView::height方法的具体用法?C++ QWebView::height怎么用?C++ QWebView::height使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QWebView
的用法示例。
在下文中一共展示了QWebView::height方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QGraphicsItem
WebPreviewItem::WebPreviewItem(const QString &url)
: QGraphicsItem(0), // needs to be a top level item as we otherwise cannot guarantee that it's on top of other chatlines
_boundingRect(0, 0, 400, 300)
{
qreal frameWidth = 5;
QWebView *webView = new QWebView;
webView->load(url);
webView->resize(1000, 750);
QGraphicsProxyWidget *proxyItem = new QGraphicsProxyWidget(this);
proxyItem->setWidget(webView);
proxyItem->setAcceptHoverEvents(false);
qreal xScale = (_boundingRect.width() - 2 * frameWidth) / webView->width();
qreal yScale = (_boundingRect.height() - 2 * frameWidth) / webView->height();
proxyItem->scale(xScale, yScale);
proxyItem->setPos(frameWidth, frameWidth);
setZValue(30);
}
示例2: QGraphicsItem
WebPreviewItem::WebPreviewItem(const QUrl &url)
: QGraphicsItem(0), // needs to be a top level item as we otherwise cannot guarantee that it's on top of other chatlines
_boundingRect(0, 0, 400, 300)
{
qreal frameWidth = 5;
QWebView *webView = new QWebView;
webView->settings()->setAttribute(QWebSettings::JavascriptEnabled, false);
webView->load(url);
webView->setDisabled(true);
webView->resize(1000, 750);
QGraphicsProxyWidget *proxyItem = new QGraphicsProxyWidget(this);
proxyItem->setWidget(webView);
proxyItem->setAcceptHoverEvents(false);
qreal xScale = (_boundingRect.width() - 2 * frameWidth) / webView->width();
qreal yScale = (_boundingRect.height() - 2 * frameWidth) / webView->height();
proxyItem->setTransform(QTransform::fromScale(xScale, yScale), true);
proxyItem->setPos(frameWidth, frameWidth);
setZValue(30);
}