use single generic template for all bindings#2226
Conversation
|
@pijyoi thanks so much for this. This has been a thorny issue for a while. It's been tough for me to evaluate the downside here as I don't use Qt designer or templates in my own projects, and I really don't know how prevalent their usage is in general. An issue I can see is that unless we remove the |
68131c0 to
6680bc5
Compare
|
By deleting the non-generic files, it becomes clear from the git history that the generic files are just a rename of the *_pyqt6.py files with a one-line modification. |
|
The only other thing I can think of that should probably be part of this PR is that |
|
The automatic rewrite of the import line would need to handle different depth relative imports (for the library) and absolute imports (for the examples). It would also be relying on pyuic6 output to remain the same style. |
|
Forgot about the relative import, that would indeed be trickier (and frankly just add un-needed complexity here). Probably not worth the effort. |
|
On a whim, I tried using (*) The colormap files were missing, so I changed my script to not use them. Digging a bit, it seems that someone has taught |
|
|
||
|
|
||
| from PyQt6 import QtCore, QtGui, QtWidgets | ||
| from ...Qt import QtCore, QtGui, QtWidgets |
Check notice
Code scanning / CodeQL
Unused import
|
|
||
|
|
||
| from PyQt6 import QtCore, QtGui, QtWidgets | ||
| from ..Qt import QtCore, QtGui, QtWidgets |
Check notice
Code scanning / CodeQL
Unused import
|
|
||
|
|
||
| from PyQt6 import QtCore, QtGui, QtWidgets | ||
| from ...Qt import QtCore, QtGui, QtWidgets |
Check notice
Code scanning / CodeQL
Unused import
7b7683d to
114649f
Compare
|
Thanks for this @pijyoi Hopefully, this will make life easier for the folks doing freezing. |
Currently, each
.uifile has a separate generated.pyfile for each of the 4 bindings.This PR demonstrates that the currently supported bindings are sufficiently similar that a single generic "generated" file can be used for all bindings. The generic "generated" file is actually a hand-modified version of the files churned out by PyQt6's
pyuic6.One benefit of doing this would be to make it easier for users who use
py2exe,pyinstalleror similar programs. These programs seem to have issues with bundling files imported using the following statement. (#2122, #2179, #1981, #1934, #1811, #1801)Disclaimer: Not being a user of any of these freezing / bundling programs, I can't say for certain that this PR would make those programs include the needed files.
Note: flowchart, canvas, console modules were left out since they are not much used.