Closed nathanielhourt closed 8 years ago
Well after much experimentation, I answered my own question. I've created a class, QmlPromise, which can be created from C++ and creates a Promise{}
component and mirrors its API in C++ friendly signals and slots. I haven't figured out how to implement then(onResolve, onReject)
in C++ since I'm not sure how to pass a C++ function to javascript as a value. It's not necessary for my purposes anyways.
I'll close this issue with a link to that class when I post it on Github, in case you'd like to add it to this repo.
Have you attempted to create and resolve these promises from C++, returning them to QML so QML can be notified when asynchronous C++ operations finish? How hard is it to do this?