add OuputDevice as singleton to manage output to statusbar,
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
#pragma once
|
||||
#include <QObject>
|
||||
#include <QOpenGlTexture>
|
||||
#include <fstream>
|
||||
#include <QVector>
|
||||
@@ -7,7 +6,6 @@
|
||||
#include <QMatrix4x4>
|
||||
#include <QQuaternion>
|
||||
#include <QRegExp>
|
||||
#include "MainWindow.h"
|
||||
|
||||
struct BoundingBox {
|
||||
QQuaternion rotation;
|
||||
@@ -54,14 +52,12 @@ struct Material {
|
||||
std::uint8_t dataValues[2] = { 0 };
|
||||
};
|
||||
|
||||
class FileInterface : public QObject
|
||||
class FileInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit FileInterface(QString path, QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_models(new QVector<Model*>)
|
||||
explicit FileInterface(QString path)
|
||||
: m_models(new QVector<Model*>)
|
||||
, m_materials(new QVector<Material>)
|
||||
{
|
||||
//open file
|
||||
@@ -70,10 +66,6 @@ public:
|
||||
if (!m_file.is_open())
|
||||
throw std::invalid_argument(std::string("ERROR: file not found: ") += path.toStdString());
|
||||
|
||||
MainWindow* tmp = dynamic_cast<MainWindow*>(parent->parent()->parent());
|
||||
if(tmp != NULL)
|
||||
connect(this, SIGNAL(sendMessage(QString, int)), tmp, SLOT(printMessage(QString, int)));
|
||||
|
||||
m_filepath = path.left(path.lastIndexOf(QRegExp("/|\\\\")));
|
||||
|
||||
};
|
||||
@@ -138,6 +130,4 @@ public:
|
||||
return defMaterial;
|
||||
};
|
||||
|
||||
signals:
|
||||
void sendMessage(QString msg, int severity);
|
||||
};
|
||||
Reference in New Issue
Block a user