summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZeno Albisser <zeno.albisser@digia.com>2013-06-18 16:18:12 +0200
committerZeno Albisser <zeno.albisser@digia.com>2013-06-18 16:18:12 +0200
commit658354db329c5a0bd163a6366ce4705bed2eadf3 (patch)
treece673b0e7c8ea8494da185a983ff67a676162648
parent4e9e513e3415ebb07da2d6360d770288765c3d54 (diff)
Use QQmlProperty::write instead of Binding item.
-rw-r--r--examples/qtquick/quickwindow.qml18
-rw-r--r--lib/qquickwebcontentsview.cpp2
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 <QUrl>
+#include <QQmlProperty>
void QQuickWebContentsView::registerType()
{
@@ -85,6 +86,7 @@ QQuickWebContentsView::QQuickWebContentsView()
WebContentsViewQt* content_view = static_cast<WebContentsViewQt*>(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()