diff options
Diffstat (limited to 'Source/WebKit/qt/declarative/qdeclarativewebview.cpp')
-rw-r--r-- | Source/WebKit/qt/declarative/qdeclarativewebview.cpp | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/Source/WebKit/qt/declarative/qdeclarativewebview.cpp b/Source/WebKit/qt/declarative/qdeclarativewebview.cpp index 9313d6c..83645aa 100644 --- a/Source/WebKit/qt/declarative/qdeclarativewebview.cpp +++ b/Source/WebKit/qt/declarative/qdeclarativewebview.cpp @@ -517,13 +517,12 @@ void QDeclarativeWebView::geometryChanged(const QRectF& newGeometry, const QRect } } - html: "<script>console.log(\"This is in WebKit!\"); window.qml.qmlCall();</script>" + html: "<script>window.qml.qmlCall();</script>" } \endqml The output of the example will be: \code - This is in WebKit! This call is in QML! \endcode @@ -772,7 +771,6 @@ void QDeclarativeWebView::setPage(QWebPage* page) page->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff); connect(page->mainFrame(), SIGNAL(urlChanged(QUrl)), this, SLOT(pageUrlChanged())); connect(page->mainFrame(), SIGNAL(titleChanged(QString)), this, SIGNAL(titleChanged(QString))); - connect(page->mainFrame(), SIGNAL(titleChanged(QString)), this, SIGNAL(iconChanged())); connect(page->mainFrame(), SIGNAL(iconChanged()), this, SIGNAL(iconChanged())); connect(page->mainFrame(), SIGNAL(initialLayoutCompleted()), this, SLOT(initialLayout())); connect(page->mainFrame(), SIGNAL(contentsSizeChanged(QSize)), this, SIGNAL(contentsSizeChanged(QSize))); @@ -983,6 +981,29 @@ void QDeclarativeWebView::setContentsScale(qreal scale) emit contentsScaleChanged(); } +#if QT_VERSION >= 0x040703 +/*! + \qmlproperty color WebView::backgroundColor + \since QtWebKit 1.1 + This property holds the background color of the view. +*/ + +QColor QDeclarativeWebView::backgroundColor() const +{ + return d->view->palette().base().color(); +} + +void QDeclarativeWebView::setBackgroundColor(const QColor& color) +{ + QPalette palette = d->view->palette(); + if (palette.base().color() == color) + return; + palette.setBrush(QPalette::Base, color); + d->view->setPalette(palette); + emit backgroundColorChanged(); +} +#endif + /*! Returns the area of the largest element at position (\a x,\a y) that is no larger than \a maxWidth by \a maxHeight pixels. |