• PyQt5 question: why are QOpenGLTimeMonitor/QOpenGLTimerQuery not define

    From Julian Gilbey@21:1/5 to All on Thu Apr 7 10:30:02 2022
    Well, the new version of qtpy failed the CI checks on armhf, and I
    don't understand why. The cause is that the following caused an
    error:

    (sid_armhf-dchroot)jdg@abel:~$ python3
    Python 3.10.4 (main, Apr 2 2022, 09:04:19) [GCC 11.2.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    from PyQt5.QtGui import QOpenGLTimeMonitor
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    ImportError: cannot import name 'QOpenGLTimeMonitor' from 'PyQt5.QtGui' (/usr/lib/python3/dist-packages/PyQt5/QtGui.abi3.so)
    from PyQt5.QtGui import QOpenGLTimerQuery
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    ImportError: cannot import name 'QOpenGLTimerQuery' from 'PyQt5.QtGui' (/usr/lib/python3/dist-packages/PyQt5/QtGui.abi3.so)

    Why are these two classes not defined on armhf? I had a quick look at
    the source code for PyQt5, and I see the following:

    sip/QtGui/qopengltimerquery.sip, lines 23-:
    %If (Qt_5_1_0 -)
    %If (PyQt_Desktop_OpenGL)

    class QOpenGLTimerQuery : QObject
    {
    %TypeHeaderCode
    #include <qopengltimerquery.h>
    %End
    [...]

    So I presume that if PyQt_Desktop_OpenGL is defined, then this is
    included. This would be set in config-tests/cfgtest_QtGui.cpp, lines
    28-:

    #if defined(QT_NO_OPENGL)
    out << "PyQt_OpenGL\n";
    out << "PyQt_Desktop_OpenGL\n";
    #elif defined(QT_OPENGL_ES) || defined(QT_OPENGL_ES_2) || defined(QT_OPENGL_ES_3)
    out << "PyQt_Desktop_OpenGL\n";
    #endif

    But nowhere do I find any of QT_NO_OPENGL or QT_OPENGL_ES* defined in
    the package (but then maybe I'm not looking in the right place? So I
    don't know why these two classes are included in the amd64 version of
    the package but not the armhf version.

    I could just protect the two imports with a try/except block, but I
    would like to know that this is the right thing to do first!

    Thanks,

    Julian

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)