././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1640193425.5293386 QtPy-2.0.0/0000777000000000000000000000000000000000000007301 5ustar00././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558318.0 QtPy-2.0.0/AUTHORS.md0000666000000000000000000000146000000000000010751 0ustar00# Authors ## Original Authors * [pyqode.qt](https://github.com/pyQode/pyqode.qt): Colin Duquesnoy ([@ColinDuquesnoy](https://github.com/ColinDuquesnoy)) * [spyderlib.qt](https://github.com/spyder-ide/spyder/commits/2.3/spyderlib/qt): Pierre Raybaut ([@PierreRaybaut](https://github.com/PierreRaybaut)) * [qt-helpers](https://github.com/glue-viz/qt-helpers): Thomas Robitaille ([@astrofrog](https://www.github.com/astrofrog)) ## Current Maintainers * Daniel Althviz ([@dalthviz](https://github.com/dalthviz)) * Carlos Cordoba ([@ccordoba12](https://github.com/ccordoba12)) * C.A.M. Gerlach ([@CAM-Gerlach](https://github.com/CAM-Gerlach)) * Spyder Development Team ([Spyder-IDE](https://github.com/spyder-ide)) ## Contributors * [The QtPy Contributors](https://github.com/spyder-ide/qtpy/graphs/contributors) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1640192889.0 QtPy-2.0.0/CHANGELOG.md0000666000000000000000000010472200000000000011120 0ustar00# History of changes ## Version 2.0.0 (2021-12-22) ### Issues Closed * [Issue 300](https://github.com/spyder-ide/qtpy/issues/300) - Release QtPy 2.0.0 * [Issue 286](https://github.com/spyder-ide/qtpy/issues/286) - PySide6 DeprecationWarning of exec_ ([PR 287](https://github.com/spyder-ide/qtpy/pull/287) by [@kumattau](https://github.com/kumattau)) * [Issue 274](https://github.com/spyder-ide/qtpy/issues/274) - SignalInstance, Slot, and Property for Qt6 QtCore * [Issue 270](https://github.com/spyder-ide/qtpy/issues/270) - Port packaging from deprecated legacy builder to current PEP 517 standards ([PR 272](https://github.com/spyder-ide/qtpy/pull/272) by [@CAM-Gerlach](https://github.com/CAM-Gerlach)) * [Issue 269](https://github.com/spyder-ide/qtpy/issues/269) - Add CI testing and official support for Python 3.10 ([PR 296](https://github.com/spyder-ide/qtpy/pull/296) by [@CAM-Gerlach](https://github.com/CAM-Gerlach)) * [Issue 267](https://github.com/spyder-ide/qtpy/issues/267) - Coveralls shows 0 coverage despite coverage report and runner output looking fine ([PR 268](https://github.com/spyder-ide/qtpy/pull/268) by [@CAM-Gerlach](https://github.com/CAM-Gerlach)) * [Issue 258](https://github.com/spyder-ide/qtpy/issues/258) - Compatibility with `QtWidgets.QOpenGLWidget` vs `QtOpenGLWidgets.QOpenGLWidget` ([PR 259](https://github.com/spyder-ide/qtpy/pull/259) by [@kumattau](https://github.com/kumattau)) * [Issue 257](https://github.com/spyder-ide/qtpy/issues/257) - Check import behavior for QtCharts module ([PR 260](https://github.com/spyder-ide/qtpy/pull/260) by [@dalthviz](https://github.com/dalthviz)) * [Issue 253](https://github.com/spyder-ide/qtpy/issues/253) - Declare and test support up to Python 3.9 and PyQt6 ([PR 262](https://github.com/spyder-ide/qtpy/pull/262) by [@CAM-Gerlach](https://github.com/CAM-Gerlach)) * [Issue 250](https://github.com/spyder-ide/qtpy/issues/250) - Drop Python 2 support ([PR 251](https://github.com/spyder-ide/qtpy/pull/251) by [@dalthviz](https://github.com/dalthviz)) * [Issue 234](https://github.com/spyder-ide/qtpy/issues/234) - distutils.LooseVersion is being deprecated ([PR 266](https://github.com/spyder-ide/qtpy/pull/266) by [@CAM-Gerlach](https://github.com/CAM-Gerlach)) * [Issue 233](https://github.com/spyder-ide/qtpy/issues/233) - PyQt6 support ([PR 294](https://github.com/spyder-ide/qtpy/pull/294) by [@CAM-Gerlach](https://github.com/CAM-Gerlach)) * [Issue 232](https://github.com/spyder-ide/qtpy/issues/232) - Add support for `QtTextToSpeech` * [Issue 197](https://github.com/spyder-ide/qtpy/issues/197) - QtTest imports are incomplete ([PR 290](https://github.com/spyder-ide/qtpy/pull/290) by [@kumattau](https://github.com/kumattau)) * [Issue 70](https://github.com/spyder-ide/qtpy/issues/70) - Add QHeaderView.setSectionResize for Qt4 layer * [Issue 66](https://github.com/spyder-ide/qtpy/issues/66) - Add documentation for how to run tests ([PR 277](https://github.com/spyder-ide/qtpy/pull/277) by [@CAM-Gerlach](https://github.com/CAM-Gerlach)) * [Issue 62](https://github.com/spyder-ide/qtpy/issues/62) - Add to the readme the importance of qtpy when migrating an application ([PR 301](https://github.com/spyder-ide/qtpy/pull/301) by [@dalthviz](https://github.com/dalthviz)) In this release 17 issues were closed. ### Pull Requests Merged * [PR 303](https://github.com/spyder-ide/qtpy/pull/303) - PR: Fix QFileSystemModel for PyQt6, by [@almarklein](https://github.com/almarklein) * [PR 301](https://github.com/spyder-ide/qtpy/pull/301) - PR: Update README.md adding a line for QtPy usefulness when migrating between Qt bindings/versions, by [@dalthviz](https://github.com/dalthviz) ([62](https://github.com/spyder-ide/qtpy/issues/62)) * [PR 299](https://github.com/spyder-ide/qtpy/pull/299) - PR: 'width' needed for PyQt6, by [@stonebig](https://github.com/stonebig) * [PR 298](https://github.com/spyder-ide/qtpy/pull/298) - PR: Make QLibraryInfo.location work for PyQt6, by [@stonebig](https://github.com/stonebig) * [PR 296](https://github.com/spyder-ide/qtpy/pull/296) - PR: Add support for Python 3.10 on CIs and packaging, by [@CAM-Gerlach](https://github.com/CAM-Gerlach) ([269](https://github.com/spyder-ide/qtpy/issues/269)) * [PR 294](https://github.com/spyder-ide/qtpy/pull/294) - PR: Add minimum version check for Qt6 >=6.2.0, by [@CAM-Gerlach](https://github.com/CAM-Gerlach) ([233](https://github.com/spyder-ide/qtpy/issues/233)) * [PR 292](https://github.com/spyder-ide/qtpy/pull/292) - PR: Define Qt/binding versions at top level, fix warnings if versions not found, and fix test dir on CIs, by [@CAM-Gerlach](https://github.com/CAM-Gerlach) * [PR 291](https://github.com/spyder-ide/qtpy/pull/291) - PR: Add QtTextToSpeech Module, by [@kumattau](https://github.com/kumattau) * [PR 290](https://github.com/spyder-ide/qtpy/pull/290) - PR: Import all classes in QtTest module., by [@kumattau](https://github.com/kumattau) ([197](https://github.com/spyder-ide/qtpy/issues/197)) * [PR 287](https://github.com/spyder-ide/qtpy/pull/287) - PR: Map exec_ to their non-deprecated alternatives, by [@kumattau](https://github.com/kumattau) ([286](https://github.com/spyder-ide/qtpy/issues/286)) * [PR 282](https://github.com/spyder-ide/qtpy/pull/282) - PR: Update README sponsors section, by [@dalthviz](https://github.com/dalthviz) * [PR 279](https://github.com/spyder-ide/qtpy/pull/279) - PR: Add back legacy PYQT4 and PYSIDE package-level constants for compat, by [@CAM-Gerlach](https://github.com/CAM-Gerlach) * [PR 278](https://github.com/spyder-ide/qtpy/pull/278) - PR: Update gitignore, gitattributes, license, authors and security policy, by [@CAM-Gerlach](https://github.com/CAM-Gerlach) * [PR 277](https://github.com/spyder-ide/qtpy/pull/277) - PR: Add Contributing Guide based on other Spyder projects, by [@CAM-Gerlach](https://github.com/CAM-Gerlach) ([66](https://github.com/spyder-ide/qtpy/issues/66)) * [PR 276](https://github.com/spyder-ide/qtpy/pull/276) - PR: Fix regression in FORCE_QT_API behavior from merging PySide6 support, by [@tlambert03](https://github.com/tlambert03) * [PR 273](https://github.com/spyder-ide/qtpy/pull/273) - PR: Avoid future deprecations and decrease general technical debt, by [@CAM-Gerlach](https://github.com/CAM-Gerlach) * [PR 272](https://github.com/spyder-ide/qtpy/pull/272) - PR: Upgrade packaging to avoid legacy/deprecated behavior and follow PEP 517, by [@CAM-Gerlach](https://github.com/CAM-Gerlach) ([270](https://github.com/spyder-ide/qtpy/issues/270)) * [PR 271](https://github.com/spyder-ide/qtpy/pull/271) - PR: Unscoped enums access for PyQt6 and other missing PyQt6 compatibility changes, by [@dalthviz](https://github.com/dalthviz) * [PR 268](https://github.com/spyder-ide/qtpy/pull/268) - PR: Fix and improve Coveralls reporting, by [@CAM-Gerlach](https://github.com/CAM-Gerlach) ([267](https://github.com/spyder-ide/qtpy/issues/267)) * [PR 266](https://github.com/spyder-ide/qtpy/pull/266) - PR: Use modern packaging instead of deprecated distutils for version parse, by [@CAM-Gerlach](https://github.com/CAM-Gerlach) ([235](https://github.com/spyder-ide/qtpy/issues/235), [234](https://github.com/spyder-ide/qtpy/issues/234)) * [PR 264](https://github.com/spyder-ide/qtpy/pull/264) - PR: [PyQt6] Add missing tabStopWidth/setTabStopWidth same as PySide6, by [@kumattau](https://github.com/kumattau) * [PR 263](https://github.com/spyder-ide/qtpy/pull/263) - PR: Remove accidentally-duplicated lines of code in QtCore, by [@kumattau](https://github.com/kumattau) * [PR 262](https://github.com/spyder-ide/qtpy/pull/262) - PR: Unify and cleanup CI infra, improve robustness and test Python 3.9 and PyQt6, by [@CAM-Gerlach](https://github.com/CAM-Gerlach) ([253](https://github.com/spyder-ide/qtpy/issues/253)) * [PR 260](https://github.com/spyder-ide/qtpy/pull/260) - PR: Reorganize `QtCharts` module import and add missing skip validation for `QtNetworkAuth` test with `PyQt6`, by [@dalthviz](https://github.com/dalthviz) ([257](https://github.com/spyder-ide/qtpy/issues/257)) * [PR 259](https://github.com/spyder-ide/qtpy/pull/259) - PR: [PyQt6] Add exec_/print_, and add QOpenGLWidget/QShortcut to QtWidgets, by [@kumattau](https://github.com/kumattau) ([258](https://github.com/spyder-ide/qtpy/issues/258)) * [PR 256](https://github.com/spyder-ide/qtpy/pull/256) - PR: Fix fallback API, by [@benoit-pierre](https://github.com/benoit-pierre) * [PR 255](https://github.com/spyder-ide/qtpy/pull/255) - PR: Add additional Qt modules and more support and tests for PyQt6/PySide6, by [@jschueller](https://github.com/jschueller) * [PR 254](https://github.com/spyder-ide/qtpy/pull/254) - PR: Add QShortcut class to QtWidgets module, by [@kumattau](https://github.com/kumattau) * [PR 252](https://github.com/spyder-ide/qtpy/pull/252) - PR: Remove Qt4 support, by [@jschueller](https://github.com/jschueller) * [PR 251](https://github.com/spyder-ide/qtpy/pull/251) - PR: Drop Python 2, by [@dalthviz](https://github.com/dalthviz) ([250](https://github.com/spyder-ide/qtpy/issues/250)) * [PR 225](https://github.com/spyder-ide/qtpy/pull/225) - PR: Add support for PySide6, by [@jschueller](https://github.com/jschueller) In this release 31 pull requests were closed. ---- ## Version 1.11.3 (2021/12/03) ### Issues Closed * [Issue 284](https://github.com/spyder-ide/qtpy/issues/284) - Warn if using a deprecated and/or unsupported Qt 5 version ([PR 289](https://github.com/spyder-ide/qtpy/pull/289) by [@CAM-Gerlach](https://github.com/CAM-Gerlach)) * [Issue 280](https://github.com/spyder-ide/qtpy/issues/280) - import qtpy raise except when only have PyQt4 ([PR 281](https://github.com/spyder-ide/qtpy/pull/281) by [@dalthviz](https://github.com/dalthviz)) * [Issue 261](https://github.com/spyder-ide/qtpy/issues/261) - Add a deprecation warning for unsupported `Qt` versions and bindings (at least `Qt4`: `PyQt4` and `PySide`) ([PR 283](https://github.com/spyder-ide/qtpy/pull/283) by [@CAM-Gerlach](https://github.com/CAM-Gerlach)) In this release 3 issues were closed. ### Pull Requests Merged * [PR 293](https://github.com/spyder-ide/qtpy/pull/293) - PR: Update RELEASE.md for 1.x version, by [@dalthviz](https://github.com/dalthviz) * [PR 289](https://github.com/spyder-ide/qtpy/pull/289) - PR: Add warning for deprecated/EoL Qt5 & PyQt5/PySide2 versions to fix #284, by [@CAM-Gerlach](https://github.com/CAM-Gerlach) ([284](https://github.com/spyder-ide/qtpy/issues/284)) * [PR 285](https://github.com/spyder-ide/qtpy/pull/285) - PR: Import Callable and MutableMapping in py3compat for Python 2 compat, by [@davvid](https://github.com/davvid) * [PR 283](https://github.com/spyder-ide/qtpy/pull/283) - PR: Add a warning for developers still running legacy Qt4-based APIs, by [@CAM-Gerlach](https://github.com/CAM-Gerlach) ([261](https://github.com/spyder-ide/qtpy/issues/261)) * [PR 281](https://github.com/spyder-ide/qtpy/pull/281) - PR: Catch `PythonQtError` when trying to do alias for `QtDataVisualization` and dev version correction, by [@dalthviz](https://github.com/dalthviz) ([280](https://github.com/spyder-ide/qtpy/issues/280)) In this release 5 pull requests were closed. ---- ## Version 1.11.2 (2021-09-23) ### Issues Closed * [Issue 248](https://github.com/spyder-ide/qtpy/issues/248) - Missing QtDataVisualization ([PR 249](https://github.com/spyder-ide/qtpy/pull/249) by [@dalthviz](https://github.com/dalthviz)) In this release 1 issue was closed. ### Pull Requests Merged * [PR 249](https://github.com/spyder-ide/qtpy/pull/249) - PR: Add handling for QtDataVisualization when missing, by [@dalthviz](https://github.com/dalthviz) ([248](https://github.com/spyder-ide/qtpy/issues/248)) In this release 1 pull request was closed. ---- ## Version 1.11.1 (2021-09-13) ### Issues Closed * [Issue 245](https://github.com/spyder-ide/qtpy/issues/245) - Importing `qtpy.uic` raises an exception ([PR 246](https://github.com/spyder-ide/qtpy/pull/246) by [@dalthviz](https://github.com/dalthviz)) In this release 1 issue was closed. ### Pull Requests Merged * [PR 246](https://github.com/spyder-ide/qtpy/pull/246) - PR: Wrap `pysideuic` and `pyside2uic` imports since they could be unavailable, by [@dalthviz](https://github.com/dalthviz) ([245](https://github.com/spyder-ide/qtpy/issues/245)) * [PR 244](https://github.com/spyder-ide/qtpy/pull/244) - qtpy/tests/test_uic.py: skip if pyside2uic not installed, by [@AndrewAmmerlaan](https://github.com/AndrewAmmerlaan) In this release 2 pull requests were closed. ---- ## Version 1.11.0 (2021-09-03) ### Issues Closed * [Issue 201](https://github.com/spyder-ide/qtpy/issues/201) - Missing QWebEngineProfile from QtWebEngineWidgets ([PR 242](https://github.com/spyder-ide/qtpy/pull/242) by [@dalthviz](https://github.com/dalthviz)) In this release 1 issue was closed. ### Pull Requests Merged * [PR 243](https://github.com/spyder-ide/qtpy/pull/243) - PR: `QtDataVisualization` backward compatibility handling on Windows, by [@dalthviz](https://github.com/dalthviz) * [PR 242](https://github.com/spyder-ide/qtpy/pull/242) - PR: Add `QtWebEngineWidgets.QWebEngineProfile` for PyQt5 and PySide2, by [@dalthviz](https://github.com/dalthviz) ([201](https://github.com/spyder-ide/qtpy/issues/201)) * [PR 228](https://github.com/spyder-ide/qtpy/pull/228) - PR: Rename QtDatavisualization to use uppercase v, by [@antlarr](https://github.com/antlarr) * [PR 219](https://github.com/spyder-ide/qtpy/pull/219) - PR: Add support for QStyleOptionFrameV3 from PyQt4, by [@PierreRaybaut](https://github.com/PierreRaybaut) * [PR 218](https://github.com/spyder-ide/qtpy/pull/218) - PR: Add QtWinExtras module, by [@phil65](https://github.com/phil65) * [PR 209](https://github.com/spyder-ide/qtpy/pull/209) - PR: Add support for QtSerialPort add-on, by [@Stanowczo](https://github.com/Stanowczo) * [PR 205](https://github.com/spyder-ide/qtpy/pull/205) - PR: Add support for the QtPositioning module, by [@avalentino](https://github.com/avalentino) * [PR 202](https://github.com/spyder-ide/qtpy/pull/202) - PR: Add loadUiType implementation for PySide2, by [@avalentino](https://github.com/avalentino) In this release 8 pull requests were closed. ---- ## Version 1.10.0 (2021-08-17) ### Issues Closed * [Issue 238](https://github.com/spyder-ide/qtpy/issues/238) - PySide2 and Python3.9: xml.etree.ElementTree.Element' object has no attribute 'getchildren * [Issue 222](https://github.com/spyder-ide/qtpy/issues/222) - Imported modules are not respected * [Issue 220](https://github.com/spyder-ide/qtpy/issues/220) - MNT: Stop using ci-helpers in appveyor.yml * [Issue 206](https://github.com/spyder-ide/qtpy/issues/206) - DeprecationWarning for getchildren ([PR 224](https://github.com/spyder-ide/qtpy/pull/224) by [@irrcombat](https://github.com/irrcombat)) * [Issue 198](https://github.com/spyder-ide/qtpy/issues/198) - PyQt4-sip==4.19.13 not supported In this release 5 issues were closed. ### Pull Requests Merged * [PR 241](https://github.com/spyder-ide/qtpy/pull/241) - PR: Update setup.py classifiers, by [@dalthviz](https://github.com/dalthviz) * [PR 230](https://github.com/spyder-ide/qtpy/pull/230) - PR: Fix imported modules logic if 'FORCE_QT_API' is empty, by [@hiaselhans](https://github.com/hiaselhans) * [PR 224](https://github.com/spyder-ide/qtpy/pull/224) - PR: Support python 3.9 `custom_widgets` iteration, by [@irrcombat](https://github.com/irrcombat) ([206](https://github.com/spyder-ide/qtpy/issues/206)) * [PR 215](https://github.com/spyder-ide/qtpy/pull/215) - PR: Slight typo fix, by [@altendky](https://github.com/altendky) * [PR 214](https://github.com/spyder-ide/qtpy/pull/214) - PR: Handle QtCore.SignalInstance/pyqtBoundSignal, by [@altendky](https://github.com/altendky) * [PR 208](https://github.com/spyder-ide/qtpy/pull/208) - PR: Move CI to Github Actions, by [@goanpeca](https://github.com/goanpeca) * [PR 204](https://github.com/spyder-ide/qtpy/pull/204) - PR: Add Python 3.9 compatibility for `collections.abc` module, by [@tirkarthi](https://github.com/tirkarthi) * [PR 199](https://github.com/spyder-ide/qtpy/pull/199) - PR: Add support to PyQt4-sip 4.19.13, by [@milanmatic](https://github.com/milanmatic) In this release 8 pull requests were closed. ---- ## Version 1.9.0 (2019-07-23) ### New features * Add the FORCE_QT_API environment variable to keep using the Qt bindings selected with the QT_API variable and avoid switching to the currently imported bindings. This allows to have applications that import PySide and PyQt bindings at the same time (which is possible if both bindings are compiled for the same Qt version). ### Issues Closed * [Issue 195](https://github.com/spyder-ide/qtpy/issues/195) - Errors in the Qt3D modules with PySide2 5.12.4+ and Python 2 ([PR 196](https://github.com/spyder-ide/qtpy/pull/196)) * [Issue 192](https://github.com/spyder-ide/qtpy/issues/192) - Binding Selection Logic ([PR 194](https://github.com/spyder-ide/qtpy/pull/194)) In this release 2 issues were closed. ### Pull Requests Merged * [PR 196](https://github.com/spyder-ide/qtpy/pull/196) - PR: Don't load Qt3D modules for buggy versions of PySide2 ([195](https://github.com/spyder-ide/qtpy/issues/195)) * [PR 194](https://github.com/spyder-ide/qtpy/pull/194) - PR: Add FORCE_QT_API environment variable ([192](https://github.com/spyder-ide/qtpy/issues/192)) In this release 2 pull requests were closed. ---- ## Version 1.8.0 (2019-06-12) ### New features * Add support for several Qt 3D modules. ### Issues Closed * [Issue 172](https://github.com/spyder-ide/qtpy/issues/172) - Support for Qt3D ([PR 191](https://github.com/spyder-ide/qtpy/pull/191)) In this release 1 issue was closed. ### Pull Requests Merged * [PR 191](https://github.com/spyder-ide/qtpy/pull/191) - PR: Add Qt 3D bindings ([172](https://github.com/spyder-ide/qtpy/issues/172)) In this release 1 pull request was closed. ---- ## Version 1.7.1 (2019-05-05) ### Pull Requests Merged * [PR 189](https://github.com/spyder-ide/qtpy/pull/189) - PR: Skip testing PyQt4 and PySide in Python 3.5 * [PR 188](https://github.com/spyder-ide/qtpy/pull/188) - PR: Trivial maintenance tweaks * [PR 187](https://github.com/spyder-ide/qtpy/pull/187) - PR: Avoid deprecated "from collections import MutableMapping" In this release 3 pull requests were closed. ---- ## Version 1.7.0 (2019-03-16) ### New features * Add support for QtCharts. ### Pull Requests Merged * [PR 186](https://github.com/spyder-ide/qtpy/pull/186) - PR: Generate PyPI long description from README.md * [PR 183](https://github.com/spyder-ide/qtpy/pull/183) - PR: Add QtCharts module support * [PR 182](https://github.com/spyder-ide/qtpy/pull/182) - PR: Prevent warnings for equivalent APIs * [PR 176](https://github.com/spyder-ide/qtpy/pull/176) - PR: Don't warn about bindings change if user did not specify a binding In this release 4 pull requests were closed. ---- ## Version 1.6 (2019-01-12) ### New features * Add support for QtQuickWidgets. ### Issues Closed * [Issue 178](https://github.com/spyder-ide/qtpy/issues/178) - Error when import QtCore.__version__ in PySide2 ([PR 180](https://github.com/spyder-ide/qtpy/pull/180)) In this release 1 issue was closed. ### Pull Requests Merged * [PR 181](https://github.com/spyder-ide/qtpy/pull/181) - PR: Restore QWebEngineSettings for PySide2 * [PR 180](https://github.com/spyder-ide/qtpy/pull/180) - PR: Add QtCore.__version__ for PySide2 ([178](https://github.com/spyder-ide/qtpy/issues/178)) * [PR 179](https://github.com/spyder-ide/qtpy/pull/179) - PR: Add QtQuickWidgets In this release 3 pull requests were closed. ---- ## Version 1.5.2 (2018-10-20) ### Pull Requests Merged * [PR 175](https://github.com/spyder-ide/qtpy/pull/175) - PR: Fix tests * [PR 174](https://github.com/spyder-ide/qtpy/pull/174) - PR: Add support for PySide2.QtOpenGL In this release 2 pull requests were closed. ---- ## Version 1.5.1 (2018-09-18) ### Issues Closed * [Issue 170](https://github.com/spyder-ide/qtpy/issues/170) - Can't catch PythonQtError ([PR 173](https://github.com/spyder-ide/qtpy/pull/173)) In this release 1 issue was closed. ### Pull Requests Merged * [PR 173](https://github.com/spyder-ide/qtpy/pull/173) - PR: Make PythonQtError inherit from RuntimeError to be easily catchable ([170](https://github.com/spyder-ide/qtpy/issues/170)) In this release 1 pull request was closed. ---- ## Version 1.5 (2018-08-25) ### New features * Add support for QtLocation, QtMultimediaWidgets, QtQml, QtQuick, QtWebChannel, QtWebSockets and QtXmlPatterns. * Raise an error when trying to use the wrong combination of macOS and Qt versions. ### Issues Closed * [Issue 155](https://github.com/spyder-ide/qtpy/issues/155) - Add warnings for Qt 5.9 in macOS 10.9 and Qt 5.11 and macOS 10.11 ([PR 168](https://github.com/spyder-ide/qtpy/pull/168)) * [Issue 153](https://github.com/spyder-ide/qtpy/issues/153) - Shim PyQt5 ToPyDateTime for compatibility with PySide2 ([PR 169](https://github.com/spyder-ide/qtpy/pull/169)) * [Issue 123](https://github.com/spyder-ide/qtpy/issues/123) - Wrap QWebChannel module ([PR 157](https://github.com/spyder-ide/qtpy/pull/157)) In this release 3 issues were closed. ### Pull Requests Merged * [PR 169](https://github.com/spyder-ide/qtpy/pull/169) - PR: Shim PyQt5 QDateTime.toPyDateTime to QDateTime.toPython for compatibility with PySide2 ([153](https://github.com/spyder-ide/qtpy/issues/153)) * [PR 168](https://github.com/spyder-ide/qtpy/pull/168) - PR: Raise error when trying to use the wrong combination of macOS and Qt versions ([155](https://github.com/spyder-ide/qtpy/issues/155)) * [PR 167](https://github.com/spyder-ide/qtpy/pull/167) - PR: Migrate to CircleCI 2.0 * [PR 163](https://github.com/spyder-ide/qtpy/pull/163) - PR: Add QtLocation * [PR 162](https://github.com/spyder-ide/qtpy/pull/162) - PR: Update readme to remove funding appeal, harmonize with other readmes and minor fixes * [PR 161](https://github.com/spyder-ide/qtpy/pull/161) - PR: Fix pyside2 wheels install * [PR 157](https://github.com/spyder-ide/qtpy/pull/157) - PR: Add more Qt modules ([123](https://github.com/spyder-ide/qtpy/issues/123)) In this release 7 pull requests were closed. ---- ## Version 1.4.2 (2018-05-06) ### Issues Closed * [Issue 150](https://github.com/spyder-ide/qtpy/issues/150) - PySide2-5.11 alpha2 compatibility ([PR 151](https://github.com/spyder-ide/qtpy/pull/151)) * [Issue 144](https://github.com/spyder-ide/qtpy/issues/144) - ValueError: API 'QString' has already been set to version 1 at line 141 in __init__.py file. ([PR 152](https://github.com/spyder-ide/qtpy/pull/152)) In this release 2 issues were closed. ### Pull Requests Merged * [PR 152](https://github.com/spyder-ide/qtpy/pull/152) - PR: Catch ValueError when trying to set sip API ([144](https://github.com/spyder-ide/qtpy/issues/144)) * [PR 151](https://github.com/spyder-ide/qtpy/pull/151) - PR: Add a preventive change for PySide-5.11a2 ([150](https://github.com/spyder-ide/qtpy/issues/150)) * [PR 149](https://github.com/spyder-ide/qtpy/pull/149) - PR: Use Qt official wheels to run tests for PySide2 * [PR 148](https://github.com/spyder-ide/qtpy/pull/148) - PR: Remove internal conda recipe In this release 4 pull requests were closed. ---- ## Version 1.4.1 (2018-04-28) ### New features * Show a warning when QT_API is changed automatically by qtpy. ### Issues Closed * [Issue 145](https://github.com/spyder-ide/qtpy/issues/145) - Raise a warning if QT_API value is changed automatically ([PR 146](https://github.com/spyder-ide/qtpy/pull/146)) * [Issue 142](https://github.com/spyder-ide/qtpy/issues/142) - On OSX qtpy applications are forcing discrete graphics ([PR 143](https://github.com/spyder-ide/qtpy/pull/143)) In this release 2 issues were closed. ### Pull Requests Merged * [PR 147](https://github.com/spyder-ide/qtpy/pull/147) - PR: Add better compatibility with PySide2 * [PR 146](https://github.com/spyder-ide/qtpy/pull/146) - PR: Add a warning if API is changed automatically ([145](https://github.com/spyder-ide/qtpy/issues/145)) * [PR 143](https://github.com/spyder-ide/qtpy/pull/143) - PR: Avoid using PyQt5.Qt, which imports unneeded stuff and forces discrete GPU on OSX ([142](https://github.com/spyder-ide/qtpy/issues/142)) In this release 3 pull requests were closed. ---- ## Version 1.4 (2018-03-11) ### New features * Add support for QtHelp and QtSql * Use already imported bindings ### Issues Closed * [Issue 138](https://github.com/spyder-ide/qtpy/issues/138) - If one binding has already been imported, then qtpy should just use it ([PR 139](https://github.com/spyder-ide/qtpy/pull/139)) * [Issue 135](https://github.com/spyder-ide/qtpy/issues/135) - Add Wrapper for QtSql [feature request] ([PR 136](https://github.com/spyder-ide/qtpy/pull/136)) * [Issue 131](https://github.com/spyder-ide/qtpy/issues/131) - Methods missing from QStandardPaths when QT_API=pyqt4 * [Issue 127](https://github.com/spyder-ide/qtpy/issues/127) - Add Wrapper for QtHelp [feature request] ([PR 128](https://github.com/spyder-ide/qtpy/pull/128)) In this release 4 issues were closed. ### Pull Requests Merged * [PR 140](https://github.com/spyder-ide/qtpy/pull/140) - PR: Pin PyQt5 to 5.9.2 in CircleCI because 5.10 is generating segfaults * [PR 139](https://github.com/spyder-ide/qtpy/pull/139) - PR: If a Qt binding is already imported, then use it. ([138](https://github.com/spyder-ide/qtpy/issues/138)) * [PR 136](https://github.com/spyder-ide/qtpy/pull/136) - PR: Add QtSql wrapper (incl. test) ([135](https://github.com/spyder-ide/qtpy/issues/135)) * [PR 132](https://github.com/spyder-ide/qtpy/pull/132) - PR: Changes to QDesktop split * [PR 128](https://github.com/spyder-ide/qtpy/pull/128) - PR: Add QtHelp Wrapper ([127](https://github.com/spyder-ide/qtpy/issues/127)) In this release 5 pull requests were closed. ---- ## Version 1.3.1 (2017-08-21) ### Bugs fixed **Issues** * [Issue 129](https://github.com/spyder-ide/qtpy/issues/129) - Spurious cache files in PyPI tarball * [Issue 119](https://github.com/spyder-ide/qtpy/issues/119) - Importing qtpy should not raise exceptions In this release 2 issues were closed **Pull requests** * [PR 130](https://github.com/spyder-ide/qtpy/pull/130) - PR: No cache files included in the release tarball * [PR 126](https://github.com/spyder-ide/qtpy/pull/126) - PR: Remove Quantified Code badge because the service doesn't exist anymore * [PR 121](https://github.com/spyder-ide/qtpy/pull/121) - PR: Warn if QHeaderView deprecated methods are used In this release 3 pull requests were merged ---- ## Version 1.3 (2017-08-12) ### New features * Add support for PySide2 and PyQt 4.6 ### Bugs fixed **Issues** * [Issue 124](https://github.com/spyder-ide/qtpy/issues/124) - Typo in readme title * [Issue 111](https://github.com/spyder-ide/qtpy/issues/111) - Update Readme for 1.3 release * [Issue 110](https://github.com/spyder-ide/qtpy/issues/110) - Add tests for untested modules * [Issue 101](https://github.com/spyder-ide/qtpy/issues/101) - Missing: QtOpenGL Module * [Issue 89](https://github.com/spyder-ide/qtpy/issues/89) - QDesktopServices split into QDesktopServices and QStandardPaths * [Issue 57](https://github.com/spyder-ide/qtpy/issues/57) - qInstallMessageHandler <-> qInstallMsgHandler * [Issue 15](https://github.com/spyder-ide/qtpy/issues/15) - Feature Request: PySide2 support In this release 7 issues were closed **Pull requests** * [PR 125](https://github.com/spyder-ide/qtpy/pull/125) - PR: Fix typo in Readme. * [PR 117](https://github.com/spyder-ide/qtpy/pull/117) - PR: Add compatibility for the rename of qInstallMsgHandler to qInstallMessageHandler * [PR 115](https://github.com/spyder-ide/qtpy/pull/115) - PR: Update Readme to reflect that we actually use the PySide2 layout * [PR 114](https://github.com/spyder-ide/qtpy/pull/114) - PR: Update Readme to mention that we now support PySide2. * [PR 113](https://github.com/spyder-ide/qtpy/pull/113) - PR: Add tests for Qtdesigner, QtNetwork, QtPrintSupport, QtSvg and QtTest. * [PR 112](https://github.com/spyder-ide/qtpy/pull/112) - PR: Follow QStandardPaths location in Qt5 for PyQt4/PySide * [PR 109](https://github.com/spyder-ide/qtpy/pull/109) - PR: Add a coveragerc file * [PR 106](https://github.com/spyder-ide/qtpy/pull/106) - PR: Add support for PyQt 4.6 * [PR 102](https://github.com/spyder-ide/qtpy/pull/102) - PR: Add a new QtOpenGL module * [PR 84](https://github.com/spyder-ide/qtpy/pull/84) - PR: Add PySide2 support In this release 10 pull requests were merged ---- ## Version 1.2.1 (2017/01/21) ### Bugs fixed **Pull requests** * [PR 98](https://github.com/spyder-ide/qtpy/pull/98) - PR: Don't use Travis to test macOS because it slows down the entire spyder-ide organization * [PR 97](https://github.com/spyder-ide/qtpy/pull/97) - PR: Update Appveyor badge in Readme because of moving to an org account * [PR 94](https://github.com/spyder-ide/qtpy/pull/94) - PR: Include test suite in sdist In this release 3 pull requests were merged ---- ## Version 1.2 (2017/01/08) ### New features * Add support for QtMultimedia * Use relative imports so its vendored more easily ### Bugs fixed **Issues** * [Issue 83](https://github.com/spyder-ide/qtpy/issues/83) - Include core doc files in PyPi releases * [Issue 78](https://github.com/spyder-ide/qtpy/issues/78) - Request for a new bugfix release * [Issue 75](https://github.com/spyder-ide/qtpy/issues/75) - Missing copyright headers * [Issue 67](https://github.com/spyder-ide/qtpy/issues/67) - uic.loadUiType is missing * [Issue 64](https://github.com/spyder-ide/qtpy/issues/64) - QHeaderView.setSectionResizeMode * [Issue 49](https://github.com/spyder-ide/qtpy/issues/49) - QtMultimedia support In this release 6 issues were closed **Pull requests** * [PR 93](https://github.com/spyder-ide/qtpy/pull/93) - Restore uic full namespace for PyQt5 and PyQt4 * [PR 92](https://github.com/spyder-ide/qtpy/pull/92) - Add missing copyright header in _patch/qheaderview.py * [PR 91](https://github.com/spyder-ide/qtpy/pull/91) - Use star imports in QtSvg again instead of direct ones (reverts PR #55) * [PR 88](https://github.com/spyder-ide/qtpy/pull/88) - PR: Add manifest * [PR 74](https://github.com/spyder-ide/qtpy/pull/74) - Move QStringListModel to QtCore * [PR 71](https://github.com/spyder-ide/qtpy/pull/71) - PR: Use relative imports so its vendored more easily * [PR 65](https://github.com/spyder-ide/qtpy/pull/65) - Introduce renamed methods of QHeaderView in PyQt4 and PySide * [PR 59](https://github.com/spyder-ide/qtpy/pull/59) - Don't install qtpy as a conda package in CircleCI * [PR 58](https://github.com/spyder-ide/qtpy/pull/58) - Remove reference to how qtpy is pronounced in README * [PR 55](https://github.com/spyder-ide/qtpy/pull/55) - PR: Add explicit imports to QtSvg module * [PR 50](https://github.com/spyder-ide/qtpy/pull/50) - Add support for QtMultimedia In this release 11 pull requests were merged ---- ## Version 1.1.2 (2016-08-08) ### Bugfixes **Pull requests** * [PR 54](https://github.com/spyder-ide/qtpy/pull/54) - PR: Fix/ci * [PR 53](https://github.com/spyder-ide/qtpy/pull/53) - PR: Move tests to module so they can be run when installed * [PR 52](https://github.com/spyder-ide/qtpy/pull/52) - PR: Update readme * [PR 51](https://github.com/spyder-ide/qtpy/pull/51) - PR: Add circle ci * [PR 47](https://github.com/spyder-ide/qtpy/pull/47) - Remove PyQt variant symbols from QtCore * [PR 46](https://github.com/spyder-ide/qtpy/pull/46) - del QtWidgets.QStyleOptionViewItemV4 * [PR 45](https://github.com/spyder-ide/qtpy/pull/45) - Allow QT_API values that are not completely in lower case In this release 7 pull requests were merged ---- ## Version 1.1.1 (2016-07-01) ### Bugfixes **Pull requests** * [PR 44](https://github.com/spyder-ide/qtpy/pull/44) - Make qtpy to set the QT_API environment variable In this release 1 pull requests were merged --- ## Version 1.1 (2016-06-30) ### New features * Make importing `qtpy` thread-safe * Add a uic module to make loadUI work for PySide * Add QtTest support for PySide ### Bugfixes **Issues** * [Issue 42](https://github.com/spyder-ide/qtpy/issues/42) - Wrong old PyQt4 version check * [Issue 21](https://github.com/spyder-ide/qtpy/issues/21) - Patch QComboBox with PySide? * [Issue 16](https://github.com/spyder-ide/qtpy/issues/16) - Add loadUI functionality In this release 3 issues were closed **Pull requests** * [PR 43](https://github.com/spyder-ide/qtpy/pull/43) - Don't check PyQt version with qtpy's version for old PyQt versions * [PR 41](https://github.com/spyder-ide/qtpy/pull/41) - `qtpy.__version__` should be QtPy version, not Qt version * [PR 40](https://github.com/spyder-ide/qtpy/pull/40) - Mention qt-helpers in README.md, and add myself to AUTHORS.md * [PR 39](https://github.com/spyder-ide/qtpy/pull/39) - Fix remaining segmentation fault that occurs with the patched QComboBox in PySide * [PR 38](https://github.com/spyder-ide/qtpy/pull/38) - QtTest for PySide * [PR 37](https://github.com/spyder-ide/qtpy/pull/37) - Automatically load custom widget classes when using PySide * [PR 33](https://github.com/spyder-ide/qtpy/pull/33) - Ignore case for QT_API env variable in qtpy submodules * [PR 32](https://github.com/spyder-ide/qtpy/pull/32) - Remove QItemSelectionModel from QtWidgets for PyQt4 and PySide * [PR 31](https://github.com/spyder-ide/qtpy/pull/31) - Add compatibility for QItemSelectionModel * [PR 29](https://github.com/spyder-ide/qtpy/pull/29) - Use ci-helpers (from Astropy) for CI and enable AppVeyor * [PR 28](https://github.com/spyder-ide/qtpy/pull/28) - Make tests.py into proper unit test, and add Qt version info to pytest header * [PR 27](https://github.com/spyder-ide/qtpy/pull/27) - Make sure loadUi is available * [PR 25](https://github.com/spyder-ide/qtpy/pull/25) - Add patched version of QComboBox In this release 13 pull requests were merged --- ## Version 1.0.2 (2016-06-02) ### New features * Add a WEBENGINE constant to QtWebEngineWidgets, which is True if Qt 5 comes with the WebEngine module and False otherwise. ### Bugfixes **Pull requests** * [PR 24](https://github.com/spyder-ide/qtpy/pull/24) - Add constant to QtWebEngineWidgets to see if we are using WebEngine or WebKit * [PR 23](https://github.com/spyder-ide/qtpy/pull/23) - Fix "Prefer `format()` over string interpolation operator" issue In this release 2 pull requests were merged --- ## Version 1.0.1 (2016-04-10) ### Bugfixes **Issues** * [Issue 18](https://github.com/spyder-ide/qtpy/issues/18) - QIntValidator left in QtWidgets, should be in QtGui In this release 1 issues were closed **Pull requests** * [PR 19](https://github.com/spyder-ide/qtpy/pull/19) - Import QIntValidator in QtGui and remove it from QtWidgets In this release 1 pull requests were merged ---- ## Version 1.0 (2016-03-22) * Add QtWebEngineWidgets module for Qt 5.6. This module replaces the previous QtWebKit one. * Import the right objects in QtGui, QtWidgets and QtCore * Add a QtPrintSupport module --- ## Version 0.1.3 (2015-12-30) * Add tests and continuous integration ## Version 0.1.2 (2015-03-01) * First release ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558318.0 QtPy-2.0.0/LICENSE.txt0000666000000000000000000000213100000000000011121 0ustar00The MIT License (MIT) Copyright (c) 2011- QtPy contributors and others (see AUTHORS.md) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558318.0 QtPy-2.0.0/MANIFEST.in0000666000000000000000000000021100000000000011031 0ustar00include AUTHORS.md include CHANGELOG.md include LICENSE.txt include README.md include SECURITY.md recursive-include qtpy/tests *.py *.ui ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1640193425.5293386 QtPy-2.0.0/PKG-INFO0000666000000000000000000001320500000000000010377 0ustar00Metadata-Version: 2.1 Name: QtPy Version: 2.0.0 Summary: Provides an abstraction layer on top of the various Qt bindings (PyQt5/6 and PySide2/6). Home-page: https://github.com/spyder-ide/qtpy Author: Colin Duquesnoy and the Spyder Development Team Author-email: spyder.python@gmail.com Maintainer: Spyder Development Team and QtPy Contributors Maintainer-email: spyder.python@gmail.com License: MIT Project-URL: Github, https://github.com/spyder-ide/qtpy Project-URL: Bug Tracker, https://github.com/spyder-ide/qtpy/issues Project-URL: Parent Project, https://www.spyder-ide.org/ Keywords: qt PyQt5 PyQt6 PySide2 PySide6 Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Environment :: MacOS X Classifier: Environment :: Win32 (MS Windows) Classifier: Environment :: X11 Applications :: Qt Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3 :: Only Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Topic :: Software Development :: Libraries Classifier: Topic :: Software Development :: User Interfaces Classifier: Topic :: Software Development :: Widget Sets Requires-Python: >=3.6 Description-Content-Type: text/markdown Provides-Extra: test License-File: AUTHORS.md License-File: LICENSE.txt # QtPy: Abstraction layer for PyQt5/PyQt6/PySide2/PySide6 [![license](https://img.shields.io/pypi/l/qtpy.svg)](./LICENSE) [![pypi version](https://img.shields.io/pypi/v/qtpy.svg)](https://pypi.org/project/QtPy/) [![conda version](https://img.shields.io/conda/vn/conda-forge/qtpy.svg)](https://www.anaconda.com/download/) [![download count](https://img.shields.io/conda/dn/conda-forge/qtpy.svg)](https://www.anaconda.com/download/) [![OpenCollective Backers](https://opencollective.com/spyder/backers/badge.svg?color=blue)](#backers) [![Join the chat at https://gitter.im/spyder-ide/public](https://badges.gitter.im/spyder-ide/spyder.svg)](https://gitter.im/spyder-ide/public)
[![PyPI status](https://img.shields.io/pypi/status/qtpy.svg)](https://github.com/spyder-ide/qtpy) [![Github build status](https://github.com/spyder-ide/qtpy/workflows/Tests/badge.svg)](https://github.com/spyder-ide/qtpy/actions) [![Coverage Status](https://coveralls.io/repos/github/spyder-ide/qtpy/badge.svg?branch=master)](https://coveralls.io/github/spyder-ide/qtpy?branch=master) *Copyright © 2009–2021 The Spyder Development Team* ## Description **QtPy** is a small abstraction layer that lets you write applications using a single API call to either PyQt or PySide. It provides support for PyQt5, PyQt6, PySide6, PySide2 using the Qt5 layout (where the QtGui module has been split into QtGui and QtWidgets). Basically, you can write your code as if you were using PyQt or PySide directly, but import Qt modules from `qtpy` instead of `PyQt5`, `PyQt6`, `PySide2`, or `PySide6`. Accordingly, when porting code between different Qt bindings (PyQt vs PySide) or Qt versions (Qt5 vs Qt6), QtPy makes this much more painless, and allows you to easily and incrementally transition between them. QtPy handles incompatibilities and differences between bindings or Qt versions for you while keeping your project running, so you can focus more on your own code and less on keeping track of supporting every Qt version and binding. Furthermore, when you do want to upgrade or support new bindings, it allows you to update your project module by module rather than all at once. You can check out examples of this approach in projects using QtPy, like [git-cola](https://github.com/git-cola/git-cola/issues/232). ### Attribution and acknowledgments This project is based on the [pyqode.qt](https://github.com/pyQode/pyqode.qt) project and the [spyderlib.qt](https://github.com/spyder-ide/spyder/tree/2.3/spyderlib/qt) module from the [Spyder](https://github.com/spyder-ide/spyder) project, and also includes contributions adapted from [qt-helpers](https://github.com/glue-viz/qt-helpers), developed as part of the [glue](http://glueviz.org) project. Unlike `pyqode.qt` this is not a namespace package, so it is not tied to a particular project or namespace. ### License This project is released under the MIT license. ### Requirements You need PyQt5, PyQt6, PySide2 or PySide6 installed in your system to make use of QtPy. If several of these packages are found, PyQt5 is used by default unless you set the `QT_API` environment variable. `QT_API` can take the following values: * `pyqt5` (to use PyQt5). * `pyqt6` (to use PyQt6). * `pyside6` (to use PySide6) * `pyside2` (to use PySide2) ### Installation ```bash pip install qtpy ``` or ```bash conda install qtpy ``` ## Contributing Everyone is welcome to contribute! ## Sponsors QtPy is funded thanks to the generous support of [![Quansight](https://user-images.githubusercontent.com/16781833/142477716-53152d43-99a0-470c-a70b-c04bbfa97dd4.png)](https://www.quansight.com/)[![Numfocus](https://i2.wp.com/numfocus.org/wp-content/uploads/2017/07/NumFocus_LRG.png?fit=320%2C148&ssl=1)](https://numfocus.org/) and the donations we have received from our users around the world through [Open Collective](https://opencollective.com/spyder/): [![Sponsors](https://opencollective.com/spyder/sponsors.svg)](https://opencollective.com/spyder#support) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1640193425.1487758 QtPy-2.0.0/QtPy.egg-info/0000777000000000000000000000000000000000000011670 5ustar00././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1640193424.0 QtPy-2.0.0/QtPy.egg-info/PKG-INFO0000666000000000000000000001320500000000000012766 0ustar00Metadata-Version: 2.1 Name: QtPy Version: 2.0.0 Summary: Provides an abstraction layer on top of the various Qt bindings (PyQt5/6 and PySide2/6). Home-page: https://github.com/spyder-ide/qtpy Author: Colin Duquesnoy and the Spyder Development Team Author-email: spyder.python@gmail.com Maintainer: Spyder Development Team and QtPy Contributors Maintainer-email: spyder.python@gmail.com License: MIT Project-URL: Github, https://github.com/spyder-ide/qtpy Project-URL: Bug Tracker, https://github.com/spyder-ide/qtpy/issues Project-URL: Parent Project, https://www.spyder-ide.org/ Keywords: qt PyQt5 PyQt6 PySide2 PySide6 Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Environment :: MacOS X Classifier: Environment :: Win32 (MS Windows) Classifier: Environment :: X11 Applications :: Qt Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3 :: Only Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Topic :: Software Development :: Libraries Classifier: Topic :: Software Development :: User Interfaces Classifier: Topic :: Software Development :: Widget Sets Requires-Python: >=3.6 Description-Content-Type: text/markdown Provides-Extra: test License-File: AUTHORS.md License-File: LICENSE.txt # QtPy: Abstraction layer for PyQt5/PyQt6/PySide2/PySide6 [![license](https://img.shields.io/pypi/l/qtpy.svg)](./LICENSE) [![pypi version](https://img.shields.io/pypi/v/qtpy.svg)](https://pypi.org/project/QtPy/) [![conda version](https://img.shields.io/conda/vn/conda-forge/qtpy.svg)](https://www.anaconda.com/download/) [![download count](https://img.shields.io/conda/dn/conda-forge/qtpy.svg)](https://www.anaconda.com/download/) [![OpenCollective Backers](https://opencollective.com/spyder/backers/badge.svg?color=blue)](#backers) [![Join the chat at https://gitter.im/spyder-ide/public](https://badges.gitter.im/spyder-ide/spyder.svg)](https://gitter.im/spyder-ide/public)
[![PyPI status](https://img.shields.io/pypi/status/qtpy.svg)](https://github.com/spyder-ide/qtpy) [![Github build status](https://github.com/spyder-ide/qtpy/workflows/Tests/badge.svg)](https://github.com/spyder-ide/qtpy/actions) [![Coverage Status](https://coveralls.io/repos/github/spyder-ide/qtpy/badge.svg?branch=master)](https://coveralls.io/github/spyder-ide/qtpy?branch=master) *Copyright © 2009–2021 The Spyder Development Team* ## Description **QtPy** is a small abstraction layer that lets you write applications using a single API call to either PyQt or PySide. It provides support for PyQt5, PyQt6, PySide6, PySide2 using the Qt5 layout (where the QtGui module has been split into QtGui and QtWidgets). Basically, you can write your code as if you were using PyQt or PySide directly, but import Qt modules from `qtpy` instead of `PyQt5`, `PyQt6`, `PySide2`, or `PySide6`. Accordingly, when porting code between different Qt bindings (PyQt vs PySide) or Qt versions (Qt5 vs Qt6), QtPy makes this much more painless, and allows you to easily and incrementally transition between them. QtPy handles incompatibilities and differences between bindings or Qt versions for you while keeping your project running, so you can focus more on your own code and less on keeping track of supporting every Qt version and binding. Furthermore, when you do want to upgrade or support new bindings, it allows you to update your project module by module rather than all at once. You can check out examples of this approach in projects using QtPy, like [git-cola](https://github.com/git-cola/git-cola/issues/232). ### Attribution and acknowledgments This project is based on the [pyqode.qt](https://github.com/pyQode/pyqode.qt) project and the [spyderlib.qt](https://github.com/spyder-ide/spyder/tree/2.3/spyderlib/qt) module from the [Spyder](https://github.com/spyder-ide/spyder) project, and also includes contributions adapted from [qt-helpers](https://github.com/glue-viz/qt-helpers), developed as part of the [glue](http://glueviz.org) project. Unlike `pyqode.qt` this is not a namespace package, so it is not tied to a particular project or namespace. ### License This project is released under the MIT license. ### Requirements You need PyQt5, PyQt6, PySide2 or PySide6 installed in your system to make use of QtPy. If several of these packages are found, PyQt5 is used by default unless you set the `QT_API` environment variable. `QT_API` can take the following values: * `pyqt5` (to use PyQt5). * `pyqt6` (to use PyQt6). * `pyside6` (to use PySide6) * `pyside2` (to use PySide2) ### Installation ```bash pip install qtpy ``` or ```bash conda install qtpy ``` ## Contributing Everyone is welcome to contribute! ## Sponsors QtPy is funded thanks to the generous support of [![Quansight](https://user-images.githubusercontent.com/16781833/142477716-53152d43-99a0-470c-a70b-c04bbfa97dd4.png)](https://www.quansight.com/)[![Numfocus](https://i2.wp.com/numfocus.org/wp-content/uploads/2017/07/NumFocus_LRG.png?fit=320%2C148&ssl=1)](https://numfocus.org/) and the donations we have received from our users around the world through [Open Collective](https://opencollective.com/spyder/): [![Sponsors](https://opencollective.com/spyder/sponsors.svg)](https://opencollective.com/spyder#support) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1640193424.0 QtPy-2.0.0/QtPy.egg-info/SOURCES.txt0000666000000000000000000000521000000000000013552 0ustar00AUTHORS.md CHANGELOG.md LICENSE.txt MANIFEST.in README.md SECURITY.md pyproject.toml setup.cfg setup.py QtPy.egg-info/PKG-INFO QtPy.egg-info/SOURCES.txt QtPy.egg-info/dependency_links.txt QtPy.egg-info/not-zip-safe QtPy.egg-info/requires.txt QtPy.egg-info/top_level.txt qtpy/Qt3DAnimation.py qtpy/Qt3DCore.py qtpy/Qt3DExtras.py qtpy/Qt3DInput.py qtpy/Qt3DLogic.py qtpy/Qt3DRender.py qtpy/QtCharts.py qtpy/QtCore.py qtpy/QtDBus.py qtpy/QtDataVisualization.py qtpy/QtDesigner.py qtpy/QtGui.py qtpy/QtHelp.py qtpy/QtLocation.py qtpy/QtMultimedia.py qtpy/QtMultimediaWidgets.py qtpy/QtNetwork.py qtpy/QtNetworkAuth.py qtpy/QtOpenGL.py qtpy/QtOpenGLWidgets.py qtpy/QtPositioning.py qtpy/QtPrintSupport.py qtpy/QtQml.py qtpy/QtQuick.py qtpy/QtQuickWidgets.py qtpy/QtRemoteObjects.py qtpy/QtSensors.py qtpy/QtSerialPort.py qtpy/QtSql.py qtpy/QtSvg.py qtpy/QtTest.py qtpy/QtTextToSpeech.py qtpy/QtWebChannel.py qtpy/QtWebEngine.py qtpy/QtWebEngineCore.py qtpy/QtWebEngineQuick.py qtpy/QtWebEngineWidgets.py qtpy/QtWebSockets.py qtpy/QtWidgets.py qtpy/QtWinExtras.py qtpy/QtXml.py qtpy/QtXmlPatterns.py qtpy/__init__.py qtpy/compat.py qtpy/enums_compat.py qtpy/sip.py qtpy/uic.py qtpy/_patch/__init__.py qtpy/_patch/qheaderview.py qtpy/tests/__init__.py qtpy/tests/conftest.py qtpy/tests/test.ui qtpy/tests/test_custom.ui qtpy/tests/test_macos_checks.py qtpy/tests/test_main.py qtpy/tests/test_patch_qheaderview.py qtpy/tests/test_qdesktopservice_split.py qtpy/tests/test_qt3danimation.py qtpy/tests/test_qt3dcore.py qtpy/tests/test_qt3dextras.py qtpy/tests/test_qt3dinput.py qtpy/tests/test_qt3dlogic.py qtpy/tests/test_qt3drender.py qtpy/tests/test_qtcharts.py qtpy/tests/test_qtcore.py qtpy/tests/test_qtdatavisualization.py qtpy/tests/test_qtdbus.py qtpy/tests/test_qtdesigner.py qtpy/tests/test_qtgui.py qtpy/tests/test_qthelp.py qtpy/tests/test_qtlocation.py qtpy/tests/test_qtmultimedia.py qtpy/tests/test_qtmultimediawidgets.py qtpy/tests/test_qtnetwork.py qtpy/tests/test_qtnetworkauth.py qtpy/tests/test_qtopenglwidgets.py qtpy/tests/test_qtpositioning.py qtpy/tests/test_qtprintsupport.py qtpy/tests/test_qtqml.py qtpy/tests/test_qtquick.py qtpy/tests/test_qtquickwidgets.py qtpy/tests/test_qtremoteobjects.py qtpy/tests/test_qtsensors.py qtpy/tests/test_qtserialport.py qtpy/tests/test_qtsql.py qtpy/tests/test_qtsvg.py qtpy/tests/test_qttest.py qtpy/tests/test_qttexttospeech.py qtpy/tests/test_qtwebchannel.py qtpy/tests/test_qtwebenginecore.py qtpy/tests/test_qtwebenginequick.py qtpy/tests/test_qtwebenginewidgets.py qtpy/tests/test_qtwebsockets.py qtpy/tests/test_qtwidgets.py qtpy/tests/test_qtwinextras.py qtpy/tests/test_qtxml.py qtpy/tests/test_qtxmlpatterns.py qtpy/tests/test_uic.py././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1640193424.0 QtPy-2.0.0/QtPy.egg-info/dependency_links.txt0000666000000000000000000000000100000000000015736 0ustar00 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1640193424.0 QtPy-2.0.0/QtPy.egg-info/not-zip-safe0000666000000000000000000000000200000000000014117 0ustar00 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1640193424.0 QtPy-2.0.0/QtPy.egg-info/requires.txt0000666000000000000000000000007000000000000014265 0ustar00packaging [test] pytest<7.0,>=6.0.0 pytest-cov>=2.11.0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1640193424.0 QtPy-2.0.0/QtPy.egg-info/top_level.txt0000666000000000000000000000000500000000000014415 0ustar00qtpy ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1640192728.0 QtPy-2.0.0/README.md0000666000000000000000000000764300000000000010572 0ustar00# QtPy: Abstraction layer for PyQt5/PyQt6/PySide2/PySide6 [![license](https://img.shields.io/pypi/l/qtpy.svg)](./LICENSE) [![pypi version](https://img.shields.io/pypi/v/qtpy.svg)](https://pypi.org/project/QtPy/) [![conda version](https://img.shields.io/conda/vn/conda-forge/qtpy.svg)](https://www.anaconda.com/download/) [![download count](https://img.shields.io/conda/dn/conda-forge/qtpy.svg)](https://www.anaconda.com/download/) [![OpenCollective Backers](https://opencollective.com/spyder/backers/badge.svg?color=blue)](#backers) [![Join the chat at https://gitter.im/spyder-ide/public](https://badges.gitter.im/spyder-ide/spyder.svg)](https://gitter.im/spyder-ide/public)
[![PyPI status](https://img.shields.io/pypi/status/qtpy.svg)](https://github.com/spyder-ide/qtpy) [![Github build status](https://github.com/spyder-ide/qtpy/workflows/Tests/badge.svg)](https://github.com/spyder-ide/qtpy/actions) [![Coverage Status](https://coveralls.io/repos/github/spyder-ide/qtpy/badge.svg?branch=master)](https://coveralls.io/github/spyder-ide/qtpy?branch=master) *Copyright © 2009–2021 The Spyder Development Team* ## Description **QtPy** is a small abstraction layer that lets you write applications using a single API call to either PyQt or PySide. It provides support for PyQt5, PyQt6, PySide6, PySide2 using the Qt5 layout (where the QtGui module has been split into QtGui and QtWidgets). Basically, you can write your code as if you were using PyQt or PySide directly, but import Qt modules from `qtpy` instead of `PyQt5`, `PyQt6`, `PySide2`, or `PySide6`. Accordingly, when porting code between different Qt bindings (PyQt vs PySide) or Qt versions (Qt5 vs Qt6), QtPy makes this much more painless, and allows you to easily and incrementally transition between them. QtPy handles incompatibilities and differences between bindings or Qt versions for you while keeping your project running, so you can focus more on your own code and less on keeping track of supporting every Qt version and binding. Furthermore, when you do want to upgrade or support new bindings, it allows you to update your project module by module rather than all at once. You can check out examples of this approach in projects using QtPy, like [git-cola](https://github.com/git-cola/git-cola/issues/232). ### Attribution and acknowledgments This project is based on the [pyqode.qt](https://github.com/pyQode/pyqode.qt) project and the [spyderlib.qt](https://github.com/spyder-ide/spyder/tree/2.3/spyderlib/qt) module from the [Spyder](https://github.com/spyder-ide/spyder) project, and also includes contributions adapted from [qt-helpers](https://github.com/glue-viz/qt-helpers), developed as part of the [glue](http://glueviz.org) project. Unlike `pyqode.qt` this is not a namespace package, so it is not tied to a particular project or namespace. ### License This project is released under the MIT license. ### Requirements You need PyQt5, PyQt6, PySide2 or PySide6 installed in your system to make use of QtPy. If several of these packages are found, PyQt5 is used by default unless you set the `QT_API` environment variable. `QT_API` can take the following values: * `pyqt5` (to use PyQt5). * `pyqt6` (to use PyQt6). * `pyside6` (to use PySide6) * `pyside2` (to use PySide2) ### Installation ```bash pip install qtpy ``` or ```bash conda install qtpy ``` ## Contributing Everyone is welcome to contribute! ## Sponsors QtPy is funded thanks to the generous support of [![Quansight](https://user-images.githubusercontent.com/16781833/142477716-53152d43-99a0-470c-a70b-c04bbfa97dd4.png)](https://www.quansight.com/)[![Numfocus](https://i2.wp.com/numfocus.org/wp-content/uploads/2017/07/NumFocus_LRG.png?fit=320%2C148&ssl=1)](https://numfocus.org/) and the donations we have received from our users around the world through [Open Collective](https://opencollective.com/spyder/): [![Sponsors](https://opencollective.com/spyder/sponsors.svg)](https://opencollective.com/spyder#support) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558318.0 QtPy-2.0.0/SECURITY.md0000666000000000000000000000245700000000000011102 0ustar00# Security Policy ## Supported Versions The following summarizes the support status of recent QtPy versions. | Version | Supported | | -------- | ------------------ | | 2.0.x | :heavy_check_mark: | | 1.11.x | :heavy_check_mark: | | <=1.10.x | :x: | ## Reporting a Vulnerability If you believe you've discovered a security vulnerability in Sub Manager, please contact the project maintainers, the Spyder development team, at spyder.python@gmail.com . Please be sure to carefully document the vulnerability, including a summary, describing the impacts, identifying the line(s) of code affected, stating the conditions under which it is exploitable and including a minimal reproducible test case. Further information and advice or patches on how to mitigate it is always welcome. You can usually expect to hear back within 1 week, at which point we'll inform you of our evaluation of the vulnerability and what steps we plan to take, and will reach out if we need further clarification from you. Once its patched, we'll send a followup email letting you know, and are happy to update you on its status should you further inquire. While this is a volunteer project and we don't have financial compensation to offer, we can certainly publicly thank you for your help if you would like. Thanks! ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/pyproject.toml0000666000000000000000000000015700000000000012220 0ustar00[build-system] requires = [ "setuptools>=42", "wheel", ] build-backend = "setuptools.build_meta" ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1640193425.2742703 QtPy-2.0.0/qtpy/0000777000000000000000000000000000000000000010276 5ustar00././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/Qt3DAnimation.py0000666000000000000000000000143200000000000013263 0ustar00# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides Qt3DAnimation classes and functions.""" # Local imports from . import PYQT5, PYSIDE2, PythonQtError, PYSIDE_VERSION if PYQT5: from PyQt5.Qt3DAnimation import * elif PYSIDE2: # https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026 import PySide2.Qt3DAnimation as __temp import inspect for __name in inspect.getmembers(__temp.Qt3DAnimation): globals()[__name[0]] = __name[1] else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/Qt3DCore.py0000666000000000000000000000156100000000000012237 0ustar00# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides Qt3DCore classes and functions.""" # Local imports from . import PYQT5, PYQT6, PYSIDE2, PYSIDE6, PythonQtError if PYQT5: from PyQt5.Qt3DCore import * elif PYQT6: from PyQt6.Qt3DCore import * elif PYSIDE6: from PySide6.Qt3DCore.Qt3DCore import * elif PYSIDE2: # https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026 import PySide2.Qt3DCore as __temp import inspect for __name in inspect.getmembers(__temp.Qt3DCore): globals()[__name[0]] = __name[1] else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/Qt3DExtras.py0000666000000000000000000000157700000000000012624 0ustar00# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides Qt3DExtras classes and functions.""" # Local imports from . import PYQT5, PYQT6, PYSIDE2, PYSIDE6, PythonQtError if PYQT5: from PyQt5.Qt3DExtras import * elif PYQT6: from PyQt6.Qt3DExtras import * elif PYSIDE6: from PySide6.Qt3DExtras.Qt3DExtras import * elif PYSIDE2: # https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026 import PySide2.Qt3DExtras as __temp import inspect for __name in inspect.getmembers(__temp.Qt3DExtras): globals()[__name[0]] = __name[1] else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/Qt3DInput.py0000666000000000000000000000157000000000000012446 0ustar00# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides Qt3DInput classes and functions.""" # Local imports from . import PYQT5, PYQT6, PYSIDE2, PYSIDE6, PythonQtError if PYQT5: from PyQt5.Qt3DInput import * elif PYQT6: from PyQt6.Qt3DInput import * elif PYSIDE6: from PySide6.Qt3DInput.Qt3DInput import * elif PYSIDE2: # https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026 import PySide2.Qt3DInput as __temp import inspect for __name in inspect.getmembers(__temp.Qt3DInput): globals()[__name[0]] = __name[1] else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/Qt3DLogic.py0000666000000000000000000000157000000000000012404 0ustar00# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides Qt3DLogic classes and functions.""" # Local imports from . import PYQT5, PYQT6, PYSIDE2, PYSIDE6, PythonQtError if PYQT5: from PyQt5.Qt3DLogic import * elif PYQT6: from PyQt6.Qt3DLogic import * elif PYSIDE6: from PySide6.Qt3DLogic.Qt3DLogic import * elif PYSIDE2: # https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026 import PySide2.Qt3DLogic as __temp import inspect for __name in inspect.getmembers(__temp.Qt3DLogic): globals()[__name[0]] = __name[1] else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/Qt3DRender.py0000666000000000000000000000157700000000000012575 0ustar00# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides Qt3DRender classes and functions.""" # Local imports from . import PYQT5, PYQT6, PYSIDE2, PYSIDE6, PythonQtError if PYQT5: from PyQt5.Qt3DRender import * elif PYSIDE6: from PySide6.Qt3DRender.Qt3DRender import * elif PYQT6: from PyQt6.Qt3DRender import * elif PYSIDE2: # https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026 import PySide2.Qt3DRender as __temp import inspect for __name in inspect.getmembers(__temp.Qt3DRender): globals()[__name[0]] = __name[1] else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtCharts.py0000666000000000000000000000242700000000000012406 0ustar00# ----------------------------------------------------------------------------- # Copyright © 2019- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtChart classes and functions.""" # Local imports from . import PYQT5, PYQT6, PYSIDE2, PYSIDE6, PythonQtError if PYQT5: try: from PyQt5.QtChart import * except ImportError as error: raise PythonQtError( 'The QtChart module was not found. ' 'It needs to be installed separately for PyQt5.' ) from error elif PYQT6: try: from PyQt6.QtCharts import * except ImportError as error: raise PythonQtError( 'The QtCharts module was not found. ' 'It needs to be installed separately for PyQt6.' ) from error elif PYSIDE6: from PySide6.QtCharts import * elif PYSIDE2: # https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026 import PySide2.QtCharts as __temp import inspect for __name in inspect.getmembers(__temp.QtCharts): globals()[__name[0]] = __name[1] else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1640192728.0 QtPy-2.0.0/qtpy/QtCore.py0000666000000000000000000000477000000000000012055 0ustar00# # Copyright © 2014-2015 Colin Duquesnoy # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) """ Provides QtCore classes and functions. """ from . import PYQT6, PYQT5, PYSIDE2, PYSIDE6, PythonQtError if PYQT6: from PyQt6 import QtCore from PyQt6.QtCore import * from PyQt6.QtCore import pyqtSignal as Signal from PyQt6.QtCore import pyqtBoundSignal as SignalInstance from PyQt6.QtCore import pyqtSlot as Slot from PyQt6.QtCore import pyqtProperty as Property from PyQt6.QtCore import QT_VERSION_STR as __version__ # For issue #153 from PyQt6.QtCore import QDateTime QDateTime.toPython = QDateTime.toPyDateTime # Map missing methods QCoreApplication.exec_ = QCoreApplication.exec QEventLoop.exec_ = QEventLoop.exec QThread.exec_ = QThread.exec QLibraryInfo.location = QLibraryInfo.path # Those are imported from `import *` del pyqtSignal, pyqtBoundSignal, pyqtSlot, pyqtProperty, QT_VERSION_STR # Allow unscoped access for enums inside the QtCore module from .enums_compat import promote_enums promote_enums(QtCore) del QtCore elif PYQT5: from PyQt5.QtCore import * from PyQt5.QtCore import pyqtSignal as Signal from PyQt5.QtCore import pyqtBoundSignal as SignalInstance from PyQt5.QtCore import pyqtSlot as Slot from PyQt5.QtCore import pyqtProperty as Property from PyQt5.QtCore import QT_VERSION_STR as __version__ # For issue #153 from PyQt5.QtCore import QDateTime QDateTime.toPython = QDateTime.toPyDateTime # Those are imported from `import *` del pyqtSignal, pyqtBoundSignal, pyqtSlot, pyqtProperty, QT_VERSION_STR elif PYSIDE6: from PySide6.QtCore import * import PySide6.QtCore __version__ = PySide6.QtCore.__version__ # obsolete in qt6 Qt.BackgroundColorRole = Qt.BackgroundRole Qt.TextColorRole = Qt.ForegroundRole Qt.MidButton = Qt.MiddleButton # Map DeprecationWarning methods QCoreApplication.exec_ = QCoreApplication.exec QEventLoop.exec_ = QEventLoop.exec QThread.exec_ = QThread.exec QTextStreamManipulator.exec_ = QTextStreamManipulator.exec elif PYSIDE2: from PySide2.QtCore import * try: # may be limited to PySide-5.11a1 only from PySide2.QtGui import QStringListModel except Exception: pass import PySide2.QtCore __version__ = PySide2.QtCore.__version__ else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtDBus.py0000666000000000000000000000116100000000000012011 0ustar00# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtDBus classes and functions.""" # Local imports from . import PYQT5, PYQT6, PYSIDE2, PYSIDE6, PythonQtError if PYQT5: from PyQt5.QtDBus import * elif PYQT6: from PyQt6.QtDBus import * elif PYSIDE6: from PySide6.QtDBus import * else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtDataVisualization.py0000666000000000000000000000165200000000000014614 0ustar00# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtDataVisualization classes and functions.""" # Local imports from . import PYQT5, PYQT6, PYSIDE2, PYSIDE6, PythonQtError if PYQT6: from PyQt6.QtDataVisualization import * elif PYQT5: from PyQt5.QtDataVisualization import * elif PYSIDE6: from PySide6.QtDataVisualization import * elif PYSIDE2: # https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026 import PySide2.QtDataVisualization as __temp import inspect for __name in inspect.getmembers(__temp.QtDataVisualization): globals()[__name[0]] = __name[1] else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtDesigner.py0000666000000000000000000000071000000000000012713 0ustar00# # Copyright © 2014-2015 Colin Duquesnoy # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) """ Provides QtDesigner classes and functions. """ from . import PYQT5, PYQT6, PYSIDE6, PythonQtError if PYQT5: from PyQt5.QtDesigner import * elif PYQT6: from PyQt6.QtDesigner import * elif PYSIDE6: from PySide6.QtDesigner import * else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1640192728.0 QtPy-2.0.0/qtpy/QtGui.py0000666000000000000000000000207000000000000011700 0ustar00# # Copyright © 2014-2015 Colin Duquesnoy # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) """ Provides QtGui classes and functions. """ from . import PYQT6, PYQT5, PYSIDE2, PYSIDE6, PythonQtError if PYQT6: from PyQt6 import QtGui from PyQt6.QtGui import * QFontMetrics.width = QFontMetrics.horizontalAdvance # Map missing/renamed methods QDrag.exec_ = QDrag.exec QGuiApplication.exec_ = QGuiApplication.exec QTextDocument.print_ = QTextDocument.print # Allow unscoped access for enums inside the QtGui module from .enums_compat import promote_enums promote_enums(QtGui) del QtGui elif PYQT5: from PyQt5.QtGui import * elif PYSIDE2: from PySide2.QtGui import * elif PYSIDE6: from PySide6.QtGui import * QFontMetrics.width = QFontMetrics.horizontalAdvance # Map DeprecationWarning methods QDrag.exec_ = QDrag.exec QGuiApplication.exec_ = QGuiApplication.exec else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtHelp.py0000666000000000000000000000076000000000000012050 0ustar00# # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) """QtHelp Wrapper.""" import warnings from . import PYQT5, PYQT6, PYSIDE6, PYSIDE2, PythonQtError if PYQT5: from PyQt5.QtHelp import * elif PYQT6: from PyQt6.QtHelp import * elif PYSIDE6: from PySide6.QtHelp import * elif PYSIDE2: from PySide2.QtHelp import * else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtLocation.py0000666000000000000000000000110000000000000012715 0ustar00# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtLocation classes and functions.""" # Local imports from . import PYQT5, PYSIDE2, PythonQtError if PYQT5: from PyQt5.QtLocation import * elif PYSIDE2: from PySide2.QtLocation import * else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtMultimedia.py0000666000000000000000000000056200000000000013252 0ustar00import warnings from . import PYQT5, PYQT6 from . import PYSIDE2 from . import PYSIDE6 if PYQT5: from PyQt5.QtMultimedia import * elif PYQT6: from PyQt6.QtMultimedia import * elif PYSIDE6: from PySide6.QtMultimedia import * elif PYSIDE2: from PySide2.QtMultimedia import * else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtMultimediaWidgets.py0000666000000000000000000000134300000000000014577 0ustar00# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtMultimediaWidgets classes and functions.""" # Local imports from . import PYSIDE2, PYSIDE6, PYQT5, PYQT6, PythonQtError if PYQT5: from PyQt5.QtMultimediaWidgets import * elif PYQT6: from PyQt6.QtMultimediaWidgets import * elif PYSIDE2: from PySide2.QtMultimediaWidgets import * elif PYSIDE6: from PySide6.QtMultimediaWidgets import * else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtNetwork.py0000666000000000000000000000106300000000000012606 0ustar00# # Copyright © 2014-2015 Colin Duquesnoy # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) """ Provides QtNetwork classes and functions. """ from . import PYQT5, PYQT6, PYSIDE2, PYSIDE6, PythonQtError if PYQT5: from PyQt5.QtNetwork import * elif PYQT6: from PyQt6.QtNetwork import * elif PYSIDE6: from PySide6.QtNetwork import * elif PYSIDE2: from PySide2.QtNetwork import * else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtNetworkAuth.py0000666000000000000000000000121500000000000013427 0ustar00# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtNetworkAuth classes and functions.""" # Local imports from . import PYQT5, PYQT6, PYSIDE2, PYSIDE6, PythonQtError if PYQT6: from PyQt6.QtNetworkAuth import * elif PYQT5: from PyQt5.QtNetworkAuth import * elif PYSIDE6: from PySide6.QtNetworkAuth import * else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtOpenGL.py0000666000000000000000000000123600000000000012303 0ustar00# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtOpenGL classes and functions.""" # Local imports from . import PYQT5, PYSIDE2, PythonQtError if PYQT5: from PyQt5.QtOpenGL import * elif PYQT6: from PyQt6.QtOpenGL import * elif PYSIDE6: from PySide6.QtOpenGL import * elif PYSIDE2: from PySide2.QtOpenGL import * else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtOpenGLWidgets.py0000666000000000000000000000113700000000000013632 0ustar00# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtOpenGLWidgets classes and functions.""" # Local imports from . import PYQT5, PYQT6, PYSIDE2, PYSIDE6, PythonQtError if PYQT6: from PyQt6.QtOpenGLWidgets import * elif PYSIDE6: from PySide6.QtOpenGLWidgets import * else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtPositioning.py0000666000000000000000000000107300000000000013460 0ustar00# ----------------------------------------------------------------------------- # Copyright 2020 Antonio Valentino # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtPositioning classes and functions.""" # Local imports from . import PYQT5, PYSIDE2, PythonQtError if PYQT5: from PyQt5.QtPositioning import * elif PYSIDE2: from PySide2.QtPositioning import * else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtPrintSupport.py0000666000000000000000000000150400000000000013646 0ustar00# # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) """ Provides QtPrintSupport classes and functions. """ from . import PYQT5, PYQT6, PYSIDE6, PYSIDE2, PythonQtError if PYQT5: from PyQt5.QtPrintSupport import * elif PYQT6: from PyQt6.QtPrintSupport import * QPageSetupDialog.exec_ = QPageSetupDialog.exec QPrintDialog.exec_ = QPrintDialog.exec QPrintPreviewWidget.print_ = QPrintPreviewWidget.print elif PYSIDE6: from PySide6.QtPrintSupport import * # Map DeprecationWarning methods QPageSetupDialog.exec_ = QPageSetupDialog.exec QPrintDialog.exec_ = QPrintDialog.exec elif PYSIDE2: from PySide2.QtPrintSupport import * else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtQml.py0000666000000000000000000000123500000000000011707 0ustar00# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtQml classes and functions.""" # Local imports from . import PYQT5, PYQT6, PYSIDE2, PYSIDE6, PythonQtError if PYQT5: from PyQt5.QtQml import * elif PYQT6: from PyQt6.QtQml import * elif PYSIDE6: from PySide6.QtQml import * elif PYSIDE2: from PySide2.QtQml import * else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtQuick.py0000666000000000000000000000124700000000000012235 0ustar00# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtQuick classes and functions.""" # Local imports from . import PYQT5, PYQT6, PYSIDE6, PYSIDE2, PythonQtError if PYQT5: from PyQt5.QtQuick import * elif PYQT6: from PyQt6.QtQuick import * elif PYSIDE6: from PySide6.QtQuick import * elif PYSIDE2: from PySide2.QtQuick import * else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtQuickWidgets.py0000666000000000000000000000131200000000000013555 0ustar00# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtQuickWidgets classes and functions.""" # Local imports from . import PYQT5, PYQT6, PYSIDE6, PYSIDE2, PythonQtError if PYQT5: from PyQt5.QtQuickWidgets import * elif PYQT6: from PyQt6.QtQuickWidgets import * elif PYSIDE6: from PySide6.QtQuickWidgets import * elif PYSIDE2: from PySide2.QtQuickWidgets import * else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtRemoteObjects.py0000666000000000000000000000131700000000000013724 0ustar00# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtRemoteObjects classes and functions.""" # Local imports from . import PYQT5, PYQT6, PYSIDE2, PYSIDE6, PythonQtError if PYQT5: from PyQt5.QtRemoteObjects import * elif PYQT6: from PyQt6.QtRemoteObjects import * elif PYSIDE6: from PySide6.QtRemoteObjects import * elif PYSIDE2: from PySide2.QtRemoteObjects import * else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtSensors.py0000666000000000000000000000126100000000000012611 0ustar00# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtSensors classes and functions.""" # Local imports from . import PYQT5, PYQT6, PYSIDE2, PYSIDE6, PythonQtError if PYQT5: from PyQt5.QtSensors import * elif PYQT6: from PyQt6.QtSensors import * elif PYSIDE6: from PySide6.QtSensors import * elif PYSIDE2: from PySide2.QtSensors import * else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtSerialPort.py0000666000000000000000000000134200000000000013241 0ustar00# ----------------------------------------------------------------------------- # Copyright © 2020 Marcin Stano # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtSerialPort classes and functions.""" # Local imports from . import PYQT5, PYQT6, PYSIDE2, PYSIDE6, PythonQtError if PYQT5: from PyQt5.QtSerialPort import * elif PYQT6: from PyQt6.QtSerialPort import * elif PYSIDE6: from PySide6.QtSerialPort import * elif PYSIDE2: from PySide2.QtSerialPort import * else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtSql.py0000666000000000000000000000167100000000000011721 0ustar00# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtSql classes and functions.""" # Local imports from . import PYQT5, PYQT6, PYSIDE6, PYSIDE2, PythonQtError if PYQT5: from PyQt5.QtSql import * elif PYQT6: from PyQt6.QtSql import * QSqlDatabase.exec_ = QSqlDatabase.exec QSqlQuery.exec_ = QSqlQuery.exec QSqlResult.exec_ = QSqlResult.exec elif PYSIDE6: from PySide6.QtSql import * # Map DeprecationWarning methods QSqlDatabase.exec_ = QSqlDatabase.exec QSqlQuery.exec_ = QSqlQuery.exec QSqlResult.exec_ = QSqlResult.exec elif PYSIDE2: from PySide2.QtSql import * else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtSvg.py0000666000000000000000000000123700000000000011717 0ustar00# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtSvg classes and functions.""" # Local imports from . import PYSIDE6, PYSIDE2, PYQT5, PYQT6, PythonQtError if PYQT6: from PyQt6.QtSvg import * elif PYQT5: from PyQt5.QtSvg import * elif PYSIDE6: from PySide6.QtSvg import * elif PYSIDE2: from PySide2.QtSvg import * else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtTest.py0000666000000000000000000000132000000000000012070 0ustar00# # Copyright © 2014-2015 Colin Duquesnoy # Copyright © 2009- The Spyder Developmet Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) """ Provides QtTest and functions """ from . import PYQT5, PYQT6, PYSIDE6, PYSIDE2, PythonQtError if PYQT6: from PyQt6 import QtTest from PyQt6.QtTest import * # Allow unscoped access for enums inside the QtTest module from .enums_compat import promote_enums promote_enums(QtTest) del QtTest elif PYQT5: from PyQt5.QtTest import * elif PYSIDE6: from PySide6.QtTest import * elif PYSIDE2: from PySide2.QtTest import * else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtTextToSpeech.py0000666000000000000000000000107300000000000013535 0ustar00# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtTextToSpeech classes and functions.""" from . import PYQT5, PYSIDE2, PythonQtError if PYQT5: from PyQt5.QtTextToSpeech import * elif PYSIDE2: from PySide2.QtTextToSpeech import * else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtWebChannel.py0000666000000000000000000000130000000000000013155 0ustar00# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtWebChannel classes and functions.""" # Local imports from . import PYSIDE2, PYSIDE6, PYQT5, PYQT6, PythonQtError if PYQT5: from PyQt5.QtWebChannel import * elif PYQT6: from PyQt6.QtWebChannel import * elif PYSIDE6: from PySide6.QtWebChannel import * elif PYSIDE2: from PySide2.QtWebChannel import * else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtWebEngine.py0000666000000000000000000000066400000000000013026 0ustar00# # Copyright © 2014-2015 Colin Duquesnoy # Copyright © 2009- The Spyder development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) """ Provides QtWebEngine classes and functions. """ from . import PYQT5, PYSIDE6 if PYQT5: from PyQt5.QtWebEngine import * elif PYSIDE6: from PySide6.QtWebEngine import * else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtWebEngineCore.py0000666000000000000000000000131700000000000013633 0ustar00# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtWebEngineCore classes and functions.""" # Local imports from . import PYQT5, PYQT6, PYSIDE2, PYSIDE6, PythonQtError if PYQT5: from PyQt5.QtWebEngineCore import * elif PYQT6: from PyQt6.QtWebEngineCore import * elif PYSIDE2: from PySide2.QtWebEngineCore import * elif PYSIDE6: from PySide6.QtWebEngineCore import * else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtWebEngineQuick.py0000666000000000000000000000114200000000000014013 0ustar00# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtWebEngineQuick classes and functions.""" # Local imports from . import PYQT5, PYQT6, PYSIDE2, PYSIDE6, PythonQtError if PYQT6: from PyQt6.QtWebEngineQuick import * elif PYSIDE6: from PySide6.QtWebEngineQuick import * else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtWebEngineWidgets.py0000666000000000000000000000346600000000000014360 0ustar00# # Copyright © 2014-2015 Colin Duquesnoy # Copyright © 2009- The Spyder development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) """ Provides QtWebEngineWidgets classes and functions. """ from . import PYQT5, PYQT6, PYSIDE2, PYSIDE6, PythonQtError # To test if we are using WebEngine or WebKit WEBENGINE = True if PYQT5: try: from PyQt5.QtWebEngineWidgets import QWebEnginePage from PyQt5.QtWebEngineWidgets import QWebEngineView from PyQt5.QtWebEngineWidgets import QWebEngineSettings # Based on the work at https://github.com/spyder-ide/qtpy/pull/203 from PyQt5.QtWebEngineWidgets import QWebEngineProfile except ImportError: from PyQt5.QtWebKitWidgets import QWebPage as QWebEnginePage from PyQt5.QtWebKitWidgets import QWebView as QWebEngineView from PyQt5.QtWebKit import QWebSettings as QWebEngineSettings WEBENGINE = False elif PYQT6: from PyQt6.QtWebEngineWidgets import * from PyQt6.QtWebEngineCore import QWebEnginePage from PyQt6.QtWebEngineCore import QWebEngineSettings from PyQt6.QtWebEngineCore import QWebEngineProfile elif PYSIDE6: from PySide6.QtWebEngineWidgets import * from PySide6.QtWebEngineCore import QWebEnginePage from PySide6.QtWebEngineCore import QWebEngineSettings from PySide6.QtWebEngineCore import QWebEngineProfile elif PYSIDE2: from PySide2.QtWebEngineWidgets import QWebEnginePage from PySide2.QtWebEngineWidgets import QWebEngineView from PySide2.QtWebEngineWidgets import QWebEngineSettings # Based on the work at https://github.com/spyder-ide/qtpy/pull/203 from PySide2.QtWebEngineWidgets import QWebEngineProfile else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtWebSockets.py0000666000000000000000000000120000000000000013217 0ustar00# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtWebSockets classes and functions.""" # Local imports from . import PYSIDE2, PYQT5, PYQT6, PythonQtError if PYQT5: from PyQt5.QtWebSockets import * elif PYQT6: from PyQt6.QtWebSockets import * elif PYSIDE2: from PySide2.QtWebSockets import * else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1640192728.0 QtPy-2.0.0/qtpy/QtWidgets.py0000666000000000000000000000353200000000000012566 0ustar00# # Copyright © 2014-2015 Colin Duquesnoy # Copyright © 2009- The Spyder Developmet Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) """ Provides widget classes and functions. """ from . import PYQT5, PYQT6, PYSIDE2, PYSIDE6, PythonQtError if PYQT6: from PyQt6 import QtWidgets from PyQt6.QtWidgets import * from PyQt6.QtGui import QAction, QActionGroup, QShortcut, QFileSystemModel from PyQt6.QtOpenGLWidgets import QOpenGLWidget # Map missing/renamed methods QTextEdit.setTabStopWidth = QTextEdit.setTabStopDistance QTextEdit.tabStopWidth = QTextEdit.tabStopDistance QTextEdit.print_ = QTextEdit.print QPlainTextEdit.setTabStopWidth = QPlainTextEdit.setTabStopDistance QPlainTextEdit.tabStopWidth = QPlainTextEdit.tabStopDistance QPlainTextEdit.print_ = QPlainTextEdit.print QApplication.exec_ = QApplication.exec QDialog.exec_ = QDialog.exec QMenu.exec_ = QMenu.exec # Allow unscoped access for enums inside the QtWidgets module from .enums_compat import promote_enums promote_enums(QtWidgets) del QtWidgets elif PYQT5: from PyQt5.QtWidgets import * elif PYSIDE6: from PySide6.QtWidgets import * from PySide6.QtGui import QAction, QActionGroup, QShortcut from PySide6.QtOpenGLWidgets import QOpenGLWidget # Map missing/renamed methods QTextEdit.setTabStopWidth = QTextEdit.setTabStopDistance QTextEdit.tabStopWidth = QTextEdit.tabStopDistance QPlainTextEdit.setTabStopWidth = QPlainTextEdit.setTabStopDistance QPlainTextEdit.tabStopWidth = QPlainTextEdit.tabStopDistance # Map DeprecationWarning methods QApplication.exec_ = QApplication.exec QDialog.exec_ = QDialog.exec QMenu.exec_ = QMenu.exec elif PYSIDE2: from PySide2.QtWidgets import * else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtWinExtras.py0000666000000000000000000000066000000000000013103 0ustar00# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) from . import PYQT5, PYSIDE2, PythonQtError if PYQT5: from PyQt5.QtWinExtras import * elif PYSIDE2: from PySide2.QtWinExtras import * else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtXml.py0000666000000000000000000000123500000000000011716 0ustar00# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtXml classes and functions.""" # Local imports from . import PYSIDE2, PYSIDE6, PYQT5, PYQT6, PythonQtError if PYQT5: from PyQt5.QtXml import * elif PYQT6: from PyQt6.QtXml import * elif PYSIDE6: from PySide6.QtXml import * elif PYSIDE2: from PySide2.QtXml import * else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/QtXmlPatterns.py0000666000000000000000000000111100000000000013430 0ustar00# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtXmlPatterns classes and functions.""" # Local imports from . import PYSIDE2, PYQT5, PythonQtError if PYQT5: from PyQt5.QtXmlPatterns import * elif PYSIDE2: from PySide2.QtXmlPatterns import * else: raise PythonQtError('No Qt bindings could be found') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1640192972.0 QtPy-2.0.0/qtpy/__init__.py0000666000000000000000000001763700000000000012425 0ustar00# # Copyright © 2009- The Spyder Development Team # Copyright © 2014-2015 Colin Duquesnoy # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) """ **QtPy** is a shim over the various Python Qt bindings. It is used to write Qt binding independent 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, PyQt6, PySide2 and PySide6); 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) PyQt6 ===== >>> import os >>> os.environ['QT_API'] = 'pyqt6' >>> 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) PySide6 ======= >>> import os >>> os.environ['QT_API'] = 'pyside6' >>> from qtpy import QtGui, QtWidgets, QtCore >>> print(QtWidgets.QWidget) """ from packaging.version import parse import os import platform import sys import warnings # Version of QtPy __version__ = '2.0.0' class PythonQtError(RuntimeError): """Error raised if no bindings could be selected.""" class PythonQtWarning(Warning): """Warning if some features are not implemented in a binding.""" # Qt API environment variable name QT_API = 'QT_API' # Names of the expected PyQt5 api PYQT5_API = ['pyqt5'] PYQT6_API = ['pyqt6'] # Names of the expected PySide2 api PYSIDE2_API = ['pyside2'] # Names of the expected PySide6 api PYSIDE6_API = ['pyside6'] # Minimum supported versions of Qt and the bindings QT5_VERSION_MIN = PYQT5_VERSION_MIN = '5.9.0' PYSIDE2_VERSION_MIN = '5.12.0' QT6_VERSION_MIN = PYQT6_VERSION_MIN = PYSIDE6_VERSION_MIN = '6.2.0' QT_VERSION_MIN = QT5_VERSION_MIN PYQT_VERSION_MIN = PYQT5_VERSION_MIN PYSIDE_VERISION_MIN = PYSIDE2_VERSION_MIN # Detecting if a binding was specified by the user binding_specified = QT_API in os.environ # Setting a default value for QT_API os.environ.setdefault(QT_API, 'pyqt5') API = os.environ[QT_API].lower() initial_api = API assert API in (PYQT5_API + PYQT6_API + PYSIDE2_API + PYSIDE6_API) is_old_pyqt = is_pyqt46 = False QT5 = PYQT5 = True QT4 = QT6 = PYQT4 = PYQT6 = PYSIDE = PYSIDE2 = PYSIDE6 = False PYQT_VERSION = None PYSIDE_VERSION = None QT_VERSION = None # Unless `FORCE_QT_API` is set, use previously imported Qt Python bindings if not os.environ.get('FORCE_QT_API'): if 'PyQt6' in sys.modules: API = initial_api if initial_api in PYQT6_API else 'pyqt6' elif 'PyQt5' in sys.modules: API = initial_api if initial_api in PYQT5_API else 'pyqt5' elif 'PySide6' in sys.modules: API = initial_api if initial_api in PYSIDE6_API else 'pyside6' elif 'PySide2' in sys.modules: API = initial_api if initial_api in PYSIDE2_API else 'pyside2' if API in PYQT5_API: try: from PyQt5.QtCore import PYQT_VERSION_STR as PYQT_VERSION # analysis:ignore from PyQt5.QtCore import QT_VERSION_STR as QT_VERSION # analysis:ignore QT5 = PYQT5 = True if sys.platform == 'darwin': macos_version = parse(platform.mac_ver()[0]) if macos_version < parse('10.10'): if parse(QT_VERSION) >= parse('5.9'): raise PythonQtError("Qt 5.9 or higher only works in " "macOS 10.10 or higher. Your " "program will fail in this " "system.") elif macos_version < parse('10.11'): if parse(QT_VERSION) >= parse('5.11'): raise PythonQtError("Qt 5.11 or higher only works in " "macOS 10.11 or higher. Your " "program will fail in this " "system.") del macos_version except ImportError: API = os.environ['QT_API'] = 'pyqt6' if API in PYQT6_API: try: from PyQt6.QtCore import PYQT_VERSION_STR as PYQT_VERSION # analysis:ignore from PyQt6.QtCore import QT_VERSION_STR as QT_VERSION # analysis:ignore QT5 = PYQT5 = False QT6 = PYQT6 = True except ImportError: API = os.environ['QT_API'] = 'pyside2' if API in PYSIDE2_API: try: from PySide2 import __version__ as PYSIDE_VERSION # analysis:ignore from PySide2.QtCore import __version__ as QT_VERSION # analysis:ignore PYQT5 = False QT5 = PYSIDE2 = True if sys.platform == 'darwin': macos_version = parse(platform.mac_ver()[0]) if macos_version < parse('10.11'): if parse(QT_VERSION) >= parse('5.11'): raise PythonQtError("Qt 5.11 or higher only works in " "macOS 10.11 or higher. Your " "program will fail in this " "system.") del macos_version except ImportError: API = os.environ['QT_API'] = 'pyside6' if API in PYSIDE6_API: try: from PySide6 import __version__ as PYSIDE_VERSION # analysis:ignore from PySide6.QtCore import __version__ as QT_VERSION # analysis:ignore QT5 = PYQT5 = False QT6 = PYSIDE6 = True except ImportError: API = os.environ['QT_API'] = 'pyqt5' # If a correct API name is passed to QT_API and it could not be found, # switches to another and informs through the warning if API != initial_api and binding_specified: warnings.warn('Selected binding "{}" could not be found, ' 'using "{}"'.format(initial_api, API), RuntimeWarning) API_NAME = {'pyqt6': 'PyQt6', 'pyqt5': 'PyQt5', 'pyside2':'PySide2', 'pyside6': 'PySide6'}[API] try: # QtDataVisualization backward compatibility (QtDataVisualization vs. QtDatavisualization) # Only available for Qt5 bindings > 5.9 on Windows from . import QtDataVisualization as QtDatavisualization # analysis:ignore except (ImportError, PythonQtError): pass def _warn_old_minor_version(name, old_version, min_version): """Warn if using a Qt or binding version no longer supported by QtPy.""" warning_message = ( "{name} version {old_version} is not supported by QtPy. " "To ensure your application works correctly with QtPy, " "please upgrade to {name} {min_version} or later.".format( name=name, old_version=old_version, min_version=min_version)) warnings.warn(warning_message, PythonQtWarning) # Warn if using an End of Life or unsupported Qt API/binding minor version if QT_VERSION: if QT5 and (parse(QT_VERSION) < parse(QT5_VERSION_MIN)): _warn_old_minor_version('Qt5', QT_VERSION, QT5_VERSION_MIN) elif QT6 and (parse(QT_VERSION) < parse(QT6_VERSION_MIN)): _warn_old_minor_version('Qt6', QT_VERSION, QT6_VERSION_MIN) if PYQT_VERSION: if PYQT5 and (parse(PYQT_VERSION) < parse(PYQT5_VERSION_MIN)): _warn_old_minor_version('PyQt5', PYQT_VERSION, PYQT5_VERSION_MIN) elif PYQT6 and (parse(PYQT_VERSION) < parse(PYQT6_VERSION_MIN)): _warn_old_minor_version('PyQt6', PYQT_VERSION, PYQT6_VERSION_MIN) elif PYSIDE_VERSION: if PYSIDE2 and (parse(PYSIDE_VERSION) < parse(PYSIDE2_VERSION_MIN)): _warn_old_minor_version('PySide2', PYSIDE_VERSION, PYSIDE2_VERSION_MIN) elif PYSIDE6 and (parse(PYSIDE_VERSION) < parse(PYSIDE6_VERSION_MIN)): _warn_old_minor_version('PySide6', PYSIDE_VERSION, PYSIDE6_VERSION_MIN) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1640193425.2790847 QtPy-2.0.0/qtpy/_patch/0000777000000000000000000000000000000000000011534 5ustar00././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1629183499.0 QtPy-2.0.0/qtpy/_patch/__init__.py0000666000000000000000000000000000000000000013633 0ustar00././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/_patch/qheaderview.py0000666000000000000000000000652700000000000014424 0ustar00# # Copyright © The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) import warnings def introduce_renamed_methods_qheaderview(QHeaderView): _isClickable = QHeaderView.isClickable def sectionsClickable(self): """ QHeaderView.sectionsClickable() -> bool """ return _isClickable(self) QHeaderView.sectionsClickable = sectionsClickable def isClickable(self): warnings.warn('isClickable is only available in Qt4. Use ' 'sectionsClickable instead.', stacklevel=2) return _isClickable(self) QHeaderView.isClickable = isClickable _isMovable = QHeaderView.isMovable def sectionsMovable(self): """ QHeaderView.sectionsMovable() -> bool """ return _isMovable(self) QHeaderView.sectionsMovable = sectionsMovable def isMovable(self): warnings.warn('isMovable is only available in Qt4. Use ' 'sectionsMovable instead.', stacklevel=2) return _isMovable(self) QHeaderView.isMovable = isMovable _resizeMode = QHeaderView.resizeMode def sectionResizeMode(self, logicalIndex): """ QHeaderView.sectionResizeMode(int) -> QHeaderView.ResizeMode """ return _resizeMode(self, logicalIndex) QHeaderView.sectionResizeMode = sectionResizeMode def resizeMode(self, logicalIndex): warnings.warn('resizeMode is only available in Qt4. Use ' 'sectionResizeMode instead.', stacklevel=2) return _resizeMode(self, logicalIndex) QHeaderView.resizeMode = resizeMode _setClickable = QHeaderView.setClickable def setSectionsClickable(self, clickable): """ QHeaderView.setSectionsClickable(bool) """ return _setClickable(self, clickable) QHeaderView.setSectionsClickable = setSectionsClickable def setClickable(self, clickable): warnings.warn('setClickable is only available in Qt4. Use ' 'setSectionsClickable instead.', stacklevel=2) return _setClickable(self, clickable) QHeaderView.setClickable = setClickable _setMovable = QHeaderView.setMovable def setSectionsMovable(self, movable): """ QHeaderView.setSectionsMovable(bool) """ return _setMovable(self, movable) QHeaderView.setSectionsMovable = setSectionsMovable def setMovable(self, movable): warnings.warn('setMovable is only available in Qt4. Use ' 'setSectionsMovable instead.', stacklevel=2) return _setMovable(self, movable) QHeaderView.setMovable = setMovable _setResizeMode = QHeaderView.setResizeMode def setSectionResizeMode(self, *args): """ QHeaderView.setSectionResizeMode(QHeaderView.ResizeMode) QHeaderView.setSectionResizeMode(int, QHeaderView.ResizeMode) """ _setResizeMode(self, *args) QHeaderView.setSectionResizeMode = setSectionResizeMode def setResizeMode(self, *args): warnings.warn('setResizeMode is only available in Qt4. Use ' 'setSectionResizeMode instead.', stacklevel=2) _setResizeMode(self, *args) QHeaderView.setResizeMode = setResizeMode ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/compat.py0000666000000000000000000001235700000000000012143 0ustar00# # Copyright © 2009- The Spyder Development Team # Licensed under the terms of the MIT License """ Compatibility functions """ import sys from .QtWidgets import QFileDialog TEXT_TYPES = (str,) def is_text_string(obj): """Return True if `obj` is a text string, False if it is anything else, like binary data.""" return isinstance(obj, str) def to_text_string(obj, encoding=None): """Convert `obj` to (unicode) text string""" if encoding is None: return str(obj) elif isinstance(obj, str): # In case this function is not used properly, this could happen return obj else: return str(obj, encoding) # ============================================================================= # QVariant conversion utilities # ============================================================================= PYQT_API_1 = False def to_qvariant(obj=None): # analysis:ignore """Convert Python object to QVariant This is a transitional function from PyQt API#1 (QVariant exist) to PyQt API#2 and Pyside (QVariant does not exist)""" return obj def from_qvariant(qobj=None, pytype=None): # analysis:ignore """Convert QVariant object to Python object This is a transitional function from PyQt API #1 (QVariant exist) to PyQt API #2 and Pyside (QVariant does not exist)""" return qobj # ============================================================================= # Wrappers around QFileDialog static methods # ============================================================================= def getexistingdirectory(parent=None, caption='', basedir='', options=QFileDialog.ShowDirsOnly): """Wrapper around QtGui.QFileDialog.getExistingDirectory static method Compatible with PyQt >=v4.4 (API #1 and #2) and PySide >=v1.0""" # Calling QFileDialog static method if sys.platform == "win32": # On Windows platforms: redirect standard outputs _temp1, _temp2 = sys.stdout, sys.stderr sys.stdout, sys.stderr = None, None try: result = QFileDialog.getExistingDirectory(parent, caption, basedir, options) finally: if sys.platform == "win32": # On Windows platforms: restore standard outputs sys.stdout, sys.stderr = _temp1, _temp2 if not is_text_string(result): # PyQt API #1 result = to_text_string(result) return result def _qfiledialog_wrapper(attr, parent=None, caption='', basedir='', filters='', selectedfilter='', options=None): if options is None: options = QFileDialog.Options(0) func = getattr(QFileDialog, attr) # Calling QFileDialog static method if sys.platform == "win32": # On Windows platforms: redirect standard outputs _temp1, _temp2 = sys.stdout, sys.stderr sys.stdout, sys.stderr = None, None result = func(parent, caption, basedir, filters, selectedfilter, options) if sys.platform == "win32": # On Windows platforms: restore standard outputs sys.stdout, sys.stderr = _temp1, _temp2 output, selectedfilter = result # Always returns the tuple (output, selectedfilter) return output, selectedfilter def getopenfilename(parent=None, caption='', basedir='', filters='', selectedfilter='', options=None): """Wrapper around QtGui.QFileDialog.getOpenFileName static method Returns a tuple (filename, selectedfilter) -- when dialog box is canceled, returns a tuple of empty strings Compatible with PyQt >=v4.4 (API #1 and #2) and PySide >=v1.0""" return _qfiledialog_wrapper('getOpenFileName', parent=parent, caption=caption, basedir=basedir, filters=filters, selectedfilter=selectedfilter, options=options) def getopenfilenames(parent=None, caption='', basedir='', filters='', selectedfilter='', options=None): """Wrapper around QtGui.QFileDialog.getOpenFileNames static method Returns a tuple (filenames, selectedfilter) -- when dialog box is canceled, returns a tuple (empty list, empty string) Compatible with PyQt >=v4.4 (API #1 and #2) and PySide >=v1.0""" return _qfiledialog_wrapper('getOpenFileNames', parent=parent, caption=caption, basedir=basedir, filters=filters, selectedfilter=selectedfilter, options=options) def getsavefilename(parent=None, caption='', basedir='', filters='', selectedfilter='', options=None): """Wrapper around QtGui.QFileDialog.getSaveFileName static method Returns a tuple (filename, selectedfilter) -- when dialog box is canceled, returns a tuple of empty strings Compatible with PyQt >=v4.4 (API #1 and #2) and PySide >=v1.0""" return _qfiledialog_wrapper('getSaveFileName', parent=parent, caption=caption, basedir=basedir, filters=filters, selectedfilter=selectedfilter, options=options) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/enums_compat.py0000666000000000000000000000257400000000000013352 0ustar00# Copyright © 2009- The Spyder Development Team # Copyright © 2012- University of North Carolina at Chapel Hill # Luke Campagnola ('luke.campagnola@%s.com' % 'gmail') # Ogi Moore ('ognyan.moore@%s.com' % 'gmail') # KIU Shueng Chuan ('nixchuan@%s.com' % 'gmail') # Licensed under the terms of the MIT License """ Compatibility functions for scoped and unscoped enum access. """ from . import PYQT6 if PYQT6: import enum from . import sip def promote_enums(module): """ Search enums in the given module and allow unscoped access. Taken from: https://github.com/pyqtgraph/pyqtgraph/blob/pyqtgraph-0.12.1/pyqtgraph/Qt.py#L331-L377 """ class_names = [name for name in dir(module) if name.startswith('Q')] for class_name in class_names: klass = getattr(module, class_name) if not isinstance(klass, sip.wrappertype): continue attrib_names = [name for name in dir(klass) if name[0].isupper()] for attrib_name in attrib_names: attrib = getattr(klass, attrib_name) if not isinstance(attrib, enum.EnumMeta): continue for enum_obj in attrib: setattr(klass, enum_obj.name, enum_obj) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/sip.py0000666000000000000000000000056100000000000011445 0ustar00# # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) from . import PYQT6, PYQT5, PythonQtError if PYQT6: from PyQt6.sip import * elif PYQT5: from PyQt5.sip import * else: raise PythonQtError( 'Currently selected Qt binding does not support this module') ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1640193425.5263467 QtPy-2.0.0/qtpy/tests/0000777000000000000000000000000000000000000011440 5ustar00././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1629183499.0 QtPy-2.0.0/qtpy/tests/__init__.py0000666000000000000000000000000000000000000013537 0ustar00././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/conftest.py0000666000000000000000000000333400000000000013642 0ustar00import os def pytest_configure(config): """Configure the test environment.""" if 'USE_QT_API' in os.environ: os.environ['QT_API'] = os.environ['USE_QT_API'].lower() # We need to import qtpy here to make sure that the API versions get set # straight away. import qtpy def pytest_report_header(config): """Insert a customized header into the test report.""" versions = os.linesep versions += 'PyQt6: ' try: from PyQt6 import Qt versions += f"PyQt: {Qt.PYQT_VERSION_STR} - Qt: {Qt.QT_VERSION_STR}" except ImportError: versions += 'not installed' except AttributeError: versions += 'unknown version' versions += os.linesep versions += 'PyQt5: ' try: from PyQt5 import Qt versions += f"PyQt: {Qt.PYQT_VERSION_STR} - Qt: {Qt.QT_VERSION_STR}" except ImportError: versions += 'not installed' except AttributeError: versions += 'unknown version' versions += os.linesep versions += 'PySide2: ' try: import PySide2 from PySide2 import QtCore versions += f"PySide: {PySide2.__version__} - Qt: {QtCore.__version__}" except ImportError: versions += 'not installed' except AttributeError: versions += 'unknown version' versions += os.linesep versions += 'PySide6: ' try: import PySide6 from PySide6 import QtCore versions += f"PySide: {PySide6.__version__} - Qt: {QtCore.__version__}" except ImportError: versions += 'not installed' except AttributeError: versions += 'unknown version' versions += os.linesep return versions ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1629183499.0 QtPy-2.0.0/qtpy/tests/test.ui0000666000000000000000000000156200000000000012762 0ustar00 Form 0 0 400 300 Form Ceci n'est pas un bouton ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1629183499.0 QtPy-2.0.0/qtpy/tests/test_custom.ui0000666000000000000000000000206400000000000014352 0ustar00 Form 0 0 400 300 Form Ceci n'est pas un bouton _QComboBoxSubclass QComboBox
qcombobox_subclass
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_macos_checks.py0000666000000000000000000000571500000000000015503 0ustar00from unittest import mock import platform import sys import pytest from qtpy import PYQT5, PYSIDE2 @pytest.mark.skipif(not PYQT5, reason="Targeted to PyQt5") @mock.patch.object(platform, 'mac_ver') def test_qt59_exception(mac_ver, monkeypatch): # Remove qtpy to reimport it again try: del sys.modules["qtpy"] except KeyError: pass # Patch stdlib to emulate a macOS system monkeypatch.setattr("sys.platform", 'darwin') mac_ver.return_value = ('10.9.2',) # Patch Qt version monkeypatch.setattr("PyQt5.QtCore.QT_VERSION_STR", '5.9.1') # This should raise an Exception with pytest.raises(Exception) as e: import qtpy assert '10.10' in str(e.value) assert '5.9' in str(e.value) @pytest.mark.skipif(not PYQT5, reason="Targeted to PyQt5") @mock.patch.object(platform, 'mac_ver') def test_qt59_no_exception(mac_ver, monkeypatch): # Remove qtpy to reimport it again try: del sys.modules["qtpy"] except KeyError: pass # Patch stdlib to emulate a macOS system monkeypatch.setattr("sys.platform", 'darwin') mac_ver.return_value = ('10.10.1',) # Patch Qt version monkeypatch.setattr("PyQt5.QtCore.QT_VERSION_STR", '5.9.5') # This should not raise an Exception try: import qtpy except Exception: pytest.fail("Error!") @pytest.mark.skipif(not (PYQT5 or PYSIDE2), reason="Targeted to PyQt5 or PySide2") @mock.patch.object(platform, 'mac_ver') def test_qt511_exception(mac_ver, monkeypatch): # Remove qtpy to reimport it again try: del sys.modules["qtpy"] except KeyError: pass # Patch stdlib to emulate a macOS system monkeypatch.setattr("sys.platform", 'darwin') mac_ver.return_value = ('10.10.3',) # Patch Qt version if PYQT5: monkeypatch.setattr("PyQt5.QtCore.QT_VERSION_STR", '5.11.1') else: monkeypatch.setattr("PySide2.QtCore.__version__", '5.11.1') # This should raise an Exception with pytest.raises(Exception) as e: import qtpy assert '10.11' in str(e.value) assert '5.11' in str(e.value) @pytest.mark.skipif(not (PYQT5 or PYSIDE2), reason="Targeted to PyQt5 or PySide2") @mock.patch.object(platform, 'mac_ver') def test_qt511_no_exception(mac_ver, monkeypatch): # Remove qtpy to reimport it again try: del sys.modules["qtpy"] except KeyError: pass # Patch stdlib to emulate a macOS system monkeypatch.setattr("sys.platform", 'darwin') mac_ver.return_value = ('10.13.2',) # Patch Qt version if PYQT5: monkeypatch.setattr("PyQt5.QtCore.QT_VERSION_STR", '5.11.1') else: monkeypatch.setattr("PySide2.QtCore.__version__", '5.11.1') # This should not raise an Exception try: import qtpy except Exception: pytest.fail("Error!") ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_main.py0000666000000000000000000000506200000000000014000 0ustar00import os from qtpy import QtCore, QtGui, QtWidgets try: # removed in qt 6.0 from qtpy import QtWebEngineWidgets except Exception: pass def assert_pyside2(): """ Make sure that we are using PySide """ import PySide2 assert QtCore.QEvent is PySide2.QtCore.QEvent assert QtGui.QPainter is PySide2.QtGui.QPainter assert QtWidgets.QWidget is PySide2.QtWidgets.QWidget assert QtWebEngineWidgets.QWebEnginePage is PySide2.QtWebEngineWidgets.QWebEnginePage def assert_pyside6(): """ Make sure that we are using PySide """ import PySide6 assert QtCore.QEvent is PySide6.QtCore.QEvent assert QtGui.QPainter is PySide6.QtGui.QPainter assert QtWidgets.QWidget is PySide6.QtWidgets.QWidget # Only valid for qt>=6.2 # assert QtWebEngineWidgets.QWebEnginePage is PySide6.QtWebEngineCore.QWebEnginePage def assert_pyqt5(): """ Make sure that we are using PyQt5 """ import PyQt5 assert QtCore.QEvent is PyQt5.QtCore.QEvent assert QtGui.QPainter is PyQt5.QtGui.QPainter assert QtWidgets.QWidget is PyQt5.QtWidgets.QWidget if QtWebEngineWidgets.WEBENGINE: assert QtWebEngineWidgets.QWebEnginePage is PyQt5.QtWebEngineWidgets.QWebEnginePage else: assert QtWebEngineWidgets.QWebEnginePage is PyQt5.QtWebKitWidgets.QWebPage def assert_pyqt6(): """ Make sure that we are using PyQt6 """ import PyQt6 assert QtCore.QEvent is PyQt6.QtCore.QEvent assert QtGui.QPainter is PyQt6.QtGui.QPainter assert QtWidgets.QWidget is PyQt6.QtWidgets.QWidget def test_qt_api(): """ If QT_API is specified, we check that the correct Qt wrapper was used """ QT_API = os.environ.get('QT_API', '').lower() if QT_API == 'pyqt5': assert_pyqt5() elif QT_API == 'pyqt6': assert_pyqt6() elif QT_API == 'pyside2': assert_pyside2() elif QT_API == 'pyside6': assert_pyside6() else: # If the tests are run locally, USE_QT_API and QT_API may not be # defined, but we still want to make sure qtpy is behaving sensibly. # We should then be loading, in order of decreasing preference, PyQt5, # PyQt6, and PySide2. try: import PyQt5 except ImportError: try: import PyQt6 except ImportError: import PySide2 assert_pyside2() else: assert_pyqt6() else: assert_pyqt5() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_patch_qheaderview.py0000666000000000000000000000656000000000000016543 0ustar00import sys import pytest from qtpy import PYQT6, PYSIDE2, PYSIDE6, QT_VERSION from qtpy.QtWidgets import QApplication from qtpy.QtWidgets import QHeaderView from qtpy.QtCore import Qt from qtpy.QtCore import QAbstractListModel def get_qapp(icon_path=None): qapp = QApplication.instance() if qapp is None: qapp = QApplication(['']) return qapp @pytest.mark.skipif( QT_VERSION.startswith('5.15') or PYSIDE6 or PYQT6 or ((PYSIDE2) and sys.version_info.major == 3 and sys.version_info.minor >= 8 and (sys.platform == 'darwin' or sys.platform.startswith('linux')) ), reason="Segfaults with Qt 5.15; and PySide2/Python 3.8+ on Mac and Linux") def test_patched_qheaderview(): """ This will test whether QHeaderView has the new methods introduced in Qt5. It will then create an instance of QHeaderView and test that no exceptions are raised and that some basic behaviour works. """ assert QHeaderView.sectionsClickable is not None assert QHeaderView.sectionsMovable is not None assert QHeaderView.sectionResizeMode is not None assert QHeaderView.setSectionsClickable is not None assert QHeaderView.setSectionsMovable is not None assert QHeaderView.setSectionResizeMode is not None # setup a model and add it to a headerview qapp = get_qapp() headerview = QHeaderView(Qt.Horizontal) # Fails here on PySide 2 and Python 3.8 due a bug: https://bugreports.qt.io/browse/PYSIDE-1140 class Model(QAbstractListModel): pass model = Model() headerview.setModel(model) assert headerview.count() == 1 # test it assert isinstance(headerview.sectionsClickable(), bool) assert isinstance(headerview.sectionsMovable(), bool) if PYSIDE2: assert isinstance(headerview.sectionResizeMode(0), QHeaderView.ResizeMode) else: assert isinstance(headerview.sectionResizeMode(0), int) headerview.setSectionsClickable(True) assert headerview.sectionsClickable() == True headerview.setSectionsClickable(False) assert headerview.sectionsClickable() == False headerview.setSectionsMovable(True) assert headerview.sectionsMovable() == True headerview.setSectionsMovable(False) assert headerview.sectionsMovable() == False headerview.setSectionResizeMode(QHeaderView.Interactive) assert headerview.sectionResizeMode(0) == QHeaderView.Interactive headerview.setSectionResizeMode(QHeaderView.Fixed) assert headerview.sectionResizeMode(0) == QHeaderView.Fixed headerview.setSectionResizeMode(QHeaderView.Stretch) assert headerview.sectionResizeMode(0) == QHeaderView.Stretch headerview.setSectionResizeMode(QHeaderView.ResizeToContents) assert headerview.sectionResizeMode(0) == QHeaderView.ResizeToContents headerview.setSectionResizeMode(0, QHeaderView.Interactive) assert headerview.sectionResizeMode(0) == QHeaderView.Interactive headerview.setSectionResizeMode(0, QHeaderView.Fixed) assert headerview.sectionResizeMode(0) == QHeaderView.Fixed headerview.setSectionResizeMode(0, QHeaderView.Stretch) assert headerview.sectionResizeMode(0) == QHeaderView.Stretch headerview.setSectionResizeMode(0, QHeaderView.ResizeToContents) assert headerview.sectionResizeMode(0) == QHeaderView.ResizeToContents ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qdesktopservice_split.py0000666000000000000000000000114700000000000017502 0ustar00"""Test QDesktopServices split in Qt5.""" import pytest import warnings def test_qstandarpath(): """Test the qtpy.QStandardPaths namespace""" from qtpy.QtCore import QStandardPaths assert QStandardPaths.StandardLocation is not None # Attributes from QDesktopServices shouldn't be in QStandardPaths with pytest.raises(AttributeError) as excinfo: QStandardPaths.setUrlHandler def test_qdesktopservice(): """Test the qtpy.QDesktopServices namespace""" from qtpy.QtGui import QDesktopServices assert QDesktopServices.setUrlHandler is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qt3danimation.py0000666000000000000000000000215200000000000015624 0ustar00import pytest from qtpy import PYQT5, PYSIDE2 @pytest.mark.skipif(not (PYQT5 or PYSIDE2), reason="Only available in Qt5 bindings") def test_qt3danimation(): """Test the qtpy.Qt3DAnimation namespace""" Qt3DAnimation = pytest.importorskip("qtpy.Qt3DAnimation") assert Qt3DAnimation.QAnimationController is not None assert Qt3DAnimation.QAdditiveClipBlend is not None assert Qt3DAnimation.QAbstractClipBlendNode is not None assert Qt3DAnimation.QAbstractAnimation is not None assert Qt3DAnimation.QKeyframeAnimation is not None assert Qt3DAnimation.QAbstractAnimationClip is not None assert Qt3DAnimation.QAbstractClipAnimator is not None assert Qt3DAnimation.QClipAnimator is not None assert Qt3DAnimation.QAnimationGroup is not None assert Qt3DAnimation.QLerpClipBlend is not None assert Qt3DAnimation.QMorphingAnimation is not None assert Qt3DAnimation.QAnimationAspect is not None assert Qt3DAnimation.QVertexBlendAnimation is not None assert Qt3DAnimation.QBlendedClipAnimator is not None assert Qt3DAnimation.QMorphTarget is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qt3dcore.py0000666000000000000000000000372200000000000014601 0ustar00import pytest from qtpy import PYQT6 @pytest.mark.skipif(PYQT6, reason="Not complete in PyQt6") def test_qt3dcore(): """Test the qtpy.Qt3DCore namespace""" Qt3DCore = pytest.importorskip("qtpy.Qt3DCore") assert Qt3DCore.QPropertyValueAddedChange is not None assert Qt3DCore.QSkeletonLoader is not None assert Qt3DCore.QPropertyNodeRemovedChange is not None assert Qt3DCore.QPropertyUpdatedChange is not None assert Qt3DCore.QAspectEngine is not None assert Qt3DCore.QPropertyValueAddedChangeBase is not None assert Qt3DCore.QStaticPropertyValueRemovedChangeBase is not None assert Qt3DCore.QPropertyNodeAddedChange is not None assert Qt3DCore.QDynamicPropertyUpdatedChange is not None assert Qt3DCore.QStaticPropertyUpdatedChangeBase is not None assert Qt3DCore.ChangeFlags is not None assert Qt3DCore.QAbstractAspect is not None assert Qt3DCore.QBackendNode is not None assert Qt3DCore.QTransform is not None assert Qt3DCore.QPropertyUpdatedChangeBase is not None assert Qt3DCore.QNodeId is not None assert Qt3DCore.QJoint is not None assert Qt3DCore.QSceneChange is not None assert Qt3DCore.QNodeIdTypePair is not None assert Qt3DCore.QAbstractSkeleton is not None assert Qt3DCore.QComponentRemovedChange is not None assert Qt3DCore.QComponent is not None assert Qt3DCore.QEntity is not None assert Qt3DCore.QNodeCommand is not None assert Qt3DCore.QNode is not None assert Qt3DCore.QPropertyValueRemovedChange is not None assert Qt3DCore.QPropertyValueRemovedChangeBase is not None assert Qt3DCore.QComponentAddedChange is not None assert Qt3DCore.QNodeCreatedChangeBase is not None assert Qt3DCore.QNodeDestroyedChange is not None assert Qt3DCore.QArmature is not None assert Qt3DCore.QStaticPropertyValueAddedChangeBase is not None assert Qt3DCore.ChangeFlag is not None assert Qt3DCore.QSkeleton is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qt3dextras.py0000666000000000000000000000407200000000000015156 0ustar00import pytest def test_qt3dextras(): """Test the qtpy.Qt3DExtras namespace""" Qt3DExtras = pytest.importorskip("qtpy.Qt3DExtras") assert Qt3DExtras.QTextureMaterial is not None assert Qt3DExtras.QPhongAlphaMaterial is not None assert Qt3DExtras.QOrbitCameraController is not None assert Qt3DExtras.QAbstractSpriteSheet is not None assert Qt3DExtras.QNormalDiffuseMapMaterial is not None assert Qt3DExtras.QDiffuseSpecularMaterial is not None assert Qt3DExtras.QSphereGeometry is not None assert Qt3DExtras.QCuboidGeometry is not None assert Qt3DExtras.QForwardRenderer is not None assert Qt3DExtras.QPhongMaterial is not None assert Qt3DExtras.QSpriteGrid is not None assert Qt3DExtras.QDiffuseMapMaterial is not None assert Qt3DExtras.QConeGeometry is not None assert Qt3DExtras.QSpriteSheetItem is not None assert Qt3DExtras.QPlaneGeometry is not None assert Qt3DExtras.QSphereMesh is not None assert Qt3DExtras.QNormalDiffuseSpecularMapMaterial is not None assert Qt3DExtras.QCuboidMesh is not None assert Qt3DExtras.QGoochMaterial is not None assert Qt3DExtras.QText2DEntity is not None assert Qt3DExtras.QTorusMesh is not None assert Qt3DExtras.Qt3DWindow is not None assert Qt3DExtras.QPerVertexColorMaterial is not None assert Qt3DExtras.QExtrudedTextGeometry is not None assert Qt3DExtras.QSkyboxEntity is not None assert Qt3DExtras.QAbstractCameraController is not None assert Qt3DExtras.QExtrudedTextMesh is not None assert Qt3DExtras.QCylinderGeometry is not None assert Qt3DExtras.QTorusGeometry is not None assert Qt3DExtras.QMorphPhongMaterial is not None assert Qt3DExtras.QPlaneMesh is not None assert Qt3DExtras.QDiffuseSpecularMapMaterial is not None assert Qt3DExtras.QSpriteSheet is not None assert Qt3DExtras.QConeMesh is not None assert Qt3DExtras.QFirstPersonCameraController is not None assert Qt3DExtras.QMetalRoughMaterial is not None assert Qt3DExtras.QCylinderMesh is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qt3dinput.py0000666000000000000000000000227700000000000015014 0ustar00import pytest def test_qt3dinput(): """Test the qtpy.Qt3DInput namespace""" Qt3DInput = pytest.importorskip("qtpy.Qt3DInput") assert Qt3DInput.QAxisAccumulator is not None assert Qt3DInput.QInputSettings is not None assert Qt3DInput.QAnalogAxisInput is not None assert Qt3DInput.QAbstractAxisInput is not None assert Qt3DInput.QMouseHandler is not None assert Qt3DInput.QButtonAxisInput is not None assert Qt3DInput.QInputSequence is not None assert Qt3DInput.QWheelEvent is not None assert Qt3DInput.QActionInput is not None assert Qt3DInput.QKeyboardDevice is not None assert Qt3DInput.QMouseDevice is not None assert Qt3DInput.QAxis is not None assert Qt3DInput.QInputChord is not None assert Qt3DInput.QMouseEvent is not None assert Qt3DInput.QKeyboardHandler is not None assert Qt3DInput.QKeyEvent is not None assert Qt3DInput.QAbstractActionInput is not None assert Qt3DInput.QInputAspect is not None assert Qt3DInput.QLogicalDevice is not None assert Qt3DInput.QAction is not None assert Qt3DInput.QAbstractPhysicalDevice is not None assert Qt3DInput.QAxisSetting is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qt3dlogic.py0000666000000000000000000000035600000000000014746 0ustar00import pytest def test_qt3dlogic(): """Test the qtpy.Qt3DLogic namespace""" Qt3DLogic = pytest.importorskip("qtpy.Qt3DLogic") assert Qt3DLogic.QLogicAspect is not None assert Qt3DLogic.QFrameAction is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qt3drender.py0000666000000000000000000001314100000000000015124 0ustar00import pytest from qtpy import PYQT6 @pytest.mark.skipif(PYQT6, reason="Not complete in PyQt6") def test_qt3drender(): """Test the qtpy.Qt3DRender namespace""" Qt3DRender = pytest.importorskip("qtpy.Qt3DRender") assert Qt3DRender.QPointSize is not None assert Qt3DRender.QFrustumCulling is not None assert Qt3DRender.QPickPointEvent is not None assert Qt3DRender.QRenderPassFilter is not None assert Qt3DRender.QMesh is not None assert Qt3DRender.QRayCaster is not None assert Qt3DRender.QStencilMask is not None assert Qt3DRender.QPickLineEvent is not None assert Qt3DRender.QPickTriangleEvent is not None assert Qt3DRender.QRenderState is not None assert Qt3DRender.QTextureWrapMode is not None assert Qt3DRender.QRenderPass is not None assert Qt3DRender.QGeometryRenderer is not None assert Qt3DRender.QAttribute is not None assert Qt3DRender.QStencilOperation is not None assert Qt3DRender.QScissorTest is not None assert Qt3DRender.QTextureCubeMapArray is not None assert Qt3DRender.QRenderTarget is not None assert Qt3DRender.QStencilTest is not None assert Qt3DRender.QTextureData is not None assert Qt3DRender.QBuffer is not None assert Qt3DRender.QLineWidth is not None assert Qt3DRender.QLayer is not None assert Qt3DRender.QTextureRectangle is not None assert Qt3DRender.QRenderTargetSelector is not None assert Qt3DRender.QPickingSettings is not None assert Qt3DRender.QCullFace is not None assert Qt3DRender.QAbstractFunctor is not None assert Qt3DRender.PropertyReaderInterface is not None assert Qt3DRender.QMaterial is not None assert Qt3DRender.QAlphaCoverage is not None assert Qt3DRender.QClearBuffers is not None assert Qt3DRender.QAlphaTest is not None assert Qt3DRender.QStencilOperationArguments is not None assert Qt3DRender.QTexture2DMultisample is not None assert Qt3DRender.QLevelOfDetailSwitch is not None assert Qt3DRender.QRenderStateSet is not None assert Qt3DRender.QViewport is not None assert Qt3DRender.QObjectPicker is not None assert Qt3DRender.QPolygonOffset is not None assert Qt3DRender.QRenderSettings is not None assert Qt3DRender.QFrontFace is not None assert Qt3DRender.QTexture3D is not None assert Qt3DRender.QTextureBuffer is not None assert Qt3DRender.QTechniqueFilter is not None assert Qt3DRender.QLayerFilter is not None assert Qt3DRender.QFilterKey is not None assert Qt3DRender.QRenderSurfaceSelector is not None assert Qt3DRender.QEnvironmentLight is not None assert Qt3DRender.QMemoryBarrier is not None assert Qt3DRender.QNoDepthMask is not None assert Qt3DRender.QBlitFramebuffer is not None assert Qt3DRender.QGraphicsApiFilter is not None assert Qt3DRender.QAbstractTexture is not None assert Qt3DRender.QRenderCaptureReply is not None assert Qt3DRender.QAbstractLight is not None assert Qt3DRender.QAbstractRayCaster is not None assert Qt3DRender.QDirectionalLight is not None assert Qt3DRender.QDispatchCompute is not None assert Qt3DRender.QBufferDataGenerator is not None assert Qt3DRender.QPointLight is not None assert Qt3DRender.QStencilTestArguments is not None assert Qt3DRender.QTexture1D is not None assert Qt3DRender.QCameraSelector is not None assert Qt3DRender.QProximityFilter is not None assert Qt3DRender.QTexture1DArray is not None assert Qt3DRender.QBlendEquation is not None assert Qt3DRender.QTextureImageDataGenerator is not None assert Qt3DRender.QSpotLight is not None assert Qt3DRender.QEffect is not None assert Qt3DRender.QSeamlessCubemap is not None assert Qt3DRender.QTexture2DMultisampleArray is not None assert Qt3DRender.QComputeCommand is not None assert Qt3DRender.QFrameGraphNode is not None assert Qt3DRender.QSortPolicy is not None assert Qt3DRender.QTextureImageData is not None assert Qt3DRender.QCamera is not None assert Qt3DRender.QGeometry is not None assert Qt3DRender.QScreenRayCaster is not None assert Qt3DRender.QClipPlane is not None assert Qt3DRender.QMultiSampleAntiAliasing is not None assert Qt3DRender.QRayCasterHit is not None assert Qt3DRender.QAbstractTextureImage is not None assert Qt3DRender.QNoDraw is not None assert Qt3DRender.QPickEvent is not None assert Qt3DRender.QRenderCapture is not None assert Qt3DRender.QDepthTest is not None assert Qt3DRender.QParameter is not None assert Qt3DRender.QLevelOfDetail is not None assert Qt3DRender.QGeometryFactory is not None assert Qt3DRender.QTexture2D is not None assert Qt3DRender.QRenderAspect is not None assert Qt3DRender.QPaintedTextureImage is not None assert Qt3DRender.QDithering is not None assert Qt3DRender.QTextureGenerator is not None assert Qt3DRender.QBlendEquationArguments is not None assert Qt3DRender.QLevelOfDetailBoundingSphere is not None assert Qt3DRender.QColorMask is not None assert Qt3DRender.QSceneLoader is not None assert Qt3DRender.QTextureLoader is not None assert Qt3DRender.QShaderProgram is not None assert Qt3DRender.QTextureCubeMap is not None assert Qt3DRender.QTexture2DArray is not None assert Qt3DRender.QTextureImage is not None assert Qt3DRender.QCameraLens is not None assert Qt3DRender.QRenderTargetOutput is not None assert Qt3DRender.QShaderProgramBuilder is not None assert Qt3DRender.QTechnique is not None assert Qt3DRender.QShaderData is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qtcharts.py0000666000000000000000000000043600000000000014705 0ustar00import pytest from qtpy import PYSIDE2, PYSIDE6 @pytest.mark.skipif(not (PYSIDE2 or PYSIDE6), reason="Only available by default in PySide") def test_qtcharts(): """Test the qtpy.QtCharts namespace""" from qtpy import QtCharts assert QtCharts.QChart is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qtcore.py0000666000000000000000000000261000000000000014345 0ustar00"""Test QtCore.""" import pytest from qtpy import PYQT5, PYQT6, PYSIDE2, PYQT_VERSION, QtCore def test_qtmsghandler(): """Test qtpy.QtMsgHandler""" assert QtCore.qInstallMessageHandler is not None def test_DateTime_toPython(): """Test QDateTime.toPython""" assert QtCore.QDateTime.toPython is not None @pytest.mark.skipif(PYSIDE2 or PYQT6, reason="Doesn't seem to be present on PySide2 and PyQt6") def test_QtCore_SignalInstance(): class ClassWithSignal(QtCore.QObject): signal = QtCore.Signal() instance = ClassWithSignal() assert isinstance(instance.signal, QtCore.SignalInstance) @pytest.mark.skipif(PYQT5 and PYQT_VERSION.startswith('5.9'), reason="A specific setup with at least sip 4.9.9 is needed for PyQt5 5.9.*" "to work with scoped enum access") def test_enum_access(): """Test scoped and unscoped enum access for qtpy.QtCore.*.""" assert QtCore.QAbstractAnimation.Stopped == QtCore.QAbstractAnimation.State.Stopped assert QtCore.QEvent.ActionAdded == QtCore.QEvent.Type.ActionAdded assert QtCore.Qt.AlignLeft == QtCore.Qt.AlignmentFlag.AlignLeft assert QtCore.Qt.Key_Return == QtCore.Qt.Key.Key_Return assert QtCore.Qt.transparent == QtCore.Qt.GlobalColor.transparent assert QtCore.Qt.Widget == QtCore.Qt.WindowType.Widget ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qtdatavisualization.py0000666000000000000000000001122600000000000017153 0ustar00import pytest def test_qtdatavisualization(): """Test the qtpy.QtDataVisualization namespace""" # Using import skip here since with Python 3 you need to install another package # besides the base `PyQt5` or `PySide2`. # For example in the case of `PyQt5` you need `PyQtDataVisualization` # QtDataVisualization QtDataVisualization = pytest.importorskip("qtpy.QtDataVisualization") assert QtDataVisualization.QScatter3DSeries is not None assert QtDataVisualization.QSurfaceDataItem is not None assert QtDataVisualization.QSurface3DSeries is not None assert QtDataVisualization.QAbstract3DInputHandler is not None assert QtDataVisualization.QHeightMapSurfaceDataProxy is not None assert QtDataVisualization.QAbstractDataProxy is not None assert QtDataVisualization.Q3DCamera is not None assert QtDataVisualization.QAbstract3DGraph is not None assert QtDataVisualization.QCustom3DVolume is not None assert QtDataVisualization.Q3DInputHandler is not None assert QtDataVisualization.QBarDataProxy is not None assert QtDataVisualization.QSurfaceDataProxy is not None assert QtDataVisualization.QScatterDataItem is not None assert QtDataVisualization.Q3DLight is not None assert QtDataVisualization.QScatterDataProxy is not None assert QtDataVisualization.QValue3DAxis is not None assert QtDataVisualization.Q3DBars is not None assert QtDataVisualization.QBarDataItem is not None assert QtDataVisualization.QItemModelBarDataProxy is not None assert QtDataVisualization.Q3DTheme is not None assert QtDataVisualization.QCustom3DItem is not None assert QtDataVisualization.QItemModelScatterDataProxy is not None assert QtDataVisualization.QValue3DAxisFormatter is not None assert QtDataVisualization.QItemModelSurfaceDataProxy is not None assert QtDataVisualization.Q3DScatter is not None assert QtDataVisualization.QTouch3DInputHandler is not None assert QtDataVisualization.QBar3DSeries is not None assert QtDataVisualization.QAbstract3DAxis is not None assert QtDataVisualization.Q3DScene is not None assert QtDataVisualization.QCategory3DAxis is not None assert QtDataVisualization.QAbstract3DSeries is not None assert QtDataVisualization.Q3DObject is not None assert QtDataVisualization.QCustom3DLabel is not None assert QtDataVisualization.Q3DSurface is not None assert QtDataVisualization.QLogValue3DAxisFormatter is not None # QtDatavisualization QtDatavisualization = pytest.importorskip("qtpy.QtDatavisualization") assert QtDatavisualization.QScatter3DSeries is not None assert QtDatavisualization.QSurfaceDataItem is not None assert QtDatavisualization.QSurface3DSeries is not None assert QtDatavisualization.QAbstract3DInputHandler is not None assert QtDatavisualization.QHeightMapSurfaceDataProxy is not None assert QtDatavisualization.QAbstractDataProxy is not None assert QtDatavisualization.Q3DCamera is not None assert QtDatavisualization.QAbstract3DGraph is not None assert QtDatavisualization.QCustom3DVolume is not None assert QtDatavisualization.Q3DInputHandler is not None assert QtDatavisualization.QBarDataProxy is not None assert QtDatavisualization.QSurfaceDataProxy is not None assert QtDatavisualization.QScatterDataItem is not None assert QtDatavisualization.Q3DLight is not None assert QtDatavisualization.QScatterDataProxy is not None assert QtDatavisualization.QValue3DAxis is not None assert QtDatavisualization.Q3DBars is not None assert QtDatavisualization.QBarDataItem is not None assert QtDatavisualization.QItemModelBarDataProxy is not None assert QtDatavisualization.Q3DTheme is not None assert QtDatavisualization.QCustom3DItem is not None assert QtDatavisualization.QItemModelScatterDataProxy is not None assert QtDatavisualization.QValue3DAxisFormatter is not None assert QtDatavisualization.QItemModelSurfaceDataProxy is not None assert QtDatavisualization.Q3DScatter is not None assert QtDatavisualization.QTouch3DInputHandler is not None assert QtDatavisualization.QBar3DSeries is not None assert QtDatavisualization.QAbstract3DAxis is not None assert QtDatavisualization.Q3DScene is not None assert QtDatavisualization.QCategory3DAxis is not None assert QtDatavisualization.QAbstract3DSeries is not None assert QtDatavisualization.Q3DObject is not None assert QtDatavisualization.QCustom3DLabel is not None assert QtDatavisualization.Q3DSurface is not None assert QtDatavisualization.QLogValue3DAxisFormatter is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qtdbus.py0000666000000000000000000000071000000000000014351 0ustar00import pytest from qtpy import PYSIDE2, PYSIDE6, PYQT5, PYQT6 @pytest.mark.skipif(PYSIDE2 or PYSIDE6, reason="Not available in PySide2, not on CI for PySide6") def test_qtdbus(): """Test the qtpy.QtDBus namespace""" from qtpy import QtDBus assert QtDBus.QDBusAbstractAdaptor is not None assert QtDBus.QDBusAbstractInterface is not None assert QtDBus.QDBusArgument is not None assert QtDBus.QDBusConnection is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qtdesigner.py0000666000000000000000000000263400000000000015223 0ustar00import pytest from qtpy import PYSIDE2 @pytest.mark.skipif(PYSIDE2, reason="QtDesigner is not avalaible in PySide2") def test_qtdesigner(): """Test the qtpy.QtDesigner namespace.""" from qtpy import QtDesigner assert QtDesigner.QAbstractExtensionFactory is not None assert QtDesigner.QAbstractExtensionManager is not None assert QtDesigner.QDesignerActionEditorInterface is not None assert QtDesigner.QDesignerContainerExtension is not None assert QtDesigner.QDesignerCustomWidgetCollectionInterface is not None assert QtDesigner.QDesignerCustomWidgetInterface is not None assert QtDesigner.QDesignerFormEditorInterface is not None assert QtDesigner.QDesignerFormWindowCursorInterface is not None assert QtDesigner.QDesignerFormWindowInterface is not None assert QtDesigner.QDesignerFormWindowManagerInterface is not None assert QtDesigner.QDesignerMemberSheetExtension is not None assert QtDesigner.QDesignerObjectInspectorInterface is not None assert QtDesigner.QDesignerPropertyEditorInterface is not None assert QtDesigner.QDesignerPropertySheetExtension is not None assert QtDesigner.QDesignerTaskMenuExtension is not None assert QtDesigner.QDesignerWidgetBoxInterface is not None assert QtDesigner.QExtensionFactory is not None assert QtDesigner.QExtensionManager is not None assert QtDesigner.QFormBuilder is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qtgui.py0000666000000000000000000000205400000000000014203 0ustar00"""Test QtGui.""" import pytest from qtpy import PYQT5, PYQT_VERSION, QtGui def test_qdrag_functions(): """Test functions mapping for QtGui.QDrag.""" assert QtGui.QDrag.exec_ def test_qguiapplication_functions(): """Test functions mapping for QtGui.QGuiApplication.""" assert QtGui.QGuiApplication.exec_ def test_qtextdocument_functions(): """Test functions mapping for QtGui.QTextDocument.""" assert QtGui.QTextDocument.print_ @pytest.mark.skipif(PYQT5 and PYQT_VERSION.startswith('5.9'), reason="A specific setup with at least sip 4.9.9 is needed for PyQt5 5.9.*" "to work with scoped enum access") def test_enum_access(): """Test scoped and unscoped enum access for qtpy.QtWidgets.*.""" assert QtGui.QColor.Rgb == QtGui.QColor.Spec.Rgb assert QtGui.QFont.AllUppercase == QtGui.QFont.Capitalization.AllUppercase assert QtGui.QIcon.Normal == QtGui.QIcon.Mode.Normal assert QtGui.QImage.Format_Invalid == QtGui.QImage.Format.Format_Invalid././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qthelp.py0000666000000000000000000000126100000000000014346 0ustar00"""Test for QtHelp namespace.""" import pytest def test_qthelp(): """Test the qtpy.QtHelp namespace.""" from qtpy import QtHelp assert QtHelp.QHelpContentItem is not None assert QtHelp.QHelpContentModel is not None assert QtHelp.QHelpContentWidget is not None assert QtHelp.QHelpEngine is not None assert QtHelp.QHelpEngineCore is not None assert QtHelp.QHelpIndexModel is not None assert QtHelp.QHelpIndexWidget is not None assert QtHelp.QHelpSearchEngine is not None assert QtHelp.QHelpSearchQuery is not None assert QtHelp.QHelpSearchQueryWidget is not None assert QtHelp.QHelpSearchResultWidget is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qtlocation.py0000666000000000000000000000433400000000000015232 0ustar00import pytest from qtpy import PYQT5, PYSIDE2 @pytest.mark.skipif(not (PYQT5 or PYSIDE2), reason="Only available in Qt5 bindings") def test_qtlocation(): """Test the qtpy.QtLocation namespace""" from qtpy import QtLocation assert QtLocation.QGeoCodeReply is not None assert QtLocation.QGeoCodingManager is not None assert QtLocation.QGeoCodingManagerEngine is not None assert QtLocation.QGeoManeuver is not None assert QtLocation.QGeoRoute is not None assert QtLocation.QGeoRouteReply is not None assert QtLocation.QGeoRouteRequest is not None assert QtLocation.QGeoRouteSegment is not None assert QtLocation.QGeoRoutingManager is not None assert QtLocation.QGeoRoutingManagerEngine is not None assert QtLocation.QGeoServiceProvider is not None #assert QtLocation.QGeoServiceProviderFactory is not None assert QtLocation.QPlace is not None assert QtLocation.QPlaceAttribute is not None assert QtLocation.QPlaceCategory is not None assert QtLocation.QPlaceContactDetail is not None assert QtLocation.QPlaceContent is not None assert QtLocation.QPlaceContentReply is not None assert QtLocation.QPlaceContentRequest is not None assert QtLocation.QPlaceDetailsReply is not None assert QtLocation.QPlaceEditorial is not None assert QtLocation.QPlaceIcon is not None assert QtLocation.QPlaceIdReply is not None assert QtLocation.QPlaceImage is not None assert QtLocation.QPlaceManager is not None assert QtLocation.QPlaceManagerEngine is not None assert QtLocation.QPlaceMatchReply is not None assert QtLocation.QPlaceMatchRequest is not None assert QtLocation.QPlaceProposedSearchResult is not None assert QtLocation.QPlaceRatings is not None assert QtLocation.QPlaceReply is not None assert QtLocation.QPlaceResult is not None assert QtLocation.QPlaceReview is not None assert QtLocation.QPlaceSearchReply is not None assert QtLocation.QPlaceSearchRequest is not None assert QtLocation.QPlaceSearchResult is not None assert QtLocation.QPlaceSearchSuggestionReply is not None assert QtLocation.QPlaceSupplier is not None assert QtLocation.QPlaceUser is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qtmultimedia.py0000666000000000000000000000113500000000000015550 0ustar00import sys import pytest from qtpy import PYSIDE6, PYQT6 @pytest.mark.skipif( sys.platform.startswith('linux') and (PYSIDE6 or PYQT6), reason="Needs to setup GStreamer on Linux") def test_qtmultimedia(): """Test the qtpy.QtMultimedia namespace""" from qtpy import QtMultimedia assert QtMultimedia.QAudio is not None assert QtMultimedia.QAudioInput is not None if not (PYSIDE6 or PYQT6): assert QtMultimedia.QAbstractVideoBuffer is not None assert QtMultimedia.QAudioDeviceInfo is not None assert QtMultimedia.QSound is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qtmultimediawidgets.py0000666000000000000000000000124200000000000017136 0ustar00import os import pytest from qtpy import PYQT5, PYSIDE2 @pytest.mark.skipif( not (PYQT5 or PYSIDE2), reason="Only available in Qt5 bindings") @pytest.mark.skipif( os.environ.get('USE_CONDA', 'Yes') == 'Yes', reason="Conda packages don't seem to include QtMultimedia") def test_qtmultimediawidgets(): """Test the qtpy.QtMultimediaWidgets namespace""" from qtpy import QtMultimediaWidgets assert QtMultimediaWidgets.QCameraViewfinder is not None assert QtMultimediaWidgets.QGraphicsVideoItem is not None assert QtMultimediaWidgets.QVideoWidget is not None # assert QtMultimediaWidgets.QVideoWidgetControl is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qtnetwork.py0000666000000000000000000000347600000000000015121 0ustar00import pytest from qtpy import PYSIDE2, PYSIDE6, PYQT6, QtNetwork def test_qtnetwork(): """Test the qtpy.QtNetwork namespace""" assert QtNetwork.QAbstractNetworkCache is not None assert QtNetwork.QNetworkCacheMetaData is not None if not PYSIDE2: assert QtNetwork.QHttpMultiPart is not None assert QtNetwork.QHttpPart is not None assert QtNetwork.QNetworkAccessManager is not None assert QtNetwork.QNetworkCookie is not None assert QtNetwork.QNetworkCookieJar is not None assert QtNetwork.QNetworkDiskCache is not None assert QtNetwork.QNetworkReply is not None assert QtNetwork.QNetworkRequest is not None if not (PYSIDE6 or PYQT6): assert QtNetwork.QNetworkConfigurationManager is not None assert QtNetwork.QNetworkConfiguration is not None assert QtNetwork.QNetworkSession is not None assert QtNetwork.QAuthenticator is not None assert QtNetwork.QHostAddress is not None assert QtNetwork.QHostInfo is not None assert QtNetwork.QNetworkAddressEntry is not None assert QtNetwork.QNetworkInterface is not None assert QtNetwork.QNetworkProxy is not None assert QtNetwork.QNetworkProxyFactory is not None assert QtNetwork.QNetworkProxyQuery is not None assert QtNetwork.QAbstractSocket is not None assert QtNetwork.QLocalServer is not None assert QtNetwork.QLocalSocket is not None assert QtNetwork.QTcpServer is not None assert QtNetwork.QTcpSocket is not None assert QtNetwork.QUdpSocket is not None assert QtNetwork.QSslCertificate is not None assert QtNetwork.QSslCipher is not None assert QtNetwork.QSslConfiguration is not None assert QtNetwork.QSslError is not None assert QtNetwork.QSslKey is not None assert QtNetwork.QSslSocket is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qtnetworkauth.py0000666000000000000000000000121200000000000015765 0ustar00import pytest from qtpy import PYQT5, PYQT6, PYSIDE2 @pytest.mark.skipif(PYQT5 or PYQT6 or PYSIDE2, reason="Not available by default in PyQt. Not available for PySide2") def test_qtnetworkauth(): """Test the qtpy.QtNetworkAuth namespace""" from qtpy import QtNetworkAuth assert QtNetworkAuth.QAbstractOAuth is not None assert QtNetworkAuth.QAbstractOAuth2 is not None assert QtNetworkAuth.QAbstractOAuthReplyHandler is not None assert QtNetworkAuth.QOAuth1 is not None assert QtNetworkAuth.QOAuth1Signature is not None assert QtNetworkAuth.QOAuth2AuthorizationCodeFlow is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qtopenglwidgets.py0000666000000000000000000000050000000000000016264 0ustar00import pytest from qtpy import PYSIDE2, PYSIDE6, PYQT5, PYQT6 @pytest.mark.skipif(PYSIDE2 or PYQT5, reason="Not available in PySide2/PyQt5") def test_qtopenglwidgets(): """Test the qtpy.QtOpenGLWidgets namespace""" from qtpy import QtOpenGLWidgets assert QtOpenGLWidgets.QOpenGLWidget is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qtpositioning.py0000666000000000000000000000250700000000000015764 0ustar00import pytest from qtpy import PYQT5, PYSIDE2 @pytest.mark.skipif(not (PYQT5 or PYSIDE2), reason="Only available in Qt5 bindings") def test_qtpositioning(): """Test the qtpy.QtPositioning namespace""" from qtpy import QtPositioning assert QtPositioning.QGeoAddress is not None assert QtPositioning.QGeoAreaMonitorInfo is not None assert QtPositioning.QGeoAreaMonitorSource is not None assert QtPositioning.QGeoCircle is not None assert QtPositioning.QGeoCoordinate is not None assert QtPositioning.QGeoLocation is not None assert QtPositioning.QGeoPath is not None # CI for 3.6 uses Qt 5.9 # assert QtPositioning.QGeoPolygon is not None # New in Qt 5.10 assert QtPositioning.QGeoPositionInfo is not None assert QtPositioning.QGeoPositionInfoSource is not None # QGeoPositionInfoSourceFactory is not available in PyQt # assert QtPositioning.QGeoPositionInfoSourceFactory is not None # New in Qt 5.2 # assert QtPositioning.QGeoPositionInfoSourceFactoryV2 is not None # New in Qt 5.14 assert QtPositioning.QGeoRectangle is not None assert QtPositioning.QGeoSatelliteInfo is not None assert QtPositioning.QGeoSatelliteInfoSource is not None assert QtPositioning.QGeoShape is not None assert QtPositioning.QNmeaPositionInfoSource is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qtprintsupport.py0000666000000000000000000000107500000000000016212 0ustar00import pytest from qtpy import QtPrintSupport def test_qtprintsupport(): """Test the qtpy.QtPrintSupport namespace""" assert QtPrintSupport.QAbstractPrintDialog is not None assert QtPrintSupport.QPageSetupDialog is not None assert QtPrintSupport.QPrintDialog is not None assert QtPrintSupport.QPrintPreviewDialog is not None assert QtPrintSupport.QPrintEngine is not None assert QtPrintSupport.QPrinter is not None assert QtPrintSupport.QPrinterInfo is not None assert QtPrintSupport.QPrintPreviewWidget is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qtqml.py0000666000000000000000000000257500000000000014220 0ustar00import pytest from qtpy import PYQT5, PYSIDE2 @pytest.mark.skipif(not (PYQT5 or PYSIDE2), reason="Only available in Qt5 bindings") def test_qtqml(): """Test the qtpy.QtQml namespace""" from qtpy import QtQml assert QtQml.QJSEngine is not None assert QtQml.QJSValue is not None assert QtQml.QJSValueIterator is not None assert QtQml.QQmlAbstractUrlInterceptor is not None assert QtQml.QQmlApplicationEngine is not None assert QtQml.QQmlComponent is not None assert QtQml.QQmlContext is not None assert QtQml.QQmlEngine is not None assert QtQml.QQmlImageProviderBase is not None assert QtQml.QQmlError is not None assert QtQml.QQmlExpression is not None assert QtQml.QQmlExtensionPlugin is not None assert QtQml.QQmlFileSelector is not None assert QtQml.QQmlIncubationController is not None assert QtQml.QQmlIncubator is not None if not PYSIDE2: # https://wiki.qt.io/Qt_for_Python_Missing_Bindings#QtQml assert QtQml.QQmlListProperty is not None assert QtQml.QQmlListReference is not None assert QtQml.QQmlNetworkAccessManagerFactory is not None assert QtQml.QQmlParserStatus is not None assert QtQml.QQmlProperty is not None assert QtQml.QQmlPropertyValueSource is not None assert QtQml.QQmlScriptString is not None assert QtQml.QQmlPropertyMap is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qtquick.py0000666000000000000000000000432500000000000014536 0ustar00import pytest from qtpy import PYQT5, PYSIDE2 @pytest.mark.skipif(not (PYQT5 or PYSIDE2), reason="Only available in Qt5 bindings") def test_qtquick(): """Test the qtpy.QtQuick namespace""" from qtpy import QtQuick assert QtQuick.QQuickAsyncImageProvider is not None if not PYSIDE2: assert QtQuick.QQuickCloseEvent is not None assert QtQuick.QQuickFramebufferObject is not None assert QtQuick.QQuickImageProvider is not None assert QtQuick.QQuickImageResponse is not None assert QtQuick.QQuickItem is not None assert QtQuick.QQuickItemGrabResult is not None assert QtQuick.QQuickPaintedItem is not None assert QtQuick.QQuickRenderControl is not None assert QtQuick.QQuickTextDocument is not None assert QtQuick.QQuickTextureFactory is not None assert QtQuick.QQuickView is not None assert QtQuick.QQuickWindow is not None assert QtQuick.QSGAbstractRenderer is not None assert QtQuick.QSGBasicGeometryNode is not None assert QtQuick.QSGClipNode is not None assert QtQuick.QSGDynamicTexture is not None assert QtQuick.QSGEngine is not None if not PYSIDE2: assert QtQuick.QSGFlatColorMaterial is not None assert QtQuick.QSGGeometry is not None assert QtQuick.QSGGeometryNode is not None #assert QtQuick.QSGImageNode is not None if not PYSIDE2: assert QtQuick.QSGMaterial is not None assert QtQuick.QSGMaterialShader is not None assert QtQuick.QSGMaterialType is not None assert QtQuick.QSGNode is not None assert QtQuick.QSGOpacityNode is not None if not PYSIDE2: assert QtQuick.QSGOpaqueTextureMaterial is not None #assert QtQuick.QSGRectangleNode is not None #assert QtQuick.QSGRenderNode is not None #assert QtQuick.QSGRendererInterface is not None assert QtQuick.QSGSimpleRectNode is not None assert QtQuick.QSGSimpleTextureNode is not None assert QtQuick.QSGTexture is not None if not PYSIDE2: assert QtQuick.QSGTextureMaterial is not None assert QtQuick.QSGTextureProvider is not None assert QtQuick.QSGTransformNode is not None if not PYSIDE2: assert QtQuick.QSGVertexColorMaterial is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qtquickwidgets.py0000666000000000000000000000045700000000000016127 0ustar00import pytest from qtpy import PYQT5, PYSIDE2 @pytest.mark.skipif(not (PYQT5 or PYSIDE2), reason="Only available in Qt5 bindings") def test_qtquickwidgets(): """Test the qtpy.QtQuickWidgets namespace""" from qtpy import QtQuickWidgets assert QtQuickWidgets.QQuickWidget is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qtremoteobjects.py0000666000000000000000000000103100000000000016256 0ustar00import pytest from qtpy import PYSIDE2, PYSIDE6, PYQT5, PYQT6 def test_qtremoteobjects(): """Test the qtpy.QtRemoteObjects namespace""" QtRemoteObjects = pytest.importorskip("qtpy.QtRemoteObjects") assert QtRemoteObjects.QRemoteObjectAbstractPersistedStore is not None assert QtRemoteObjects.QRemoteObjectDynamicReplica is not None assert QtRemoteObjects.QRemoteObjectHost is not None assert QtRemoteObjects.QRemoteObjectHostBase is not None assert QtRemoteObjects.QRemoteObjectNode is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qtsensors.py0000666000000000000000000000047200000000000015115 0ustar00import pytest from qtpy import PYSIDE6, PYQT6 def test_qtsensors(): """Test the qtpy.QtSensors namespace""" from qtpy import QtSensors assert QtSensors.QAccelerometer is not None assert QtSensors.QAccelerometerFilter is not None assert QtSensors.QAccelerometerReading is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qtserialport.py0000666000000000000000000000047400000000000015607 0ustar00import pytest from qtpy import PYSIDE2 @pytest.mark.skipif(PYSIDE2, reason="Not available in CI") def test_qtserialport(): """Test the qtpy.QtSerialPort namespace""" from qtpy import QtSerialPort assert QtSerialPort.QSerialPort is not None assert QtSerialPort.QSerialPortInfo is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qtsql.py0000666000000000000000000000147100000000000014220 0ustar00import pytest from qtpy import QtSql def test_qtsql(): """Test the qtpy.QtSql namespace""" assert QtSql.QSqlDatabase is not None assert QtSql.QSqlDriverCreatorBase is not None assert QtSql.QSqlDriver is not None assert QtSql.QSqlError is not None assert QtSql.QSqlField is not None assert QtSql.QSqlIndex is not None assert QtSql.QSqlQuery is not None assert QtSql.QSqlRecord is not None assert QtSql.QSqlResult is not None assert QtSql.QSqlQueryModel is not None assert QtSql.QSqlRelationalDelegate is not None assert QtSql.QSqlRelation is not None assert QtSql.QSqlRelationalTableModel is not None assert QtSql.QSqlTableModel is not None # Following modules are not (yet) part of any wrapper: # QSqlDriverCreator, QSqlDriverPlugin ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qtsvg.py0000666000000000000000000000054300000000000014217 0ustar00import pytest from qtpy import PYSIDE6, PYQT6 def test_qtsvg(): """Test the qtpy.QtSvg namespace""" from qtpy import QtSvg if not (PYSIDE6 or PYQT6): assert QtSvg.QGraphicsSvgItem is not None assert QtSvg.QSvgWidget is not None assert QtSvg.QSvgGenerator is not None assert QtSvg.QSvgRenderer is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qttest.py0000666000000000000000000000151000000000000014372 0ustar00import pytest from packaging import version from qtpy import QtTest, PYQT5, PYQT6, PYSIDE6, PYQT_VERSION def test_qttest(): """Test the qtpy.QtTest namespace""" assert QtTest.QTest is not None if PYQT5 or PYQT6 or PYSIDE6: assert QtTest.QSignalSpy is not None if (PYQT5 and version.parse(PYQT_VERSION) >= version.parse('5.11')) or PYQT6 or PYSIDE6: assert QtTest.QAbstractItemModelTester is not None @pytest.mark.skipif(PYQT5 and PYQT_VERSION.startswith('5.9'), reason="A specific setup with at least sip 4.9.9 is needed for PyQt5 5.9.*" "to work with scoped enum access") def test_enum_access(): """Test scoped and unscoped enum access for qtpy.QtTest.*.""" assert QtTest.QTest.Click == QtTest.QTest.KeyAction.Click ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qttexttospeech.py0000666000000000000000000000112100000000000016130 0ustar00import pytest from packaging import version from qtpy import PYQT5, PYSIDE2, PYQT_VERSION @pytest.mark.skipif(not ((PYQT5 and version.parse(PYQT_VERSION) >= version.parse('5.15.1')) or PYSIDE2), reason="Only available in Qt5 bindings (PyQt5 >= 5.15.1 or PySide2)") def test_qttexttospeech(): """Test the qtpy.QtTextToSpeech namespace.""" from qtpy import QtTextToSpeech assert QtTextToSpeech.QTextToSpeech is not None assert QtTextToSpeech.QVoice is not None if PYSIDE2: assert QtTextToSpeech.QTextToSpeechEngine is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qtwebchannel.py0000666000000000000000000000055400000000000015530 0ustar00import pytest from qtpy import PYQT5, PYSIDE2 @pytest.mark.skipif(not (PYQT5 or PYSIDE2), reason="Only available in Qt5 bindings") def test_qtwebchannel(): """Test the qtpy.QtWebChannel namespace""" from qtpy import QtWebChannel assert QtWebChannel.QWebChannel is not None assert QtWebChannel.QWebChannelAbstractTransport is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qtwebenginecore.py0000666000000000000000000000037600000000000016240 0ustar00import pytest from qtpy import PYQT5, PYQT6, PYSIDE2, PYSIDE6 def test_qtwebenginecore(): """Test the qtpy.QtWebEngineCore namespace""" from qtpy import QtWebEngineCore assert QtWebEngineCore.QWebEngineHttpRequest is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qtwebenginequick.py0000666000000000000000000000060700000000000016421 0ustar00import pytest from qtpy import PYQT5, PYQT6, PYSIDE2, PYSIDE6 @pytest.mark.skipif(PYQT5 or PYSIDE2, reason="Only available in Qt6 bindings") def test_qtwebenginequick(): """Test the qtpy.QtWebEngineQuick namespace""" from qtpy import QtWebEngineQuick assert QtWebEngineQuick.QtWebEngineQuick is not None assert QtWebEngineQuick.QQuickWebEngineProfile is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qtwebenginewidgets.py0000666000000000000000000000073500000000000016755 0ustar00import pytest from qtpy import PYSIDE6, PYQT6 @pytest.mark.skipif(PYSIDE6 or PYQT6, reason="Only available in Qt<6,>=6.2 bindings") def test_qtwebenginewidgets(): """Test the qtpy.QtWebEngineWidget namespace""" QtWebEngineWidgets = pytest.importorskip("qtpy.QtWebEngineWidgets") assert QtWebEngineWidgets.QWebEnginePage is not None assert QtWebEngineWidgets.QWebEngineView is not None assert QtWebEngineWidgets.QWebEngineSettings is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qtwebsockets.py0000666000000000000000000000101200000000000015561 0ustar00import pytest from qtpy import PYQT5, PYSIDE2 @pytest.mark.skipif(not (PYQT5 or PYSIDE2), reason="Only available in Qt5 bindings") def test_qtwebsockets(): """Test the qtpy.QtWebSockets namespace""" from qtpy import QtWebSockets assert QtWebSockets.QMaskGenerator is not None assert QtWebSockets.QWebSocket is not None assert QtWebSockets.QWebSocketCorsAuthenticator is not None assert QtWebSockets.QWebSocketProtocol is not None assert QtWebSockets.QWebSocketServer is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qtwidgets.py0000666000000000000000000000302200000000000015061 0ustar00"""Test QtWidgets.""" import pytest from qtpy import PYQT5, PYQT_VERSION, QtWidgets def test_qtextedit_functions(): """Test functions mapping for QtWidgets.QTextEdit.""" assert QtWidgets.QTextEdit.setTabStopWidth assert QtWidgets.QTextEdit.tabStopWidth assert QtWidgets.QTextEdit.print_ def test_qplaintextedit_functions(): """Test functions mapping for QtWidgets.QPlainTextEdit.""" assert QtWidgets.QPlainTextEdit.setTabStopWidth assert QtWidgets.QPlainTextEdit.tabStopWidth assert QtWidgets.QPlainTextEdit.print_ def test_qapplication_functions(): """Test functions mapping for QtWidgets.QApplication.""" assert QtWidgets.QApplication.exec_ def test_qdialog_functions(): """Test functions mapping for QtWidgets.QDialog.""" assert QtWidgets.QDialog.exec_ def test_qmenu_functions(): """Test functions mapping for QtWidgets.QDialog.""" assert QtWidgets.QMenu.exec_ @pytest.mark.skipif(PYQT5 and PYQT_VERSION.startswith('5.9'), reason="A specific setup with at least sip 4.9.9 is needed for PyQt5 5.9.*" "to work with scoped enum access") def test_enum_access(): """Test scoped and unscoped enum access for qtpy.QtWidgets.*.""" assert QtWidgets.QFileDialog.AcceptOpen == QtWidgets.QFileDialog.AcceptMode.AcceptOpen assert QtWidgets.QMessageBox.InvalidRole == QtWidgets.QMessageBox.ButtonRole.InvalidRole assert QtWidgets.QStyle.State_None == QtWidgets.QStyle.StateFlag.State_None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qtwinextras.py0000666000000000000000000000222300000000000015441 0ustar00import os import sys import pytest from qtpy import PYQT6, PYSIDE2, PYSIDE6 @pytest.mark.skipif( PYQT6 or PYSIDE6, reason="Not availible on Qt6-based bindings") @pytest.mark.skipif( sys.platform != "win32" or os.environ.get('USE_CONDA', 'Yes') == 'Yes', reason="Only available in Qt5 bindings > 5.9 with pip on Windows in CIs") def test_qtwinextras(): """Test the qtpy.QtWinExtras namespace""" from qtpy import QtWinExtras assert QtWinExtras.QWinJumpList is not None assert QtWinExtras.QWinJumpListCategory is not None assert QtWinExtras.QWinJumpListItem is not None assert QtWinExtras.QWinTaskbarButton is not None assert QtWinExtras.QWinTaskbarProgress is not None assert QtWinExtras.QWinThumbnailToolBar is not None assert QtWinExtras.QWinThumbnailToolButton is not None if not PYSIDE2: # See https://bugreports.qt.io/browse/PYSIDE-1047 assert QtWinExtras.QtWin is not None if PYSIDE2: assert QtWinExtras.QWinColorizationChangeEvent is not None assert QtWinExtras.QWinCompositionChangeEvent is not None assert QtWinExtras.QWinEvent is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qtxml.py0000666000000000000000000000155100000000000014220 0ustar00import pytest def test_qtxml(): """Test the qtpy.QtXml namespace""" from qtpy import QtXml assert QtXml.QDomAttr is not None assert QtXml.QDomCDATASection is not None assert QtXml.QDomCharacterData is not None assert QtXml.QDomComment is not None assert QtXml.QDomDocument is not None assert QtXml.QDomDocumentFragment is not None assert QtXml.QDomDocumentType is not None assert QtXml.QDomElement is not None assert QtXml.QDomEntity is not None assert QtXml.QDomEntityReference is not None assert QtXml.QDomImplementation is not None assert QtXml.QDomNamedNodeMap is not None assert QtXml.QDomNode is not None assert QtXml.QDomNodeList is not None assert QtXml.QDomNotation is not None assert QtXml.QDomProcessingInstruction is not None assert QtXml.QDomText is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/tests/test_qtxmlpatterns.py0000666000000000000000000000216500000000000016003 0ustar00import pytest from qtpy import PYSIDE2, PYSIDE6, PYQT6 @pytest.mark.skipif((PYSIDE6 or PYQT6), reason="not available with qt 6.0") def test_qtxmlpatterns(): """Test the qtpy.QtXmlPatterns namespace""" from qtpy import QtXmlPatterns assert QtXmlPatterns.QAbstractMessageHandler is not None assert QtXmlPatterns.QAbstractUriResolver is not None assert QtXmlPatterns.QAbstractXmlNodeModel is not None assert QtXmlPatterns.QAbstractXmlReceiver is not None if not PYSIDE2: assert QtXmlPatterns.QSimpleXmlNodeModel is not None assert QtXmlPatterns.QSourceLocation is not None assert QtXmlPatterns.QXmlFormatter is not None assert QtXmlPatterns.QXmlItem is not None assert QtXmlPatterns.QXmlName is not None assert QtXmlPatterns.QXmlNamePool is not None assert QtXmlPatterns.QXmlNodeModelIndex is not None assert QtXmlPatterns.QXmlQuery is not None assert QtXmlPatterns.QXmlResultItems is not None assert QtXmlPatterns.QXmlSchema is not None assert QtXmlPatterns.QXmlSchemaValidator is not None assert QtXmlPatterns.QXmlSerializer is not None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1640192728.0 QtPy-2.0.0/qtpy/tests/test_uic.py0000666000000000000000000001054300000000000013634 0ustar00import contextlib import os import sys import warnings import pytest from qtpy import PYSIDE6, PYSIDE2, QtWidgets from qtpy.QtWidgets import QComboBox if PYSIDE2: pytest.importorskip("pyside2uic", reason="pyside2uic not installed") from qtpy import uic from qtpy.uic import loadUi, loadUiType QCOMBOBOX_SUBCLASS = """ from qtpy.QtWidgets import QComboBox class _QComboBoxSubclass(QComboBox): pass """ @contextlib.contextmanager def enabled_qcombobox_subclass(temp_dir_path): """ Context manager that sets up a temporary module with a QComboBox subclass and then removes it once we are done. """ with open( temp_dir_path / 'qcombobox_subclass.py', mode='w', encoding="utf-8", ) as f: f.write(QCOMBOBOX_SUBCLASS) sys.path.insert(0, str(temp_dir_path)) yield sys.path.pop(0) def get_qapp(icon_path=None): """ Helper function to return a QApplication instance """ qapp = QtWidgets.QApplication.instance() if qapp is None: qapp = QtWidgets.QApplication(['']) return qapp @pytest.mark.skipif( os.environ.get('CI', None) is not None and sys.platform.startswith('linux'), reason="Segfaults on Linux CIs under all bindings (PYSIDE2/6 & PYQT5/6)") def test_load_ui(): """ Make sure that the patched loadUi function behaves as expected with a simple .ui file. """ app = get_qapp() with warnings.catch_warnings(): warnings.filterwarnings( "ignore", category=DeprecationWarning, message=".*mode.*") ui = loadUi(os.path.join(os.path.dirname(__file__), 'test.ui')) assert isinstance(ui.pushButton, QtWidgets.QPushButton) assert isinstance(ui.comboBox, QComboBox) @pytest.mark.skipif( PYSIDE2 or PYSIDE6, reason="PySide2uic not consistantly installed across platforms/versions") @pytest.mark.skipif( os.environ.get('CI', None) is not None and sys.platform.startswith('linux'), reason="Segfaults on Linux CIs under all bindings (PYSIDE2/6 & PYQT5/6)") def test_load_ui_type(): """ Make sure that the patched loadUiType function behaves as expected with a simple .ui file. """ app = get_qapp() with warnings.catch_warnings(): warnings.filterwarnings( "ignore", category=DeprecationWarning, message=".*mode.*") ui_type, ui_base_type = loadUiType( os.path.join(os.path.dirname(__file__), 'test.ui')) assert ui_type.__name__ == 'Ui_Form' class Widget(ui_base_type, ui_type): def __init__(self): super().__init__() self.setupUi(self) ui = Widget() assert isinstance(ui, QtWidgets.QWidget) assert isinstance(ui.pushButton, QtWidgets.QPushButton) assert isinstance(ui.comboBox, QComboBox) @pytest.mark.skipif( PYSIDE2 and sys.platform == "darwin" and sys.version_info.major == 3 and sys.version_info.minor == 9 and os.environ.get('USE_CONDA', 'No') == 'No', reason="Fails on this specific platform, at least on our CIs") @pytest.mark.skipif( os.environ.get('CI', None) is not None and sys.platform.startswith('linux'), reason="Segfaults on Linux CIs under all bindings (PYSIDE2/6 & PYQT5/6)") def test_load_ui_custom_auto(tmp_path): """ Test that we can load a .ui file with custom widgets without having to explicitly specify a dictionary of custom widgets, even in the case of PySide. """ app = get_qapp() with enabled_qcombobox_subclass(tmp_path): from qcombobox_subclass import _QComboBoxSubclass with warnings.catch_warnings(): warnings.filterwarnings( "ignore", category=DeprecationWarning, message=".*mode.*") ui = loadUi( os.path.join(os.path.dirname(__file__), 'test_custom.ui')) assert isinstance(ui.pushButton, QtWidgets.QPushButton) assert isinstance(ui.comboBox, _QComboBoxSubclass) @pytest.mark.skipif(PYSIDE6, reason="Unavailable on PySide6") def test_load_full_uic(): """Test that we load the full uic objects.""" QT_API = os.environ.get('QT_API', '').lower() if QT_API.startswith('pyside'): assert hasattr(uic, 'loadUi') assert hasattr(uic, 'loadUiType') else: objects = ['compileUi', 'compileUiDir', 'loadUi', 'loadUiType', 'widgetPluginPath'] assert all(hasattr(uic, o) for o in objects) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/qtpy/uic.py0000666000000000000000000002562600000000000011443 0ustar00import os from . import PYSIDE6, PYSIDE2, PYQT5, PYQT6 from .QtWidgets import QComboBox if PYQT6: from PyQt6.uic import * elif PYQT5: from PyQt5.uic import * else: __all__ = ['loadUi', 'loadUiType'] # In PySide, loadUi does not exist, so we define it using QUiLoader, and # then make sure we expose that function. This is adapted from qt-helpers # which was released under a 3-clause BSD license: # qt-helpers - a common front-end to various Qt modules # # Copyright (c) 2015, Chris Beaumont and Thomas Robitaille # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the # distribution. # * Neither the name of the Glue project nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS # IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Which itself was based on the solution at # # https://gist.github.com/cpbotha/1b42a20c8f3eb9bb7cb8 # # which was released under the MIT license: # # Copyright (c) 2011 Sebastian Wiesner # Modifications by Charl Botha # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modify, merge, publish, distribute, sublicense, # and/or sell copies of the Software, and to permit persons to whom the # Software is furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. if PYSIDE6: from PySide6.QtCore import QMetaObject from PySide6.QtUiTools import QUiLoader elif PYSIDE2: from PySide2.QtCore import QMetaObject from PySide2.QtUiTools import QUiLoader try: from pyside2uic import compileUi except ImportError: pass class UiLoader(QUiLoader): """ Subclass of :class:`~PySide.QtUiTools.QUiLoader` to create the user interface in a base instance. Unlike :class:`~PySide.QtUiTools.QUiLoader` itself this class does not create a new instance of the top-level widget, but creates the user interface in an existing instance of the top-level class if needed. This mimics the behaviour of :func:`PyQt4.uic.loadUi`. """ def __init__(self, baseinstance, customWidgets=None): """ Create a loader for the given ``baseinstance``. The user interface is created in ``baseinstance``, which must be an instance of the top-level class in the user interface to load, or a subclass thereof. ``customWidgets`` is a dictionary mapping from class name to class object for custom widgets. Usually, this should be done by calling registerCustomWidget on the QUiLoader, but with PySide 1.1.2 on Ubuntu 12.04 x86_64 this causes a segfault. ``parent`` is the parent object of this loader. """ QUiLoader.__init__(self, baseinstance) self.baseinstance = baseinstance if customWidgets is None: self.customWidgets = {} else: self.customWidgets = customWidgets def createWidget(self, class_name, parent=None, name=''): """ Function that is called for each widget defined in ui file, overridden here to populate baseinstance instead. """ if parent is None and self.baseinstance: # supposed to create the top-level widget, return the base # instance instead return self.baseinstance else: # For some reason, Line is not in the list of available # widgets, but works fine, so we have to special case it here. if class_name in self.availableWidgets() or class_name == 'Line': # create a new widget for child widgets widget = QUiLoader.createWidget(self, class_name, parent, name) else: # If not in the list of availableWidgets, must be a custom # widget. This will raise KeyError if the user has not # supplied the relevant class_name in the dictionary or if # customWidgets is empty. try: widget = self.customWidgets[class_name](parent) except KeyError as error: raise Exception( f'No custom widget {class_name} ' 'found in customWidgets' ) from error if self.baseinstance: # set an attribute for the new child widget on the base # instance, just like PyQt4.uic.loadUi does. setattr(self.baseinstance, name, widget) return widget def _get_custom_widgets(ui_file): """ This function is used to parse a ui file and look for the section, then automatically load all the custom widget classes. """ import sys import importlib from xml.etree.ElementTree import ElementTree # Parse the UI file etree = ElementTree() ui = etree.parse(ui_file) # Get the customwidgets section custom_widgets = ui.find('customwidgets') if custom_widgets is None: return {} custom_widget_classes = {} for custom_widget in list(custom_widgets): cw_class = custom_widget.find('class').text cw_header = custom_widget.find('header').text module = importlib.import_module(cw_header) custom_widget_classes[cw_class] = getattr(module, cw_class) return custom_widget_classes def loadUi(uifile, baseinstance=None, workingDirectory=None): """ Dynamically load a user interface from the given ``uifile``. ``uifile`` is a string containing a file name of the UI file to load. If ``baseinstance`` is ``None``, the a new instance of the top-level widget will be created. Otherwise, the user interface is created within the given ``baseinstance``. In this case ``baseinstance`` must be an instance of the top-level widget class in the UI file to load, or a subclass thereof. In other words, if you've created a ``QMainWindow`` interface in the designer, ``baseinstance`` must be a ``QMainWindow`` or a subclass thereof, too. You cannot load a ``QMainWindow`` UI file with a plain :class:`~PySide.QtGui.QWidget` as ``baseinstance``. :method:`~PySide.QtCore.QMetaObject.connectSlotsByName()` is called on the created user interface, so you can implemented your slots according to its conventions in your widget class. Return ``baseinstance``, if ``baseinstance`` is not ``None``. Otherwise return the newly created instance of the user interface. """ # We parse the UI file and import any required custom widgets customWidgets = _get_custom_widgets(uifile) loader = UiLoader(baseinstance, customWidgets) if workingDirectory is not None: loader.setWorkingDirectory(workingDirectory) widget = loader.load(uifile) QMetaObject.connectSlotsByName(widget) return widget def loadUiType(uifile, from_imports=False): """Load a .ui file and return the generated form class and the Qt base class. The "loadUiType" command convert the ui file to py code in-memory first and then execute it in a special frame to retrieve the form_class. Credit: https://stackoverflow.com/a/14195313/15954282 """ import sys from io import StringIO from xml.etree.ElementTree import ElementTree from . import QtWidgets # Parse the UI file etree = ElementTree() ui = etree.parse(uifile) widget_class = ui.find('widget').get('class') form_class = ui.find('class').text with open(uifile, encoding="utf-8") as fd: code_stream = StringIO() frame = {} compileUi(fd, code_stream, indent=0, from_imports=from_imports) pyc = compile(code_stream.getvalue(), '', 'exec') exec(pyc, frame) # Fetch the base_class and form class based on their type in the # xml from designer form_class = frame['Ui_%s' % form_class] base_class = getattr(QtWidgets, widget_class) return form_class, base_class ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1640193425.5343258 QtPy-2.0.0/setup.cfg0000666000000000000000000000343000000000000011122 0ustar00[metadata] name = QtPy version = attr: qtpy.__version__ description = Provides an abstraction layer on top of the various Qt bindings (PyQt5/6 and PySide2/6). long_description = file: README.md long_description_content_type = text/markdown url = https://github.com/spyder-ide/qtpy author = Colin Duquesnoy and the Spyder Development Team author_email = spyder.python@gmail.com maintainer = Spyder Development Team and QtPy Contributors maintainer_email = spyder.python@gmail.com license = MIT license_file = LICENSE.txt license_files = AUTHORS.md LICENSE.txt classifiers = Development Status :: 5 - Production/Stable Environment :: MacOS X Environment :: Win32 (MS Windows) Environment :: X11 Applications :: Qt Intended Audience :: Developers License :: OSI Approved :: MIT License Operating System :: OS Independent Programming Language :: Python :: 3 Programming Language :: Python :: 3 :: Only Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Topic :: Software Development :: Libraries Topic :: Software Development :: User Interfaces Topic :: Software Development :: Widget Sets keywords = qt PyQt5 PyQt6 PySide2 PySide6 project_urls = Github = https://github.com/spyder-ide/qtpy Bug Tracker = https://github.com/spyder-ide/qtpy/issues Parent Project = https://www.spyder-ide.org/ [options] packages = find: install_requires = packaging python_requires = >=3.6 include_package_data = True zip_safe = False [options.packages.find] exclude = contrib docs tests* [options.extras_require] test = pytest>=6.0.0,<7.0 pytest-cov>=2.11.0 [egg_info] tag_build = tag_date = 0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638558301.0 QtPy-2.0.0/setup.py0000666000000000000000000000023500000000000011013 0ustar00#!/usr/bin/env python3 """Stub setup.py for use with legacy build tooling.""" import setuptools if __name__ == "__main__": setuptools.setup()