PDF: resize QGraphicsScene if PNG displayed shrunk

This commit is contained in:
Nicolas Mailloux 2021-09-04 14:16:09 -04:00
parent 62e9ddc6e3
commit f4a842a55d
2 changed files with 6 additions and 0 deletions

View file

@ -1955,6 +1955,9 @@ void reader::setupPng() {
// Initialized above
graphicsScene->clear();
graphicsScene->addPixmap(pixmap);
// Shrinking scene if item is smaller than previous one
QRectF rect = graphicsScene->itemsBoundingRect();
graphicsScene->setSceneRect(rect);
ui->graphicsView->items().clear();
ui->graphicsView->setScene(graphicsScene);
}

View file

@ -891,6 +891,9 @@ void settings::openUpdateDialog() {
}
void settings::launchOtaUpdater() {
global::toast::modalToast = true;
global::toast::indefiniteToast = true;
emit showToast("Checking for updates");
otaManagerWindow = new otaManager(this);
connect(otaManagerWindow, SIGNAL(canOtaUpdate(bool)), SLOT(openUpdateDialogOTA(bool)));
otaManagerWindow->setAttribute(Qt::WA_DeleteOnClose);