a
    §ˆcL  ã                   @   s   d Z ddlmZ dd„ ZdS )zF Module containing GUI event processing utility for testing purposes.
é    )Ú	ETSConfigc                  C   sL   t j d¡r4ddlm}  |  ¡ }| | jjj¡rHq nddl	m
} | ¡  dS )aã  Process all posted events, and attempt to process new events posted by
    the processed events.

    Cautions:
    - An infinite cascade of events will cause this function to enter an
      infinite loop.
    - There still exists technical difficulties with Qt. On Qt4 + OSX,
      QEventLoop.processEvents may report false saying it had found no events
      to process even though it actually had processed some.
      Consequently the internal loop breaks too early such that there are
      still cascaded events unprocessed. Problems are also observed on
      Qt5 + Appveyor occasionally. At the very least, events that are already
      posted prior to calling this function will be processed.
      See enthought/traitsui#951
    Zqtr   )ÚQtCore)ÚGUIN)r   ZtoolkitÚ
startswithZ	pyface.qtr   Z
QEventLoopZprocessEventsZProcessEventsFlagZ	AllEventsZ
pyface.apir   Zprocess_events)r   Z
event_loopr   © r   úX/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/traitsui/testing/_gui.pyÚprocess_cascade_events   s    r   N)Ú__doc__Ztraits.etsconfig.apir   r   r   r   r   r   Ú<module>   s   