mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-09 12:22:34 +01:00
27 lines
559 B
C++
27 lines
559 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(Model* model)
|
|
{
|
|
if(framemodel) {
|
|
delete framemodel;
|
|
framemodel = nullptr;
|
|
tree->setModel(nullptr);
|
|
}
|
|
gmodel = model;
|
|
if(model != nullptr) {
|
|
framemodel = new DFFFramesTreeModel(model, this);
|
|
tree->setModel(framemodel);
|
|
}
|
|
else {
|
|
tree->setDisabled(true);
|
|
}
|
|
}
|