This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Doric/doric-Qt/doric/template/custom_callback.h

26 lines
412 B
C
Raw Normal View History

2019-12-19 20:24:44 +08:00
#ifndef CUSTOM_CALLBACK_H
#define CUSTOM_CALLBACK_H
2019-12-20 11:20:38 +08:00
#include <QDebug>
2019-12-19 20:24:44 +08:00
#include "async/callback.h"
template <class R>
class CustomCallback : public Callback<R> {
public:
void onResult(R result) override {
2019-12-20 11:20:38 +08:00
qDebug() << result;
2019-12-19 20:24:44 +08:00
}
void onError(QException exception) override {
2019-12-20 11:20:38 +08:00
qDebug() << exception.what();
2019-12-19 20:24:44 +08:00
}
void onFinish() override {
}
};
#endif // CUSTOM_CALLBACK_H