-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement #131 #132
Implement #131 #132
Conversation
I'm considering getting my hands on a large library of For that, how about finding say, 10.000 of them from GitHub via a specific search query, storing them all in a Gist for reproducibility, and download them during testing to be run through the same conversion mechanism? |
More discussion on Python Inside Maya. |
This didn't work, here's why.
So I'll now resort to collecting any .ui files you have lying around. Let me know! |
I'm considering releasing this as-is as an alpha. Currently, when you run it, this happens. $ python -m Qt --help
usage: Qt.py [-h] [--convert CONVERT] [--compile COMPILE] [--stdout] [--stdin]
optional arguments:
-h, --help show this help message and exit
--convert CONVERT Path to compiled Python module, e.g. my_ui.py
--compile COMPILE Accept raw .ui file and compile with native PySide2
compiler.
--stdout Write to stdout instead of file
--stdin Read from stdin instead of file
$ python -m Qt --convert my_ui.py
#
# WARNING: --convert is an ALPHA feature.
#
# See https://github.com/mottosso/Qt.py/pull/132
# for details.
#
Creating "my_ui_backup.py"..
Successfully converted "my_ui.py"
$ Which should be enough to keep people from relying on it, but inviting enough for them to try and find problems for us to expel. @fredrikaverpil What do you think of all this? |
Ok, I'm back from my honeymoon 😄 I use .ui files (from Qt Designer) and load those as they are without converting them (this means using Qt.py's $ python -m Qt --convert main_window.ui
#
# WARNING: --convert is an ALPHA feature.
#
# See https://github.com/mottosso/Qt.py/pull/132
# for details.
#
Creating "main_window_backup.ui"..
Successfully converted "main_window.ui"
$ ls -alh main_win*
-rwxr-xr-x 1 fredrik staff 2.4K Sep 14 07:16 main_window.ui
-rwxr-xr-x 1 fredrik staff 2.4K Sep 14 07:16 main_window_backup.ui I'm not sure what I'm doing wrong. Perhaps you never go from .ui to .py? |
|
I think it looks fine to merge this, especially since you're mentioning it's an alpha. I can't say I know much about this feature. |
Do you want to include something on this in the README? |
Welcome back, by the way! Sorry, was deep in thought as I wrote the reply. The feature is in relation to #99 and #129, and #131 is the source issue. In short, some users, like yourself, prefer This is an attempt at solving this problem by way of the command-line, the same environment in which files are compiled in the first place. I was hoping to also have the Other than that, it needs testing. If you have any |
So when you use the About pyside2-uic, I think it's part of pyside-tools, which doesn't seem to be compiled when building pyside-setup and thus not included in the PySide2 wheel. But what's the use case for the |
# This
$ pyside2-uic my_ui.ui -o my_ui.py
# Is this
$ python -m Qt --compile my_ui.ui It's to highlight the fact that the only compiler you can use is the one from PySide2.
When used in conjunction with $ python -m Qt --compile --convert my_ui.ui
$ cat my_ui.py |
Okay, now I get it. Thanks for that explanation :) Do you have access to Maya 2017? |
I do, but I'm looking to include tests for this and need it accessible somehow via the Docker image. |
For completion... I managed to find the built package and manually copy it into my site-packages. Then I also copied the built binary. Details here. |
Qt.py is running hot at Method!
Conflicts: Qt.py
Ok, let's get this on the road for testing as-is, then continue working on it through more issues and PRs. Any objections? |
No objections! |
Allright folks, let's get this started!
This command converts a PySide2-compiled .ui file into a Qt.py-compatible equivalent.
Tested on this file.
Also includes a non command-line version.
What we need
Let me know what you think!