Clarification on Signal Exposure in QField Plugins #5892
-
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
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,
Does this mean that all I’ve reviewed files like layerobserver.cpp and featurelistmodel.cpp, which appear to connect I’d appreciate it if you could clarify:
Apologies if my question isn’t clear—I’m still learning about Plugin development with Qfield. Thank you in advance ! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@paul-carteron , every Q_OBJECT or Q_GADGET class exposed in our QML environment (see 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 :) |
Beta Was this translation helpful? Give feedback.
@paul-carteron , every Q_OBJECT or Q_GADGET class exposed in our QML environment (see 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 :)