def paint(self, canvas): xy = list(map(int, self._roi.get_center())) radius = int(self._roi.get_radius()) center = QtCore.QPoint(xy[0], canvas.height() - xy[1]) p = self.get_painter(canvas) p.drawEllipse(center, radius, radius) p.end()
def draw_polygon(self, canvas, x, y): x, y = self._transform(x, y) poly = QtGui.QPolygon() points = [QtCore.QPoint(xx, yy) for xx, yy in zip(x, y)] for p in points: poly.append(p) p = self.get_painter(canvas) p.drawPolyline(poly) p.end()
def test_style_dialog(): # This is in part a regression test for a bug in Python 3. It is not a # full test of StyleDialog. session = simple_session() hub = session.hub collect = session.data_collection image = Data(label='im', x=[[1, 2], [3, 4]], y=[[2, 3], [4, 5]]) pos = QtCore.QPoint(10, 10) st = NonBlockingStyleDialog.dropdown_editor(image, pos)