2022-09-06 11:36:55 +08:00
|
|
|
// SPDX-FileCopyrightText: 2011 - 2022 UnionTech Software Technology Co., Ltd.
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
2018-06-04 21:09:41 +08:00
|
|
|
|
|
|
|
#ifndef APPDRAG_H
|
|
|
|
#define APPDRAG_H
|
|
|
|
|
|
|
|
#include "appdragwidget.h"
|
|
|
|
|
|
|
|
#include <QDrag>
|
|
|
|
#include <QWidget>
|
|
|
|
|
|
|
|
class AppDrag : public QDrag
|
|
|
|
{
|
|
|
|
public:
|
2021-03-20 12:10:45 +08:00
|
|
|
explicit AppDrag(QObject *dragSource);
|
2018-06-04 21:09:41 +08:00
|
|
|
virtual ~AppDrag();
|
|
|
|
|
|
|
|
void setPixmap(const QPixmap &);
|
|
|
|
QPixmap pixmap() const;
|
|
|
|
|
|
|
|
Qt::DropAction start(Qt::DropActions supportedActions = Qt::CopyAction);
|
|
|
|
Qt::DropAction exec(Qt::DropActions supportedActions = Qt::MoveAction);
|
|
|
|
Qt::DropAction exec(Qt::DropActions supportedActions, Qt::DropAction defaultAction);
|
|
|
|
|
|
|
|
AppDragWidget *appDragWidget();
|
|
|
|
|
2021-11-05 21:29:32 +08:00
|
|
|
private:
|
|
|
|
void setDragMoveCursor();
|
|
|
|
|
2018-06-04 21:09:41 +08:00
|
|
|
private:
|
2019-01-17 11:00:40 +08:00
|
|
|
QPointer<AppDragWidget> m_appDragWidget;
|
2018-06-04 21:09:41 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* DRAGAPP_H */
|