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. [solved] Flickable doesn't function in a Column
Forum Updated to NodeBB v4.3 + New Features

[solved] Flickable doesn't function in a Column

Scheduled Pinned Locked Moved QML and Qt Quick
7 Posts 4 Posters 1.6k Views 1 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.
  • J Offline
    J Offline
    jago
    wrote on last edited by
    #1

    Hello,

    I have a Column, where only some Elements are seen, the others should appear upon scrolling.
    Here is my code:

    @
    Flickable {
    width: parent.width
    height: parent.height
    flickableDirection: Flickable.VerticalFlick
    clip: true

                Column {
                    id: column
                    width: contentLayout.width*0.9
                    height: contentLayout.height*0.9
                    anchors {
                        horizontalCenter: parent.horizontalCenter
                        verticalCenter: parent.verticalCenter
                    }
                    spacing: width*0.05
    
                    FirstComponent {}
                    SecondComponent {}
                    ThirdComponent {}
          }
    

    }
    @

    It shows the first two Components alright. When I flick I can also see the third component, but it snaps back down after i release the mouse.

    Can anyone help me out here?

    Best regards

    1 Reply Last reply
    0
    • X Offline
      X Offline
      Xander84
      wrote on last edited by
      #2

      Hi, I think you have to set the contentHeight of the Flickable to the height of the Column, also the Column height should be the height of all children, usually you don't need to set the height in a Column unless the child elements have no implicit height. I see you are also using anchors in the Flickable, the Column should fill the flickable by itself, I don't know if that is a good idea to use anchors there.
      From my experience with Flickable you get this issue when the content size is not set or not correct.

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jago
        wrote on last edited by
        #3

        Hi!
        I tried to set the contentHeight and contentWidth like this:

        @
        Flickable {
        width: parent.width
        height: parent.height
        contentHeight: column.height
        contentWidth: column.width
        flickableDirection: Flickable.VerticalFlick
        clip: true

                    Column {
                                   id: column
                                   .......
                    }
        

        }
        @

        But it still doesn't function. :(
        More suggestions?

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          Hey,

          The flickable contentheight should be higher than the parent height.
          Add contentHeight: parent.height * 2

          Hope this helps.

          Ansif

          1 Reply Last reply
          0
          • J Offline
            J Offline
            jago
            wrote on last edited by
            #5

            Thank you! That was it! Now it functions. :)

            Best regards,

            Jago

            1 Reply Last reply
            0
            • EddyE Offline
              EddyE Offline
              Eddy
              wrote on last edited by
              #6

              Hi,

              Please add [solved] to the topic so everyone can see that this problem is solved. You can do that by editing your first post.

              Qt Certified Specialist
              www.edalsolutions.be

              1 Reply Last reply
              0
              • ? Offline
                ? Offline
                A Former User
                wrote on last edited by
                #7

                Glad I could help you.

                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