Details
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
For Gerrit Dashboard: PYSIDE-1840 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
399132,2 | shiboken6: Enable declaring top-level functions | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
399133,4 | Expose QtGui's qFuzzyCompare() overloads | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
399227,2 | shiboken6: Enable declaring top-level functions | 6.2 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
399228,2 | Expose QtGui's qFuzzyCompare() overloads | 6.2 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
399229,1 | shiboken6: Enable declaring top-level functions | tqtc/lts-5.15 | pyside/tqtc-pyside-setup | Status: ABANDONED | 0 | 0 |