Implement QDropEvent::source() again
QDropEvent::source() now returns a QObject instead of a widget, matching the implementation in QDrag. Reviewed-by: Samuel
This commit is contained in:
parent
71304aefd0
commit
4386425ce3
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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();
|
||||
|
@ -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 *);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user