refactor: Verhindere ständiges Löschen und Neuerstellen von QGraphicsLineItem durch direktes Verschieben
Co-authored-by: aider (ollama/qwen2.5-coder:14b) <aider@aider.chat>
This commit is contained in:
1 parent
b7224649f1
commit
d8421e7138
1 file changed
+1
-4
@@ -135,10 +135,7 @@ class MainWindow(QMainWindow):
|
||||
def move_playhead(self):
|
||||
self.current_x += 1
|
||||
if self.current_x < self.timeline_length:
|
||||
self.scene.removeItem(self.playhead)
|
||||
self.playhead = QGraphicsLineItem(self.current_x, -5, self.current_x, 5)
|
||||
self.playhead.setPen(QPen(Qt.GlobalColor.red, 2))
|
||||
self.scene.addItem(self.playhead)
|
||||
self.playhead.setX(self.current_x)
|
||||
else:
|
||||
self.pause()
|
||||
|
||||
|
||||
Reference in new issue
Block a user