Results 1 to 4 of 4

Thread: increasing usability of drag'n'drop

  1. #1
    Join Date
    May 2006
    Location
    Australia
    Posts
    53
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    11
    Thanked 4 Times in 4 Posts

    Default increasing usability of drag'n'drop

    I want my user to be able to move a widget around with reasonable accuracy.

    The drag and drop works fine, but in initial testing, most of my users were slightly disconcerted by the fact that the drop act does not happen under the tip of the mouse....i.e. event.pos() does not return a value under the part of the mouse which is usually the "active" pointy bit at the tip of the arrow, but insead off to the right and down, under the box bit....

    now i've fixed it easily with an offset, but it just seems a wierd choice IMO......

    has anybody else had experience with this? is there any way of uniformly changing the position of a mouse event? like setting the active bit of the mouse for the whole program....

    (n.b. it also meant that if I selected the widget and did not move the mouse, but just dropped it in the same position it still moved about 25 right and 25 down).......
    Last edited by georgie; 23rd May 2006 at 05:42. Reason: changed number of pixels for offset after checking

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: increasing usability of drag'n'drop

    Quote Originally Posted by georgie
    I want my user to be able to move a widget around with reasonable accuracy.

    The drag and drop works fine, but in initial testing, most of my users were slightly disconcerted by the fact that the drop act does not happen under the tip of the mouse....i.e. event.pos() does not return a value under the part of the mouse which is usually the "active" pointy bit at the tip of the arrow, but insead off to the right and down, under the box bit....
    I think you are confusing two techniques. Dragging widgets is not considered a drag&drop. It's simply moving them with your mouse


    now i've fixed it easily with an offset, but it just seems a wierd choice IMO......

    has anybody else had experience with this? is there any way of uniformly changing the position of a mouse event? like setting the active bit of the mouse for the whole program....

    (n.b. it also meant that if I selected the widget and did not move the mouse, but just dropped it in the same position it still moved about 25 right and 25 down).......
    Can we see the code?

  3. #3
    Join Date
    May 2006
    Location
    Australia
    Posts
    53
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    11
    Thanked 4 Times in 4 Posts

    Default Re: increasing usability of drag'n'drop

    sorry, i may have phrased myself inexactly - i am pretty sure I am doing drag and drop (they are moving from one window to another...or within the one window....whatever they need, it's pretty flexible - either way i have reimplemented dragMoveEvent, dragEnterEvent and dropEvent).....

    but i just want them to be able to place the item in the destination window with some accuracy -- the drop should occur so that the centre of the widget's new position is where the pointy bit of the mouse is instead of the top right hand corner being under the active bit of the mouse...

    actually, i think what i mean when i say centre of the widget should be made more clear....what i mean is that if we assume my widget is painted as a large-ish rectangle, this means that there is quite a large range of points where the user can click to "pick up" the widget....irrespective of this, when the user drops the widget, the drop position is always the left top corner of the widget...this can lead to some slightly unexpected behaviours....in particular if the user clicks the object and then decides not to move it, the unclick will be interpreted as a drop event and the widget will shift so that the top left corner is now where previously some arbitrary point anywhere within the widget was.....

    hope that makes it more clear because i don't have any of my code with me because I am at home now....
    thanks =)
    have a nice day

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: increasing usability of drag'n'drop

    You can store the offset from the corner of the item when starting a drag and then use that offset to recalculate the drop position.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.