Issue
I've been experimenting with QT5
for Python, using pyqt5
. I've noticed that most tutorials recommend using pyuic5 to convert the XML UI to Python code. I've also seen a couple of tutorials where instead they use uic.loadUi("myui.ui") to dynamical load the XML UI
. This seems like a cleaner, more modular solution to me, but it appears to be an unpopular option. Is there a reason converting your code with pyuic5
is a sounder solution?
Solution
Both solutions are good, they have advantages and disadvantages that have to be weighed with what you want to do, and many times it will depend on the taste of the programmer.
pyuic5:
Allows inheritance [+]
There is no additional load when running the application [+]
Convert the .ui to .py every time the file is modified [-]
uic.loadUi():
You do not have to modify anything when modifying the .ui [+]
Compilation extra time [+]
Does not allow inheritance (You could implement the inheritance using
uic.loadUiType()
) [-]Does not allow the use of inspect [-].
Answered By - eyllanesc
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.