Skip to content

Commit 191c596

Browse files
committed
Use a QTimer object instead of QTimer::singleShot.
It seems using the static QTimer::singleShot function repeatedly causes a segfault - see #42 and #43.
1 parent a93f8ca commit 191c596

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pytestqt/_tests/test_wait_signal.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ def test_signal_triggered(qtbot, wait_function, emit_delay, timeout,
5555
the expected results.
5656
"""
5757
signaller = Signaller()
58-
QtCore.QTimer.singleShot(emit_delay, signaller.signal.emit)
58+
timer = QtCore.QTimer()
59+
timer.setSingleShot(True)
60+
timer.timeout.connect(signaller.signal.emit)
61+
timer.start(emit_delay)
5962

6063
# block signal until either signal is emitted or timeout is reached
6164
start_time = time.time()

0 commit comments

Comments
 (0)