[Interest] Calling C++ from QML (without objects)

Daniel França daniel.franca at gmail.com
Thu Nov 5 19:30:38 CET 2015


You can define a singleton type for your object and call your function from
there http://doc.qt.io/qt-5/qqmlengine.html#qmlRegisterSingletonType

Em qui, 5 de nov de 2015 às 19:25, Dmitry Volosnykh <
dmitry.volosnykh at gmail.com> escreveu:

> I think, you have only option to wrap it with QObject that you expose to
> QML.
>
> On Thu, Nov 5, 2015 at 9:17 PM, Jason H <jhihn at gmx.com> wrote:
>
>> I want to provide a wrapper around QMessageAuthenticationCode::hash()
>>
>> But I think I need an object for it. Can I just expose it as a function
>> some how?
>>
>> I am more interested in having it callable, than an object in my QML
>> element hierarchy.
>>
>> Thanks!
>> _______________________________________________
>> Interest mailing list
>> Interest at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20151105/298f87ca/attachment.html>


More information about the Interest mailing list