mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 21:14:33 -04:00
Support drag&drop for setting a custom cover in the properties dialog
This commit is contained in:
29
custom_widgets/yacreader_cover_label.h
Normal file
29
custom_widgets/yacreader_cover_label.h
Normal 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
|
Reference in New Issue
Block a user