context holder & generic

This commit is contained in:
王劲鹏
2021-02-05 18:12:25 +08:00
committed by osborn
parent 41640c1399
commit 24f7bb2498
9 changed files with 51 additions and 8 deletions

View File

@@ -0,0 +1,9 @@
#include "DoricContextHolder.h"
DoricContextHolder::DoricContextHolder(QObject *parent) { mContext = NULL; }
void DoricContextHolder::setContext(DoricContext *context) {
mContext = context;
}
DoricContext *DoricContextHolder::getContext() { return mContext; }

View File

@@ -0,0 +1,18 @@
#ifndef DORICCONTEXTHOLDER_H
#define DORICCONTEXTHOLDER_H
#include "../DoricContext.h"
class DoricContextHolder : public QObject {
protected:
DoricContext *mContext = NULL;
public:
explicit DoricContextHolder(QObject *parent = nullptr);
void setContext(DoricContext *context);
DoricContext *getContext();
};
#endif // DORICCONTEXTHOLDER_H