def add_row(self, widget): """Add widget to row""" item = widget.item line, col, span = self.items_pos[item.item] if col > 0: self.layout.addItem( QSpacerItem(20, 1), line, col*3-1 ) widget.place_on_grid( self.layout, line, col*3, col*3 + 1, 1, 3*span-2) try: widget.get() except Exception: print("Error building item :", item.item._name) raise
def __init__(self, parent=None, position="right", xsection_pos="top"): self.xsection_pos = xsection_pos self.spacer = QSpacerItem(0, 0) super(YCrossSection, self).__init__(parent) self.cs_plot.set_axis_direction("bottom", reverse=position == "left")