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

List:       pykde
Subject:    Re: QSizePolicy.PolicyFlag broken
From:       Phil Thompson <phil () riverbankcomputing ! com>
Date:       2022-01-06 16:23:10
Message-ID: 309c8cbdc12cf5cd695c1019ca61e018 () riverbankcomputing ! com
[Download RAW message or body]

On 06/01/2022 03:22, Kovid Goyal wrote:
> python -c 'from PyQt6.QtWidgets import QSizePolicy;
> QSizePolicy(QSizePolicy.PolicyFlag.ExpandFlag)'
>                
> Traceback (most recent call last):
>   File "<string>", line 1, in <module>
> TypeError: arguments did not match any overloaded call:
>   QSizePolicy(): argument 1 has unexpected type 'PolicyFlag'
>   QSizePolicy(QSizePolicy.Policy, QSizePolicy.Policy, type:
> QSizePolicy.ControlType = QSizePolicy.DefaultType): argument 1 has
> unexpected type 'PolicyFlag'
> 
> python -c 'from PyQt6.QtWidgets import QSizePolicy;
> QSizePolicy(QSizePolicy.PolicyFlag.ExpandFlag |
> QSizePolicy.PolicyFlag.ShrinkFlag)'
> Traceback (most recent call last):
>   File "<string>", line 1, in <module>
> TypeError: unsupported operand type(s) for |: 'PolicyFlag' and 
> 'PolicyFlag'
> 
> And QWidget::setSizePolicy() doesnt take policyflags either.

The problem here is that the C++ API is broken so that you can't use 
"non-standard" combinations of PolicyFlag without using explicit casts.

Are you using combinations of PolicyFlag that aren't defined by the 
Policy enum?

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

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