|
|
@ -149,7 +149,7 @@ class Playhead(QtWidgets.QGraphicsLineItem): |
|
|
|
self.setFlags(QtWidgets.QGraphicsItem.ItemIsMovable) |
|
|
|
self.setCursor(QtCore.Qt.SizeHorCursor) |
|
|
|
self.setAcceptedMouseButtons(QtCore.Qt.LeftButton) |
|
|
|
self.setZValue(90) |
|
|
|
self.setZValue(90) #This is relative to the parent, which is the scene. |
|
|
|
#self.parentScoreScene.parentView.verticalScrollBar().valueChanged.connect(self.setLineToWindowHeigth) |
|
|
|
#self.hide() |
|
|
|
#self.maxHeight = QtWidgets.QDesktopWidget().geometry().height() #we really hope the screen resolution does not change during the session. |
|
|
@ -226,15 +226,25 @@ class Selection(QtWidgets.QGraphicsRectItem): |
|
|
|
self.invalidBrush = QtGui.QBrush(QtGui.QColor("grey")) |
|
|
|
self.invalidBrush.setStyle(QtCore.Qt.DiagCrossPattern) |
|
|
|
|
|
|
|
self._tupleOfCursorExportObjects = None #cache for stretchX |
|
|
|
|
|
|
|
self.setPen(pen) |
|
|
|
self.setOpacity(0.2) |
|
|
|
self.setZValue(95) #Below playback cursor, but pretty high. This is relative to the parent, which is the scene. |
|
|
|
self.setEnabled(False) |
|
|
|
api.callbacks.setSelection.append(self.setSelection) |
|
|
|
|
|
|
|
def boundingRect(self, *args): |
|
|
|
return oneRectToReturnThemAll |
|
|
|
|
|
|
|
def stretchXCoordinates(self, factor): |
|
|
|
"""Reposition the items on the X axis. |
|
|
|
Call goes through all parents/children, starting from ScoreView._stretchXCoordinates. |
|
|
|
Docstring there.""" |
|
|
|
self.setSelection(self._tupleOfCursorExportObjects) |
|
|
|
|
|
|
|
def setSelection(self, tupleOfCursorExportObjects): |
|
|
|
self._tupleOfCursorExportObjects = tupleOfCursorExportObjects |
|
|
|
if tupleOfCursorExportObjects: |
|
|
|
validSelection, topleftCursorObject, bottomRightCursorObject = tupleOfCursorExportObjects |
|
|
|
if validSelection: |
|
|
|