aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlcomponent_p.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2022-05-11 12:48:55 +0200
committerUlf Hermann <ulf.hermann@qt.io>2022-05-23 12:50:02 +0200
commit7fa03450cf68a02da6d6ff04fb5d568b3cca6efe (patch)
treeb1bfefb08a9881f360c554ed5701fceb905294de /src/qml/qml/qqmlcomponent_p.h
parentcfbc5ecf2af04e4c0ae6053081b2fa47e8ac5ca8 (diff)
QML: Add an option to bind components to files
If a component is bound to a file context, we can be sure that the IDs present in the same file will be accessible to bindings and functions inside the component. We will need this to allow such bindings to be compiled to C++. [ChangeLog][QtQml] You can now bind components to a file scope. This way you can make sure IDs in the file are accessible to the components. Task-number: QTBUG-101012 Task-number: QTBUG-102806 Change-Id: I290a61752b4b02e13f0bb0213ba3f871bdb95260 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlcomponent_p.h')
-rw-r--r--src/qml/qml/qqmlcomponent_p.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlcomponent_p.h b/src/qml/qml/qqmlcomponent_p.h
index 55330c6837..471aaa09c5 100644
--- a/src/qml/qml/qqmlcomponent_p.h
+++ b/src/qml/qml/qqmlcomponent_p.h
@@ -138,6 +138,10 @@ public:
QObject *doBeginCreate(QQmlComponent *q, QQmlContext *context);
bool setInitialProperty(QObject *component, const QString &name, const QVariant& value);
+
+ bool isBound() const {
+ return compilationUnit->unitData()->flags & QV4::CompiledData::Unit::ComponentsBound;
+ }
};
QT_END_NAMESPACE