I'm using qtpandas as a module in a PySide project, so I want all the calls from the compat imports to be from PySide.
I also have PyQt4 installed system-wide as well, but it is not going to be imported anywhere in the project. Unfortunately, following the default order, compat tries to import PyQt4 first, it finds it, so classes like QtGui are overwritten by the ones from PyQt4. This makes trouble when later I create objects that are, for instance, a subclass of QtGui.QWidget et similia.
The easy patch for my case is to switch the try cases, but one is simply re-phrasing the problem in this way...
There should be a way to look if one of the modules is already imported, like is done in pyqtgraph:
https://github.com/pyqtgraph/pyqtgraph/blob/develop/pyqtgraph/Qt.py
AFAIU, their Qt module should do the same job as the compat one...
I'm using qtpandas as a module in a PySide project, so I want all the calls from the compat imports to be from PySide. I also have PyQt4 installed system-wide as well, but it is not going to be imported anywhere in the project. Unfortunately, following the default order, compat tries to import PyQt4 first, it finds it, so classes like QtGui are overwritten by the ones from PyQt4. This makes trouble when later I create objects that are, for instance, a subclass of QtGui.QWidget et similia. The easy patch for my case is to switch the try cases, but one is simply re-phrasing the problem in this way... There should be a way to look if one of the modules is already imported, like is done in pyqtgraph: https://github.com/pyqtgraph/pyqtgraph/blob/develop/pyqtgraph/Qt.py AFAIU, their Qt module should do the same job as the compat one...