[Interest] using a custom class as parameter of signal/slot, used in QML

Sylvain Pointeau sylvain.pointeau at gmail.com
Fri Mar 1 12:43:55 CET 2019


Dear all,

I understood how to use a struct / simple class as a parameter of a signal
/ slot, and it works well by value.

However as soon as we have to declare the type for QML, it is not good
anymore.
It seems that it must be derived from QObject and passed by pointer.

Do I understand well that the QML world does only accept pointers on
QObject?

However I don't understand, who owns the pointer of the custom class
(derived from QObject) and who actually deletes it?
(I tried a sharepointer but QML does not know how to handle it)

Do you have any idea?

Best regards,
Sylvain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20190301/7a720c2f/attachment.html>


More information about the Interest mailing list