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
12
QT_BEGIN_NAMESPACE
13
14
class
QComboBox;
15
class
QFrame;
16
class
QLabel;
17
class
QTextBrowser;
18
19
class
DragWidget
:
public
QFrame
20
{
21
Q_OBJECT
22
23
public
:
24
explicit
DragWidget
(
QWidget
*
parent
=
nullptr
);
25
void
setData
(
const
QString &mimetype,
const
QByteArray &newData);
26
27
signals
:
28
void
dragResult
(
const
QString
&
actionText
);
29
void
mimeTypes
(
const
QStringList &types);
30
31
protected
:
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
37
private
:
38
QByteArray data;
39
QLabel *dragDropLabel;
40
QPoint dragStartPosition;
41
QString mimeType;
42
};
43
44
QT_END_NAMESPACE
45
46
#
endif
DragWidget
Definition
dragwidget.h:20
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
qtbase
src
gui
doc
snippets
draganddrop
dragwidget.h
Generated on
for Qt by
1.14.0