Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
26 void dragResult(const QString &actionText);
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:
37 QLabel *dragDropLabel;
38 QPoint dragStartPosition;
39 QString mimeType;
40};
41
42#endif
void dragResult(const QString &actionText)
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]
DragWidget(QWidget *parent=nullptr)
void mousePressEvent(QMouseEvent *event) override
[5]
\inmodule QtCore
Definition qbytearray.h:57
The QComboBox widget combines a button with a dropdown list.
Definition qcombobox.h:24
The QFrame class is the base class of widgets that can have a frame.
Definition qframe.h:17
The QLabel widget provides a text or image display.
Definition qlabel.h:20
\inmodule QtGui
Definition qevent.h:196
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
\inmodule QtCore\reentrant
Definition qpoint.h:25
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
The QTextBrowser class provides a rich text browser with hypertext navigation.
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
GLsizei GLenum GLenum * types
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
struct _cl_event * event
#define Q_OBJECT
#define signals