summaryrefslogtreecommitdiffstats
path: root/src/render/picking
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2015-11-04 15:04:54 +0100
committerAndy Nichols <andy.nichols@theqtcompany.com>2015-11-16 09:17:38 +0000
commitcb99c0358a9ec6d51a165ff4513b146f45f5fb9f (patch)
tree26689e2c471edaa3ad323dba07af780d0a3be25e /src/render/picking
parent6002528b4610f8223b97b3f5d34a0cb1e0e98393 (diff)
Remove anything related to pick attribute in QObjectPicker
Change-Id: I5a25c97841854bd231af0600ecfe08ff4c056de1 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
Diffstat (limited to 'src/render/picking')
-rw-r--r--src/render/picking/objectpicker.cpp13
-rw-r--r--src/render/picking/objectpicker_p.h2
-rw-r--r--src/render/picking/qobjectpicker.cpp28
-rw-r--r--src/render/picking/qobjectpicker.h5
4 files changed, 1 insertions, 47 deletions
diff --git a/src/render/picking/objectpicker.cpp b/src/render/picking/objectpicker.cpp
index 38775327c..c2f8a354f 100644
--- a/src/render/picking/objectpicker.cpp
+++ b/src/render/picking/objectpicker.cpp
@@ -61,15 +61,12 @@ void ObjectPicker::cleanup()
{
m_isDirty = false;
m_hoverEnabled = false;
- m_pickAttributeId = Qt3DCore::QNodeId();
}
void ObjectPicker::updateFromPeer(Qt3DCore::QNode *peer)
{
QObjectPicker *picker = static_cast<QObjectPicker *>(peer);
if (picker) {
- if (picker->pickAttribute())
- m_pickAttributeId = picker->pickAttribute()->id();
m_hoverEnabled = picker->hoverEnabled();
m_isDirty = true;
}
@@ -81,21 +78,13 @@ void ObjectPicker::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e)
const QByteArray propertyName = propertyChange->propertyName();
if (propertyChange->type() == Qt3DCore::NodeUpdated) {
- if (propertyName == QByteArrayLiteral("pickAttribute")) {
- m_pickAttributeId = propertyChange->value().value<Qt3DCore::QNodeId>();
- m_isDirty = true;
- } else if (propertyName == QByteArrayLiteral("hoverEnabled")) {
+ if (propertyName == QByteArrayLiteral("hoverEnabled")) {
m_hoverEnabled = propertyChange->value().toBool();
m_isDirty = true;
}
}
}
-Qt3DCore::QNodeId ObjectPicker::pickAttributeId() const
-{
- return m_pickAttributeId;
-}
-
bool ObjectPicker::isDirty() const
{
return m_isDirty;
diff --git a/src/render/picking/objectpicker_p.h b/src/render/picking/objectpicker_p.h
index a7dc0e3a2..545c7ff95 100644
--- a/src/render/picking/objectpicker_p.h
+++ b/src/render/picking/objectpicker_p.h
@@ -65,7 +65,6 @@ public:
void cleanup();
void updateFromPeer(Qt3DCore::QNode *peer) Q_DECL_FINAL;
void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e) Q_DECL_FINAL;
- Qt3DCore::QNodeId pickAttributeId() const;
bool isDirty() const;
void unsetDirty();
void makeDirty();
@@ -78,7 +77,6 @@ public:
void onExited();
private:
- Qt3DCore::QNodeId m_pickAttributeId;
bool m_isDirty;
bool m_hoverEnabled;
};
diff --git a/src/render/picking/qobjectpicker.cpp b/src/render/picking/qobjectpicker.cpp
index 7d1e4a946..da13baace 100644
--- a/src/render/picking/qobjectpicker.cpp
+++ b/src/render/picking/qobjectpicker.cpp
@@ -38,7 +38,6 @@
#include <Qt3DCore/qentity.h>
#include <Qt3DCore/private/qcomponent_p.h>
#include <Qt3DCore/qbackendscenepropertychange.h>
-#include <Qt3DRender/qattribute.h>
#include <Qt3DRender/qpickevent.h>
QT_BEGIN_NAMESPACE
@@ -89,7 +88,6 @@ class QObjectPickerPrivate : public Qt3DCore::QComponentPrivate
public:
QObjectPickerPrivate()
: QComponentPrivate()
- , m_pickAttribute(Q_NULLPTR)
, m_hoverEnabled(false)
, m_pressed(false)
, m_containsMouse(false)
@@ -99,7 +97,6 @@ public:
}
Q_DECLARE_PUBLIC(QObjectPicker)
- Qt3DRender::QAttribute *m_pickAttribute;
bool m_hoverEnabled;
bool m_pressed;
bool m_containsMouse;
@@ -128,28 +125,6 @@ QObjectPicker::~QObjectPicker()
QComponent::cleanup();
}
-void QObjectPicker::setPickAttribute(QAttribute *pickAttribute)
-{
- Q_D(QObjectPicker);
- if (pickAttribute != d->m_pickAttribute) {
-
- if (pickAttribute && !pickAttribute->parent())
- pickAttribute->setParent(this);
-
- d->m_pickAttribute = pickAttribute;
- emit pickAttributeChanged();
- }
-}
-
-/*!
- \qmlproperty Qt3D.Render.Attribute Qt3D.Render::ObjectPicker::pickAttribute
-*/
-QAttribute *QObjectPicker::pickAttribute() const
-{
- Q_D(const QObjectPicker);
- return d->m_pickAttribute;
-}
-
void QObjectPicker::setHoverEnabled(bool hoverEnabled)
{
Q_D(QObjectPicker);
@@ -191,9 +166,6 @@ void QObjectPicker::copy(const QNode *ref)
QComponent::copy(ref);
const QObjectPicker *picker = static_cast<const QObjectPicker *>(ref);
d_func()->m_hoverEnabled = picker->d_func()->m_hoverEnabled;
- // Only clone the pickAttribute if we are it's parent, will be deleted by its parent otherwise
- if (picker->d_func()->m_pickAttribute != Q_NULLPTR && picker->d_func()->m_pickAttribute->parent() == ref)
- setPickAttribute(qobject_cast<QAttribute *>(QNode::clone(picker->d_func()->m_pickAttribute)));
}
void QObjectPicker::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change)
diff --git a/src/render/picking/qobjectpicker.h b/src/render/picking/qobjectpicker.h
index bc77a1cf4..81126796f 100644
--- a/src/render/picking/qobjectpicker.h
+++ b/src/render/picking/qobjectpicker.h
@@ -51,7 +51,6 @@ class QPickEvent;
class QT3DRENDERSHARED_EXPORT QObjectPicker : public Qt3DCore::QComponent
{
Q_OBJECT
- Q_PROPERTY(Qt3DRender::QAttribute *pickAttribute READ pickAttribute WRITE setPickAttribute NOTIFY pickAttributeChanged)
Q_PROPERTY(bool hoverEnabled READ hoverEnabled WRITE setHoverEnabled NOTIFY hoverEnabledChanged)
Q_PROPERTY(bool pressed READ isPressed NOTIFY pressedChanged)
Q_PROPERTY(bool containsMouse READ containsMouse NOTIFY containsMouseChanged)
@@ -60,9 +59,6 @@ public:
explicit QObjectPicker(QNode *parent = Q_NULLPTR);
~QObjectPicker();
- void setPickAttribute(QAttribute *pickAttribute);
- QAttribute *pickAttribute() const;
-
void setHoverEnabled(bool hoverEnabled);
bool hoverEnabled() const;
@@ -75,7 +71,6 @@ Q_SIGNALS:
void clicked(Qt3DRender::QPickEvent *event);
void entered();
void exited();
- void pickAttributeChanged();
void hoverEnabledChanged();
void pressedChanged();
void containsMouseChanged();