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
4#ifndef QPLATFORMDRAG_H
5#define QPLATFORMDRAG_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is part of the QPA API and is not meant to be used
12// in applications. Usage of this API may make your code
13// source and binary incompatible with future versions of Qt.
14//
15
16#include <QtGui/qtguiglobal.h>
17#include <QtGui/QPixmap>
18
20
21QT_BEGIN_NAMESPACE
22
23class QMimeData;
24class QMouseEvent;
25class QDrag;
26class QObject;
27class QEvent;
29
30class Q_GUI_EXPORT QPlatformDropQtResponse
31{
32public:
33 QPlatformDropQtResponse(bool accepted, Qt::DropAction acceptedAction);
34 bool isAccepted() const;
35 Qt::DropAction acceptedAction() const;
36
37private:
38 bool m_accepted;
39 Qt::DropAction m_accepted_action;
40
41};
42
43class Q_GUI_EXPORT QPlatformDragQtResponse : public QPlatformDropQtResponse
44{
45public:
46 QPlatformDragQtResponse(bool accepted, Qt::DropAction acceptedAction, QRect answerRect);
47
48 QRect answerRect() const;
49
50private:
51 QRect m_answer_rect;
52};
53
54class Q_GUI_EXPORT QPlatformDrag
55{
56 Q_DECLARE_PRIVATE(QPlatformDrag)
57public:
58 Q_DISABLE_COPY_MOVE(QPlatformDrag)
59
60 QPlatformDrag();
61 virtual ~QPlatformDrag();
62
63 QDrag *currentDrag() const;
64
65 virtual Qt::DropAction drag(QDrag *m_drag) = 0;
66 virtual void cancelDrag();
67 void updateAction(Qt::DropAction action);
68
69 virtual Qt::DropAction defaultAction(Qt::DropActions possibleActions, Qt::KeyboardModifiers modifiers) const;
70
71 static QPixmap defaultPixmap();
72
73 virtual bool ownsDragObject() const;
74
75private:
76 QPlatformDragPrivate *d_ptr;
77};
78
79QT_END_NAMESPACE
80
81#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[]