Results 1 to 5 of 5

Thread: Flickable

  1. #1
    Join Date
    Jan 2016
    Posts
    54
    Thanks
    7
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Flickable

    Hiii everyOne,

    See the code below:
    Qt Code:
    1. Item{
    2. width: 600
    3. height: 500
    4.  
    5. Rectangle{
    6. width: parent.width
    7. height: 400
    8. color: "#710909"
    9. anchors.bottom: parent.bottom
    10. Flickable{
    11. anchors.fill: parent
    12. contentWidth: parent.width
    13. contentHeight: parent.height*3
    14. Rectangle {
    15. id: GreenRectangle
    16. x: 200
    17. y: 106
    18. width: 200
    19. height: 200
    20. color: "green"
    21. }
    22. }
    23. }
    24. }
    To copy to clipboard, switch view to plain text mode 

    Why the object GreenRectangle exceeds the limit of Flickable ... see image : fl.png
    Any solution ?

  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: Flickable

    The Flickable's default boundsBehavior is Flickable.DragAndOvershootBounds (default) - the contents can be dragged beyond the boundary of the Flickable, and can overshoot the boundary when flicked.

    Also clipping is off by default.

    Cheers,
    _

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

    Binary01 (18th February 2016)

  4. #3
    Join Date
    Jan 2016
    Posts
    54
    Thanks
    7
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Flickable

    Is there a way to stop GreenRectangle at the bound of Flickable (we can see GreenRectangle)
    Cheers,

  5. #4
    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: Flickable

    That doesn't sound like you have tried changing the boundsBehavior.
    Have you?

    Cheers,
    _

  6. #5
    Join Date
    Jan 2016
    Posts
    54
    Thanks
    7
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Flickable

    Yes I tried,

    Qt Code:
    1. Flickable{
    2. boundsBehavior: Flickable.StopAtBounds
    3. anchors.fill: parent
    4. contentWidth: parent.width
    5. contentHeight: parent.height*2
    6. clip: true
    To copy to clipboard, switch view to plain text mode 

    I want to disable the flick when the green rectangle reaches the top like : fl.png

Similar Threads

  1. Flickable with right click
    By clousque in forum Qt Quick
    Replies: 0
    Last Post: 12th October 2015, 16:03
  2. Flickable some items
    By lqsa in forum Qt Quick
    Replies: 7
    Last Post: 29th August 2015, 13:10
  3. Problem using Flickable in QML?
    By tanthinh1510 in forum Qt Quick
    Replies: 2
    Last Post: 15th May 2015, 07:08
  4. mousearea outside flickable not working
    By joko in forum Qt Quick
    Replies: 3
    Last Post: 15th December 2014, 16:36
  5. Replies: 0
    Last Post: 16th September 2012, 10:28

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.