B Tonner
unread,Nov 29, 2021, 12:26:15 PM11/29/21Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pyqt...@googlegroups.com
The GraphicsLayout.addItem method increments self.currentCol through
self.nextColumn() every time addItem is called, independent of whether
or not there is a 'col' value specified in the method call.
This leads to an inconsistency in the meaning of
GraphicsLayout.currentCol when items are added to specific rows and
columns. The GraphicsLayout.currentCol can exceed the underlying
GraphicsLayout.layout.columnCount() (which is the QGraphicsGridLayout
column count).
This mainly affects cases where an item is added without (row, col),
after one or more items are added using (row,col). It is probably
otherwise not visible. But it still doesn't "feel right".
It seems that the meaning of "currentRow" and "currentCol" is more
closely "maxRow" and "maxCol".
Perhaps a fix would be:
def addItem(self.......
.....
.....
#self.nextColumn()
self.currentCol = self.layout.columnCount()
Brian Tonner