From f261f87e6f071d3855a0f6a853b0d382a878ee3e Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Sat, 6 Mar 2010 01:41:46 +0000 Subject: [PATCH] allow setting the mouse offset for better drop positioning svn path=/trunk/KDE/kdelibs/; revision=1099726 --- private/extenderitemmimedata.cpp | 10 ++++++++++ private/extenderitemmimedata_p.h | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/private/extenderitemmimedata.cpp b/private/extenderitemmimedata.cpp index 9b2d87ca3..6169ff1d4 100644 --- a/private/extenderitemmimedata.cpp +++ b/private/extenderitemmimedata.cpp @@ -51,6 +51,16 @@ void ExtenderItemMimeData::setExtenderItem(ExtenderItem *item) m_extenderItem = item; } +void ExtenderItemMimeData::setPointerOffset(const QPoint &p) +{ + m_offset = p; +} + +QPoint ExtenderItemMimeData::pointerOffset() const +{ + return m_offset; +} + ExtenderItem *ExtenderItemMimeData::extenderItem() const { return m_extenderItem; diff --git a/private/extenderitemmimedata_p.h b/private/extenderitemmimedata_p.h index 5eeaa7b55..ded3c93f2 100644 --- a/private/extenderitemmimedata_p.h +++ b/private/extenderitemmimedata_p.h @@ -21,6 +21,7 @@ #define EXTENDERITEMMIMEDATA_H #include +#include namespace Plasma { @@ -45,8 +46,12 @@ class ExtenderItemMimeData : public QMimeData static QString mimeType(); + void setPointerOffset(const QPoint &p); + QPoint pointerOffset() const; + private: ExtenderItem *m_extenderItem; + QPoint m_offset; }; } // namespace Plasma