mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
DocPage Organizer: page image preview
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user