Skip to content

Commit

Permalink
ref: get rid of some pyqt5 deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Aug 4, 2020
1 parent 27aa19e commit 158e173
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion shapeout2/gui/analysis/ana_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def __setstate__(self, state):
color_index = COLORMAPS.index(sca["colormap"])
self.comboBox_colormap.setCurrentIndex(color_index)
self.checkBox_event_count.setChecked(sca["show event count"])
self.spinBox_alpha.setValue(sca["marker alpha"]*100)
self.spinBox_alpha.setValue(int(sca["marker alpha"]*100))
if sca["marker hue"] == "feature":
self._set_range_feat_state(sca["hue feature"], sca["hue min"],
sca["hue max"])
Expand Down
11 changes: 7 additions & 4 deletions shapeout2/gui/widgets/colorbar_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,23 @@ def __init__(self, cmap, width, height, vmin=0.0, vmax=1.0, label=""):
maxwidth = 0.0
for tick, tick_label in zip(ticks, tick_labels):
y_ = (1.0 - (tick - smn)/spp) * h
p.drawLine(w, y_, w+5.0, y_)
p.drawLine(w, int(y_), int(w+5.0), int(y_))
br = p.boundingRect(
0, 0, 0, 0, pg.QtCore.Qt.AlignRight, tick_label)
if br.x() < mintx:
mintx = br.x()
if br.width() > maxwidth:
maxwidth = br.width()
p.drawText(br.x() + 10.0 + w + br.width(),
y_ + br.height() / 4.0, tick_label)
p.drawText(int(br.x() + 10.0 + w + br.width()),
int(y_ + br.height() / 4.0),
tick_label)

# draw label
br = p.boundingRect(0, 0, 0, 0, pg.QtCore.Qt.AlignBottom, label)
p.rotate(90)
p.drawText(h/2 - br.width()/2, -w-maxwidth-15, label)
p.drawText(int(h/2 - br.width()/2),
int(-w-maxwidth-15),
label)

# done
p.end()
Expand Down

0 comments on commit 158e173

Please sign in to comment.