Skip to content

Commit

Permalink
Merge pull request #357 from dalthviz/fixes_issue_61
Browse files Browse the repository at this point in the history
PR: Add initial `Methods, helpers and QtPy namespace specifics` section to the README
  • Loading branch information
ccordoba12 authored Jul 25, 2022
2 parents 469e8d1 + 050a383 commit 78ee3de
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,37 @@ default unless you set the `QT_API` environment variable.
* `pyside6` (to use PySide6).


### Module aliases and constants

* `QtCore.pyqtSignal`, `QtCore.pyqtSlot` and `QtCore.pyqtProperty` (available on PyQt5/6) are instead exposed as `QtCore.Signal`, `QtCore.Slot` and `QtCore.Property`, respectively, following the Qt5 module layout.

* The Qt version being used can be checked with `QtCore.__version__` (instead of `QtCore.QT_VERSION_STR`) as well as from `qtpy.QT_VERSION`.

* For PyQt6 enums, unscoped enum access was added by promoting the enums of the `QtCore`, `QtGui`, `QtTest` and `QtWidgets` modules.

* Compatibility is added between the `QtGui` and `QtOpenGL` modules for the `QOpenGL*` classes.

* To check the current binding version, you can use `qtpy.PYSIDE_VERSION` for PySide2/6 and `qtpy.PYQT_VERSION` for PyQt5/6. If the respective binding is not being used, the value of its attribute will be `None`.

* To check the current selected binding, you can use `qtpy.API_NAME`

* There are boolean values to check if Qt5/6, PyQt5/6 or PySide2/6 are being used: `qtpy.Qt5`, `qtpy.Qt6`, `qtpy.PYQT5`, `qtpy.PYQT6`, `qtpy.PYSIDE2` and `qtpy.PYSIDE6`. `True` if currently being used, `False` otherwise.

#### Compat module

In the `qtpy.compat` module, you can find wrappers for `QFileDialog` static methods and SIP/Shiboken functions, such as:

* `QFileDialog.getExistingDirectory` wrapped with `qtpy.compat.getexistingdirectory`

* `QFileDialog.getOpenFileName` wrapped with `qtpy.compat.getopenfilename`

* `QFileDialog.getOpenFileNames` wrapped with `qtpy.compat.getopenfilenames`

* `QFileDialog.getSaveFileName` wrapped with `qtpy.compat.getsavefilename`

* `sip.isdeleted` and `shiboken.isValid` wrapped with `qtpy.compat.isalive`


### Installation

```bash
Expand Down

0 comments on commit 78ee3de

Please sign in to comment.