def _draw_video_pos(self, painter):
if not self._api.video.current_pts:
return
x = self._pts_to_x(self._api.video.current_pts)
painter.setPen(QtCore.Qt.NoPen)
painter.setBrush(get_color(self._api, 'spectrogram/video-marker'))
width = 7
polygon = QtGui.QPolygonF()
for x, y in [
(x - width / 2, 0),
(x + width / 2, 0),
(x + width / 2, SLIDER_SIZE),
(x + 1, SLIDER_SIZE + width / 2),
(x + 1, painter.viewport().height() - 1),
(x, painter.viewport().height() - 1),
(x, SLIDER_SIZE + width / 2),
(x - width / 2, SLIDER_SIZE),
]:
polygon.append(QtCore.QPointF(x, y))
painter.drawPolygon(polygon)
评论列表
文章目录