Support drag&drop for setting a custom cover in the properties dialog

This commit is contained in:
Luis Ángel San Martín
2025-05-09 19:58:52 +02:00
parent 28952180ab
commit 8b159c9da6
7 changed files with 115 additions and 5 deletions

View File

@ -0,0 +1,29 @@
#ifndef DROP_LABEL_H
#define DROP_LABEL_H
#include <QLabel>
#include <QDragEnterEvent>
#include <QDropEvent>
#include <QMimeData>
namespace YACReader {
class CoverLabel : public QLabel
{
Q_OBJECT
public:
explicit CoverLabel(QWidget *parent = nullptr);
protected:
void dragEnterEvent(QDragEnterEvent *event) override;
void dragMoveEvent(QDragMoveEvent *event) override;
void dropEvent(QDropEvent *event) override;
signals:
void imageDropped(const QString &path);
};
}
#endif // DROP_LABEL_H