pureqml / qmlcore

QML to Javascript/HTML5 translator. Ready for Mobile, Desktop and SmartTV platforms.
MIT License
331 stars 41 forks source link

How can React call compiled internal components? #218

Closed t2dk49580 closed 2 years ago

t2dk49580 commented 3 years ago

I want to put compiled content inside React and use React to interact with the compiled content

whoozle commented 3 years ago

Do you want React to call qml component methods or the other way around (qml code calling react)?

t2dk49580 commented 3 years ago

I give up react, now I want to use nodeJS library in QML, and then compile to HTML, if I use this way can QMLCore still complete build, if possible, can you write an example, thank you very much

whoozle commented 2 years ago

you can call any external javascript from pureQML just like from javascript file. external (to qml) code can access it using qml._context (namespace could be changed in the manifest) you can even retrieve individual components by id - qml._context._get('zzzz')

It's mapped in quite straightforward way: qml properties are real properties. qml components are objects of real JS classes. methods are methods etc.

t2dk49580 commented 2 years ago

Thank you very much, you are a true QML fan, other QML projects are not working

whoozle commented 2 years ago

no worries, feel free to contact us again on telegram, gitter or here.