B
    W•\  ã            	   @   sd  d Z ddlmZ ddlZddlZddlZddlZddlmZ G dd„ de	ƒZ
G dd	„ d	eƒZd
ZdgZddgZdgZdgZeejkZej ed¡ eje  ¡ ZeZeee e e ks¼t‚d ZZdZd Z ZZdejkrðeekrêendZn^dejkreekr
endZn>dejkr0eekr*endZndejkrNeekrJendZeekryddl m!Z" ddl m#Z$ dZ%ejdkræee &¡ d ƒZ'e'edƒk r¼ee$ƒedƒkräe
dƒ‚n(e'edƒk räee$ƒedƒkräe
dƒ‚['W n$ e(k
r   d Zejd
< Y nX eekr¬ynddl)mZ% ddl*mZ$ dZ"dZdZejdkr„ee &¡ d ƒZ'e'edƒk r‚ee$ƒedƒkr‚e
dƒ‚['W n$ e(k
rª   d Zejd
< Y nX eekr”y¤ddl+Z+yXe+ ,dd ¡ e+ ,d!d ¡ e+ ,d"d ¡ e+ ,d#d ¡ e+ ,d$d ¡ e+ ,d%d ¡ e+ ,d&d ¡ W n e-e.fk
r2   Y nX ddl/m!Z" ddl/m#Z$ dZ%dZdZW n$ e(k
r~   d Zejd
< Y nX e" 0d'¡Ze" 0d(¡Zeekrêy,ddl1mZ% ddl2mZ$ dZ"d ZZdZW n e(k
rè   e
d)ƒ‚Y nX eekrere 3d* 4ee¡e5¡ dddddd+œe Z6er`ddl+Z+ye6d, 4e+ 7d¡¡7 Z6W n e-k
r^   Y nX dS )-a’  
**QtPy** is a shim over the various Python Qt bindings. It is used to write
Qt binding indenpendent libraries or applications.

If one of the APIs has already been imported, then it will be used.

Otherwise, the shim will automatically select the first available API (PyQt5,
PySide2, PyQt4 and finally PySide); in that case, you can force the use of one
specific bindings (e.g. if your application is using one specific bindings and
you need to use library that use QtPy) by setting up the ``QT_API`` environment
variable.

PyQt5
=====

For PyQt5, you don't have to set anything as it will be used automatically::

    >>> from qtpy import QtGui, QtWidgets, QtCore
    >>> print(QtWidgets.QWidget)


PySide2
======

Set the QT_API environment variable to 'pyside2' before importing other
packages::

    >>> import os
    >>> os.environ['QT_API'] = 'pyside2'
    >>> from qtpy import QtGui, QtWidgets, QtCore
    >>> print(QtWidgets.QWidget)

PyQt4
=====

Set the ``QT_API`` environment variable to 'pyqt' before importing any python
package::

    >>> import os
    >>> os.environ['QT_API'] = 'pyqt'
    >>> from qtpy import QtGui, QtWidgets, QtCore
    >>> print(QtWidgets.QWidget)

PySide
======

Set the QT_API environment variable to 'pyside' before importing other
packages::

    >>> import os
    >>> os.environ['QT_API'] = 'pyside'
    >>> from qtpy import QtGui, QtWidgets, QtCore
    >>> print(QtWidgets.QWidget)

é    )ÚLooseVersionNé   )Ú__version__c               @   s   e Zd ZdZdS )ÚPythonQtErrorz-Error raise if no bindings could be selected.N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__© r
   r
   ú,lib/python3.7/site-packages/qtpy/__init__.pyr   K   s   r   c               @   s   e Zd ZdZdS )ÚPythonQtWarningz:Warning if some features are not implemented in a binding.N)r   r   r   r	   r
   r
   r
   r   r   P   s   r   ÚQT_APIÚpyqt5ÚpyqtÚpyqt4ÚpysideÚpyside2FTZPyQt5ÚPySide2ZPyQt4ÚPySide)ÚPYQT_VERSION_STR)ÚQT_VERSION_STRÚdarwinz10.10z5.9z\Qt 5.9 or higher only works in macOS 10.10 or higher. Your program will fail in this system.z10.11z5.11z]Qt 5.11 or higher only works in macOS 10.11 or higher. Your program will fail in this system.ZQStringé   ZQVariantZQDateZ	QDateTimeZQTextStreamZQTimeZQUrl)z4.4z4.5z4.6z4.7z4.6zNo Qt bindings could be foundz4Selected binding "{}" could not be found, using "{}")r   r   r   r   r   z (API v{0}))8r	   Zdistutils.versionr   ÚosÚplatformÚsysÚwarningsZ_versionr   ÚRuntimeErrorr   ÚWarningr   r   Z	PYQT5_APIZ	PYQT4_APIZ
PYSIDE_APIZPYSIDE2_APIÚenvironZbinding_specifiedÚ
setdefaultÚlowerZAPIZinitial_apiÚAssertionErrorZis_old_pyqtZ	is_pyqt46ZPYQT5ZPYQT4ZPYSIDEZPYSIDE2ÚmodulesZPyQt5.QtCorer   ZPYQT_VERSIONr   Z
QT_VERSIONZPYSIDE_VERSIONZmac_verZmacos_versionÚImportErrorr   ZPySide2.QtCoreZsipZsetapiÚAttributeErrorÚ
ValueErrorZPyQt4.QtÚ
startswithr   ZPySide.QtCoreÚwarnÚformatÚRuntimeWarningZAPI_NAMEZgetapir
   r
   r
   r   Ú<module>?   sÎ   








