Skip to content

0.5.0

Compare
Choose a tag to compare
@mottosso mottosso released this 17 Sep 09:17
· 687 commits to master since this release

Alpha release of --convert for Qt Designer files.

Steps

  1. Have your .ui file ready.
  2. Compile your .ui file using the PySide2 uic module.
  3. Convert your compiled .ui file with Qt.py

Demo

$ pyside2-uic my_ui.ui -o my_ui.py
$ python -m Qt --convert my_ui.py
# Creating "my_ui_backup.py"..
# Successfully converted "my_ui.py"

Note to Maya 2017-users: You can find pyside2-uic in your Maya installation directory

Implementation

The method at which the conversion happens is early alpha and is expected to work in common cases, but may not cover all edge cases.

What we need is for you to test this, and let us know where it fails so we can repair it.

The implementation will, at this point in time:

  1. Replace occurrences of from PySide2 import with from Qt import
  2. Replace occurrences of QtWidgets.QApplication.translate with Qt.translate

And that's it.

The function is idempotent and will create a backup of your original, as my_ui_backup.py

Let us know what you think!