Skip to content

Conversation

@jnsebgosselin
Copy link
Member

@jnsebgosselin jnsebgosselin commented Aug 26, 2025

This PR introduces a new utility function, qtwait, to the qthelpers module.

Key features:

  • The qtwait function provides a convenient way to block execution within a Qt event loop until a specified condition becomes true, or a timeout occurs.
  • The function supports checking the condition at a configurable interval, custom timeout durations, and custom error messages on timeout.
  • This is useful for synchronizing asynchronous events in Qt-based applications and for writing robust tests with frameworks such as pytest-qt.

Why?

  • Helps manage asynchronous event synchronization in a clean and reliable way.
  • Facilitates writing and maintaining tests for Qt code that depend on timing or external events.

@jnsebgosselin jnsebgosselin self-assigned this Aug 26, 2025
@jnsebgosselin jnsebgosselin added this to the 0.9.0 milestone Aug 26, 2025
@jnsebgosselin jnsebgosselin merged commit c5dc52d into main Aug 26, 2025
1 check passed
@jnsebgosselin jnsebgosselin deleted the add_qtwait_to_qthelpers branch August 29, 2025 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants