Files
GUI/src/dialogs/DialogManager.h

40 lines
931 B
C
Raw Normal View History

2022-07-19 14:15:00 +08:00
//
// 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