diff options
Diffstat (limited to 'WebKit/qt/Api')
-rw-r--r-- | WebKit/qt/Api/qgraphicswebview.cpp | 19 | ||||
-rw-r--r-- | WebKit/qt/Api/qgraphicswebview.h | 6 |
2 files changed, 24 insertions, 1 deletions
diff --git a/WebKit/qt/Api/qgraphicswebview.cpp b/WebKit/qt/Api/qgraphicswebview.cpp index 6d6acc5..8fbb8e2 100644 --- a/WebKit/qt/Api/qgraphicswebview.cpp +++ b/WebKit/qt/Api/qgraphicswebview.cpp @@ -73,6 +73,7 @@ public: QGraphicsWebView* q; QWebPage* page; bool resizesToContents; + QSize deviceSize; // Just a convenience to avoid using page->client->overlay always QSharedPointer<QGraphicsItemOverlay> overlay; @@ -549,6 +550,24 @@ QIcon QGraphicsWebView::icon() const } /*! + \property QGraphicsWebView::deviceSize + \brief the size of the device using the web view + + The device size is used by the DOM window object methods + otherHeight(), otherWidth() as well as a page for the viewport + meta tag attributes device-width and device-height. +*/ +void QGraphicsWebView::setDeviceSize(const QSize& size) +{ + d->deviceSize = size; +} + +QSize QGraphicsWebView::deviceSize() const +{ + return d->deviceSize; +} + +/*! \property QGraphicsWebView::zoomFactor \brief the zoom factor for the view */ diff --git a/WebKit/qt/Api/qgraphicswebview.h b/WebKit/qt/Api/qgraphicswebview.h index 88729d3..8650984 100644 --- a/WebKit/qt/Api/qgraphicswebview.h +++ b/WebKit/qt/Api/qgraphicswebview.h @@ -41,6 +41,7 @@ class QWEBKIT_EXPORT QGraphicsWebView : public QGraphicsWidget { Q_PROPERTY(QString title READ title NOTIFY titleChanged) Q_PROPERTY(QIcon icon READ icon NOTIFY iconChanged) Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor) + Q_PROPERTY(QSize deviceSize READ deviceSize WRITE setDeviceSize) Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged) @@ -64,9 +65,12 @@ public: qreal zoomFactor() const; void setZoomFactor(qreal); + QSize deviceSize() const; + void setDeviceSize(const QSize&); + bool isModified() const; - void load(const QUrl &url); + void load(const QUrl& url); void load(const QNetworkRequest& request, QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation, const QByteArray& body = QByteArray()); void setHtml(const QString& html, const QUrl& baseUrl = QUrl()); |