コード例 #1
0
ファイル: unit_view.py プロジェクト: jessecrossen/jackdaw
 def layout(self):
   r = self._rect
   x = self.base_x()
   y = self._rect.y()
   view_count = len(self._views)
   i = 0
   for view in self._views:
     view.setPos(QPointF(x, self.y_of_view(r, view, i, view_count)))
     i += 1
コード例 #2
0
 def layout(self):
     r = self._rect
     x = self.base_x()
     y = self._rect.y()
     view_count = len(self._views)
     i = 0
     for view in self._views:
         view.setPos(QPointF(x, self.y_of_view(r, view, i, view_count)))
         i += 1
コード例 #3
0
 def layout(self):
   r = self.boundingRect()
   cr = self.effectiveClipRect()
   pitch_map = dict()
   i = 0.5
   for pitch in reversed(self._track.pitches):
     pitch_map[pitch] = i
     i += 1.0
   if (self._views is not None):
     for view in self._views:
       note = view.note
       try:
         y = pitch_map[note.pitch]
       except KeyError:
         y = -1.0
       view.setPos(QPointF(r.x() + note.time, r.y() + y))
       view.setVisible((cr is None) or (view.rect().intersects(cr)))