1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-14 21:23:52 +01:00
LibrePilot/ground/openpilotgcs/src/plugins/debuggadget/debugengine.cpp
2013-09-15 23:37:20 +02:00

45 lines
713 B
C++

#include "debugengine.h"
debugengine::debugengine()
{
mut_lock = new QMutex(QMutex::Recursive);
}
debugengine *debugengine::getInstance()
{
static debugengine objectInstance;
return &objectInstance;
}
debugengine::~debugengine()
{
delete mut_lock;
mut_lock = NULL;
}
void debugengine::setTextEdit(QTextBrowser *textEdit)
{
QMutexLocker lock(mut_lock);
_textEdit = textEdit;
}
void debugengine::writeMessage(const QString &message)
{
QMutexLocker lock(mut_lock);
if (_textEdit) {
_textEdit->append(message);
}
}
void debugengine::setColor(const QColor &c)
{
QMutexLocker lock(mut_lock);
if (_textEdit) {
_textEdit->setTextColor(c);
}
}