Skip to content

Commit

Permalink
Use QElapsedTimer rather than the obsolete QTime.
Browse files Browse the repository at this point in the history
  • Loading branch information
smartavionics committed May 3, 2022
1 parent f5d0d0c commit 08dffcd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions RawMouse/RawMouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
using_QT5 = False

try:
from PyQt6.QtCore import QObject, QTime
from PyQt6.QtCore import QObject, QElapsedTimer
from PyQt6 import QtCore, QtWidgets
except ImportError:
from PyQt5.QtCore import QObject, QTime
from PyQt5.QtCore import QObject, QElapsedTimer
from PyQt5 import QtCore, QtWidgets
using_QT5 = True

Expand Down Expand Up @@ -229,7 +229,7 @@ def _stop(self):

def _run_hid(self):
Logger.log("d", "HID event reader running...")
runner_started_at = QTime()
runner_started_at = QElapsedTimer()
runner_started_at.start()
auto_restart = False
self._running = True
Expand All @@ -246,7 +246,7 @@ def _run_hid(self):
Logger.log("i", "Product: %s", h.get_product_string())
#Logger.log("i", "Serial No: %s", h.get_serial_number_string())

self._last_camera_update_at = QTime()
self._last_camera_update_at = QElapsedTimer()
self._last_camera_update_at.start()
self._fast_view = False
while self._running:
Expand Down Expand Up @@ -622,7 +622,7 @@ def _run_libspnav(self):
Logger.log("d", "Reading events from libspnav...")
try:
if spnavOpen() == False:
self._last_camera_update_at = QTime()
self._last_camera_update_at = QElapsedTimer()
self._last_camera_update_at.start()
self._fast_view = False
while self._running:
Expand Down

0 comments on commit 08dffcd

Please sign in to comment.