gui: add basic gui code.
This commit is contained in:
38
Gui/Control/LogControl.h
Normal file
38
Gui/Control/LogControl.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#ifndef LOGCONTROL_H
|
||||
#define LOGCONTROL_H
|
||||
|
||||
#include <QBrush>
|
||||
#include <QStandardItemModel>
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
class LogPrint;
|
||||
}
|
||||
|
||||
class LogPrint : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit LogPrint(QWidget* parent = nullptr);
|
||||
~LogPrint();
|
||||
|
||||
public:
|
||||
void Info(const QString& message);
|
||||
void Warn(const QString& message);
|
||||
void Error(const QString& message);
|
||||
void Debug(const QString& message);
|
||||
|
||||
public:
|
||||
std::string now_str();
|
||||
|
||||
private:
|
||||
void InitControl();
|
||||
void Print(const QString& message, const QBrush& color);
|
||||
|
||||
private:
|
||||
Ui::LogPrint* ui;
|
||||
QStandardItemModel* model_;
|
||||
};
|
||||
|
||||
#endif // LOGCONTROL_H
|
||||
Reference in New Issue
Block a user