diff --git a/ground/gcs/src/libs/osgearth/osgQtQuick/OSGViewport.cpp b/ground/gcs/src/libs/osgearth/osgQtQuick/OSGViewport.cpp index de46be9ea..36b6e9c38 100644 --- a/ground/gcs/src/libs/osgearth/osgQtQuick/OSGViewport.cpp +++ b/ground/gcs/src/libs/osgearth/osgQtQuick/OSGViewport.cpp @@ -607,11 +607,27 @@ QtKeyboardMap OSGViewport::Hidden::keyMap = QtKeyboardMap(); OSGViewport::OSGViewport(QQuickItem *parent) : Inherited(parent), h(new Hidden(this)) { // setClearBeforeRendering(false); +#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) setMirrorVertically(true); +#endif setAcceptHoverEvents(true); setAcceptedMouseButtons(Qt::AllButtons); } +#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0) +QSGNode *OSGViewport::updatePaintNode(QSGNode *node, QQuickItem::UpdatePaintNodeData *nodeData) +{ + if (!node) { + node = QQuickFramebufferObject::updatePaintNode(node, nodeData); + QSGSimpleTextureNode *n = static_cast(node); + if (n) + n->setTextureCoordinatesTransform(QSGSimpleTextureNode::MirrorVertically); + return node; + } + return QQuickFramebufferObject::updatePaintNode(node, nodeData); +} +#endif + OSGViewport::~OSGViewport() { delete h; diff --git a/ground/gcs/src/libs/osgearth/osgQtQuick/OSGViewport.hpp b/ground/gcs/src/libs/osgearth/osgQtQuick/OSGViewport.hpp index 46e6d366e..35a7e142c 100644 --- a/ground/gcs/src/libs/osgearth/osgQtQuick/OSGViewport.hpp +++ b/ground/gcs/src/libs/osgearth/osgQtQuick/OSGViewport.hpp @@ -93,6 +93,9 @@ signals: void busyChanged(bool busy); protected: +#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0) + QSGNode *updatePaintNode(QSGNode *node, QQuickItem::UpdatePaintNodeData *nodeData) override; +#endif // QQuickItem void mousePressEvent(QMouseEvent *event); void mouseMoveEvent(QMouseEvent *event);