Browse Source

Merge pull request #1253 from kyuupichan/fast_qr_draw

Speed up painting of qr codes.
283
ThomasV 10 years ago
parent
commit
2f7503c635
  1. 9
      gui/qt/qrcodewidget.py

9
gui/qt/qrcodewidget.py

@ -72,16 +72,13 @@ class QRCodeWidget(QWidget):
qp.setBrush(white)
qp.setPen(white)
qp.drawRect(left-margin, top-margin, size+(margin*2), size+(margin*2))
qp.setBrush(black)
qp.setPen(black)
for r in range(k):
for c in range(k):
if matrix[r][c]:
qp.setBrush(black)
qp.setPen(black)
else:
qp.setBrush(white)
qp.setPen(white)
qp.drawRect(left+c*boxsize, top+r*boxsize, boxsize, boxsize)
qp.drawRect(left+c*boxsize, top+r*boxsize, boxsize - 1, boxsize - 1)
qp.end()

Loading…
Cancel
Save