1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-02 00:42:33 +01:00
openrw/rwviewer/views/WorldViewer.cpp
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

26 lines
644 B
C++

#include "WorldViewer.hpp"
#include "ViewerWidget.hpp"
#include <QFileDialog>
WorldViewer::WorldViewer(QWidget* parent, Qt::WindowFlags f)
: ViewerInterface(parent, f) {
mainLayout = new QVBoxLayout;
mainLayout->addWidget(QWidget::createWindowContainer(createViewer()));
setLayout(mainLayout);
}
void WorldViewer::loadPlacements(const QString& file) {
world()->placeItems(file.toStdString());
placementsLoaded(file);
}
void WorldViewer::loadPlacements() {
QFileDialog dialog(this, "Open Placements", "", "Placement (*.ipl)");
if (dialog.exec()) {
loadPlacements(dialog.selectedFiles()[0]);
}
}