removed PrefixPath debug line
[opentx.git] / companion / src / simulation / debugoutput.cpp
blob03aa757d61cd41e0b82936c73128feab100cdbc0
1 #include <QtGui>
2 #include <stdint.h>
3 #include "debugoutput.h"
4 #include "ui_debugoutput.h"
6 DebugOutput::DebugOutput(QWidget * parent):
7 QDialog(parent),
8 ui(new Ui::DebugOutput)
10 ui->setupUi(this);
12 #ifdef __APPLE__
13 QFont newFont("Courier", 13);
14 ui->Output->setFont(newFont);
15 ui->Output->setAttribute(Qt::WA_MacNormalSize);
16 #endif
17 #if defined WIN32 || !defined __GNUC__
18 QFont newFont("Courier", 9);
19 ui->Output->setFont(newFont);
20 #endif
24 DebugOutput::~DebugOutput()
26 delete ui;
29 void DebugOutput::traceCallback(const QString & text)
31 // ui->Output->appendPlainText(text);
32 QTextCursor cursor(ui->Output->textCursor());
34 // is the scrollbar at the end?
35 bool atEnd = (ui->Output->verticalScrollBar()->value() == ui->Output->verticalScrollBar()->maximum());
37 cursor.movePosition(QTextCursor::End, QTextCursor::MoveAnchor, 1);
38 cursor.insertText(text);
40 if (atEnd) {
41 ui->Output->verticalScrollBar()->triggerAction(QAbstractSlider::SliderToMaximum);