From 658354db329c5a0bd163a6366ce4705bed2eadf3 Mon Sep 17 00:00:00 2001 From: Zeno Albisser Date: Tue, 18 Jun 2013 16:18:12 +0200 Subject: Use QQmlProperty::write instead of Binding item. --- examples/qtquick/quickwindow.qml | 18 ------------------ lib/qquickwebcontentsview.cpp | 2 ++ 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/examples/qtquick/quickwindow.qml b/examples/qtquick/quickwindow.qml index 688014b6f..7d42b2c01 100644 --- a/examples/qtquick/quickwindow.qml +++ b/examples/qtquick/quickwindow.qml @@ -49,24 +49,6 @@ ApplicationWindow { anchors.fill: parent url: "http://qt-project.org/" - Binding { - target: webContentsView.children[0] - property: 'anchors.fill' - value: webContentsView - when: webContentsView.children.length > 0 - } - onUrlChanged: addressBar.text = url } - - Text { - id: info - anchors.top: parent.top - anchors.right: parent.right - horizontalAlignment: "AlignRight" - width: 100 - height: 100 - - text: viewContainer.children[0].width + "x" + viewContainer.children[0].height - } } diff --git a/lib/qquickwebcontentsview.cpp b/lib/qquickwebcontentsview.cpp index 0d82020fa..8b9622e29 100644 --- a/lib/qquickwebcontentsview.cpp +++ b/lib/qquickwebcontentsview.cpp @@ -54,6 +54,7 @@ #include "web_engine_context.h" #include +#include void QQuickWebContentsView::registerType() { @@ -85,6 +86,7 @@ QQuickWebContentsView::QQuickWebContentsView() WebContentsViewQt* content_view = static_cast(d->webContentsDelegate->web_contents()->GetView()); QQuickItem* windowContainer = content_view->windowContainer()->qQuickItem(); windowContainer->setParentItem(this); + QQmlProperty::write(windowContainer, QStringLiteral("anchors.fill"), QVariant::fromValue(this)); } QQuickWebContentsView::~QQuickWebContentsView() -- cgit v1.2.3