KIO::ThumbnailRequest Class

Encapsulates the input data for a thumbnail request. More...

Header: #include <KIO/ThumbnailCreator>
CMake: find_package(KF6 REQUIRED COMPONENTS KIO)
target_link_libraries(mytarget PRIVATE KIOGui)
Since: KDE Frameworks 5.100

Public Functions

ThumbnailRequest(const QUrl &url, const QSize &targetSize, const QString &mimeType, qreal dpr, float sequenceIndex)
qreal devicePixelRatio() const
QString mimeType() const
float sequenceIndex() const
QSize targetSize() const
QUrl url() const

Detailed Description

This includes the URL of the target file as well as additional data such as the target size

Member Function Documentation

[explicit] ThumbnailRequest::ThumbnailRequest(const QUrl &url, const QSize &targetSize, const QString &mimeType, qreal dpr, float sequenceIndex)

Contruct a new ThumbnailRequest for a given file.

url URL of the relevant file.

targetSize A size hint for the result image. The actual result size may be different. This already accounts for highdpi scaling, i.e. if a 500x500px thumbnail with a DPR of 2 is requested 1000x1000 is passed here.

mimeType The MIME type of the target file.

dpr The device pixle ratio for this request. This can be used to adjust the level of detail rendered. For example a thumbnail for text of size 1000x1000 and DPR 1 should have the name number of text lines as for a request of size 2000x2000 and DPR 2.

sequenceIndex If the thumbnailer supports sequences this determines which sequence frame is used. Pass 0 otherwise.

qreal ThumbnailRequest::devicePixelRatio() const

The device Pixel Ratio used for thumbnail creation

QString ThumbnailRequest::mimeType() const

The target file's MIME type

float ThumbnailRequest::sequenceIndex() const

If the thumb-creator can create a sequence of thumbnails, it should use this to decide what sequence item to use.

If the value is zero, the standard thumbnail should be created.

This can be used for example to create thumbnails for different timeframes in videos(For example 0m, 10m, 20m, ...).

If the thumb-creator supports a high granularity, like a video, the sub-integer precision coming from the float should be respected.

If the end of the sequence is reached, the sequence should start from the beginning.

QSize ThumbnailRequest::targetSize() const

The target thumbnail size

QUrl ThumbnailRequest::url() const

URL of the relevant file