1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-22 18:32:44 +01:00
openrw/rwviewer/views/ViewerInterface.hpp
Daniel Evans 6f9c3db52e Overahaul of rwviewer to simplify the code and improve usability
- Shared ViewerWidget has been removed. Now multiple instances exist
2018-01-27 21:44:18 +00:00

40 lines
751 B
C++

#ifndef _RWVIEWER_VIEWERINTERFACE_HPP_
#define _RWVIEWER_VIEWERINTERFACE_HPP_
#include <engine/GameWorld.hpp>
#include <ViewerWidget.hpp>
#include <QWidget>
class ViewerInterface : public QWidget {
Q_OBJECT
public:
ViewerInterface(QWidget* parent = 0, Qt::WindowFlags f = 0)
: QWidget(parent, f), m_world(nullptr) {
}
GameWorld* world() {
return m_world;
}
protected:
virtual void worldChanged() {}
ViewerWidget* createViewer();
signals:
void gameLoaded(GameWorld*, GameRenderer*);
public slots:
void showData(GameWorld* world, GameRenderer* renderer) {
m_world = world;
gameLoaded(world, renderer);
worldChanged();
}
private:
GameWorld* m_world;
};
#endif