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:

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)

Most upvoted comments

QtUiTools is not available in PyQt, 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-files

You can add custom QtUiTools support yourself using QtSiteConfig.py if needed, please see https://github.com/mottosso/Qt.py#qtsiteconfigpy