Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Implementing swipe to refresh as in material design
Forum Updated to NodeBB v4.3 + New Features

Implementing swipe to refresh as in material design

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 3 Posters 741 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RudolfVonKrugstein
    wrote on last edited by
    #1

    Hi,

    I want to implement an swipe-to-refresh behavior as described in the material design here: https://www.google.com/design/spec/patterns/swipe-to-refresh.html

    Now there is the twitter search example. It works by using the contentY property to see how much the list is overshoot.

     states: [
            State {
                name: "base"; when: mainListView.contentY >= -120
                PropertyChanges { target: arrow; rotation: 180 }
            },
            State {
                name: "pulled"; when: mainListView.contentY < -120
                PropertyChanges { target: label; text: "Release to refresh..." }
                PropertyChanges { target: arrow; rotation: 0 }
            }
        ]
    

    That is nice, but not what I want. I want my list not to overhoot. But when setting:

            boundsBehavior: Flickable.StopAtBounds
    

    The contentY "trick" does not work anymore.

    So I wonder how can I set the boundsBehavior to StopAtBounds but still react to overshooting?

    Or how else can I implement swipe-to-refresh as described in the material design?

    Thanks!
    Nathan

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Schluchti
      wrote on last edited by
      #2

      Has someone implemented something like this or is there maybe already something directly in Qt? I already searched the Qt documentation but couldn't find anything. But maybe I am using the wrong search keywords.

      Want to read more about Qt?

      https://gympulsr.com/blog/qt/

      Latest Article: https://gympulsr.com/blog/qt/2017/06/14/ios-background-music-qt.html

      1 Reply Last reply
      0
      • p3c0P Offline
        p3c0P Offline
        p3c0
        Moderators
        wrote on last edited by p3c0
        #3

        @Schluchti AFAIK this functionality is no yet implemented in Qt so you are left with creating your own. Here is one that I came across. Ofcourse it is for BB but you can subsitute similar existing components provided by Qt with some extra coding :)

        157

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved