mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Fix thumbnail images - they have too low resolution
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2019-2022 Jakub Melka
|
// Copyright (C) 2019-2022 Jakub Melka
|
||||||
//
|
//
|
||||||
// This file is part of PDF4QT.
|
// This file is part of PDF4QT.
|
||||||
//
|
//
|
||||||
@@ -19,6 +19,7 @@
|
|||||||
#include "pdfdocument.h"
|
#include "pdfdocument.h"
|
||||||
#include "pdfdrawspacecontroller.h"
|
#include "pdfdrawspacecontroller.h"
|
||||||
#include "pdfdbgheap.h"
|
#include "pdfdbgheap.h"
|
||||||
|
#include "pdfdrawwidget.h"
|
||||||
|
|
||||||
#include <QFont>
|
#include <QFont>
|
||||||
#include <QStyle>
|
#include <QStyle>
|
||||||
@@ -691,9 +692,11 @@ QVariant PDFThumbnailsItemModel::data(const QModelIndex& index, int role) const
|
|||||||
QPixmap pixmap;
|
QPixmap pixmap;
|
||||||
if (!m_thumbnailCache.find(key, &pixmap))
|
if (!m_thumbnailCache.find(key, &pixmap))
|
||||||
{
|
{
|
||||||
QImage thumbnail = m_proxy->drawThumbnailImage(index.row(), m_thumbnailSize);
|
const qreal devicePixelRatio = m_proxy->getWidget()->devicePixelRatioF();
|
||||||
|
QImage thumbnail = m_proxy->drawThumbnailImage(index.row(), m_thumbnailSize * devicePixelRatio);
|
||||||
if (!thumbnail.isNull())
|
if (!thumbnail.isNull())
|
||||||
{
|
{
|
||||||
|
thumbnail.setDevicePixelRatio(devicePixelRatio);
|
||||||
pixmap = QPixmap::fromImage(qMove(thumbnail));
|
pixmap = QPixmap::fromImage(qMove(thumbnail));
|
||||||
m_thumbnailCache.insert(key, pixmap);
|
m_thumbnailCache.insert(key, pixmap);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user