diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-24 02:19:41 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-24 02:19:41 +0000 |
commit | d728c2086bb8bb99df2828948644c14194a91681 (patch) | |
tree | 3f62305a8afc7dbb36d90ab5fc6fc0538972b71e /src/DragWidget.cpp | |
download | kvkbd-d728c2086bb8bb99df2828948644c14194a91681.tar.gz kvkbd-d728c2086bb8bb99df2828948644c14194a91681.zip |
Added KDE3 version of kvkbd
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kvkbd@1095344 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/DragWidget.cpp')
-rw-r--r-- | src/DragWidget.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/DragWidget.cpp b/src/DragWidget.cpp new file mode 100644 index 0000000..5a65130 --- /dev/null +++ b/src/DragWidget.cpp @@ -0,0 +1,35 @@ +#include "DragWidget.h" + +DragWidget::DragWidget(QWidget *parent, const char *name, WFlags f) : QWidget(parent,name,f) +{ + dragP=QPoint(0,0); + drag=false; + +} +DragWidget::~DragWidget() +{ + +} + +void DragWidget::mousePressEvent(QMouseEvent *e) +{ + dragP=e->pos(); + gpress=e->globalPos(); + drag=true; + +} +void DragWidget::mouseReleaseEvent(QMouseEvent *) +{ + + drag=false; +} +void DragWidget::mouseMoveEvent(QMouseEvent *e) +{ + if (!drag) { + return; + } + QPoint curr(e->globalPos().x()-dragP.x(),e->globalPos().y()-dragP.y()); + QWidget::move(curr); + +} + |