Results 1 to 8 of 8

Thread: mouseMoveEvent during drag is not fired

  1. #1
    Join Date
    Feb 2008
    Posts
    40
    Thanks
    9
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default mouseMoveEvent during drag is not fired

    If I start a drag action, then mouseMoveEvent method of the widget that I am currently dragging something over is not called anymore. I would like it to be called, because I want to know, where is the cursor. It's a widget drawn completely during paintEvent and I would like to redraw it, when drag is in certain areas (that represent objects onto which drop can be done). How can I turn it on or emulate this?

  2. #2
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: mouseMoveEvent during drag is not fired

    if that doesnt work maybe u can try events like enterEvent or hoverEvent..do they work for u?

  3. #3
    Join Date
    Feb 2008
    Posts
    40
    Thanks
    9
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: mouseMoveEvent during drag is not fired

    Nope, neither of them works.

  4. #4
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: mouseMoveEvent during drag is not fired

    Qt Code:
    1. void QWidget::dragEnterEvent ( QDragEnterEvent * event ) [virtual protected]
    2.  
    3. This event handler is called when a drag is in progress and the mouse enters this widget. The event is passed in the event parameter.
    To copy to clipboard, switch view to plain text mode 

    this should be your solution

  5. #5
    Join Date
    Feb 2008
    Posts
    40
    Thanks
    9
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: mouseMoveEvent during drag is not fired

    :-)

    I'll try to explain it again. I am dragging an object inside a one widget, that is painted using some information stored inside this widget. There are no subwidgets, so there are no dragEnterEvents inside (unless I drag an object outside this widget, but that really isn't the case). I am doing everything based on mouse moves - if I drag mouse in a certain region of the widget, drag starts. If I drop the widget in a certain region - proper drop is done. And this works. But I would like to be able to control this move and repaint widget accordingly. But it seems, that everything is frozen during drag.
    Last edited by gruszczy; 24th February 2009 at 16:26.

  6. #6
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: mouseMoveEvent during drag is not fired

    alright dude, now ur requirement is a bit clear..but i havent done anth like that before..but i wanna shoot in the dark for last time..how about using dragMove?

  7. The following user says thank you to talk2amulya for this useful post:

    gruszczy (24th February 2009)

  8. #7
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: mouseMoveEvent during drag is not fired

    Why do u want to draw during drag ?
    If I am getting your problem right,y ou could better set pixmap in the mimedata of the drag.

    You can see the draggable icons examples in Qt Demos.

  9. #8
    Join Date
    Feb 2008
    Posts
    40
    Thanks
    9
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: mouseMoveEvent during drag is not fired

    Ahhh, why haven't I noticed that dragMoveEvent! That's it! Thanks :-)

Similar Threads

  1. drag and drop QToolButton in QToolBar
    By NBilal in forum Qt Programming
    Replies: 1
    Last Post: 28th December 2008, 20:11
  2. Change cursor & status during Drag & Drop
    By ronlongo in forum Qt Programming
    Replies: 0
    Last Post: 1st December 2008, 16:56

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.