forked from Wobbl/Wobuzz
Optimized the CPU usage a little by creating one QTimer that updates all progress indicators instead of having a different QTimer for each Widget.
This commit is contained in:
parent
105cc5ddf9
commit
8d74c1e14c
3 changed files with 17 additions and 21 deletions
|
@ -1,12 +1,9 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
from PyQt6.QtCore import Qt, QTimer
|
||||
from PyQt6.QtCore import Qt
|
||||
from PyQt6.QtGui import QMouseEvent
|
||||
from PyQt6.QtWidgets import QSlider, QStyle, QStyleOptionSlider
|
||||
|
||||
PROGRESS_UPDATE_RATE = 60
|
||||
PROGRESS_UPDATE_INTERVAL = 1000 // PROGRESS_UPDATE_RATE
|
||||
|
||||
|
||||
class TrackProgressSlider(QSlider):
|
||||
def __init__(self, app, parent=None):
|
||||
|
@ -17,10 +14,6 @@ class TrackProgressSlider(QSlider):
|
|||
|
||||
self.dragged = False
|
||||
|
||||
self.progress_update_timer = QTimer()
|
||||
self.progress_update_timer.timeout.connect(self.update_progress)
|
||||
self.progress_update_timer.start(PROGRESS_UPDATE_INTERVAL)
|
||||
|
||||
option = QStyleOptionSlider()
|
||||
style = self.style()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue