blob: 812c640b22b96a914af7b0978988c05e4f5e921e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef DRAGWIDGET_H
#define DRAGWIDGET_H
#include <QByteArray>
#include <QFrame>
#include <QString>
#include <QStringList>
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
|