mirror of
https://github.com/simonbrunel/qtpromise.git
synced 2024-11-26 05:17:02 +08:00
18739bd8e0
Split the root README.md in multiple Markdown files (in the `docs/` folder) to make easier reading, editing and extending the documentation. An online version is also available on netlify (https://qtpromise.netlify.com). Building it requires Node.js installed, then: - npm install -g gitbook-cli - gitbook install ./ - gitbook build . dist/docs
448 B
448 B
[static] QPromise<T>::reject
[static] QPromise<T>::reject(any reason) -> QPromise<T>
Creates a QPromise<T>
that is rejected with the given reason
of whatever type:
QPromise<int> compute(const QString& type)
{
if (type == "foobar") {
return QPromise<int>::reject(QString("Unknown type: %1").arg(type));
}
return QPromise<int>([](const QPromiseResolve<int>& resolve) {
// {...}
});
}