Scope resolution question

Pavel Vasev pavel.vasev at gmail.com
Fri Jun 12 06:54:52 UTC 2015


Hi Anton!

Please consider the example:

*********************** main.qml
import QtQuick 2.3

RectWithFoo {
  color: "green"

  Text {
    text: "foo="+foo
  }
}
*********************** RectWithFoo.qml
import QtQuick 2.3
Rectangle {
  property var foo: 15
}
***********************

When I run this example via qmlscene of Qt project, all works.
When I run it via qmlweb, I get "foo is undefined" error during text eval.

I tried to "fix" it and failed, because I cannot understand how scope
variables (e.g. componentScope e.g. context)  are collected..

Could you please explain, how and where context is gathered?

If I understand it, probably I will find the way how to insert "internal"
properties of component root object to that scope.

Best Regards,
Pavel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/qmlweb/attachments/20150612/a7235974/attachment.html>


More information about the QmlWeb mailing list