Hi all,
Many of you have been asking about working with ui files in a way maintains the cross-binding benefit of Qt.py.
The problem has been that:
loadUi()
differently andOne suggestion was to:
So that’s what is happening here.
$ pyside2-uic my_ui.ui -o my_ui.py
$ python -m Qt --convert my_ui.py
$ cat my_ui_.py
What we need now is:
Let me know what you think!
Best,
Marcus
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAjdKbcXmfG1LNSyA514-HC9XC3UkxtXq0fNUb6Nj%2BAJg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA1oNG3qmkTXajcrfnTGLvoonZJ_PBmmnjSO3kqZYVEA9Q%40mail.gmail.com.
That's a good idea!I'm expecting this initial proposal to mostly get the conversation started and iterate on it until all is well. Considering the source files are all automatically generated by another program, I'm expecting a finite set of edge cases. This does sound like one of them.
But, don't you feel working at the abstract tree-level is perhaps a tad premature? Spontaneously I'd first try splitting lines at file-open, via e.g. file.readlines().
Another reason for going with .replace() as opposed to jumping straight into regular expressions is readability and maintainability. I want to enable others to understand the conversion and make changes to it where necessary. Both re and AST carry the potential of making these options fairly limited.
Thanks, and if you have any ui files (I know you generally don't work with them, neither do I) do let me know!
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/2060697B-7EFD-436A-8CDD-6E18347070E5%40gmail.com.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAw-4OzCXB4T5qTKdxf9G8x%2BgY3M%2BpMLMTByyOtHEEJow%40mail.gmail.com.
On Thu, 8 Sep 2016, 7:09 PM Marcus Ottosson <konstr...@gmail.com> wrote:Good thoughts.I've always wanted a reason to get into AST, perhaps now is the time.Thanks Justin.Sweet. Let us know if you end up going down that path. Would love to see it in action.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAw-4OzCXB4T5qTKdxf9G8x%2BgY3M%2BpMLMTByyOtHEEJow%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3aQFgm0BbA0La_ibx%3DFV-ExARHoOecAWE68XUXUwZbQg%40mail.gmail.com.
Good thoughts.I've always wanted a reason to get into AST, perhaps now is the time.Thanks Justin.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAw-4OzCXB4T5qTKdxf9G8x%2BgY3M%2BpMLMTByyOtHEEJow%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Ok, we’ve made an alpha version of this to test with.
If you’re interested in compiling Qt Designer files for use across bindings, your help would be most appreciated. The rule is, .ui
files are first compiled with the PySide2 compiler, and then converted to Qt.py.
$ pip install Qt.py
$ 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"
The resulting Python module should be compatible with every binding. If it’s not, submit a bug report or pull-request and we’ll see it fixed!
In Maya 2017, the compiler executable will be located in your Maya installation directory, alongside mayapy
and maya
.
Let me know how that works for you!