Weird QProxyStyle TypeError on Python 3.12
Charles
peacech at gmail.com
Thu Sep 28 17:02:13 BST 2023
I also experienced this when trying qdarktheme (
https://github.com/5yutan5/PyQtDarkTheme), running on python 3.11 64 bit,
Windows 10, PyQt6-6.5.3.dev2309101249-cp37-abi3-win_amd64.whl
TypeError: arguments did not match any overloaded call:
QProxyStyle(style: typing.Optional[QStyle] = None): not enough arguments
QProxyStyle(key: Optional[str]): not enough arguments
Probably because key is a reference
QProxyStyle::QProxyStyle(const QString &key)
To fix it I have to pass None as the parameter. So maybe None match a null
pointer but it does not match a null? reference. Can a reference even be
null?
On Thu, Sep 21, 2023 at 2:52 PM Florian Bruhin <me at the-compiler.org> wrote:
> Hey,
>
> With CPython 3.12.0rc1 and PyQt 6.5.2 on Fedora 39 Beta 1.1, it looks
> like it's impossible to create a QProxyStyle with no arguments.
>
> A "docker run -it fedora:39" followed by:
>
> dnf install python-pyqt6
> python3 -c 'from PyQt6.QtWidgets import QProxyStyle; s = QProxyStyle()'
>
> Results in:
>
> TypeError: arguments did not match any overloaded call:
> QProxyStyle(style: typing.Optional[QStyle] = None): not enough
> arguments
> QProxyStyle(key: Optional[str]): not enough arguments
>
> Using QProxyStyle(None) seems to work as a workaround.
>
> For some reason, I can *not* reproduce this right now on Archlinux with
> Python 3.12.0rc2 (but Python 3.12.0rc3 on Fedora also reproduces it,
> *and* I've seen this exact error on Archlinux earlier this week, so not
> sure yet what triggers it).
>
> Florian
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20230928/54741df1/attachment.htm>
More information about the PyQt
mailing list