• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kde-runtime API Reference
  • KDE Home
  • Contact Us
 

DragAndDrop

  • sources
  • kde-4.14
  • kde-runtime
  • plasma
  • declarativeimports
  • draganddrop
DeclarativeDragDropEvent.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2010 by BetterInbox <contact@betterinbox.com>
3  Original author: Gregory Schlomoff <greg@betterinbox.com>
4 
5  Permission is hereby granted, free of charge, to any person obtaining a copy
6  of this software and associated documentation files (the "Software"), to deal
7  in the Software without restriction, including without limitation the rights
8  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9  copies of the Software, and to permit persons to whom the Software is
10  furnished to do so, subject to the following conditions:
11 
12  The above copyright notice and this permission notice shall be included in
13  all copies or substantial portions of the Software.
14 
15  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21  THE SOFTWARE.
22 */
23 
24 #ifndef DECLARATIVEDRAGDROPEVENT_H
25 #define DECLARATIVEDRAGDROPEVENT_H
26 
27 #include <QObject>
28 #include <QGraphicsSceneDragDropEvent>
29 #include "DeclarativeMimeData.h"
30 #include "DeclarativeDropArea.h"
31 
32 class DeclarativeDragDropEvent : public QObject
33 {
34  Q_OBJECT
35 
39  Q_PROPERTY(int x READ x)
40 
41 
44  Q_PROPERTY(int y READ y)
45 
57  Q_PROPERTY(int buttons READ buttons)
58 
69  Q_PROPERTY(int modifiers READ modifiers)
70 
75  Q_PROPERTY(DeclarativeMimeData* mimeData READ mimeData)
76 
88  Q_PROPERTY(Qt::DropActions possibleActions READ possibleActions)
89 
94  Q_PROPERTY(Qt::DropAction proposedAction READ proposedAction)
95 
96 public:
97 
98  DeclarativeDragDropEvent(QGraphicsSceneDragDropEvent* e, DeclarativeDropArea* parent = 0);
99 
100  int x() const { return m_x; }
101  int y() const { return m_y; }
102  int buttons() const { return m_buttons; }
103  int modifiers() const { return m_modifiers; }
104  DeclarativeMimeData* mimeData() { return &m_data; }
105  Qt::DropAction proposedAction() const { return m_event->proposedAction(); }
106  Qt::DropActions possibleActions() const { return m_event->possibleActions(); }
107 
108 public Q_SLOTS:
109  void accept(int action);
110 
111 private:
112  int m_x;
113  int m_y;
114  Qt::MouseButtons m_buttons;
115  Qt::KeyboardModifiers m_modifiers;
116  DeclarativeMimeData m_data;
117  QGraphicsSceneDragDropEvent* m_event;
118 };
119 
120 #endif // DECLARATIVEDRAGDROPEVENT_H
DeclarativeDragDropEvent::mimeData
DeclarativeMimeData * mimeData()
Definition: DeclarativeDragDropEvent.h:104
DeclarativeDragDropEvent::y
int y() const
Definition: DeclarativeDragDropEvent.h:101
DeclarativeDropArea.h
DeclarativeMimeData.h
DeclarativeDragDropEvent
Definition: DeclarativeDragDropEvent.h:32
QObject
DeclarativeDragDropEvent::accept
void accept(int action)
Definition: DeclarativeDragDropEvent.cpp:42
QGraphicsSceneDragDropEvent::proposedAction
Qt::DropAction proposedAction() const
DeclarativeDragDropEvent::modifiers
int modifiers() const
Definition: DeclarativeDragDropEvent.h:103
DeclarativeDragDropEvent::x
int x() const
Definition: DeclarativeDragDropEvent.h:100
DeclarativeMimeData
Definition: DeclarativeMimeData.h:32
Qt::MouseButtons
typedef MouseButtons
Qt::DropActions
typedef DropActions
DeclarativeDragDropEvent::possibleActions
Qt::DropActions possibleActions() const
Definition: DeclarativeDragDropEvent.h:106
QGraphicsSceneDragDropEvent::possibleActions
Qt::DropActions possibleActions() const
DeclarativeDragDropEvent::proposedAction
Qt::DropAction proposedAction() const
Definition: DeclarativeDragDropEvent.h:105
QGraphicsSceneDragDropEvent
DeclarativeDropArea
Definition: DeclarativeDropArea.h:31
QObject::parent
QObject * parent() const
DeclarativeDragDropEvent::buttons
int buttons() const
Definition: DeclarativeDragDropEvent.h:102
Qt::KeyboardModifiers
typedef KeyboardModifiers
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:08:31 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

DragAndDrop

Skip menu "DragAndDrop"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List

kde-runtime API Reference

Skip menu "kde-runtime API Reference"
  • KCMShell
  • KNotify
  • Plasma Runtime
  •     PlasmaCore
  •     DragAndDrop
  •     PlasmaComponents
  •     PlasmaExtraComponents
  •     QtExtraComponents

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal