diff options
Diffstat (limited to 'Source/WebKit/qt/declarative')
-rw-r--r-- | Source/WebKit/qt/declarative/plugin.cpp | 5 | ||||
-rw-r--r-- | Source/WebKit/qt/declarative/qdeclarativewebview.cpp | 27 | ||||
-rw-r--r-- | Source/WebKit/qt/declarative/qdeclarativewebview_p.h | 11 |
3 files changed, 40 insertions, 3 deletions
diff --git a/Source/WebKit/qt/declarative/plugin.cpp b/Source/WebKit/qt/declarative/plugin.cpp index f1f165e..49af415 100644 --- a/Source/WebKit/qt/declarative/plugin.cpp +++ b/Source/WebKit/qt/declarative/plugin.cpp @@ -32,6 +32,11 @@ public: Q_ASSERT(QLatin1String(uri) == QLatin1String("QtWebKit")); qmlRegisterType<QDeclarativeWebSettings>(); qmlRegisterType<QDeclarativeWebView>(uri, 1, 0, "WebView"); +#if QT_VERSION >= 0x040703 + qmlRegisterType<QDeclarativeWebView>(uri, 1, 1, "WebView"); + qmlRegisterRevision<QDeclarativeWebView, 0>("QtWebKit", 1, 0); + qmlRegisterRevision<QDeclarativeWebView, 1>("QtWebKit", 1, 1); +#endif } }; 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. diff --git a/Source/WebKit/qt/declarative/qdeclarativewebview_p.h b/Source/WebKit/qt/declarative/qdeclarativewebview_p.h index ca15a1e..05f35f6 100644 --- a/Source/WebKit/qt/declarative/qdeclarativewebview_p.h +++ b/Source/WebKit/qt/declarative/qdeclarativewebview_p.h @@ -123,6 +123,9 @@ class QDeclarativeWebView : public QDeclarativeItem { Q_PROPERTY(QSize contentsSize READ contentsSize NOTIFY contentsSizeChanged) Q_PROPERTY(qreal contentsScale READ contentsScale WRITE setContentsScale NOTIFY contentsScaleChanged) +#if QT_VERSION >= 0x040703 + Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor NOTIFY backgroundColorChanged REVISION 1) +#endif public: QDeclarativeWebView(QDeclarativeItem *parent = 0); @@ -193,6 +196,11 @@ public: void setContentsScale(qreal scale); qreal contentsScale() const; +#if QT_VERSION >= 0x040703 + Q_REVISION(1) QColor backgroundColor() const; + Q_REVISION(1) void setBackgroundColor(const QColor&); +#endif + Q_SIGNALS: void preferredWidthChanged(); void preferredHeightChanged(); @@ -209,6 +217,9 @@ Q_SIGNALS: void renderingEnabledChanged(); void contentsSizeChanged(const QSize&); void contentsScaleChanged(); +#if QT_VERSION >= 0x040703 + void backgroundColorChanged(); +#endif void loadStarted(); void loadFinished(); |