Correct way to load .ui files?
Charles
peacech at gmail.com
Mon Nov 25 04:28:18 GMT 2024
Debian likes to split an application into multiple packages
https://packages.debian.org/bookworm/all/pyqt6-dev-tools/filelist
On Mon, Nov 25, 2024 at 11:22 AM Colin Macdonald <cbm at math.ubc.ca> wrote:
> I've been using "from PyQt6 import uic" and this works just fine with
> your libraries from `pip install pyqt6`.
>
> But I've just found that this does not work out-of-the-box on Debian
> 12.8 and Ubuntu 24.04.
>
> For example:
>
> $ docker pull debian:trixie
> $ docker run -it --rm debian:trixie
> $ apt update
> $ apt install python3-pyqt6
> $ python3 -c "from PyQt6 import uic"
> Traceback (most recent call last):
> File "<string>", line 1, in <module>
> ImportError: cannot import name 'uic' from 'PyQt6'
> (/usr/lib/python3/dist-packages/PyQt6/__init__.py)
>
> - - - -
>
> My real code looks something like this:
>
> from PyQt6 import uic
>
> class XYZ(QDialog):
> def __init__(self):
> super().__init__()
> uic.loadUi("xyz.ui", self)
>
> Perhaps that isn't quite right? I don't recall where I learned this,
> perhaps
> https://www.pythonguis.com/tutorials/pyqt6-first-steps-qt-designer/
>
> Maybe I should go back to `pyuic6` approach instead?
>
> Or is this something to file an issue with the Debian folks?
>
> thanks,
> Colin
>
> --
> Colin Macdonald
> Associate Professor
> Dept of Math, UBC
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20241125/c69736cf/attachment.htm>
More information about the PyQt
mailing list