Settings of cache size

This commit is contained in:
Jakub Melka
2019-12-15 19:28:25 +01:00
parent 3cd2dd5104
commit 7dbae1c3dc
17 changed files with 467 additions and 24 deletions

View File

@@ -17,11 +17,13 @@
#include "pdfdrawwidget.h"
#include "pdfdrawspacecontroller.h"
#include "pdfcompiler.h"
#include <QPainter>
#include <QGridLayout>
#include <QKeyEvent>
#include <QApplication>
#include <QPixmapCache>
namespace pdf
{
@@ -96,6 +98,13 @@ void PDFWidget::updateRenderer(RendererEngine engine, int samplesCount)
updateRendererImpl();
}
void PDFWidget::updateCacheLimits(int compiledPageCacheLimit, int thumbnailsCacheLimit, int fontCacheLimit, int instancedFontCacheLimit)
{
m_proxy->getCompiler()->setCacheLimit(compiledPageCacheLimit);
QPixmapCache::setCacheLimit(thumbnailsCacheLimit);
m_proxy->getFontCache()->setCacheLimits(fontCacheLimit, instancedFontCacheLimit);
}
int PDFWidget::getPageRenderingErrorCount() const
{
int count = 0;