You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
164 lines
4.0 KiB
C++
164 lines
4.0 KiB
C++
/**
|
|
*
|
|
* @file FITKAbstractGUI.h
|
|
* @brief GUI控件基类声明
|
|
* @author LiBaojun (libaojunqd@foxmail.com)
|
|
* @date 2024-03-02
|
|
*
|
|
*/
|
|
#ifndef ___FITKABSTRACTGUI_H__
|
|
#define ___FITKABSTRACTGUI_H__
|
|
|
|
#include <QWidget>
|
|
#include <QDialog>
|
|
#include <QMainWindow>
|
|
#include "FITKAbstractGUIObject.h"
|
|
|
|
class QCloseEvent;
|
|
|
|
namespace Core
|
|
{
|
|
class FITKAbstractOperator;
|
|
/**
|
|
* @brief GUI WIDGET声明
|
|
* @author LiBaojun (libaojunqd@foxmail.com)
|
|
* @date 2024-03-02
|
|
*/
|
|
class FITKCoreAPI FITKWidget : public QWidget ,public FITKAbstractGUIObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
/**
|
|
* @brief 使用全部基类构造函数
|
|
* @author LiBaojun (libaojunqd@foxmail.com)
|
|
* @date 2024-03-02
|
|
*/
|
|
using QWidget::QWidget;
|
|
virtual ~FITKWidget() = 0;
|
|
/**
|
|
* @brief 强制刷新窗口
|
|
* @author LiBaojun (libaojunqd@foxmail.com)
|
|
* @date 2024-04-17
|
|
*/
|
|
virtual void flush();
|
|
|
|
/**
|
|
* @brief 获取操作器
|
|
* @param[i] operName 操作器名称
|
|
* @author LiBaojun (libaojunqd@foxmail.com)
|
|
* @date 2024-04-13
|
|
*/
|
|
virtual void initOperator(const QString & operName);
|
|
|
|
template<class T>
|
|
/**
|
|
* @brief 获取操作器并进行类型转换
|
|
* @return T*
|
|
* @author LiBaojun (libaojunqd@foxmail.com)
|
|
* @date 2024-04-13
|
|
*/
|
|
T* getTOperator()
|
|
{
|
|
return dynamic_cast<T*>(_oper);
|
|
}
|
|
|
|
protected:
|
|
/**
|
|
* @brief 操作器
|
|
* @author LiBaojun (libaojunqd@foxmail.com)
|
|
* @date 2024-04-13
|
|
*/
|
|
FITKAbstractOperator* _oper{};
|
|
|
|
|
|
};
|
|
/**
|
|
* @brief GUI Dialog 抽象类声明
|
|
* @author LiBaojun (libaojunqd@foxmail.com)
|
|
* @date 2024-03-02
|
|
*/
|
|
class FITKCoreAPI FITKDialog : public QDialog, public FITKAbstractGUIObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
/**
|
|
* @brief 使用全部基类构造函数
|
|
* @author LiBaojun (libaojunqd@foxmail.com)
|
|
* @date 2024-03-02
|
|
*/
|
|
using QDialog::QDialog;
|
|
virtual ~FITKDialog() = 0;
|
|
|
|
};
|
|
/**
|
|
* @brief Mainwindow声明
|
|
* @author LiBaojun (libaojunqd@foxmail.com)
|
|
* @date 2024-03-02
|
|
*/
|
|
class FITKCoreAPI FITKMainWindow : public QMainWindow, public FITKAbstractGUIObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
/**
|
|
* @brief 使用全部基类构造函数
|
|
* @author LiBaojun (libaojunqd@foxmail.com)
|
|
* @date 2024-03-02
|
|
*/
|
|
using QMainWindow::QMainWindow;
|
|
virtual ~FITKMainWindow() = 0;
|
|
/**
|
|
* @brief 重写关闭事件
|
|
* @param[i] event 关闭事件
|
|
* @author LiBaojun (libaojunqd@foxmail.com)
|
|
* @date 2024-04-13
|
|
*/
|
|
virtual void closeEvent(QCloseEvent *event) override;
|
|
/**
|
|
* @brief 强制刷新窗口
|
|
* @author LiBaojun (libaojunqd@foxmail.com)
|
|
* @date 2024-04-17
|
|
*/
|
|
virtual void flush();
|
|
|
|
};
|
|
|
|
/**
|
|
* @brief Mainwindow声明
|
|
* @author LiBaojun (libaojunqd@foxmail.com)
|
|
* @date 2024-03-02
|
|
*/
|
|
class FITKCoreAPI FITKRibbonMainWindow : public QMainWindow, public FITKAbstractGUIObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
/**
|
|
* @brief 使用全部基类构造函数
|
|
* @author LiBaojun (libaojunqd@foxmail.com)
|
|
* @date 2024-03-02
|
|
*/
|
|
using QMainWindow::QMainWindow;
|
|
virtual ~FITKRibbonMainWindow() = 0;
|
|
/**
|
|
* @brief 重写关闭事件
|
|
* @param[i] event 关闭事件
|
|
* @author LiBaojun (libaojunqd@foxmail.com)
|
|
* @date 2024-04-13
|
|
*/
|
|
virtual void closeEvent(QCloseEvent *event) override;
|
|
/**
|
|
* @brief 强制刷新窗口
|
|
* @author LiBaojun (libaojunqd@foxmail.com)
|
|
* @date 2024-04-17
|
|
*/
|
|
virtual void flush();
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|