Skip to content

Commit

Permalink
Fix of crash in Util/models.py - #196 (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkyral authored Nov 10, 2022
1 parent 5415cf6 commit 2286002
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Util/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def paint(self, p, option, index):
elif rssi >= 75:
px = QPixmap(":/status_high.png")

px_y = (option.rect.height() - 24) / 2
px_y = (option.rect.height() - 24) // 2
p.drawPixmap(option.rect.x() + 2, option.rect.y() + px_y, px.scaled(24, 24))

p.drawText(option.rect.adjusted(28, 0, 0, 0), Qt.AlignVCenter | Qt.AlignLeft, index.data())
Expand Down Expand Up @@ -333,8 +333,8 @@ def paint(self, p, option, index):

if num <= 4:
for i, k in enumerate(sorted(index.data().keys())):
x = option.rect.x() + i * 24 + (option.rect.width() - num * 24) / 2
y = option.rect.y() + (option.rect.height() - 24) / 2
x = option.rect.x() + i * 24 + (option.rect.width() - num * 24) // 2
y = option.rect.y() + (option.rect.height() - 24) // 2

if num == 1:
p.drawPixmap(x, y, 24, 24, QPixmap(":/P_{}".format(index.data()[k])))
Expand Down

0 comments on commit 2286002

Please sign in to comment.