def __init__(self, timeAxis, parent=None): """ Parameter timeAxis points to Time Axis on which the time bars are placed. Parameter parent is a parent object in scene where time bars will be displayed. """ super(TimeBar, self).__init__(parent) self.timeAxis = timeAxis self.setFlag(QtGui.QGraphicsItem.ItemIsSelectable, True) self.setFlag(self.ItemSendsGeometryChanges, True) # Create graphical subcomponents. self.topTriangle = TimeBarTriangle(True) self.topTriangle.setParentItem(self) self.bottomTriangle = TimeBarTriangle(False) self.bottomTriangle.setParentItem(self) self.line = TimeBarLine() self.line.setParentItem(self) # Support data for drag and drop movement self.movingItemsInitialPositions = None self.signals = self.Signals()