a
    §ˆcÒ  ã                   @   s0   d Z ddlmZ ddlmZ dd„ Zdd„ ZdS )	z4 Utility functions for handling Qt dates and times. é    )Úis_pyqt)ÚQTimec                 C   s   t r|  ¡ S |  ¡ S dS )a(   Convert a QTime to a Python datetime.time

    This is needed to paper over the differences between PyQt and PySide.

    Parameters
    ----------
    qtime : QTime
        The Qt QTime to convert

    Returns
    -------
    pytime : datetime.time
        The corresponding datetime.time.
    N)r   ZtoPyTimeZtoPython)Zqtime© r   ú^/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/pyface/ui/qt4/util/datetime.pyÚqtime_to_pytime   s    r   c                 C   s   t | j| j| j| jd ƒS )aj   Convert a Python datetime.time to a QTime

    This is a convenience function to construct a qtime from a Python time.
    This loses any :attr:`fold` information in the Python time.

    Parameters
    ----------
    pytime : datetime.time
        The datetime.time to convert

    Returns
    -------
    qtime : QTime
        The corresponding Qt QTime.
    iè  )r   ÚhourÚminuteÚsecondÚmicrosecond)Zpytimer   r   r   Úpytime_to_qtime&   s    ür   N)Ú__doc__Z	pyface.qtr   Zpyface.qt.QtCorer   r   r   r   r   r   r   Ú<module>   s   