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] Is there anyway to create a scrollable version of Layouts?

[SOLVED] Is there anyway to create a scrollable version of Layouts?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
qmllayoutsflickablemobilescrolling
7 Posts 5 Posters 9.4k Views
  • 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.
  • E Offline
    E Offline
    eLim
    wrote on last edited by eLim
    #1

    Putting a column/row/grid in a Flickable is fine since you can bind the flickable's contentHeight to the height of its child, thus enabling it to scroll.

    However we're using ColumnLayout to create automatically resizable versions of our layouts for some mobile apps at the moment. The issue is now we are unable to place these layouts into a Flickable due to the fact that ColumnLayout will never report its height. Therefore the Flickable's contentHeight never gets updated and the Flickable is unable to scroll.

    This seems like a ridiculously major flaw in the design of the Layouts functionality. Either that or I'm just unable to see another way to place a Layout in a scrollable container. Has anyone had any success doing it?

    Cheers

    1 Reply Last reply
    0
    • ekkescornerE Offline
      ekkescornerE Offline
      ekkescorner
      Qt Champions 2016
      wrote on last edited by
      #2

      you're writing mobile apps, so my question:
      have you allready tried qt.labs.controls with Qt 5.6 ?
      there's a new concept to add ScrollBars
      https://doc-snapshots.qt.io/qt5-5.6/qml-qt-labs-controls-scrollbar.html
      perhaps it will work for you

      ekke ... Qt Champion 2016 | 2024 ... mobile business apps
      5.15 --> 6.8 https://t1p.de/ekkeChecklist
      QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

      E 1 Reply Last reply
      0
      • ekkescornerE ekkescorner

        you're writing mobile apps, so my question:
        have you allready tried qt.labs.controls with Qt 5.6 ?
        there's a new concept to add ScrollBars
        https://doc-snapshots.qt.io/qt5-5.6/qml-qt-labs-controls-scrollbar.html
        perhaps it will work for you

        E Offline
        E Offline
        eLim
        wrote on last edited by
        #3

        @ekkescorner Thanks for the reply but unfortunately this doesn't help.
        A ScrollBar is just an extra feature for a Flickable. My issue I'm having is that I can't have a dynamically sized ColumnLayout with flicking capabilities. Seems like someone at Qt really missed the mark with this one!

        Like I said I can always piece a regular Column together with my Components, but it completely bypasses the ability to dynamically resize things based on external parameters (ie screen dimensions) without having to do the calculations and all that myself.

        1 Reply Last reply
        0
        • jpnurmiJ Offline
          jpnurmiJ Offline
          jpnurmi
          wrote on last edited by
          #4

          The issue is now we are unable to place these layouts into a Flickable due to the fact that ColumnLayout will never report its height.

          Laying out its children into a column and calculating the total height is the sole purpose of ColumnLayout.

          Therefore the Flickable's contentHeight never gets updated and the Flickable is unable to scroll.

          You forgot to post a snippet that shows the contentHeight binding. Do you specify height or vertical/fill anchors for the column?

          1 Reply Last reply
          0
          • V Offline
            V Offline
            vladstelmahovsky
            wrote on last edited by
            #5

            use implicitHeight instead of height

            E 1 Reply Last reply
            2
            • U Offline
              U Offline
              Uwe Koehler
              wrote on last edited by
              #6

              Hi, I faced a similar problem and a fix (with example code) can be found in this forum entry nested-repeater-in-listview-with-scrollview.

              Maybe that is of any use. This discussion certainly help me with the fix.

              Many thanks everybody!

              1 Reply Last reply
              0
              • V vladstelmahovsky

                use implicitHeight instead of height

                E Offline
                E Offline
                eLim
                wrote on last edited by
                #7

                @vladstelmahovsky Thanks. This solves the issue! Shame on me for not reading the documentation more thoroughly.

                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