@ -62,17 +62,19 @@ class GuiBlockHandle(QtWidgets.QGraphicsRectItem):
self . parent = parent #GuiTrack instance
self . parentGuiTrack = parent #redundant, but specifically for block movement. see ScoreScene
self . trans = QtGui . QColor ( " transparent " )
self . setPen ( self . trans )
self . setPen ( self . trans ) #activate to show outline.
self . setBrush ( self . trans )
#self.setOpacity(0.4) #slightly fuller than background
#self.setFlag(QtWidgets.QGraphicsItem.ItemIgnoresParentOpacity, True)
#self.setFlag(QtWidgets.QGraphicsItem.ItemIsMovable, True)
self . setParentItem ( parent )
self . setZValue ( 10 ) #This is the z value within GuiTrack
#self.setZValue(10) #This is the z value within GuiTrack
self . staticExportItem = staticExportItem
self . _color = None # @property
self . posBeforeMove = None
self . cursorPosOnMoveStart = None
self . setFlags ( QtWidgets . QGraphicsItem . ItemIgnoresParentOpacity )
#Display Block ID
"""
@ -96,11 +98,13 @@ class GuiBlockHandle(QtWidgets.QGraphicsRectItem):
self . startLabel . setParentItem ( self )
self . startLabel . setPos ( 0 , constantsAndConfigs . stafflineGap )
self . startLabel . setFlags ( QtWidgets . QGraphicsItem . ItemIgnoresParentOpacity )
#self.startLabel.setZValue(self.zValue()+1) this doesn't matter because our value is relative to self, the rectangle. And selfs value is relative to the GuiTracks other children.
self . endLabel . setParentItem ( self )
self . endLabel . setPos ( self . rect ( ) . width ( ) - self . endLabel . boundingRect ( ) . width ( ) , constantsAndConfigs . stafflineGap )
self . endLabel . setFlags ( QtWidgets . QGraphicsItem . ItemIgnoresParentOpacity )
@property
def color ( self ) :
assert self . _color
@ -136,9 +140,10 @@ class GuiBlockHandle(QtWidgets.QGraphicsRectItem):
self . endLabel . hide ( )
def mousePressEventCustom ( self , event ) :
""" Not a qt-override. This is called directly by GuiScore
if you click on a block with the right modifier keys ( none ) """
if you click on a block """
self . posBeforeMove = self . pos ( )
self . cursorPosOnMoveStart = QtGui . QCursor . pos ( )
self . setBrush ( self . color )
@ -595,7 +600,7 @@ class GuiTrack(QtWidgets.QGraphicsItem):
elif nameAsString == " block " :
self . blockModeNameGraphic . show ( )
self . nameGraphic . hide ( )
self . setOpacity ( 0 )
self . setOpacity ( 0 ) #this hides the notation stuff. The block mode graphics and labels are also children of ours, but they ignore parent opacity.
for backgroundColor in self . backgroundBlockColors : #simple QRectItems, they don't have their own updateMode function
backgroundColor . setOpacity ( 1 )
for tbh in self . transparentBlockHandles :