2011-09-25 20:30:32 +02:00
|
|
|
#include "debugengine.h"
|
2013-09-15 23:06:25 +02:00
|
|
|
|
2011-09-25 20:30:32 +02:00
|
|
|
debugengine::debugengine()
|
2013-09-15 23:06:25 +02:00
|
|
|
{
|
|
|
|
mut_lock = new QMutex(QMutex::Recursive);
|
|
|
|
}
|
2011-09-25 20:30:32 +02:00
|
|
|
|
2013-09-15 23:06:25 +02:00
|
|
|
debugengine *debugengine::getInstance()
|
2011-09-25 20:30:32 +02:00
|
|
|
{
|
2013-09-15 23:06:25 +02:00
|
|
|
static debugengine objectInstance;
|
|
|
|
|
|
|
|
return &objectInstance;
|
2011-09-25 20:30:32 +02:00
|
|
|
}
|
2013-09-15 23:06:25 +02:00
|
|
|
|
|
|
|
debugengine::~debugengine()
|
2011-09-25 20:30:32 +02:00
|
|
|
{
|
2013-09-15 23:06:25 +02:00
|
|
|
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);
|
|
|
|
}
|
2011-09-25 20:30:32 +02:00
|
|
|
}
|