Fix logout miss bug

This commit is contained in:
Krad
2021-12-16 10:52:21 +08:00
parent ba0d59ef54
commit 5d8b983813
3 changed files with 49 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
//
// Created by Krad on 2021/12/16.
//
#include "GUIErrorBase.h"

View File

@@ -0,0 +1,40 @@
//
// Created by Krad on 2021/12/16.
//
#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){
this->parent = parent;
};
/**
* handle error, should be implement in sub class
*/
virtual void handle(){};
protected:
QWidget* parent = nullptr;
};
#endif //GUI_GUIERRORBASE_H

View File

@@ -1,4 +1,4 @@
#include "mainwindow.h"
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <qtabwidget.h>
#include <QSizePolicy>
@@ -236,6 +236,9 @@ MainWindow::MainWindow(QWidget* parent) :
msgDialog = nullptr;
AppGlobalValues::setInProcessing(false);
});
connect(EventCenter::Default(), &EventCenter::RequestLogin, [=](QObject*, QObject* msg) {
this->requestLogin();
});
DeviceManager::Default()->initDevice();
centerWidgetHide();
}