Wed, 01 Jan 2020 17:45:56 +0200
things
#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); }