37 lines
671 B
C++
37 lines
671 B
C++
#ifndef GUI_GUIERRORBASE_H
|
|
#define GUI_GUIERRORBASE_H
|
|
|
|
#include <QWidget>
|
|
|
|
/**
|
|
* GUI Error interface
|
|
*/
|
|
class GUIErrorBase {
|
|
public:
|
|
GUIErrorBase()= default;
|
|
|
|
/**
|
|
* parse error object from error msg
|
|
* @param errorMsg
|
|
*/
|
|
virtual void parse(const QString& errorMsg){};
|
|
|
|
/**
|
|
* setErrorHandleParent
|
|
* @param parent The parent widget of error handling
|
|
*/
|
|
void setErrorHandleParent(QWidget* parent){
|
|
if (parent)this->parent = parent;
|
|
};
|
|
|
|
/**
|
|
* handle error, should be implement in sub class
|
|
*/
|
|
virtual void handle(){};
|
|
protected:
|
|
QWidget* parent = nullptr;
|
|
};
|
|
|
|
|
|
#endif //GUI_GUIERRORBASE_H
|