6 class EmptyPromise : public QObject {
10 explicit EmptyPromise(QObject *parent = nullptr) : QObject(parent) {
11 connect(this, &EmptyPromise::resolve, this, &QObject::deleteLater);
12 connect(this, &EmptyPromise::reject, this, &QObject::deleteLater);
15 template <typename Functor> EmptyPromise &then(Functor func) {
16 connect(this, &EmptyPromise::resolve, this, func);
19 template <typename Functor> EmptyPromise &onFailed(Functor func) {
20 connect(this, &EmptyPromise::reject, this, func);
23 template <typename Functor> EmptyPromise &finally(Functor func) {
24 connect(this, &EmptyPromise::destroyed, this, func);
30 void reject(const QString &message);
33 #endif // EMPTYPROMISE_H