QVideo 3.4.1__tar.gz → 3.4.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {qvideo-3.4.1 → qvideo-3.4.2}/PKG-INFO +1 -1
- {qvideo-3.4.1 → qvideo-3.4.2}/QVideo.egg-info/PKG-INFO +1 -1
- {qvideo-3.4.1 → qvideo-3.4.2}/lib/QVideoScreen.py +33 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/overlays/trackpy.py +12 -2
- {qvideo-3.4.1 → qvideo-3.4.2}/overlays/yolo.py +12 -2
- {qvideo-3.4.1 → qvideo-3.4.2}/pyproject.toml +1 -1
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qvideoscreen.py +82 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_trackpy_overlay.py +9 -1
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_yolo_overlay.py +9 -1
- {qvideo-3.4.1 → qvideo-3.4.2}/LICENSE.md +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/QCamcorder.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/QVideo.egg-info/SOURCES.txt +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/QVideo.egg-info/dependency_links.txt +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/QVideo.egg-info/requires.txt +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/QVideo.egg-info/top_level.txt +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/README.md +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/__init__.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/cameras/Basler/__init__.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/cameras/Basler/_camera.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/cameras/Basler/_tree.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/cameras/Flir/QListFlirCameras.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/cameras/Flir/__init__.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/cameras/Flir/_camera.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/cameras/Flir/_tree.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/cameras/Genicam/__init__.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/cameras/Genicam/_camera.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/cameras/Genicam/_tree.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/cameras/IDS/__init__.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/cameras/IDS/_camera.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/cameras/IDS/_tree.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/cameras/MV/__init__.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/cameras/MV/_camera.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/cameras/MV/_tree.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/cameras/Noise/__init__.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/cameras/Noise/_camera.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/cameras/Noise/_tree.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/cameras/OpenCV/QListCVCameras.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/cameras/OpenCV/__init__.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/cameras/OpenCV/_camera.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/cameras/OpenCV/_resolution_tree.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/cameras/OpenCV/_tree.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/cameras/Picamera/__init__.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/cameras/Picamera/_camera.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/cameras/Picamera/_tree.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/cameras/Vimbax/__init__.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/cameras/Vimbax/_camera.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/cameras/Vimbax/_tree.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/cameras/__init__.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/demos/ROIdemo.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/demos/__init__.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/demos/demo.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/demos/filterdemo.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/demos/trackpydemo.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/demos/yolodemo.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/dvr/QDVRWidget.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/dvr/QHDF5Reader.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/dvr/QHDF5Writer.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/dvr/QOpenCVReader.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/dvr/QOpenCVWriter.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/dvr/__init__.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/dvr/icons_rc.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/filters/Median.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/filters/MoMedian.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/filters/Normalize.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/filters/QBlurFilter.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/filters/QEdgeFilter.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/filters/QRGBFilter.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/filters/QSampleHold.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/filters/QYOLOFilter.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/filters/_MedianBase.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/filters/__init__.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/lib/QCamera.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/lib/QCameraTree.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/lib/QFPSMeter.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/lib/QFilterBank.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/lib/QListCameras.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/lib/QVideoFilter.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/lib/QVideoReader.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/lib/QVideoSource.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/lib/QVideoWriter.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/lib/__init__.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/lib/chooser.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/lib/clickable.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/lib/resolutions.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/lib/types.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/overlays/__init__.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/setup.cfg +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_chooser.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_clickable.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_demo.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_filterdemo.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_icons_rc.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_median.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_momedian.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_normalize.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qbaslercamera.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qblurfilter.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qcamcorder.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qcamera.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qcameratree.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qdvrwidget.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qedgefilter.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qfilterbank.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qflircamera.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qfpsmeter.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qgenicamcamera.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qgenicamtree.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qhdf5reader.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qhdf5writer.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qidscamera.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qlistcameras.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qlistcvcameras.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qmvcamera.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qnoisecamera.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qnoisetree.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qopencvcamera.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qopencvreader.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qopencvresolutiontree.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qopencvtree.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qopencvwriter.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qpicamera.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qrgbfilter.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qsamplehold.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qvideoreader.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qvideosource.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qvideowriter.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_qvimbaxcamera.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_resolutions.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_roidemo.py +0 -0
- {qvideo-3.4.1 → qvideo-3.4.2}/tests/test_videofilter.py +0 -0
|
@@ -53,6 +53,7 @@ class QVideoScreen(GraphicsLayoutWidget):
|
|
|
53
53
|
self.framerate = framerate
|
|
54
54
|
self._ready = True
|
|
55
55
|
self._pending = None
|
|
56
|
+
self._overlays = []
|
|
56
57
|
self._setupUi()
|
|
57
58
|
self._timer = QtCore.QTimer()
|
|
58
59
|
self._source = None
|
|
@@ -70,6 +71,38 @@ class QVideoScreen(GraphicsLayoutWidget):
|
|
|
70
71
|
self.image = ImageItem(axisOrder='row-major')
|
|
71
72
|
self.view.addItem(self.image)
|
|
72
73
|
|
|
74
|
+
def addOverlay(self, item) -> None:
|
|
75
|
+
'''Add a graphics item to the view and register it for visibility control.
|
|
76
|
+
|
|
77
|
+
Parameters
|
|
78
|
+
----------
|
|
79
|
+
item : pyqtgraph.GraphicsObject
|
|
80
|
+
The overlay item to add.
|
|
81
|
+
'''
|
|
82
|
+
self.view.addItem(item)
|
|
83
|
+
self._overlays.append(item)
|
|
84
|
+
|
|
85
|
+
def removeOverlay(self, item) -> None:
|
|
86
|
+
'''Remove a previously added graphics item from the view.
|
|
87
|
+
|
|
88
|
+
Parameters
|
|
89
|
+
----------
|
|
90
|
+
item : pyqtgraph.GraphicsObject
|
|
91
|
+
The overlay item to remove.
|
|
92
|
+
'''
|
|
93
|
+
self.view.removeItem(item)
|
|
94
|
+
self._overlays.remove(item)
|
|
95
|
+
|
|
96
|
+
@property
|
|
97
|
+
def overlaysVisible(self) -> bool:
|
|
98
|
+
'''Whether any registered overlay is currently visible.'''
|
|
99
|
+
return any(item.isVisible() for item in self._overlays)
|
|
100
|
+
|
|
101
|
+
@overlaysVisible.setter
|
|
102
|
+
def overlaysVisible(self, visible: bool) -> None:
|
|
103
|
+
for item in self._overlays:
|
|
104
|
+
item.setVisible(visible)
|
|
105
|
+
|
|
73
106
|
@property
|
|
74
107
|
def framerate(self) -> int | None:
|
|
75
108
|
'''Maximum display frame rate [fps].
|
|
@@ -210,9 +210,19 @@ class QTrackpyWidget(QtWidgets.QGroupBox):
|
|
|
210
210
|
Parameters
|
|
211
211
|
----------
|
|
212
212
|
screen : QVideoScreen
|
|
213
|
-
The screen
|
|
213
|
+
The screen that will host the overlay.
|
|
214
214
|
'''
|
|
215
|
-
screen.
|
|
215
|
+
screen.addOverlay(self._overlay)
|
|
216
|
+
|
|
217
|
+
def detachFrom(self, screen) -> None:
|
|
218
|
+
'''Remove the overlay graphics item from *screen*.
|
|
219
|
+
|
|
220
|
+
Parameters
|
|
221
|
+
----------
|
|
222
|
+
screen : QVideoScreen
|
|
223
|
+
The screen currently hosting the overlay.
|
|
224
|
+
'''
|
|
225
|
+
screen.removeOverlay(self._overlay)
|
|
216
226
|
|
|
217
227
|
@QtCore.pyqtSlot(np.ndarray)
|
|
218
228
|
def _onNewFrame(self, image: Image) -> None:
|
|
@@ -227,9 +227,19 @@ class QYoloWidget(QtWidgets.QGroupBox):
|
|
|
227
227
|
Parameters
|
|
228
228
|
----------
|
|
229
229
|
screen : QVideoScreen
|
|
230
|
-
The screen
|
|
230
|
+
The screen that will host the overlay.
|
|
231
231
|
'''
|
|
232
|
-
screen.
|
|
232
|
+
screen.addOverlay(self._overlay)
|
|
233
|
+
|
|
234
|
+
def detachFrom(self, screen) -> None:
|
|
235
|
+
'''Remove the overlay graphics item from *screen*.
|
|
236
|
+
|
|
237
|
+
Parameters
|
|
238
|
+
----------
|
|
239
|
+
screen : QVideoScreen
|
|
240
|
+
The screen currently hosting the overlay.
|
|
241
|
+
'''
|
|
242
|
+
screen.removeOverlay(self._overlay)
|
|
233
243
|
|
|
234
244
|
@QtCore.pyqtSlot(np.ndarray)
|
|
235
245
|
def _onNewFrame(self, image: Image) -> None:
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "QVideo"
|
|
7
|
-
version = "3.4.
|
|
7
|
+
version = "3.4.2"
|
|
8
8
|
description = "PyQt-based framework for integrating video cameras into research applications"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "GPL-3.0-or-later" }
|
|
@@ -297,5 +297,87 @@ class TestUpdateShape(unittest.TestCase):
|
|
|
297
297
|
mock_geom.assert_called_once()
|
|
298
298
|
|
|
299
299
|
|
|
300
|
+
class TestOverlays(unittest.TestCase):
|
|
301
|
+
|
|
302
|
+
def _make_mock_item(self, visible=True):
|
|
303
|
+
item = MagicMock()
|
|
304
|
+
item.isVisible.return_value = visible
|
|
305
|
+
return item
|
|
306
|
+
|
|
307
|
+
def test_overlays_empty_on_init(self):
|
|
308
|
+
screen = make_screen()
|
|
309
|
+
self.assertEqual(screen._overlays, [])
|
|
310
|
+
|
|
311
|
+
def test_add_overlay_appends_to_list(self):
|
|
312
|
+
screen = make_screen()
|
|
313
|
+
item = self._make_mock_item()
|
|
314
|
+
with patch.object(screen.view, 'addItem'):
|
|
315
|
+
screen.addOverlay(item)
|
|
316
|
+
self.assertIn(item, screen._overlays)
|
|
317
|
+
|
|
318
|
+
def test_add_overlay_calls_view_add_item(self):
|
|
319
|
+
screen = make_screen()
|
|
320
|
+
item = self._make_mock_item()
|
|
321
|
+
with patch.object(screen.view, 'addItem') as mock_add:
|
|
322
|
+
screen.addOverlay(item)
|
|
323
|
+
mock_add.assert_called_once_with(item)
|
|
324
|
+
|
|
325
|
+
def test_overlays_visible_false_when_none_registered(self):
|
|
326
|
+
screen = make_screen()
|
|
327
|
+
self.assertFalse(screen.overlaysVisible)
|
|
328
|
+
|
|
329
|
+
def test_overlays_visible_true_when_any_visible(self):
|
|
330
|
+
screen = make_screen()
|
|
331
|
+
with patch.object(screen.view, 'addItem'):
|
|
332
|
+
screen.addOverlay(self._make_mock_item(visible=False))
|
|
333
|
+
screen.addOverlay(self._make_mock_item(visible=True))
|
|
334
|
+
self.assertTrue(screen.overlaysVisible)
|
|
335
|
+
|
|
336
|
+
def test_overlays_visible_false_when_all_hidden(self):
|
|
337
|
+
screen = make_screen()
|
|
338
|
+
with patch.object(screen.view, 'addItem'):
|
|
339
|
+
screen.addOverlay(self._make_mock_item(visible=False))
|
|
340
|
+
screen.addOverlay(self._make_mock_item(visible=False))
|
|
341
|
+
self.assertFalse(screen.overlaysVisible)
|
|
342
|
+
|
|
343
|
+
def test_set_overlays_visible_true(self):
|
|
344
|
+
screen = make_screen()
|
|
345
|
+
items = [self._make_mock_item(visible=False) for _ in range(3)]
|
|
346
|
+
with patch.object(screen.view, 'addItem'):
|
|
347
|
+
for item in items:
|
|
348
|
+
screen.addOverlay(item)
|
|
349
|
+
screen.overlaysVisible = True
|
|
350
|
+
for item in items:
|
|
351
|
+
item.setVisible.assert_called_once_with(True)
|
|
352
|
+
|
|
353
|
+
def test_set_overlays_visible_false(self):
|
|
354
|
+
screen = make_screen()
|
|
355
|
+
items = [self._make_mock_item(visible=True) for _ in range(3)]
|
|
356
|
+
with patch.object(screen.view, 'addItem'):
|
|
357
|
+
for item in items:
|
|
358
|
+
screen.addOverlay(item)
|
|
359
|
+
screen.overlaysVisible = False
|
|
360
|
+
for item in items:
|
|
361
|
+
item.setVisible.assert_called_once_with(False)
|
|
362
|
+
|
|
363
|
+
def test_remove_overlay_removes_from_list(self):
|
|
364
|
+
screen = make_screen()
|
|
365
|
+
item = self._make_mock_item()
|
|
366
|
+
with patch.object(screen.view, 'addItem'):
|
|
367
|
+
screen.addOverlay(item)
|
|
368
|
+
with patch.object(screen.view, 'removeItem'):
|
|
369
|
+
screen.removeOverlay(item)
|
|
370
|
+
self.assertNotIn(item, screen._overlays)
|
|
371
|
+
|
|
372
|
+
def test_remove_overlay_calls_view_remove_item(self):
|
|
373
|
+
screen = make_screen()
|
|
374
|
+
item = self._make_mock_item()
|
|
375
|
+
with patch.object(screen.view, 'addItem'):
|
|
376
|
+
screen.addOverlay(item)
|
|
377
|
+
with patch.object(screen.view, 'removeItem') as mock_remove:
|
|
378
|
+
screen.removeOverlay(item)
|
|
379
|
+
mock_remove.assert_called_once_with(item)
|
|
380
|
+
|
|
381
|
+
|
|
300
382
|
if __name__ == '__main__':
|
|
301
383
|
unittest.main()
|
|
@@ -44,6 +44,8 @@ class MockSource(QtCore.QObject):
|
|
|
44
44
|
class MockScreen:
|
|
45
45
|
def __init__(self):
|
|
46
46
|
self.view = MagicMock()
|
|
47
|
+
self.addOverlay = MagicMock()
|
|
48
|
+
self.removeOverlay = MagicMock()
|
|
47
49
|
|
|
48
50
|
|
|
49
51
|
# ---------------------------------------------------------------------------
|
|
@@ -294,7 +296,13 @@ class TestQTrackpyWidgetAttachTo(unittest.TestCase):
|
|
|
294
296
|
w = _make_widget()
|
|
295
297
|
screen = MockScreen()
|
|
296
298
|
w.attachTo(screen)
|
|
297
|
-
screen.
|
|
299
|
+
screen.addOverlay.assert_called_once_with(w._overlay)
|
|
300
|
+
|
|
301
|
+
def test_detach_from_removes_overlay(self):
|
|
302
|
+
w = _make_widget()
|
|
303
|
+
screen = MockScreen()
|
|
304
|
+
w.detachFrom(screen)
|
|
305
|
+
screen.removeOverlay.assert_called_once_with(w._overlay)
|
|
298
306
|
|
|
299
307
|
|
|
300
308
|
class TestQTrackpyWidgetDiameter(unittest.TestCase):
|
|
@@ -61,6 +61,8 @@ class MockSource(QtCore.QObject):
|
|
|
61
61
|
class MockScreen:
|
|
62
62
|
def __init__(self):
|
|
63
63
|
self.view = MagicMock()
|
|
64
|
+
self.addOverlay = MagicMock()
|
|
65
|
+
self.removeOverlay = MagicMock()
|
|
64
66
|
|
|
65
67
|
|
|
66
68
|
def _make_widget(**kwargs):
|
|
@@ -283,7 +285,13 @@ class TestQYoloWidgetAttachTo(unittest.TestCase):
|
|
|
283
285
|
w = _make_widget()
|
|
284
286
|
screen = MockScreen()
|
|
285
287
|
w.attachTo(screen)
|
|
286
|
-
screen.
|
|
288
|
+
screen.addOverlay.assert_called_once_with(w._overlay)
|
|
289
|
+
|
|
290
|
+
def test_detach_from_removes_overlay(self):
|
|
291
|
+
w = _make_widget()
|
|
292
|
+
screen = MockScreen()
|
|
293
|
+
w.detachFrom(screen)
|
|
294
|
+
screen.removeOverlay.assert_called_once_with(w._overlay)
|
|
287
295
|
|
|
288
296
|
|
|
289
297
|
class TestQYoloWidgetConfidence(unittest.TestCase):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|