mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 09:23:03 +00:00

将static_cast修改为dynamic_cast,增加了类型判断 Log: Influence: 将托盘图标拖动到任务栏 Bug: https://pms.uniontech.com/bug-view-181945.html Change-Id: I5b23088b8b7508d9a7cf2683a3a8571a57b82e38
54 lines
1.0 KiB
C++
54 lines
1.0 KiB
C++
#ifndef QUICKDRAGCORE_H
|
|
#define QUICKDRAGCORE_H
|
|
|
|
#include <QMimeData>
|
|
#include <QDrag>
|
|
#include <QPixmap>
|
|
|
|
class PluginsItemInterface;
|
|
class QTimer;
|
|
|
|
class QuickPluginMimeData : public QMimeData
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit QuickPluginMimeData(PluginsItemInterface *item, QDrag *drag);
|
|
~QuickPluginMimeData();
|
|
PluginsItemInterface *pluginItemInterface() const;
|
|
QDrag *drag() const;
|
|
|
|
private:
|
|
PluginsItemInterface *m_item;
|
|
QDrag *m_drag;
|
|
};
|
|
|
|
class QuickIconDrag : public QDrag
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit QuickIconDrag(QObject *dragSource, const QPixmap &pixmap);
|
|
~QuickIconDrag();
|
|
void updatePixmap(QPixmap pixmap);
|
|
void useSourcePixmap();
|
|
void setDragHotPot(QPoint point);
|
|
|
|
protected:
|
|
bool eventFilter(QObject *watched, QEvent *event) override;
|
|
QPoint currentPoint() const;
|
|
|
|
private Q_SLOTS:
|
|
void onDragMove();
|
|
|
|
private:
|
|
QWidget *m_imageWidget;
|
|
QTimer *m_timer;
|
|
QPixmap m_sourcePixmap;
|
|
QPixmap m_pixmap;
|
|
QPoint m_hotPoint;
|
|
bool m_useSourcePixmap;
|
|
};
|
|
|
|
#endif // QUICKDRAGCORE_H
|