// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause #ifndef DRAGWIDGET_H #define DRAGWIDGET_H #include #include #include #include class QComboBox; class QFrame; class QLabel; class QTextBrowser; class DragWidget : public QFrame { Q_OBJECT public: DragWidget(QWidget *parent); void setData(const QString &mimetype, const QByteArray &newData); signals: void dragResult(const QString &actionText); void mimeTypes(const QStringList &types); protected: void dragEnterEvent(QDragEnterEvent *event); void dropEvent(QDropEvent *event); void mouseMoveEvent(QMouseEvent *event); void mousePressEvent(QMouseEvent *event); private: QByteArray data; QLabel *dragDropLabel; QPoint dragStartPosition; QString mimeType; }; #endif