src/document.cpp

Sun, 19 Jan 2020 02:54:48 +0200

author
Teemu Piippo <teemu@hecknology.net>
date
Sun, 19 Jan 2020 02:54:48 +0200
changeset 22
6da867fa5429
parent 21
0133e565e072
child 24
1a0faaaceb84
permissions
-rw-r--r--

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);
}

mercurial