Add DialogManager
This commit is contained in:
39
src/dialogs/DialogManager.h
Normal file
39
src/dialogs/DialogManager.h
Normal file
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// Created by Krad on 2022/7/19.
|
||||
//
|
||||
|
||||
#ifndef GUI_DIALOGMANAGER_H
|
||||
#define GUI_DIALOGMANAGER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QStack>
|
||||
|
||||
class QWidget;
|
||||
class QDialog;
|
||||
class GUIMessageDialog;
|
||||
|
||||
class DialogManager:public QObject {
|
||||
public:
|
||||
static DialogManager *Default() {
|
||||
static DialogManager manager;
|
||||
return &manager;
|
||||
}
|
||||
|
||||
DialogManager() = default;
|
||||
|
||||
~DialogManager() override = default;
|
||||
|
||||
void init();
|
||||
QWidget* getTopWidget();
|
||||
void raiseDeviceError(QObject* parent, QObject* msg);
|
||||
void invokeOperationStart(QObject* parent, QObject* msg);
|
||||
void invokeOperationProgress(QObject* parent, QObject* msg);
|
||||
void invokeOperationPending(QObject* parent, QObject* msg);
|
||||
void invokeOperationEnd(QObject* parent, QObject* msg);
|
||||
private:
|
||||
QDialog* mDialog = nullptr;
|
||||
GUIMessageDialog* mMessageDialog = nullptr;
|
||||
QStack<QDialog*> topWidgetStore;
|
||||
};
|
||||
|
||||
#endif //GUI_DIALOGMANAGER_H
|
||||
Reference in New Issue
Block a user