Is the QGraphicsSceneEvent constructor public?
-
On the one hand, the constructor for the C++ class QGraphicsSceneEvent appears to be public https://github.com/qt/qtbase/blob/5.13/src/widgets/graphicsview/qgraphicssceneevent.h#L67
However, the documention at https://doc.qt.io/qt-5/qgraphicssceneevent.html does not list this constructor under "Public Functions".
This constructor is used in the working virtual reality demo at https://github.com/ValveSoftware/openvr/blob/master/samples/helloworldoverlay/openvroverlaycontroller.cpp#L213
Is it wrong for them to use that constructor?
Is there a bug in the documentation?
-
Hi and welcome to devnet,
Based on the documentation itself, it's marked as internal.
-
On the one hand, the constructor for the C++ class QGraphicsSceneEvent appears to be public https://github.com/qt/qtbase/blob/5.13/src/widgets/graphicsview/qgraphicssceneevent.h#L67
However, the documention at https://doc.qt.io/qt-5/qgraphicssceneevent.html does not list this constructor under "Public Functions".
This constructor is used in the working virtual reality demo at https://github.com/ValveSoftware/openvr/blob/master/samples/helloworldoverlay/openvroverlaycontroller.cpp#L213
Is it wrong for them to use that constructor?
Is there a bug in the documentation?
@biospud said in Is the QGraphicsSceneEvent constructor public?:
Is it wrong for them to use that constructor?
no, since it is there it wont change at least until Qt 6 (for the sake of binary compatibility)
-
@biospud said in Is the QGraphicsSceneEvent constructor public?:
Is it wrong for them to use that constructor?
no, since it is there it wont change at least until Qt 6 (for the sake of binary compatibility)
I think I understand now. There is a class of functions that are public-in-C++-but-documented internal.
This means that I probably cannot get PyQt5 to expose the QGraphicsSceneEvent constructor because it is not part of the "public" public API. Plus I am not a paying customer of riverbankcomputing.
I also probably cannot get the folks at Valve to change the C++ implementation of their demo to not use QGraphicsSceneEvent. Because it works for them, and why should they care whether it's an "internal" call or not?
So my desire to do a directly literal translation of that C++ demo into python might need to bend or wait.
PySide2 does expose the QGraphicsSceneEvent constructor in python, but lacks some other things. Fortunately, those other things might be recognizable as bugs by folks other than me. So for the time being I will take the patient long term approach of trying to get those bugs fixed.
Thanks again for the explanations.
-
I think I understand now. There is a class of functions that are public-in-C++-but-documented internal.
This means that I probably cannot get PyQt5 to expose the QGraphicsSceneEvent constructor because it is not part of the "public" public API. Plus I am not a paying customer of riverbankcomputing.
I also probably cannot get the folks at Valve to change the C++ implementation of their demo to not use QGraphicsSceneEvent. Because it works for them, and why should they care whether it's an "internal" call or not?
So my desire to do a directly literal translation of that C++ demo into python might need to bend or wait.
PySide2 does expose the QGraphicsSceneEvent constructor in python, but lacks some other things. Fortunately, those other things might be recognizable as bugs by folks other than me. So for the time being I will take the patient long term approach of trying to get those bugs fixed.
Thanks again for the explanations.
@biospud
C++ > documentation
what i want to say is, that the application works on code base not on documentation base.
and also note that Qt is not bug-free, so it might just be that is just not documented by mistake
nevertheless its safe to use the public constructor -
For the bits and pieces that are missing, you should check the bug report system to see if there's already something there and otherwise open a feature request or an issue depending on what is missing.
-
For the bits and pieces that are missing, you should check the bug report system to see if there's already something there and otherwise open a feature request or an issue depending on what is missing.