fix: use QWidget video container and disable linked plot auto-range

This commit is contained in:
Honney OC committed 2026-09-13 22:59:50 +00:00
1 parent 10f03ec6d3
commit bbcdc2227b
1 file changed
+15 -9
+15 -9
View File
@@ -219,11 +219,11 @@ class VerifyWindow(QtWidgets.QMainWindow):
lay = QtWidgets.QVBoxLayout(central)
lay.setSpacing(2)
# ── Video display (QVideoWidget) ──
self.video_widget = QtMultimediaWidgets.QVideoWidget()
self.video_widget.setMinimumHeight(300)
self.video_widget.setStyleSheet("background: #000;")
lay.addWidget(self.video_widget, stretch=4)
# ── Video display (QWidget container) ──
self.video_container = QtWidgets.QWidget()
self.video_container.setMinimumHeight(300)
self.video_container.setStyleSheet("background: #000;")
lay.addWidget(self.video_container, stretch=4)
# ── Timeline seek bar ──
time_row = QtWidgets.QHBoxLayout()
@@ -284,6 +284,13 @@ class VerifyWindow(QtWidgets.QMainWindow):
self.p_a.setXLink(self.p_comb)
self.p_b.setXLink(self.p_comb)
# Disable auto-range on all plots to prevent overflow on linked axes
self.p_comb.getViewBox().setAutoVisible(y=False)
self.p_a.getViewBox().setAutoVisible(y=False)
self.p_b.getViewBox().setAutoVisible(y=False)
for p in [self.p_comb, self.p_a, self.p_b]:
p.enableAutoRange(axis='x', enable=False)
p.enableAutoRange(axis='y', enable=False)
lay.addWidget(self.gw_dual, stretch=2)
@@ -343,10 +350,8 @@ class VerifyWindow(QtWidgets.QMainWindow):
"""Set up QMediaPlayer with QVideoWidget for smooth video playback."""
self.media_player = QtMultimedia.QMediaPlayer()
self.video_output = QtMultimediaWidgets.QVideoWidget()
# Reparent video_output into our video_widget container
layout = self.video_widget.layout()
if layout is None:
layout = QtWidgets.QVBoxLayout(self.video_widget)
# Place QVideoWidget inside our container
layout = QtWidgets.QVBoxLayout(self.video_container)
layout.setContentsMargins(0, 0, 0, 0)
layout.addWidget(self.video_output)
@@ -517,6 +522,7 @@ class VerifyWindow(QtWidgets.QMainWindow):
self.curve_b_sep.setVisible(self.chk_b.isChecked())
def _reset_zoom(self):
self.p_comb.enableAutoRange(axis='x', enable=False)
self.p_comb.setXRange(0, self.duration, padding=0)
def closeEvent(self, event):