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

-- 
You received this message because you are subscribed to the Google Groups 
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyqtgraph/CAEcrfYjmUNFhsXF2vxh9WDZohMydOMTTBFAQKVg%2BV4ykzCr8ag%40mail.gmail.com.

Reply via email to