mirror of
https://github.com/simonbrunel/qtpromise.git
synced 2025-07-07 17:57:39 +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`.
14 lines
350 B
Markdown
14 lines
350 B
Markdown
# QPromiseConversionException
|
|
|
|
*Since: 0.7.0*
|
|
|
|
This exception is thrown whenever a promise result conversion fails, for example:
|
|
|
|
```cpp
|
|
QPromise<QVariant> input = {...};
|
|
auto output = input.convert<int>()
|
|
.fail([](const QPromiseconversionException& e) {
|
|
// conversion may fail because input could not be converted to number
|
|
});
|
|
```
|