DocPage Organizer: page image preview

This commit is contained in:
Jakub Melka
2021-07-29 20:20:28 +02:00
parent 97151df84c
commit edcd992697
6 changed files with 61 additions and 8 deletions

View File

@@ -34,6 +34,8 @@
#include <QDesktopServices>
#include <QImageReader>
#include <QPixmapCache>
#include <QScreen>
#include <QGuiApplication>
namespace pdfdocpage
{
@@ -126,6 +128,14 @@ MainWindow::MainWindow(QWidget* parent) :
}
}
// Initialize pixmap cache size
const int depth = 4; // 4 bytes (ARGB)
const int reserveSize = 2; // Caching of two screens
QSize size = QGuiApplication::primaryScreen()->availableVirtualSize();
int bytes = size.width() * size.height() * depth * reserveSize;
int kBytes = bytes / 1024;
QPixmapCache::setCacheLimit(kBytes);
loadSettings();
updateActions();
}