marmistrz
marmistrz

Reputation: 6414

One-time QML Column spacing override

I use QML Column layout, but I'd like to disable (or decrease) spacing between two elements only. Between the rest the spacing should be left alone.

Is it possible?

Thanks.

Upvotes: 3

Views: 1235

Answers (1)

sebasgo
sebasgo

Reputation: 3861

Decreasing is difficult, but increasing the space between two adjacent items is easy: just insert an empty Item between them with the needed additional vertical space (minus the amount of one extra regular spacing, of course) as height. Don't forget to also set a non-zero width or otherwise the item won't be taken into account for the layout calculation.

With no spacing set for the Column itself you can achieve this way every spacing configuration possible. This is obviously a bit hacky, but there is no other way.

Upvotes: 5

Related Questions