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
qplatformdrag.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QPLATFORMDRAG_H
6#define QPLATFORMDRAG_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is part of the QPA API and is not meant to be used
13// in applications. Usage of this API may make your code
14// source and binary incompatible with future versions of Qt.
15//
16
17#include <QtGui/qtguiglobal.h>
18#include <QtGui/QPixmap>
19
21
22QT_BEGIN_NAMESPACE
23
24class QMimeData;
25class QMouseEvent;
26class QDrag;
27class QObject;
28class QEvent;
30
31class Q_GUI_EXPORT QPlatformDropQtResponse
32{
33public:
34 QPlatformDropQtResponse(bool accepted, Qt::DropAction acceptedAction);
35 bool isAccepted() const;
36 Qt::DropAction acceptedAction() const;
37
38private:
39 bool m_accepted;
40 Qt::DropAction m_accepted_action;
41
42};
43
44class Q_GUI_EXPORT QPlatformDragQtResponse : public QPlatformDropQtResponse
45{
46public:
47 QPlatformDragQtResponse(bool accepted, Qt::DropAction acceptedAction, QRect answerRect);
48
49 QRect answerRect() const;
50
51private:
52 QRect m_answer_rect;
53};
54
55class Q_GUI_EXPORT QPlatformDrag
56{
57 Q_DECLARE_PRIVATE(QPlatformDrag)
58public:
59 Q_DISABLE_COPY_MOVE(QPlatformDrag)
60
61 QPlatformDrag();
62 virtual ~QPlatformDrag();
63
64 QDrag *currentDrag() const;
65
66 virtual Qt::DropAction drag(QDrag *m_drag) = 0;
67 virtual void cancelDrag();
68 void updateAction(Qt::DropAction action);
69
70 virtual Qt::DropAction defaultAction(Qt::DropActions possibleActions, Qt::KeyboardModifiers modifiers) const;
71
72 static QPixmap defaultPixmap();
73
74 virtual bool ownsDragObject() const;
75
76private:
77 QPlatformDragPrivate *d_ptr;
78};
79
80QT_END_NAMESPACE
81
82#endif
Qt::DropAction cursor_drop_action
The QPlatformDrag class provides an abstraction for drag.
virtual void cancelDrag()
Cancels the currently active drag (only for drags of the current application initiated by QPlatformDr...
virtual bool ownsDragObject() const
Returns bool indicating whether QPlatformDrag takes ownership and therefore responsibility of deletin...
QDrag * currentDrag() const
static QPixmap defaultPixmap()
virtual Qt::DropAction drag(QDrag *m_drag)=0
virtual Qt::DropAction defaultAction(Qt::DropActions possibleActions, Qt::KeyboardModifiers modifiers) const
void updateAction(Qt::DropAction action)
Called to notify QDrag about changes of the current action.
Combined button and popup list for selecting options.
QT_REQUIRE_CONFIG(draganddrop)
Q_GLOBAL_STATIC_WITH_ARGS(PermissionStatusHash, g_permissionStatusHash,({ { qMetaTypeId< QCameraPermission >(), Qt::PermissionStatus::Undetermined }, { qMetaTypeId< QMicrophonePermission >(), Qt::PermissionStatus::Undetermined }, { qMetaTypeId< QBluetoothPermission >(), Qt::PermissionStatus::Undetermined }, { qMetaTypeId< QContactsPermission >(), Qt::PermissionStatus::Undetermined }, { qMetaTypeId< QCalendarPermission >(), Qt::PermissionStatus::Undetermined }, { qMetaTypeId< QLocationPermission >(), Qt::PermissionStatus::Undetermined } }))
static const char *const default_pm[]