-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1018 from astrofrog/use-qtpy
Use of QtPy instead of qt-helpers
- Loading branch information
Showing
93 changed files
with
573 additions
and
1,053 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,24 @@ | ||
Qt development in Glue | ||
====================== | ||
|
||
.. _qthelpers: | ||
.. _qtpy: | ||
|
||
Using qt-helpers | ||
---------------- | ||
Using QtPy | ||
---------- | ||
|
||
If you are interested in working on some of the Qt-specific code, it's | ||
important that you don't import any code directly from PyQt4, PyQt5, or PySide. | ||
Since we want to maintain backward-compatibility with all of these, you should | ||
always import from ``glue.external.qt`` as if this was one of the Python Qt | ||
packages. For instance, instead of:: | ||
always use the `QtPy <https://pypi.python.org/pypi/QtPy>`__ package. The way to | ||
use this package is to import from the ``qtpy`` module as if it was the | ||
``PyQt5`` module, and QtPy will automatically translate this into the | ||
appropriate imports for PySide or PyQt4 if needed. For instance, instead of:: | ||
|
||
from PyQt4 import QtGui | ||
from PyQt4 import QtCore | ||
|
||
you should do:: | ||
|
||
from glue.external.qt import QtGui | ||
from qtpy import QtCore | ||
|
||
Note that for now, if the PyQt4 and PyQt5 import paths would be different, you | ||
should use the PyQt4 one, and we have provided patches in ``glue.external.qt`` | ||
to make PyQt5 backward-compatible. | ||
Note that if the PyQt4 and PyQt5 import paths would be different, you should | ||
use the PyQt5 one. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.