Display current velocity of blocks

This commit is contained in:
Felix Bargfeldt 2019-05-04 02:03:16 +02:00
parent 2f1c9466f2
commit afecf7d60e
No known key found for this signature in database
GPG key ID: 99184F5FDC589A67

View file

@ -101,6 +101,15 @@ class Window(QWidget):
t: str = str(self.counter)
qp.drawText(self.width() - 10 - QFontMetrics(f).width(t), 32, t)
f.setPixelSize(20)
qp.setFont(f)
t: str = f"{self.v1:.2f}"
w: int = QFontMetrics(f).width(t)
qp.drawText(50 + int(self.x1) + self.s1 // 2 - w // 2, self.height() - 60 - self.s1, t)
t: str = f"{self.v2:.2f}"
w: int = QFontMetrics(f).width(t)
qp.drawText(50 + int(self.x2) + self.s2 // 2 - w // 2, self.height() - 60 - self.s2, t)
if __name__ == '__main__':
qa: QApplication = QApplication([])