Peter Würtz

Results 45 comments of Peter Würtz

What exactly do you mean by "cancel"? If you just don't want the promise continuations (then/fail) to be invoked, stopping the event loop and destroying all `QObjects` is probably enough....

Oh ok, by "close window" I thought you meant shutting down the application. So you have some kind of dialog with a long running promise and you want that promise...

You are trying to retrieve an asynchronous promise result in a syncronous way. There is an example for this in the tests: https://github.com/simonbrunel/qtpromise/blob/461f09bef8547d8696f909488afa31b399b9c78d/tests/auto/qtpromise/shared/utils.h#L14 But generally, this is not what promises...

> Maybe there are some situations where we know for sure that the promise is resolved, thus that method would make easier retrieving the value, though I don't think of...

> Could you advise what would be the best way to implement a `wait()` equivalent that would be safe for production code? Generally, there is no way to do this....

@mkucmpro "ocasionally use in a synchronous way" might work in specific situations if you're able to control and contain the event emitter in a thread. For example, you can wrap...

There is nothing special about `deleteLater()` that would prevent it from working in `then()`. This works as expected: ```c++ void testDelete() { auto obj = QPointer{new QObject{}}; auto p1 =...

@simonbrunel What is the biggest issue to solve for getting QML Promise in a technology preview state? As in knowing full well that the API may change, but being confident...

Interesting, sounds like they are almost at the point of merging ES6 Promises into their JS engine. Crazy thought: Could this be an opportunity to use that momentum and convince...

So since creating `QJSValue` from C++ is a pain due to the burden of acquiring a `QJSEngine`, couldn't the Promise be shipped via `QVariant` instead? With `QJSPromise` being a registered...