Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
dragwidget.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4#ifndef DRAGWIDGET_H
5#define DRAGWIDGET_H
6
7#include <QByteArray>
8#include <QFrame>
9#include <QString>
10#include <QStringList>
11
12QT_BEGIN_NAMESPACE
13
14class QComboBox;
15class QFrame;
16class QLabel;
17class QTextBrowser;
18
19class DragWidget : public QFrame
20{
22
23public:
24 explicit DragWidget(QWidget *parent = nullptr);
25 void setData(const QString &mimetype, const QByteArray &newData);
26
29 void mimeTypes(const QStringList &types);
30
31protected:
32 void dragEnterEvent(QDragEnterEvent *event) override;
33 void dropEvent(QDropEvent *event) override;
34 void mouseMoveEvent(QMouseEvent *event) override;
35 void mousePressEvent(QMouseEvent *event) override;
36
37private:
38 QByteArray data;
39 QLabel *dragDropLabel;
40 QPoint dragStartPosition;
41 QString mimeType;
42};
43
44QT_END_NAMESPACE
45
46#endif
void mouseMoveEvent(QMouseEvent *event) override
[6]
void setData(const QString &mimetype, const QByteArray &newData)
[8]
void dropEvent(QDropEvent *event) override
[0]
void mimeTypes(const QStringList &types)
void dragEnterEvent(QDragEnterEvent *event) override
[0]
void mousePressEvent(QMouseEvent *event) override
[5]