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

qFuzzyCompare() overloads not available

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • None
    • 5.15.1, 5.15.2, 6.2.2
    • PySide, Shiboken
    • None
    • Ubuntu 18.04, Python 3.6
    • d6d63cf55a (pyside/pyside-setup/dev) 1f4d657657 (pyside/pyside-setup/6.2) 1f4d657657 (pyside/tqtc-pyside-setup/6.2) d6d63cf55a (pyside/tqtc-pyside-setup/dev)

    Description

      The only overload available for qFuzzyCompare() is the one for `double` provided by QtCore. The other overloads are visible in the `typesystem_gui_common.xml`, but they do not appear to result in any entries in the QtGui.pyi file.

      To reproduce, do a clean install of PySide (here using PySide2 but also possible with PySide6):

      $ python -m venv temp.venv
      $ source temp.venv/bin/activate
      $ pip install --upgrade pip setuptools numpy PyOpenGL
      $ pip install --index-url=http://download.qt.io/official_releases/QtForPython/ --trusted-host download.qt.io shiboken2 pyside2 shiboken2_generator

      Using the overload for `double` works:

      $ python -c "from PySide2.QtCore import *; print(qFuzzyCompare(0.0, 0.0))"
      True

      But the overload for `QMatrix4x4` does not:

      $ python -c "from PySide2.QtGui import *; print(qFuzzyCompare(QMatrix4x4(), QMatrix4x4()))"
      Traceback (most recent call last):
      File "<string>", line 1, in <module>
      NameError: name 'qFuzzyCompare' is not defined
      $ python -c "from PySide2.QtCore import *; from PySide2.QtGui import *; print(qFuzzyCompare(QMatrix4x4(), QMatrix4x4()))"
      Traceback (most recent call last):
      File "<string>", line 1, in <module>
      TypeError: 'PySide2.QtCore.qFuzzyCompare' called with wrong argument types:
      PySide2.QtCore.qFuzzyCompare(QMatrix4x4, QMatrix4x4)
      Supported signatures:
      PySide2.QtCore.qFuzzyCompare(float, float)

      A quick grep on the installed files shows this:

      $ grep -R qFuzzyCompare temp.venv/lib/python3.6/site-packages/PySide2
      Binary file temp.venv/lib/python3.6/site-packages/PySide6/QtCore.abi3.so matches
      Binary file temp.venv/lib/python3.6/site-packages/PySide6/Qt/lib/libQt6Quick3DRuntimeRender.so.6 matches
      Binary file temp.venv/lib/python3.6/site-packages/PySide6/Qt/lib/libQt63DRender.so.6 matches
      Binary file temp.venv/lib/python3.6/site-packages/PySide6/Qt/lib/libQt6Quick3D.so.6 matches
      Binary file temp.venv/lib/python3.6/site-packages/PySide6/Qt/lib/libQt63DQuick.so.6 matches
      Binary file temp.venv/lib/python3.6/site-packages/PySide6/Qt/lib/libQt6Quick.so.6 matches
      Binary file temp.venv/lib/python3.6/site-packages/PySide6/Qt/lib/libQt6Gui.so.6 matches
      Binary file temp.venv/lib/python3.6/site-packages/PySide6/Qt/qml/QtQuick/Controls/Material/impl/qtquickcontrols2materialstyleimplplugin.debug matches
      Binary file temp.venv/lib/python3.6/site-packages/PySide6/Qt/qml/QtQuick/Controls/Imagine/impl/qtquickcontrols2imaginestyleimplplugin.debug matches
      Binary file temp.venv/lib/python3.6/site-packages/PySide6/Qt/qml/QtQuick/Scene3D/qtquickscene3dplugin.debug matches
      Binary file temp.venv/lib/python3.6/site-packages/PySide6/Qt/qml/QtQuick/NativeStyle/qtquickcontrols2nativestyleplugin.debug matches
      Binary file temp.venv/lib/python3.6/site-packages/PySide6/Qt/qml/Qt/labs/lottieqt/lottieqtplugin.debug matches
      Binary file temp.venv/lib/python3.6/site-packages/PySide6/Qt/qml/QtDataVisualization/datavisualizationqml2plugin.debug matches
      temp.venv/lib/python3.6/site-packages/PySide6/Qt/qml/QtTest/TestCase.qml: to \c{qFuzzyCompare(actual, expected)} in C++ but with a required \a delta value.
      Binary file temp.venv/lib/python3.6/site-packages/PySide6/Qt/qml/Qt5Compat/GraphicalEffects/private/qtgraphicaleffectsprivateplugin.debug matches
      temp.venv/lib/python3.6/site-packages/PySide6/QtCore.pyi:def qFuzzyCompare(p1:float, p2:float) -> bool: ...
      temp.venv/lib/python3.6/site-packages/PySide6/typesystems/typesystem_core_common.xml: <function signature="qFuzzyCompare(double,double)"/>
      temp.venv/lib/python3.6/site-packages/PySide6/typesystems/typesystem_gui_common.xml: <function signature="qFuzzyCompare(QMatrix,QMatrix)"/>
      temp.venv/lib/python3.6/site-packages/PySide6/typesystems/typesystem_gui_common.xml: <function signature="qFuzzyCompare(QTransform,QTransform)"/>
      temp.venv/lib/python3.6/site-packages/PySide6/typesystems/typesystem_gui_common.xml: <function signature="qFuzzyCompare(QQuaternion,QQuaternion)"/>
      temp.venv/lib/python3.6/site-packages/PySide6/typesystems/typesystem_gui_common.xml: <function signature="qFuzzyCompare(QMatrix4x4,QMatrix4x4)"/>
      temp.venv/lib/python3.6/site-packages/PySide6/typesystems/typesystem_gui_common.xml: <function signature="qFuzzyCompare(QVector2D,QVector2D)"/>
      temp.venv/lib/python3.6/site-packages/PySide6/typesystems/typesystem_gui_common.xml: <function signature="qFuzzyCompare(QVector3D,QVector3D)"/>
      temp.venv/lib/python3.6/site-packages/PySide6/typesystems/typesystem_gui_common.xml: <function signature="qFuzzyCompare(QVector4D,QVector4D)"/>

      So it appears that the function signature is made visible to the typesystem, but it does not result in any generated bindings for the QtGui overloads.

      Attachments

        1. pyside1840.py
          0.5 kB
          Friedemann Kleint
        For Gerrit Dashboard: PYSIDE-1840
        # Subject Branch Project Status CR V

        Activity

          People

            kleint Friedemann Kleint
            michael.siegrist Michael Siegrist
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes