mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-23 11:28:49 +03:00
31 lines
783 B
C
31 lines
783 B
C
|
#include <QQuickItem>
|
||
|
|
||
|
class NhekoDropArea : public QQuickItem
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
Q_PROPERTY(QString roomid READ roomid WRITE setRoomid NOTIFY roomidChanged)
|
||
|
public:
|
||
|
NhekoDropArea(QQuickItem *parent = nullptr);
|
||
|
|
||
|
signals:
|
||
|
void roomidChanged(QString roomid);
|
||
|
|
||
|
public slots:
|
||
|
void setRoomid(QString roomid)
|
||
|
{
|
||
|
if (roomid_ != roomid) {
|
||
|
roomid_ = roomid;
|
||
|
emit roomidChanged(roomid);
|
||
|
}
|
||
|
}
|
||
|
QString roomid() const { return roomid_; }
|
||
|
|
||
|
protected:
|
||
|
void dragEnterEvent(QDragEnterEvent *event) override;
|
||
|
void dragMoveEvent(QDragMoveEvent *event) override;
|
||
|
void dropEvent(QDropEvent *event) override;
|
||
|
|
||
|
private:
|
||
|
QString roomid_;
|
||
|
};
|