summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qevent.cpp10
-rw-r--r--src/gui/kernel/qevent.h2
-rw-r--r--src/widgets/graphicsview/qgraphicsview.cpp2
-rw-r--r--src/widgets/to_be_moved/qtextcontrol.cpp2
-rw-r--r--src/widgets/to_be_moved/qtextcontrol_p_p.h2
5 files changed, 8 insertions, 10 deletions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 5e01e43e56..f5a5c2826a 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -46,7 +46,7 @@
#include "private/qkeysequence_p.h"
#include "qdebug.h"
#include "qmime.h"
-//#include "private/qdnd_p.h"
+#include "private/qdnd_p.h"
#include "qevent_p.h"
#ifdef Q_OS_SYMBIAN
@@ -2265,12 +2265,10 @@ bool QDropEvent::provides(const char *mimeType) const
\sa QDrag::QDrag()
*/
-QWidget* QDropEvent::source() const
+QObject* QDropEvent::source() const
{
- return 0;
- // ### Qt5
-// QDragManager *manager = QDragManager::self();
-// return manager ? manager->source() : 0;
+ QDragManager *manager = QDragManager::self();
+ return (manager && manager->object) ? manager->object->source() : 0;
}
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h
index 21a0b05b55..fc9e8118fd 100644
--- a/src/gui/kernel/qevent.h
+++ b/src/gui/kernel/qevent.h
@@ -443,7 +443,7 @@ public:
inline Qt::DropAction dropAction() const { return drop_action; }
void setDropAction(Qt::DropAction action);
- QWidget* source() const;
+ QObject* source() const;
inline const QMimeData *mimeData() const { return mdata; }
// QT3_SUPPORT
diff --git a/src/widgets/graphicsview/qgraphicsview.cpp b/src/widgets/graphicsview/qgraphicsview.cpp
index c6e06e22c2..c918072196 100644
--- a/src/widgets/graphicsview/qgraphicsview.cpp
+++ b/src/widgets/graphicsview/qgraphicsview.cpp
@@ -780,7 +780,7 @@ void QGraphicsViewPrivate::populateSceneDragDropEvent(QGraphicsSceneDragDropEven
dest->setDropAction(source->dropAction());
dest->setMimeData(source->mimeData());
dest->setWidget(viewport);
- dest->setSource(source->source());
+ dest->setSource(qobject_cast<QWidget *>(source->source()));
#else
Q_UNUSED(dest)
Q_UNUSED(source)
diff --git a/src/widgets/to_be_moved/qtextcontrol.cpp b/src/widgets/to_be_moved/qtextcontrol.cpp
index ab294b9e0d..aeb2ede106 100644
--- a/src/widgets/to_be_moved/qtextcontrol.cpp
+++ b/src/widgets/to_be_moved/qtextcontrol.cpp
@@ -1885,7 +1885,7 @@ bool QTextControlPrivate::dragMoveEvent(QEvent *e, const QMimeData *mimeData, co
return true; // accept proposed action
}
-bool QTextControlPrivate::dropEvent(const QMimeData *mimeData, const QPointF &pos, Qt::DropAction dropAction, QWidget *source)
+bool QTextControlPrivate::dropEvent(const QMimeData *mimeData, const QPointF &pos, Qt::DropAction dropAction, QObject *source)
{
Q_Q(QTextControl);
dndFeedbackCursor = QTextCursor();
diff --git a/src/widgets/to_be_moved/qtextcontrol_p_p.h b/src/widgets/to_be_moved/qtextcontrol_p_p.h
index 099843437a..1b707eeef3 100644
--- a/src/widgets/to_be_moved/qtextcontrol_p_p.h
+++ b/src/widgets/to_be_moved/qtextcontrol_p_p.h
@@ -160,7 +160,7 @@ public:
bool dragEnterEvent(QEvent *e, const QMimeData *mimeData);
void dragLeaveEvent();
bool dragMoveEvent(QEvent *e, const QMimeData *mimeData, const QPointF &pos);
- bool dropEvent(const QMimeData *mimeData, const QPointF &pos, Qt::DropAction dropAction, QWidget *source);
+ bool dropEvent(const QMimeData *mimeData, const QPointF &pos, Qt::DropAction dropAction, QObject *source);
void inputMethodEvent(QInputMethodEvent *);