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
12class QComboBox;
13class QFrame;
14class QLabel;
15class QTextBrowser;
16
17class DragWidget : public QFrame
18{
20
21public:
22 explicit DragWidget(QWidget *parent = nullptr);
23 void setData(const QString &mimetype, const QByteArray &newData);
24
27 void mimeTypes(const QStringList &types);
28
29protected:
30 void dragEnterEvent(QDragEnterEvent *event) override;
31 void dropEvent(QDropEvent *event) override;
32 void mouseMoveEvent(QMouseEvent *event) override;
33 void mousePressEvent(QMouseEvent *event) override;
34
35private:
36 QByteArray data;
37 QLabel *dragDropLabel;
38 QPoint dragStartPosition;
39 QString mimeType;
40};
41
42#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]