Results 1 to 10 of 10

Thread: mouseMoveEvent and leaveEvent Problems

  1. #1
    Join Date
    Apr 2010
    Posts
    31
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Question mouseMoveEvent and leaveEvent Problems

    Hi. Using leaveEvent, I press and hold an item move it out of the list widget, still the leaveEvent isn't triggered, when I release the mouse it is triggered. Why is that? Should't it be triggered whenever mouse gets out of the widget? The same things happens with mouseMoveEvent it's not triggered if the mouse left button is held.
    Please help!
    Thanks in advance!

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: mouseMoveEvent and leaveEvent Problems

    The same things happens with mouseMoveEvent it's not triggered if the mouse left button is held.
    Is reading it here better then reading it in the documentation??
    If mouse tracking is switched off, mouse move events only occur if a mouse button is pressed while the mouse is being moved. If mouse tracking is switched on, mouse move events occur even if no mouse button is pressed.
    This probably also effect the leaveEvent() and enterEvent() are behaving.
    Try setting mouse tracking on, see if it helps.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Apr 2010
    Posts
    31
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: mouseMoveEvent and leaveEvent Problems

    I did. But it didn't help.

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: mouseMoveEvent and leaveEvent Problems

    Not even for mouseMove() events?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  5. #5
    Join Date
    Apr 2010
    Posts
    31
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: mouseMoveEvent and leaveEvent Problems

    mouseMove event works when I don't press and hold an item and move it around the widget.

  6. #6
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: mouseMoveEvent and leaveEvent Problems

    then you are doing something else worng, but with out code its hard to tell.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  7. #7
    Join Date
    Apr 2010
    Posts
    31
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: mouseMoveEvent and leaveEvent Problems

    The widget.cpp >> http://paste.kde.org/1259/
    the widget.h >> http://paste.kde.org/1260/
    the main.cpp >> http://paste.kde.org/1246/

  8. #8
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: mouseMoveEvent and leaveEvent Problems

    Hmm... in the code you posted I see nothing wrong.
    I have used this in the past and never had trouble.
    Maybe I am forgetting something...
    Hopefully someone else might have an idea.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  9. #9
    Join Date
    Apr 2010
    Posts
    31
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: mouseMoveEvent and leaveEvent Problems

    Can you compile the code and see if it works for you?
    It might be a bug may be.

  10. #10
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: mouseMoveEvent and leaveEvent Problems

    Sorry, no, not at the moment, as I am at work.
    Only in the evening.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. QTabBar + leaveEvent + mouseMoveEvent
    By enlightened_j in forum Qt Programming
    Replies: 1
    Last Post: 25th September 2010, 00:13
  2. About the mouseMoveEvent()
    By bingoking in forum Qt Programming
    Replies: 3
    Last Post: 26th September 2008, 12:56
  3. leaveEvent on transparent area issue
    By nooky59 in forum Qt Programming
    Replies: 10
    Last Post: 8th January 2008, 14:22
  4. QWidget::leaveEvent
    By ToddAtWSU in forum Qt Programming
    Replies: 2
    Last Post: 15th October 2007, 18:28
  5. enterEvent, leaveEvent, setWindowFlags
    By TheKedge in forum Qt Programming
    Replies: 1
    Last Post: 3rd February 2007, 10:15

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.