Results 1 to 4 of 4

Thread: mousearea outside flickable not working

  1. #1
    Join Date
    Oct 2014
    Posts
    104
    Thanks
    16
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default mousearea outside flickable not working

    Hi,

    I know this is somewhat easy however I can't figure out what prevents the mousearea from working when the parent height of the flickable is less than its (flickable) content height, other than that mousearea is okay.

    Qt Code:
    1. Item
    2. {
    3. MouseArea
    4. {
    5. id: mouseArea
    6. anchors.fill: parent
    7. onClicked: { console.log("yes") }
    8. }
    9.  
    10. Flickable
    11. {
    12. id: main
    13. contentHeight: 160
    14. anchors.fill: parent
    15. boundsBehavior: Flickable.StopAtBounds
    16. interactive: parent.height > contentHeight ? false : true
    17.  
    18. Rectangle
    19. {
    20. id: body
    21. anchors {
    22. left: parent.left
    23. right: parent.right
    24. }
    25. }
    26. }
    27. }
    To copy to clipboard, switch view to plain text mode 

    Thanks.
    Last edited by joko; 15th December 2014 at 16:34.

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

    Default Re: mousearea outside flickable not working

    Flickable also does mouse event handling and it probably steals events from your MouseArea. See if setting "preventStealing" to true helps.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Oct 2014
    Posts
    104
    Thanks
    16
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: mousearea outside flickable not working

    Quote Originally Posted by wysota View Post
    Flickable also does mouse event handling and it probably steals events from your MouseArea. See if setting "preventStealing" to true helps.
    I already tried setting "preventStealing" to true, same issue.

    Thanks.

  4. #4
    Join Date
    Oct 2014
    Posts
    104
    Thanks
    16
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: mousearea outside flickable not working

    I managed to get it working by using propagateComposedEvents instead

    Qt Code:
    1. Item
    2. {
    3. MouseArea
    4. {
    5. id: mouseArea
    6. anchors.fill: parent
    7. onClicked: { console.log("yes") }
    8. }
    9.  
    10. Flickable
    11. {
    12. id: main
    13. contentHeight: 160
    14. anchors.fill: parent
    15. boundsBehavior: Flickable.StopAtBounds
    16. interactive: parent.height > contentHeight ? false : true
    17.  
    18. MouseArea
    19. {
    20. anchors.fill: parent
    21. propagateComposedEvents: true
    22. onClicked: { mouse.accepted = false }
    23. }
    24.  
    25. Rectangle
    26. {
    27. id: body
    28. anchors {
    29. left: parent.left
    30. right: parent.right
    31. }
    32. }
    33. }
    34. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by joko; 15th December 2014 at 18:28.

Similar Threads

  1. Flickable and mouse signal propagation
    By clousque in forum Qt Quick
    Replies: 7
    Last Post: 25th August 2014, 12:16
  2. Replies: 1
    Last Post: 18th July 2013, 13:31
  3. Replies: 0
    Last Post: 7th July 2013, 02:43
  4. MouseArea
    By Viper666 in forum Qt Quick
    Replies: 6
    Last Post: 10th January 2013, 13:30
  5. Replies: 0
    Last Post: 16th September 2012, 10:28

Tags for this Thread

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.