Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.
C++
/*
* SPDX-FileCopyrightText: 2020 Agata Cacko <[email protected]>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef KIS_FILE_ICON_CREATOR_H
#define KIS_FILE_ICON_CREATOR_H
#include <QIcon>
#include <KisPreviewFileDialog.h>
#include "kritaui_export.h"
/**
* @brief The KisFileIconCreator class creates a thumbnail from a file on disk
*
* On Welcome Page and possibly other places there might be a need to show the user
* a thumbnail of a file. This class tries to open a file and create a thumbnail out of it.
*
* In theory creating the object is not needed, so if you, dear future reader, want to convert
* the function inside to a static one, go ahead.
*
*/
class KRITAUI_EXPORT KisFileIconCreator : public KisAbstractFileIconCreator
{
public:
/**
* @brief createFileIcon creates an icon from the file on disk
* @param path path to the file
* @param icon created icon
* @param devicePixelRatioF a result from devicePixelRatioF() called in a widget
* @param iconSize size of the icon
* @return true if icon was created successfully, false if not (for example the file doesn't exist)
*/
bool createFileIcon(QString path, QIcon &icon, qreal devicePixelRatioF, QSize iconSize) override;
};
#endif // KIS_FILE_ICON_CREATOR_H