--- a/src/mainwindow.cpp Wed May 25 13:49:45 2022 +0300 +++ b/src/mainwindow.cpp Wed May 25 17:24:51 2022 +0300 @@ -70,7 +70,7 @@ { if (this->currentDocument() != nullptr) { - this->currentDocument()->adjustGridToView(); + adjustGridToView(this->currentDocument()->canvas); } }); connect(this->ui->actionSave, &QAction::triggered, @@ -194,7 +194,7 @@ void MainWindow::openModelForEditing(const ModelId modelId) { Document* document = new Document{this->documents.getModelById(modelId), &this->documents, this->colorTable}; - document->setRenderPreferences(this->renderPreferences); + document->canvas->setRenderPreferences(this->renderPreferences); connect(document, &Document::newStatusText, [&](const QString& newStatusText) { this->statusBar()->showMessage(newStatusText); @@ -495,7 +495,7 @@ Document* document = qobject_cast<Document*>(this->ui->tabs->widget(i)); if (document != nullptr) { - document->setRenderPreferences(this->renderPreferences); + document->canvas->setRenderPreferences(this->renderPreferences); } } for (auto data : ::renderStyleButtons) @@ -559,11 +559,13 @@ this->colorTable = this->libraries.loadColorTable(errors); } -void MainWindow::keyReleaseEvent(QKeyEvent* event) +void MainWindow::keyReleaseEvent(QKeyEvent* /*event*/) { + /* Document* document = this->currentDocument(); if (document != nullptr) { document->handleKeyPress(event); } + */ }