Results 1 to 2 of 2

Thread: Moving MouseArea.containsMouse

  1. #1
    Join Date
    Sep 2016
    Posts
    6
    Thanks
    3
    Qt products
    Qt5
    Platforms
    Windows

    Default Moving MouseArea.containsMouse

    Hi,

    So there is limitation in Qt documentation:

    Warning: This property is not updated if the area moves under the mouse: containsMouse will not change. In addition, if hoverEnabled is false, containsMouse will only be valid when the mouse is pressed while the mouse cursor is inside the MouseArea.

    Is there any way to work around this?
    I have buttons with hover states and the buttons move at certain occasions. This results in the containsMouse being set to true but not set to false when the MouseArea of the buttons moves away from the mouse cursor.

    I though about disabling the hoverEnable during movement but this didn't work for some reason.

    Thanks,
    Ben

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Moving MouseArea.containsMouse

    Hmm, difficult.

    One thing one could try is to send an artifical mouse move event after the components moved, e.g. using QCoreApplication::sendEvent(), but the difficult part will be to find the correct coordinates to send.

    Cheers,
    _

  3. The following user says thank you to anda_skoa for this useful post:

    benberli (14th September 2016)

Similar Threads

  1. why not works my mouseArea
    By kickoune in forum Qt Quick
    Replies: 3
    Last Post: 11th March 2016, 14:51
  2. mousearea outside flickable not working
    By joko in forum Qt Quick
    Replies: 3
    Last Post: 15th December 2014, 17:36
  3. mousearea containsmouse property
    By joko in forum Qt Quick
    Replies: 8
    Last Post: 4th December 2014, 16:07
  4. MouseArea
    By Viper666 in forum Qt Quick
    Replies: 6
    Last Post: 10th January 2013, 14:30
  5. Replies: 0
    Last Post: 24th May 2010, 13:19

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.