On 10/2/19 4:36 PM, Jason H wrote:

There is fontSizeMode: Text.Fit, .HorizontalFit and .VerticalFit. Horizontal fit is what you want in that situation. But the whole implementation is lacking because you can't actually ask the Text what size it used to render so that other text items on the screen can be the same size.

Typical layout classes have 2 things to do:

a) calculating the geometry of the children
b) offering layout information to the parent calculated from the information provided by the children.

With Widgets, GraphicsView or my framework the system depends on the
min/preferred/max hints being evaluated by a size policy. F.e
QSizePolicy::hasHeightForWidth() tells the layout classes, what to do.

QQuickItem has the implicitSize ( = implicit preferred size ) only - no
other explicit/implicit size hints and no policy.

And b) has become something you have to implement manually on application side. With anchoring things are even worse: there is not even a container who is in control of the scenario, that could do the job.

Ironically GridLayout/RowLayout/ColumnLayout are using the same layout
engine as the layout classes of the QGraphicsView framework. It
offers all the whistles and bells, but QQuickItem does not have the parameters to feed it.

Uwe

_______________________________________________
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development

Reply via email to