Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-2042

inconsistent interface to sizeHint with true_property

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.3.1
    • PySide
    • None
    • 2b14cba812 (pyside/pyside-setup/dev) a4329741e9 (pyside/pyside-setup/6.4) a4329741e9 (pyside/tqtc-pyside-setup/6.4) a4329741e9 (pyside/tqtc-pyside-setup/tqtc/6.4)

      With the true_property enabled, sizeHint (and minimumSizeHint, possibly others) is a property on QWidget, but subclasses expose it as a method:

      from PySide6 import QtWidgets
      from __feature__ import true_property # noqa: F401
      
      
      app = QtWidgets.QApplication()
      widget = QtWidgets.QWidget()
      print(widget.sizeHint)
      
      spin_box = QtWidgets.QSpinBox()
      print(spin_box.sizeHint)
      print(spin_box.sizeHint())

      prints

      PySide6.QtCore.QSize(-1, -1)
      <built-in method sizeHint of PySide6.QtWidgets.QSpinBox object at 0x000001FCF5998BC0>
      PySide6.QtCore.QSize(33, 22)

        For Gerrit Dashboard: PYSIDE-2042
        # Subject Branch Project Status CR V

            ctismer Christian Tismer
            numerlor Michal Laboš
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes