mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-01 09:24:10 +01:00
Add Qt < 5.6 compatibility again
This commit is contained in:
parent
19b474341c
commit
f4955741bf
@ -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<QSGSimpleTextureNode *>(node);
|
||||
if (n)
|
||||
n->setTextureCoordinatesTransform(QSGSimpleTextureNode::MirrorVertically);
|
||||
return node;
|
||||
}
|
||||
return QQuickFramebufferObject::updatePaintNode(node, nodeData);
|
||||
}
|
||||
#endif
|
||||
|
||||
OSGViewport::~OSGViewport()
|
||||
{
|
||||
delete h;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user