Qt
6.x
The Qt SDK
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
12
class
QComboBox
;
13
class
QFrame
;
14
class
QLabel
;
15
class
QTextBrowser
;
16
17
class
DragWidget
:
public
QFrame
18
{
19
Q_OBJECT
20
21
public
:
22
explicit
DragWidget
(
QWidget
*
parent
=
nullptr
);
23
void
setData
(
const
QString
&mimetype,
const
QByteArray
&newData);
24
25
signals
:
26
void
dragResult
(
const
QString
&actionText);
27
void
mimeTypes
(
const
QStringList
&
types
);
28
29
protected
:
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
35
private
:
36
QByteArray
data
;
37
QLabel
*dragDropLabel;
38
QPoint
dragStartPosition;
39
QString
mimeType;
40
};
41
42
#endif
DragWidget
Definition
dragwidget.h:18
DragWidget::dragResult
void dragResult(const QString &actionText)
DragWidget::mouseMoveEvent
void mouseMoveEvent(QMouseEvent *event) override
[6]
Definition
dragwidget.cpp:77
DragWidget::setData
void setData(const QString &mimetype, const QByteArray &newData)
[8]
Definition
dragwidget.cpp:109
DragWidget::dropEvent
void dropEvent(QDropEvent *event) override
[0]
Definition
dragwidget.cpp:35
DragWidget::mimeTypes
void mimeTypes(const QStringList &types)
DragWidget::dragEnterEvent
void dragEnterEvent(QDragEnterEvent *event) override
[0]
Definition
dragwidget.cpp:28
DragWidget::mousePressEvent
void mousePressEvent(QMouseEvent *event) override
[5]
Definition
dragwidget.cpp:69
QByteArray
\inmodule QtCore
Definition
qbytearray.h:57
QComboBox
The QComboBox widget is a combined button and popup list.
Definition
qcombobox.h:24
QFrame
The QFrame class is the base class of widgets that can have a frame.
Definition
qframe.h:17
QLabel
The QLabel widget provides a text or image display.
Definition
qlabel.h:20
QMouseEvent
\inmodule QtGui
Definition
qevent.h:195
QObject::parent
QObject * parent() const
Returns a pointer to the parent object.
Definition
qobject.h:311
QPoint
\inmodule QtCore\reentrant
Definition
qpoint.h:23
QStringList
\inmodule QtCore
QString
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition
qstring.h:127
QTextBrowser
The QTextBrowser class provides a rich text browser with hypertext navigation.
Definition
qtextbrowser.h:18
QWidget
The QWidget class is the base class of all user interface objects.
Definition
qwidget.h:99
types
GLsizei GLenum GLenum * types
Definition
qopengles2ext.h:153
data
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
Definition
qopengles2ext.h:206
event
struct _cl_event * event
Definition
qopenglext.h:2998
Q_OBJECT
#define Q_OBJECT
Definition
qtmetamacros.h:117
signals
#define signals
Definition
qtmetamacros.h:41
qtbase
src
gui
doc
snippets
draganddrop
dragwidget.h
Generated by
1.9.7