mirror of
https://github.com/YACReader/yacreader
synced 2025-07-20 14:04:40 -04:00
Add support for loading custom comic images
This commit is contained in:
@ -2,6 +2,8 @@
|
||||
|
||||
#include <QtCore>
|
||||
#include <QAction>
|
||||
#include <QImageReader>
|
||||
#include <QFileDialog>
|
||||
|
||||
using namespace YACReader;
|
||||
|
||||
@ -99,3 +101,13 @@ QPixmap YACReader::hdpiPixmap(const QString &file, QSize size)
|
||||
{
|
||||
return QIcon(file).pixmap(size);
|
||||
}
|
||||
|
||||
QString YACReader::imageFileLoader(QWidget *parent)
|
||||
{
|
||||
QString supportedImageFormatsString;
|
||||
for (const QByteArray &format : QImageReader::supportedImageFormats()) {
|
||||
supportedImageFormatsString += QString("*.%1 ").arg(QString(format));
|
||||
}
|
||||
|
||||
return QFileDialog::getOpenFileName(parent, QObject::tr("Select custom cover"), QDir::homePath(), QObject::tr("Images (%1)").arg(supportedImageFormatsString));
|
||||
}
|
||||
|
Reference in New Issue
Block a user