Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
pderocco last edited by
I'm having two related problems with
GridLayoutobjects, both revolving around the use of
Layout.fillHeightto get constant sized cells that their contents can anchor themselves to. I believe they also apply to
First, some of my children use
Layout.rowSpan. But when I do this, even though the extra columns or rows are "occupied", the
fillHeightdoesn't seem to apply to the extra columns or rows. If this is W.A.D, I can't imagine why anyone would D. it this way--it looks like a bug to me. My "solution" is to create dummy items that force the other columns or rows to be filled. But this isn't without its problems. For instance, if I have a
GridLayoutwith five columns, and I want to attach a child that is five columns wide (say as a title in the top row), and some of the columns are otherwise unoccupied, I can create a dummy
Layerproperties set to occupy those columns. But if I can't find a row in which there isn't something already spanning those columns, then the item clashes with one of the real items I want to display. This "works", but it produces an error message in the log, e.g.,
QGridLayoutEngine::addItem: Cell (0, 4) already taken.
BTW, I've found that I only need to insert enough dummy single-cell items to define all the grid boundaries. In the above example, I'd need a dummy in columns 1 and 3, because that's enough to define boundaries 0-1, 1-2, 2-3, and 3-4:
0 1 2 3 4 +---------------------------------------+ | colSpan = 5 | +-------+-------+-------+-------+-------+ | dummy | | dummy | +-------+ +-------+
Second, I specify a
GridLayout, but sometimes I want a double-wide gap, so I treat that as just another row or column that has nothing in it, and that should therefore have a zero height or width. But when I do that, I don't get the extra spacing--it acts as if the row or column just doesn't exist. Again, W.A.D.? But why? My "solution" is to place a dummy
Iteminto the empty row with its
Layout.fillWidthset, but obviously not
Layout.fillHeight(or the opposite for an empty column).
These are pretty ugly hacks, they junk up the source code, and they're error-prone. Does anyone have any better ideas on how to do either of these things? Does anyone think they could be called bugs?
Lucinda183 Banned last edited by
This post is deleted!
pderocco last edited by
It was spam.