diff --git a/src/declarativeimports/draganddrop/DeclarativeDragArea.cpp b/src/declarativeimports/draganddrop/DeclarativeDragArea.cpp index 2b5a151e0..3df56e3bd 100644 --- a/src/declarativeimports/draganddrop/DeclarativeDragArea.cpp +++ b/src/declarativeimports/draganddrop/DeclarativeDragArea.cpp @@ -31,6 +31,8 @@ #include #include +#include + /*! A DragArea is used to make an item draggable. */ @@ -249,6 +251,7 @@ bool DeclarativeDragArea::childMouseEventFilter(QQuickItem *item, QEvent *event) if (event->type() == QEvent::MouseMove) { QMouseEvent *me = static_cast(event); + qDebug() << "move in dragarea"; mouseMoveEvent(me); } diff --git a/src/declarativeimports/draganddrop/DeclarativeDropArea.cpp b/src/declarativeimports/draganddrop/DeclarativeDropArea.cpp index 012a1c4ea..0050a4a97 100644 --- a/src/declarativeimports/draganddrop/DeclarativeDropArea.cpp +++ b/src/declarativeimports/draganddrop/DeclarativeDropArea.cpp @@ -27,33 +27,42 @@ #include #include +#include + DeclarativeDropArea::DeclarativeDropArea(QQuickItem *parent) : QQuickItem(parent), m_enabled(true) { setFlag(ItemAcceptsDrops, m_enabled); + setFlag(ItemHasContents, m_enabled); + setAcceptHoverEvents(m_enabled); + } void DeclarativeDropArea::dragEnterEvent(QDragEnterEvent *event) { DeclarativeDragDropEvent dde(event, this); + qDebug() << "enter."; emit dragEnter(&dde); } void DeclarativeDropArea::dragLeaveEvent(QDragLeaveEvent *event) { DeclarativeDragDropEvent dde(event, this); + qDebug() << "leave."; emit dragLeave(&dde); } void DeclarativeDropArea::dragMoveEvent(QDragMoveEvent *event) { DeclarativeDragDropEvent dde(event, this); + qDebug() << "move."; emit dragMove(&dde); } void DeclarativeDropArea::dropEvent(QDropEvent *event) { DeclarativeDragDropEvent dde(event, this); + qDebug() << "Drop."; emit drop(&dde); } @@ -69,6 +78,7 @@ void DeclarativeDropArea::setEnabled(bool enabled) } m_enabled = enabled; + setAcceptHoverEvents(m_enabled); setFlag(ItemAcceptsDrops, m_enabled); emit enabledChanged(); } diff --git a/src/declarativeimports/draganddrop/draganddropplugin.cpp b/src/declarativeimports/draganddrop/draganddropplugin.cpp index 3628f1d09..630a4dee2 100644 --- a/src/declarativeimports/draganddrop/draganddropplugin.cpp +++ b/src/declarativeimports/draganddrop/draganddropplugin.cpp @@ -31,6 +31,7 @@ void DragAndDropPlugin::registerTypes(const char *uri) { + qDebug() << " ********** " << uri << "loaded."; Q_ASSERT(uri == QLatin1String("org.kde.draganddrop")); qmlRegisterType(uri, 1, 0, "DropArea");