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

inconsistent interface to sizeHint with true_property

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • 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)

    Description

      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)

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes