self.title=titleor''# Do not initialise title empty
self.title=titleor''# Do not initialise title empty
self.subtitle=subtitle
self.composer=composer
self.composer=composer
self.arranger=arranger
self.arranger=arranger
self.timeSignature=timeSignature
self.timeSignature=timeSignature
self.tempo=tempo
def__eq__(self,other):
def__eq__(self,other):
ifisinstance(other,self.__class__):
ifisinstance(other,self.__class__):
textEqual=self.title==other.titleandself.composer==other.composerandself.arranger==other.arrangerandself.timeSignature==other.timeSignature# check all the text values for equality
textEqual=self.title==other.titleandself.subtitle==other.subtitleandself.composer==other.composerandself.arranger==other.arrangerandself.timeSignature==other.timeSignatureandself.tempo==other.tempo# check all the text values for equality
maxWidth=int((((pagesize[0]-(2*margin))/style.unitWidth)//(document.timeSignature*2))*(document.timeSignature*2))# use integer division to round maxWidth to nearest two bars
if(unitWidth*document.timeSignature*2)>=((pagesize[0]-(2*margin)+1)):# adding 1 to allow for rounding errors
raiseException("Beat width (unitWidth) is too high. It is {current} pt and can be a maximum of {max} pt".format(current=unitWidth,max=((pagesize[0]-(2*margin)/(document.timeSignature*2)))))
maxWidth=int((((pagesize[0]-(2*margin))/unitWidth)//(document.timeSignature*2))*(document.timeSignature*2))# use integer division to round maxWidth to nearest two bars
warning=QMessageBox.warning(self,"Out of range","Beat width is out of range. It can be a maximum of {}.".format(maxBeatWidth),buttons=QMessageBox.Ok,defaultButton=QMessageBox.Ok)