add OuputDevice as singleton to manage output to statusbar,

This commit is contained in:
Anakin
2017-01-29 11:35:43 +01:00
parent 96b7d6f736
commit 98302664ca
9 changed files with 52 additions and 34 deletions

View File

@@ -1,5 +1,5 @@
#include "..\Header\OglViewerWidget.h"
#include "..\Header\OutputDevice.h"
#include <QMouseEvent>
#include <QDropEvent>
#include <QMimeData>
@@ -65,7 +65,6 @@ void OglViewerWidget::setConnections()
connect(m_dataEngine, &GeometryEngine::requestResetView, this, &OglViewerWidget::resetView);
connect(parentWidget(), SIGNAL(loadFile(QString)), m_dataEngine, SLOT(loadFile(QString)));
connect(this, SIGNAL(loadFile(QString)), m_dataEngine, SLOT(loadFile(QString)));
connect(m_dataEngine, SIGNAL(sendMessage(QString, int)), parentWidget(), SLOT(printMessage(QString, int)));
connect(m_dataEngine, SIGNAL(requestUpdate()), this, SLOT(update()));
connect(m_dataEngine, SIGNAL(sendFileInfo(QString, QVector<Material>*, int, int)), parentWidget(), SLOT(setFileInfo(QString, QVector<Material>*, int, int)));
}
@@ -308,12 +307,12 @@ void OglViewerWidget::keyPressEvent(QKeyEvent *e)
{
m_zSpeed -= 0.1;
m_zSpeed < 0.09 ? m_zSpeed = 0 : NULL;
emit sendMessage(QString("Zoom speed = %1%").arg(m_zSpeed * 100), 0);
OutputDevice::getInstance()->print(QString("Zoom speed = %1%").arg(m_zSpeed * 100), 0);
}
else if (e->key() == Qt::Key_Plus)
{
m_zSpeed += 0.1;
emit sendMessage(QString("Zoom speed = %1%").arg(m_zSpeed * 100), 0);
OutputDevice::getInstance()->print(QString("Zoom speed = %1%").arg(m_zSpeed * 100), 0);
}
}