add OuputDevice as singleton to manage output to statusbar,
This commit is contained in:
27
QtMeshViewer/Header/OutputDevice.h
Normal file
27
QtMeshViewer/Header/OutputDevice.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
#include <QObject>
|
||||
|
||||
class OutputDevice : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
OutputDevice(QObject *parent = Q_NULLPTR) : QObject(parent) {};
|
||||
|
||||
public:
|
||||
OutputDevice(OutputDevice const&) = delete;
|
||||
void operator=(OutputDevice const&) = delete;
|
||||
|
||||
~OutputDevice() {};
|
||||
|
||||
static OutputDevice* getInstance(QObject *parent = Q_NULLPTR) {
|
||||
static OutputDevice* instance = new OutputDevice(parent);
|
||||
return instance;
|
||||
};
|
||||
|
||||
void print(QString message, int severity) { emit sendMessage(message, severity); };
|
||||
|
||||
signals:
|
||||
void sendMessage(QString message, int severity);
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user