[SOLVED] Is there anyway to create a scrollable version of Layouts?
-
wrote on 31 Mar 2016, 04:14 last edited by eLim
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
-
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 -
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 youwrote on 7 Apr 2016, 07:04 last edited by@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.
-
wrote on 9 Apr 2016, 12:55 last edited by
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?
-
wrote on 11 Apr 2016, 14:17 last edited by
use implicitHeight instead of height
-
wrote on 12 Apr 2016, 12:03 last edited by
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!
-
use implicitHeight instead of height
wrote on 21 Apr 2016, 03:29 last edited by@vladstelmahovsky Thanks. This solves the issue! Shame on me for not reading the documentation more thoroughly.