1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-25 20:02:40 +01:00
openrw/rwviewer/ModelFramesWidget.cpp
2014-06-06 13:12:20 +01:00

28 lines
593 B
C++

#include "ModelFramesWidget.hpp"
ModelFramesWidget::ModelFramesWidget(QWidget* parent, Qt::WindowFlags flags)
: QDockWidget(parent, flags), gmodel(nullptr), framemodel(nullptr)
{
setWindowTitle("Frames");
tree = new QTreeView;
setWidget(tree);
}
void ModelFramesWidget::setModel(ModelHandle *model)
{
if(framemodel) {
delete framemodel;
framemodel = nullptr;
tree->setModel(nullptr);
}
gmodel = model;
if(model != nullptr) {
framemodel = new DFFFramesTreeModel(model, this);
tree->setModel(framemodel);
tree->setDisabled(false);
}
else {
tree->setDisabled(true);
}
}