add custom callback for async result

This commit is contained in:
王劲鹏 2019-12-20 11:20:38 +08:00
parent 7443e5c1c9
commit 15d3a1cbf7

View File

@ -1,6 +1,8 @@
#ifndef CUSTOM_CALLBACK_H #ifndef CUSTOM_CALLBACK_H
#define CUSTOM_CALLBACK_H #define CUSTOM_CALLBACK_H
#include <QDebug>
#include "async/callback.h" #include "async/callback.h"
template <class R> template <class R>
@ -8,11 +10,11 @@ class CustomCallback : public Callback<R> {
public: public:
void onResult(R result) override { void onResult(R result) override {
qDebug() << result;
} }
void onError(QException exception) override { void onError(QException exception) override {
qDebug() << exception.what();
} }
void onFinish() override { void onFinish() override {