KDeclarative

DeclarativeDragDropEvent.h
1 /*
2  SPDX-FileCopyrightText: 2010 BetterInbox <[email protected]>
3  SPDX-FileContributor: Gregory Schlomoff <[email protected]>
4 
5  SPDX-License-Identifier: MIT
6 */
7 
8 #ifndef DECLARATIVEDRAGDROPEVENT_H
9 #define DECLARATIVEDRAGDROPEVENT_H
10 
11 #include <QObject>
12 #include "DeclarativeDropArea.h"
13 #include "DeclarativeMimeData.h"
14 
15 class DeclarativeDragDropEvent : public QObject
16 {
17  Q_OBJECT
18 
22  Q_PROPERTY(int x READ x)
23 
24 
27  Q_PROPERTY(int y READ y)
28 
29 
40  Q_PROPERTY(int buttons READ buttons)
41 
42 
52  Q_PROPERTY(int modifiers READ modifiers)
53 
54 
58  Q_PROPERTY(DeclarativeMimeData* mimeData READ mimeData)
59 
60 
71  Q_PROPERTY(Qt::DropActions possibleActions READ possibleActions)
72 
73 
77  Q_PROPERTY(Qt::DropAction proposedAction READ proposedAction)
78 
79 public:
80 
81  DeclarativeDragDropEvent(QDropEvent* e, DeclarativeDropArea* parent = nullptr);
82  DeclarativeDragDropEvent(QDragLeaveEvent* e, DeclarativeDropArea* parent = nullptr);
83 
84  int x() const { return m_x; }
85  int y() const { return m_y; }
86  int buttons() const { return m_buttons; }
87  int modifiers() const { return m_modifiers; }
88  DeclarativeMimeData* mimeData();
89  Qt::DropAction proposedAction() const { return m_event->proposedAction(); }
90  Qt::DropActions possibleActions() const { return m_event->possibleActions(); }
91 
92 public Q_SLOTS:
93  void accept(int action);
94  void ignore();
95 
96 private:
97  int m_x;
98  int m_y;
99  Qt::MouseButtons m_buttons;
100  Qt::KeyboardModifiers m_modifiers;
102  QDropEvent* m_event;
103 };
104 
105 #endif // DECLARATIVEDRAGDROPEVENT_H
typedef KeyboardModifiers
typedef MouseButtons
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SLOTSQ_SLOTS
typedef DropActions
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Jan 25 2021 22:44:28 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.