Files
qtpromise/docs/qtpromise/exceptions/conversion.md
Dmitriy Purgin 0c3955cca5 Implement QPromise<T>::convert<U>() (#41)
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`.
2020-11-22 17:26:06 +01:00

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
    });