Sun, 19 Jan 2020 02:54:48 +0200
commit work on GL rendering
#include "document.h" #include "ui_document.h" #include "model.h" Document::Document(Model* model, DocumentManager* documents, QWidget* parent) : QWidget{parent}, model{model}, documents{documents}, renderer{new PartRenderer{model, documents, this}}, ui{*new Ui::Document} { this->ui.setupUi(this); this->ui.listView->setModel(model); QVBoxLayout* layout = new QVBoxLayout; layout->addWidget(this->renderer); this->ui.viewportFrame->setLayout(layout); connect(this->ui.splitter, &QSplitter::splitterMoved, this, &Document::splitterChanged); } Document::~Document() { delete &this->ui; } QByteArray Document::saveSplitterState() const { return this->ui.splitter->saveState(); } void Document::restoreSplitterState(const QByteArray& state) { this->ui.splitter->restoreState(state); }