• 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
DeclarativeDropArea.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 DECLARATIVEDROPAREA_H
25 #define DECLARATIVEDROPAREA_H
26 
27 #include <QDeclarativeItem>
28 
29 class DeclarativeDragDropEvent;
30 
31 class DeclarativeDropArea : public QDeclarativeItem
32 {
33  Q_OBJECT
34 
38  Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged)
39 
40 public:
41  DeclarativeDropArea(QDeclarativeItem *parent=0);
42  bool isEnabled() const;
43  void setEnabled(bool enabled);
44 
45 Q_SIGNALS:
51  void dragEnter(DeclarativeDragDropEvent* event);
52 
58  void dragLeave(DeclarativeDragDropEvent* event);
59 
65  void dragMove(DeclarativeDragDropEvent *event);
66 
72  void drop(DeclarativeDragDropEvent* event);
73 
74  void enabledChanged();
75 
76 protected:
77  void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
78  void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
79  void dragMoveEvent(QGraphicsSceneDragDropEvent *event);
80  void dropEvent(QGraphicsSceneDragDropEvent *event);
81 
82 private:
83  bool m_enabled;
84 };
85 
86 #endif
87 
DeclarativeDropArea::dropEvent
void dropEvent(QGraphicsSceneDragDropEvent *event)
Definition: DeclarativeDropArea.cpp:54
DeclarativeDropArea::isEnabled
bool isEnabled() const
Definition: DeclarativeDropArea.cpp:60
DeclarativeDropArea::enabled
bool enabled
If false the area will receive no drop events.
Definition: DeclarativeDropArea.h:38
DeclarativeDropArea::enabledChanged
void enabledChanged()
DeclarativeDropArea::DeclarativeDropArea
DeclarativeDropArea(QDeclarativeItem *parent=0)
Definition: DeclarativeDropArea.cpp:30
DeclarativeDropArea::dragEnter
void dragEnter(DeclarativeDragDropEvent *event)
Emitted when the mouse cursor dragging something enters in the drag area.
DeclarativeDropArea::dragLeaveEvent
void dragLeaveEvent(QGraphicsSceneDragDropEvent *event)
Definition: DeclarativeDropArea.cpp:42
DeclarativeDropArea::dragEnterEvent
void dragEnterEvent(QGraphicsSceneDragDropEvent *event)
Definition: DeclarativeDropArea.cpp:37
DeclarativeDropArea::dragLeave
void dragLeave(DeclarativeDragDropEvent *event)
Emitted when the mouse cursor dragging something leaves the drag area.
QObject::event
virtual bool event(QEvent *e)
DeclarativeDropArea::dragMoveEvent
void dragMoveEvent(QGraphicsSceneDragDropEvent *event)
Definition: DeclarativeDropArea.cpp:48
DeclarativeDropArea::drop
void drop(DeclarativeDragDropEvent *event)
Emitted when the user drops something in the area.
DeclarativeDragDropEvent
Definition: DeclarativeDragDropEvent.h:32
DeclarativeDropArea::setEnabled
void setEnabled(bool enabled)
Definition: DeclarativeDropArea.cpp:65
QDeclarativeItem
QGraphicsSceneDragDropEvent
DeclarativeDropArea
Definition: DeclarativeDropArea.h:31
QObject::parent
QObject * parent() const
DeclarativeDropArea::dragMove
void dragMove(DeclarativeDragDropEvent *event)
Emitted when the mouse cursor dragging something moves over the drag area.
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