Qt.py: PySide2 ImportError: cannot import name 'QtUiTools'
Hey Guys!
I’ve noticed some inconsistencies between Maya’s PySide2 and the latest PySide2 that prevent it from being used in Qt.py:
- The latest version of https://codereview.qt-project.org/pyside/pyside-setup does not include
QtUiTools
in it’s__init__.py
- Within Maya2017
PySide2
still includes theQtUiTools
module. Qt5
does not list the module here: http://doc.qt.io/qt-5/qtmodules.html- (
Qt4
does: http://doc.qt.io/qt-4.8/modules.html)
It looks like the module has been replaced with QFormBuilder in Qt5 (But I’ve never actually used a .ui file, so I could be horribly incorrect here): http://doc.qt.io/qt-5/qformbuilder.html http://stackoverflow.com/questions/20670457/qt-5-unknown-modules-in-qt-uitools
If it has been replaced, you might need a version check in the _pyside2
function to determine whether or not it should be imported.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 18 (4 by maintainers)
QtUiTools
is not available inPyQt
, and therefore not supported by Qt.py. Today, Qt.py will only support members which are most usually found across all the different Qt bindings. I believe that Qt.py did not follow this rule when this issue was originally created.Please have a look at the
QtCompat.loadUi
convenience function here: https://github.com/mottosso/Qt.py#loading-qt-designer-filesYou can add custom
QtUiTools
support yourself usingQtSiteConfig.py
if needed, please see https://github.com/mottosso/Qt.py#qtsiteconfigpy