# Clarification on Signal Exposure in QField Plugins

**URL:** <https://community.qfield.org/t/clarification-on-signal-exposure-in-qfield-plugins/373>\
**Category:** Ask the Community\
**Tags:** gh-import\
**Created:** [14 May 2025 02:11 UTC](https://community.qfield.org/t/clarification-on-signal-exposure-in-qfield-plugins/373 "2025-05-14T02:11:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex018/uploads/qfield/original/1X/7d3726da0ef5099a1e135505c03d2f125d527aae.png) [@system](https://community.qfield.org/u/system)\
**Post date:** [14 May 2025 02:11 UTC](https://community.qfield.org/t/clarification-on-signal-exposure-in-qfield-plugins/373/1 "2025-05-14T02:11:14Z")

</div>

Hi,

I’ve been working on QField plugin and recently started exploring the use of signals. If I understand correctly, signals from QGIS classes can be accessed in QML when the class is exposed. For example, I’ve successfully connected to signals from `QgsVectorLayer` like `featureAdded` and `geometryChanged` in QML using the following:

```auto
property var my_layer: qgisProject.mapLayersByName("my_layer")[0]

Connections {
    target: my_layer

    onGeometryChanged: {
        iface.logMessage("onGeometryChanged")
    }
    onFeatureAdded: {
        iface.logMessage("onFeatureAdded")
    }
}

```

This works perfectly, but I’m trying to understand how to confirm whether signals for a specific class are fully exposed to QML or if there’s a custom mechanism in QField that bridges these signals.

From my understanding, `QgsVectorLayer` is exposed to QML with :

`qmlRegisterType<QgsVectorLayer>( "org.qgis", 1, 0, "VectorLayer")`

Does this mean that all `QgsVectorLayer` signals (like `featureAdded`, `geometryChanged`, `committedFeaturesAdded`, etc.) are automatically available in QML?

I’ve reviewed files like [layerobserver.cpp](https://github.com/opengisch/QField/blob/master/src/core/layerobserver.cpp) and [featurelistmodel.cpp](https://github.com/opengisch/QField/blob/master/src/core/featurelistmodel.cpp), which appear to connect `QgsVectorLayer` signals internally. However, in the plugin I use `target:my_layer` (a `QgsVectorLayer` instance) and not to something like `layerObserver`.

I’d appreciate it if you could clarify:

- Are all `QgsVectorLayer` signals exposed to QML by default, or is there a custom mechanism in QField for signal exposure?
- If not all signals are exposed, are there specific parts of the codebase I can refer to confirm which signals are available for a given class in QField?

Apologies if my question isn’t clear—I’m still learning about Plugin development with Qfield.

Thank you in advance !

* * *

_Imported from [GitHub discussion](https://github.com/opengisch/qfield/discussions/5892) by @paul-carteron on 2024-12-13T10:54:55Z_

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex018/uploads/qfield/original/1X/7d3726da0ef5099a1e135505c03d2f125d527aae.png) [@system](https://community.qfield.org/u/system)\
**Post date:** [14 May 2025 02:11 UTC](https://community.qfield.org/t/clarification-on-signal-exposure-in-qfield-plugins/373/2 "2025-05-14T02:11:15Z")

</div>

paul-carteron , every Q\_OBJECT or Q\_GADGET class exposed in our QML environment (see [QField/src/core/qgismobileapp.cpp at master · opengisch/QField · GitHub](https://github.com/opengisch/QField/blob/master/src/core/qgismobileapp.cpp#L366) to see a list of those objects and gadgets exposed) will have their signals exposed to our QML environment.

It is possible a signal containing parameter types that are not exposed in the QML environment will be skipped. It’s not something I’ve tested before, but I can see a disabling logic there 🙂

* * *

_Imported from [GitHub comment](https://github.com/opengisch/QField/discussions/5892#discussioncomment-11564508) by @nirvn on 2024-12-14T08:33:44Z_

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex018/uploads/qfield/original/1X/7d3726da0ef5099a1e135505c03d2f125d527aae.png) [@system](https://community.qfield.org/u/system)\
**Post date:** [14 May 2025 02:11 UTC](https://community.qfield.org/t/clarification-on-signal-exposure-in-qfield-plugins/373/3 "2025-05-14T02:11:17Z")

</div>

Oh I see ! By default all signals are implemented. It’s just a matter of understanding exactly how a signal is triggered, and checking that the parameters are available in qfield.

I will continue exploring !

Thank you so much for your work and time 🙂

* * *

_Imported from [GitHub comment](https://github.com/opengisch/QField/discussions/5892#discussioncomment-11578930) by @paul-carteron on 2024-12-16T09:40:52Z_
