[PyQt] pyuic4 vs uic Module
christop.probst at gmail.com
Thu Aug 2 20:04:59 BST 2018
Thank-you very much for your insight. I must say, coming from the Qt C++
world, dynamically loading the ui at run-time seems unusual to me. Is there
a performance hit? Why not use pyqt4uic to compile in the code into Python?
What is the issue with that?
On Wed, 1 Aug 2018 at 17:24, Kyle Altendorf <sda at fstab.net> wrote:
> On August 1, 2018 5:08:48 PM EDT, Christopher Probst <
> christop.probst at gmail.com> wrote:
> >Helllo everybody,
> >Is there any best practice suggestion as to how to interact with the Qt
> >files? Is it better to load them dynamically using the uic module with
> >load uic.loadUi method?
> >Or is it recommended to compile the ui files into python code using
> I'm not sure any caveats between 4 vs 5 but I much prefer loading at run
> time. Here's what I'm tending towards now.
> Ui, UiBase = PyQt5.uic.loadUiType(
> pathlib.Path(__file__).parents / 'mainwindow.ui',
> class MainWindow(UiBase):
> def __init__(self, parent=None):
> super().__init__(parent) self.ui = Ui()
> The one caveat that I'm aware of is the lack of a .py file for an IDE to
> parse for help completing names. I'll note that there is a call in uic for
> compiling without having to run pyuic from the command line so some hybrid
> might make sense.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt