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.
AppFlow/FITK_Component/FITKCompMessageWidget/FITKConsole.h

116 lines
3.1 KiB
C

/**
*
* @file FITKConsole.h
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-04
*
*/
#ifndef _FITKConsole_H_
#define _FITKConsole_H_
#include "FITKCompMessageWidgetAPI.h"
#include "FITK_Kernel/FITKCore/FITKAbstractGUIObject.h"
#include <QTextEdit>
class QAction;
class QMutex;
class QContextMenuEvent;
namespace Comp
{
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-04
*/
enum MessageType
{
None = 0,
Normal,
Warning,
Error,
Info,
};
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-04
*/
class CompMesWidgetAPI FITKConsole :public QTextEdit, public Core::FITKAbstractGUIObject
{
Q_OBJECT
public:
/**
* @brief Construct a new FITKConsole object
* @param[i] parent My Param doc
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-04
*/
FITKConsole(bool qtMessage, QWidget* parent = nullptr);
/**
* @brief Destroy the FITKConsole object
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-04
*/
~FITKConsole();
/**
* @brief
* @param[i] type ()
* @param[i] message
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-04
*/
void displayMessage(MessageType type, const QString message);
protected:
/**
* @brief
* @param[i] event
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-04
*/
void contextMenuEvent(QContextMenuEvent *event) override;
private:
/**
* @brief Qt
* @param[i] type
* @param[i] context
* @param[i] msg
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-05
*/
static void messageCallBack(QtMsgType type, const QMessageLogContext &context, const QString &msg);
private slots:
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-04
*/
void save();
/**
* @brief
* @param[i] type ()
* @param[i] message
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-04
*/
void displayMessage(int type, const QString message);
private:
/**
* @brief 线
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-06
*/
static QMutex m_mutex;
/**
* @brief qt
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-04-13
*/
bool _qtMessage{ false };
};
}
#endif