mirror of
https://github.com/simonbrunel/qtpromise.git
synced 2025-07-07 09:45:24 +08:00
Converts the resolved value of `QPromise<T>` to the type `U`. Depending on types `T` and `U`, it performs a static cast, calls a converting constructor or tries to convert using `QVariant`.
350 B
350 B
QPromiseConversionException
Since: 0.7.0
This exception is thrown whenever a promise result conversion fails, for example:
QPromise<QVariant> input = {...};
auto output = input.convert<int>()
.fail([](const QPromiseconversionException& e) {
// conversion may fail because input could not be converted to number
});