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

增加从快捷面板拖动应用到任务栏的功能 Log: Influence: 从快捷面板拖动图标到任务栏,观察是否驻留在任务栏 Bug: https://pms.uniontech.com/bug-view-171517.html Change-Id: I3351be282ef8d3afbb55f227fc6ae8ce16c78a97
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
|