Weird QProxyStyle TypeError on Python 3.12
Charles
peacech at gmail.com
Thu Sep 28 17:11:30 BST 2023
Fixed by upgrading pyqt6-sip to pyqt6-sip-13.5.2. I guess the problem was
in the sip package.
On Thu, Sep 28, 2023 at 11:02 PM Charles <peacech at gmail.com> wrote:
> 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/c8adb30c/attachment.htm>
More information about the PyQt
mailing list