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

Inconsistencies in arithmetic operators with mixed types

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4: Low
    • Some future version
    • 6.3.0
    • Documentation, PySide
    • None
    • PyCharm 2021.3 Community Edition
      Python 3.8
      Windows 10 Pro 21H2
    • Windows

    Description

      I've been working on the translation of this example:

      https://doc.qt.io/qtforpython-5/overviews/qtwidgets-painting-pathstroke-example.html#path-stroking

      from c++ into python and I've run into some issues with the imports of the method

      PySide6.QtCore.QPointF.__mul__() 

      According to the documentation:

      https://doc.qt.io/qtforpython/PySide6/QtCore/QPointF.html#PySide6.QtCore.PySide6.QtCore.QPointF.__mul__

      it should support as a parameter either a float, a PySide6.QtGui.QMatrix4x4 or a 

      PySide6.QtGui.QTransform, but when trying to perform 

      QPointF(0.1, 0.25) * (m * vm)

      the following Error is risen: 

      TypeError: 'PySide6.QtCore.QPointF.__mul__' called with wrong argument types:
       PySide6.QtCore.QPointF.__mul__(QTransform)
      Supported signatures:
       PySide6.QtCore.QPointF.__mul__(float)

      After looking into the QPointF.py file the installation of  PySide6 has created locally, I found out that there was only one of the three definitions, which is the following:

      def __mul__(self, c): # real signature unknown; restored from __doc__
       """
       __mul__(self, c: float) -> PySide6.QtCore.QPointF
       
       Return self*value.
       """
       pass

      There is only the one supporting a float as parameter.

      corelib/tools/qpoint.h:289:    friend constexpr inline QPointF operator*(const QPointF &p, qreal c)
      corelib/tools/qpoint.h:291:    friend constexpr inline QPointF operator*(qreal c, const QPointF &p)
      gui/math3d/qmatrix4x4.h:834:inline QPointF operator*(const QPointF& point, const QMatrix4x4& matrix) (deprecated since 6.1)
      gui/math3d/qmatrix4x4.h:865:inline QPointF operator*(const QMatrix4x4& matrix, const QPointF& point)
      gui/painting/qtransform.h:361:inline QPointF operator*(const QPointF &p, const QTransform &m)
      

      Attachments

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

        Activity

          People

            kleint Friedemann Kleint
            yngvine Igor Vons
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes