maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   QT - Vertical Drag&Drop (https://talk.maemo.org/showthread.php?t=63204)

b0unc3 2010-10-01 11:59

QT - Vertical Drag&Drop
 
Hello,

I'm wondering if there is any way (with QT) to make drag&drop available only on certain direction (vertical for example).
Help/examples/links are welcome ;)

mece 2010-10-01 12:07

Re: QT - Vertical Drag&Drop
 
Quote:

Originally Posted by b0unc3 (Post 830872)
Hello,

I'm wondering if there is any way (with QT) to make drag&drop available only on certain direction (vertical for example).
Help/examples/links are welcome ;)

you can easily drag n drop along chosen axis in QML, but I'm not sure how to implement it in directly in Qt. worth a look though, I gather:

http://doc.trolltech.com/4.7/qml-mousearea.html

AndiThebest 2010-10-01 12:32

Re: QT - Vertical Drag&Drop
 
I had problems get drag&drop working in qt, so i have written my own one.
When i push a button, a timer starts and sets geometry of the button to the position of the mouse (or finger). When i release the mousebutton, the timer stops.
With this, you can make a rule that only the x or y property of the button is set to the mouse.

I use this in my app, an older sourcecode is available here:
svn checkout https://vcs.maemo.org/svn/drinkcounter

b0unc3 2010-10-03 16:13

Re: QT - Vertical Drag&Drop
 
Hi,

thanks for the info... I think I'll try to use (or adapt) the solution pointed by AndiTheBest. But maybe I can try to stylize the QSlider to have (maybe it's easier) what I need.


All times are GMT. The time now is 12:09.

vBulletin® Version 3.8.8