[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: Weird QProxyStyle TypeError on Python 3.12
From:       Charles <peacech () gmail ! com>
Date:       2023-09-28 16:11:30
Message-ID: CABthHP-Go7rPNnJnwzU7yPAw0vZJmw08X+2FBT6mDEDooJXnWA () mail ! gmail ! com
[Download RAW message or body]

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@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@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
>>
>

[Attachment #3 (text/html)]

<div dir="ltr"><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif;font-size:small">Fixed by upgrading \
pyqt6-sip to pyqt6-sip-13.5.2. I guess the problem was in the sip \
package.<br></div></div><br><div class="gmail_quote"><div dir="ltr" \
class="gmail_attr">On Thu, Sep 28, 2023 at 11:02 PM Charles &lt;<a \
href="mailto:peacech@gmail.com">peacech@gmail.com</a>&gt; wrote:<br></div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif;font-size:small">I also experienced \
this when trying qdarktheme (<a href="https://github.com/5yutan5/PyQtDarkTheme" \
target="_blank">https://github.com/5yutan5/PyQtDarkTheme</a>), running on python 3.11 \
64 bit, Windows 10, PyQt6-6.5.3.dev2309101249-cp37-abi3-win_amd64.whl</div><div \
class="gmail_default" \
style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div \
class="gmail_default" \
style="font-family:arial,helvetica,sans-serif;font-size:small">TypeError: arguments \
did not match any overloaded call:<br>   QProxyStyle(style: typing.Optional[QStyle] = \
None): not enough arguments<br>   QProxyStyle(key: Optional[str]): not enough \
arguments</div><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div \
class="gmail_default" \
style="font-family:arial,helvetica,sans-serif;font-size:small">Probably because key \
is a reference</div><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div \
class="gmail_default" \
style="font-family:arial,helvetica,sans-serif;font-size:small">QProxyStyle::QProxyStyle(const \
QString &amp;key)</div><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div \
class="gmail_default" \
style="font-family:arial,helvetica,sans-serif;font-size:small">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?<br></div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 21, 2023 at \
2:52 PM Florian Bruhin &lt;<a href="mailto:me@the-compiler.org" \
target="_blank">me@the-compiler.org</a>&gt; wrote:<br></div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex">Hey,<br> <br>
With CPython 3.12.0rc1 and PyQt 6.5.2 on Fedora 39 Beta 1.1, it looks<br>
like it&#39;s impossible to create a QProxyStyle with no arguments.<br>
<br>
A &quot;docker run -it fedora:39&quot; followed by:<br>
<br>
      dnf install python-pyqt6<br>
      python3 -c &#39;from PyQt6.QtWidgets import QProxyStyle; s = \
QProxyStyle()&#39;<br> <br>
Results in:<br>
<br>
      TypeError: arguments did not match any overloaded call:<br>
         QProxyStyle(style: typing.Optional[QStyle] = None): not enough arguments<br>
         QProxyStyle(key: Optional[str]): not enough arguments<br>
<br>
Using QProxyStyle(None) seems to work as a workaround.<br>
<br>
For some reason, I can *not* reproduce this right now on Archlinux with<br>
Python 3.12.0rc2 (but Python 3.12.0rc3 on Fedora also reproduces it,<br>
*and* I&#39;ve seen this exact error on Archlinux earlier this week, so not<br>
sure yet what triggers it).<br>
<br>
Florian<br>
</blockquote></div>
</blockquote></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic