Address FutureWarning about implicit float to int conversions

This commit is contained in:
Ognyan Moore 2020-02-28 14:27:10 -08:00
parent 7199a4f4ce
commit 6ed8a405fe
3 changed files with 4 additions and 4 deletions

View File

@ -921,7 +921,7 @@ class AxisItem(GraphicsWidget):
p2[axis] += tickLength*tickDir
tickPen = self.pen()
color = tickPen.color()
color.setAlpha(lineAlpha)
color.setAlpha(int(lineAlpha))
tickPen.setColor(color)
tickSpecs.append((tickPen, Point(p1), Point(p2)))
profiler('compute ticks')
@ -1078,7 +1078,7 @@ class AxisItem(GraphicsWidget):
p.setFont(self.tickFont)
p.setPen(self.textPen())
for rect, flags, text in textSpecs:
p.drawText(rect, flags, text)
p.drawText(rect, flags.__int__(), text)
profiler('draw text')

View File

@ -654,7 +654,7 @@ class GradientEditorItem(TickSliderItem):
s = s1 * (1.-f) + s2 * f
v = v1 * (1.-f) + v2 * f
c = QtGui.QColor()
c.setHsv(h,s,v)
c.setHsv(*map(int, [h,s,v]))
if toQColor:
return c
else:

View File

@ -153,7 +153,7 @@ class GridItem(UIGraphicsItem):
continue
ppl = dim[ax] / nl[ax]
c = np.clip(5.*(ppl-3), 0., 50.)
c = np.clip(5 * (ppl-3), 0., 50.).astype(int)
linePen = self.opts['pen']
lineColor = self.opts['pen'].color()