1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-09 20:32:43 +01:00
openrw/rwviewer/views/WorldViewer.cpp

26 lines
644 B
C++
Raw Normal View History

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