A few issue with 6.2.0
Phil Thompson
phil at riverbankcomputing.com
Sat Oct 23 14:03:46 BST 2021
On 21/10/2021 04:39, Damien Elmes wrote:
> Thanks for your continued work on PyQt, Phil. The improvements to the
> PyPI
> packaging over the last few years are particularly appreciated -
> everything
> is a lot easier than it used to be.
>
> Just wanted to let you know about a few issues I came across:
>
> - The Wayland driver appears to be missing
> libQt6WaylandEglClientHwIntegration.so.6. When starting a PyQt app with
> QT_QPA_PLATFORM=wayland:
>
> Cannot load library
> PyQt6/Qt6/plugins/wayland-graphics-integration-client/libqt-plugin-wayland-egl.so:
> (libQt6WaylandEglClientHwIntegration.so.6: cannot open shared object
> file:
> No such file or directory)"
> Qt warning: Failed to load client buffer integration: "wayland-egl"
> Qt warning: Available client buffer integrations: QList("wayland-egl",
> "xcomposite-egl", "xcomposite-glx")
>
> Things work correctly when it's copied from a Qt6 install into
> PyQt6/Qt6/lib.
Thanks.
> - QtWebEngineProcess appears to have a malformed signature in the macOS
> builds, and needs to be re-signed before WebEngine will work on a Mac:
>
> codesign -s - \
> PyQt6/Qt6/lib/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess
I can't reproduce this (on an Intel Mac). The original file is not
signed.
> - the macos_amd64 wheels should probably use 11_0 - they are currently
> 10_14, and pip refuses to install them with 'no matching distributions'
> on
> an Apple M1 machine.
That sounds like a pip bug as 10.4 is the minimum required version. What
is the output of 'pip --verbose debug'?
> - The uic tool is outputting a few old-style enums that don't work, and
> need to be adjusted:
>
> line = line.replace(
> "QAction.PreferencesRole", "QAction.MenuRole.PreferencesRole"
> )
> line = line.replace("QAction.AboutRole", "QAction.MenuRole.AboutRole")
> line = line.replace(
> "QComboBox.AdjustToMinimumContentsLength",
> "QComboBox.SizeAdjustPolicy.AdjustToMinimumContentsLength",
> )
>
> This is for content like the following in an action:
>
> 118- <property name="menuRole">
> 119: <enum>QAction::PreferencesRole</enum>
> 120- </property>
>
> and for qcombobox:
>
> 60- <widget class="QComboBox" name="field">
> 61- <property name="sizeAdjustPolicy">
> 62:
> <enum>QComboBox::AdjustToMinimumContentsLengthWithIcon</enum>
> 63- </property>
> 64- </widget>
Fixed for QAction.MenuRole but QComboBox.SizeAdjustPolicy should be
fine. Do you have a .ui file that demonstrates the problem?
> Also one issue not specific to the 6.2.0 release - the provided typings
> are
> a big help, and coming from a 5.x release, it's nice to see py.typed
> being
> included by default. One issue that still seems to remain though is
> that
> mypy does not pick up references to missing attributes/methods on
> objects
> inheriting from PyQt. This means if you make a class that inherits from
> QDialog for example, and then call
> self.a_custom_func_that_was_removed_in_a_refactor(), mypy can't warn
> you
> about it. We're currently applying some transformations to the
> distributed
> .pyi files to work around it:
>
> # inheriting from the missing sip.sipwrapper definition
> # causes missing attributes not to be detected, as it's treating
> # the class as inheriting from Any
> line = line.replace("PyQt6.sip.wrapper", "object")
sip.wrapper is not missing, it is defined in sip.pyi.
> # remove blanket getattr in QObject which also causes missing
> # attributes not to be detected
> if "def __getattr__(self, name: str) -> typing.Any" in line:
> continue
Fixed - even though it is accurate it can hide a multitude of sins.
> We also automatically add '# type: ignore' comments to any '.connect('
> line
> in generated uic files, as the types don't currently cover the signals.
> Apart from that, the typing is working great.
Can you give me an example of a modified file - just so that I get it
right first time.
Phil
More information about the PyQt
mailing list