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

List:       pykde
Subject:    Re: Qt6: QUrl and UrlFormattingOption vs. ComponentFormattingOption
From:       Phil Thompson <phil () riverbankcomputing ! com>
Date:       2021-08-26 16:19:57
Message-ID: 8277542813efa154d70052f1637f57c6 () riverbankcomputing ! com
[Download RAW message or body]

On 26/08/2021 16:34, Florian Bruhin wrote:
> Hi,
> 
> Qt's QUrl.toString() (and other methods taking 
> QUrl.UrlFormattingOption)
> are a bit weird, because they *also* can take
> QUrl.ComponentFormattingOption:
> https://doc.qt.io/qt-6/qurl.html#UrlFormattingOption-enum
> 
> However, combining the two doesn't seem to be possible anymore with 
> PyQt6:
> 
>     >>> from PyQt6.QtCore import QUrl
>     >>>
> QUrl("https://example.org").toString(QUrl.UrlFormattingOption.RemovePassword
> | QUrl.ComponentFormattingOption.FullyEncoded)
>     Traceback (most recent call last):
>       File "<stdin>", line 1, in <module>
>     TypeError: unsupported operand type(s) for |:
> 'UrlFormattingOption' and 'ComponentFormattingOption'
> 
> and converting won't work either:
> 
>     >>>
> QUrl("https://example.org").toString(QUrl.UrlFormattingOption.RemovePassword
> |
> QUrl.UrlFormattingOption(QUrl.ComponentFormattingOption.FullyEncoded))
>     ValueError: <ComponentFormattingOption.FullyEncoded: 32505856> is
> not a valid QUrl.UrlFormattingOption
> 
> Florian

Fixed in the next PyQt6 snapshot.

Thanks,
Phil
[prev in list] [next in list] [prev in thread] [next in thread] 

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