KIO::ThumbnailResult Class

Header: #include <ThumbnailResult>
CMake: find_package(KF6 REQUIRED COMPONENTS KIO)
target_link_libraries(mytarget PRIVATE KIOGui)

Public Functions

QImage image() const
bool isValid() const
float sequenceIndexWraparoundPoint() const
void setSequenceIndexWraparoundPoint(float wraparoundPoint)

Static Public Members

KIO::ThumbnailResult fail()
KIO::ThumbnailResult pass(const QImage &image)

Detailed Description

Encapsulates the output of a thumbnail request. It contains information on whether the request was successful and, if successful, the requested thumbnail

To create a result use KIO::ThumbnailResult::pass(image) or KIO::ThumbnailResult::fail()

@since 5.100

Member Function Documentation

[static] KIO::ThumbnailResult ThumbnailResult::fail()

Create an error result, i.e. the thumbnail creation failed

QImage ThumbnailResult::image() const

The requested thumbnail.

If the request failed the image is null

bool ThumbnailResult::isValid() const

Whether the request was successful.

[static] KIO::ThumbnailResult ThumbnailResult::pass(const QImage &image)

Create a successful result with a given image

float ThumbnailResult::sequenceIndexWraparoundPoint() const

Returns the point at which this thumb-creator's sequence indices will wrap around (loop).

Usually, the frontend will call setSequenceIndex() with indices that increase indefinitely with time, e.g. as long as the user keeps hovering a video file. Most thumb-creators however only want to display a finite sequence of thumbs, after which their sequence repeats.

This method can return the sequence index at which this thumb-creator's sequence starts wrapping around to the start again ("looping"). The frontend may use this to generate only thumbs up to this index, and then use cached versions for the repeating sequence instead.

Like sequenceIndex(), fractional values can be used if the wraparound does not happen at an integer position, but frontends handling only integer sequence indices may choose to round it down.

By default, this method returns a negative index, which signals the frontend that it can't rely on this fixed-length sequence.

See also setSequenceIndexWraparoundPoint().

void ThumbnailResult::setSequenceIndexWraparoundPoint(float wraparoundPoint)

Sets the point at which this thumb-creator's sequence indices will wrap around.

@see sequenceIndexWraparoundPoint()

See also sequenceIndexWraparoundPoint().