QSizePolicy.PolicyFlag broken

Kovid Goyal kovid at kovidgoyal.net
Thu Jan 6 03:22:12 GMT 2022


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.
-- 
_____________________________________

Dr. Kovid Goyal 
https://www.kovidgoyal.net
https://calibre-ebook.com
_____________________________________


More information about the PyQt mailing list