Commit 0ce9f6a4 authored by Mike Krus's avatar Mike Krus
Browse files

Restore use of Added/Removed messages for aspects not supporting sync



If (third party) aspects don't support direct sync, restore use
of PropertyValueAdded and PropertyValueRemoved messages so avoid
breaking existing code

Change-Id: Icac717583a8fe72acdb0cf599981251e310734bd
Reviewed-by: Paul Lemire's avatarPaul Lemire <paul.lemire@kdab.com>
parent e8ef2e3e
......@@ -36,6 +36,7 @@
#include "qchannelmapper.h"
#include "qchannelmapper_p.h"
#include <Qt3DCore/qscenechange.h>
#include <Qt3DAnimation/qchannelmapping.h>
QT_BEGIN_NAMESPACE
......@@ -85,7 +86,7 @@ void QChannelMapper::addMapping(QAbstractChannelMapping *mapping)
if (!mapping->parent())
mapping->setParent(this);
d->update();
d->updateNode(mapping, "mappings", Qt3DCore::PropertyValueAdded);
}
}
......@@ -94,7 +95,7 @@ void QChannelMapper::removeMapping(QAbstractChannelMapping *mapping)
Q_ASSERT(mapping);
Q_D(QChannelMapper);
d->m_mappings.removeOne(mapping);
d->update();
d->updateNode(mapping, "mappings", Qt3DCore::PropertyValueRemoved);
// Remove bookkeeping connection
d->unregisterDestructionHelper(mapping);
}
......
......@@ -165,7 +165,7 @@ void QAbstractPhysicalDevice::addAxisSetting(QAxisSetting *axisSetting)
{
Q_D(QAbstractPhysicalDevice);
if (axisSetting && !d->m_axisSettings.contains(axisSetting)) {
d->update();
d->updateNode(axisSetting, "axisSettings", Qt3DCore::PropertyValueAdded);
d->m_axisSettings.push_back(axisSetting);
}
}
......@@ -177,7 +177,7 @@ void QAbstractPhysicalDevice::removeAxisSetting(QAxisSetting *axisSetting)
{
Q_D(QAbstractPhysicalDevice);
if (axisSetting && d->m_axisSettings.contains(axisSetting)) {
d->update();
d->updateNode(axisSetting, "axisSettings", Qt3DCore::PropertyValueRemoved);
d->m_axisSettings.removeOne(axisSetting);
}
}
......
......@@ -119,7 +119,7 @@ void QAction::addInput(QAbstractActionInput *input)
// Ensures proper bookkeeping
d->registerDestructionHelper(input, &QAction::removeInput, d->m_inputs);
d->update();
d->updateNode(input, "inputs", Qt3DCore::PropertyValueAdded);
}
}
......@@ -131,7 +131,7 @@ void QAction::removeInput(QAbstractActionInput *input)
Q_D(QAction);
if (d->m_inputs.contains(input)) {
d->update();
d->updateNode(input, "inputs", Qt3DCore::PropertyValueRemoved);
d->m_inputs.removeOne(input);
......
......@@ -115,7 +115,7 @@ void QAxis::addInput(QAbstractAxisInput *input)
// Ensures proper bookkeeping
d->registerDestructionHelper(input, &QAxis::removeInput, d->m_inputs);
d->update();
d->updateNode(input, "input", Qt3DCore::PropertyValueAdded);
}
}
......@@ -137,7 +137,7 @@ void QAxis::removeInput(QAbstractAxisInput *input)
Q_D(QAxis);
if (d->m_inputs.contains(input)) {
d->update();
d->updateNode(input, "input", Qt3DCore::PropertyValueRemoved);
d->m_inputs.removeOne(input);
......
......@@ -154,7 +154,7 @@ void QInputChord::addChord(QAbstractActionInput *input)
if (!input->parent())
input->setParent(this);
d->update();
d->updateNode(input, "input", Qt3DCore::PropertyValueAdded);
}
}
......@@ -167,7 +167,7 @@ void QInputChord::removeChord(QAbstractActionInput *input)
{
Q_D(QInputChord);
if (d->m_chords.contains(input)) {
d->update();
d->updateNode(input, "input", Qt3DCore::PropertyValueRemoved);
d->m_chords.removeOne(input);
......
......@@ -207,7 +207,7 @@ void QInputSequence::addSequence(QAbstractActionInput *input)
if (!input->parent())
input->setParent(this);
d->update();
d->updateNode(input, "input", Qt3DCore::PropertyValueAdded);
}
}
......@@ -220,7 +220,7 @@ void QInputSequence::removeSequence(QAbstractActionInput *input)
{
Q_D(QInputSequence);
if (d->m_sequences.contains(input)) {
d->update();
d->updateNode(input, "input", Qt3DCore::PropertyValueRemoved);
d->m_sequences.removeOne(input);
......
......@@ -173,7 +173,7 @@ void QLogicalDevice::addAction(QAction *action)
// Ensures proper bookkeeping
d->registerDestructionHelper(action, &QLogicalDevice::removeAction, d->m_actions);
d->update();
d->updateNode(action, "action", Qt3DCore::PropertyValueAdded);
}
}
......@@ -184,7 +184,7 @@ void QLogicalDevice::removeAction(QAction *action)
{
Q_D(QLogicalDevice);
if (d->m_actions.contains(action)) {
d->update();
d->updateNode(action, "action", Qt3DCore::PropertyValueRemoved);
d->m_actions.removeOne(action);
......@@ -224,7 +224,7 @@ void QLogicalDevice::addAxis(QAxis *axis)
// Ensures proper bookkeeping
d->registerDestructionHelper(axis, &QLogicalDevice::removeAxis, d->m_axes);
d->update();
d->updateNode(axis, "axis", Qt3DCore::PropertyValueAdded);
}
}
......@@ -235,7 +235,7 @@ void QLogicalDevice::removeAxis(QAxis *axis)
{
Q_D(QLogicalDevice);
if (d->m_axes.contains(axis)) {
d->update();
d->updateNode(axis, "axis", Qt3DCore::PropertyValueRemoved);
d->m_axes.removeOne(axis);
......
......@@ -203,7 +203,7 @@ void QLayerFilter::addLayer(QLayer *layer)
if (!layer->parent())
layer->setParent(this);
d->update();
d->updateNode(layer, "layer", Qt3DCore::PropertyValueAdded);
}
}
......@@ -214,7 +214,7 @@ void QLayerFilter::removeLayer(QLayer *layer)
{
Q_ASSERT(layer);
Q_D(QLayerFilter);
d->update();
d->updateNode(layer, "layer", Qt3DCore::PropertyValueRemoved);
d->m_layers.removeOne(layer);
// Remove bookkeeping connection
d->unregisterDestructionHelper(layer);
......
......@@ -139,7 +139,7 @@ void QRenderPassFilter::addMatch(QFilterKey *filterKey)
if (!filterKey->parent())
filterKey->setParent(this);
d->update();
d->updateNode(filterKey, "match", Qt3DCore::PropertyValueAdded);
}
}
......@@ -151,7 +151,7 @@ void QRenderPassFilter::removeMatch(QFilterKey *filterKey)
Q_ASSERT(filterKey);
Q_D(QRenderPassFilter);
d->update();
d->updateNode(filterKey, "match", Qt3DCore::PropertyValueRemoved);
d->m_matchList.removeOne(filterKey);
// Remove bookkeeping connection
d->unregisterDestructionHelper(filterKey);
......@@ -177,7 +177,7 @@ void QRenderPassFilter::addParameter(QParameter *parameter)
if (!parameter->parent())
parameter->setParent(this);
d->update();
d->updateNode(parameter, "parameter", Qt3DCore::PropertyValueAdded);
}
}
......@@ -189,7 +189,7 @@ void QRenderPassFilter::removeParameter(QParameter *parameter)
Q_ASSERT(parameter);
Q_D(QRenderPassFilter);
d->update();
d->updateNode(parameter, "parameter", Qt3DCore::PropertyValueRemoved);
d->m_parameters.removeOne(parameter);
// Remove bookkeeping connection
d->unregisterDestructionHelper(parameter);
......
......@@ -191,7 +191,7 @@ void QRenderStateSet::addRenderState(QRenderState *state)
if (!state->parent())
state->setParent(this);
d->update();
d->updateNode(state, "renderState", Qt3DCore::PropertyValueAdded);
}
}
......@@ -203,7 +203,7 @@ void QRenderStateSet::removeRenderState(QRenderState *state)
Q_ASSERT(state);
Q_D(QRenderStateSet);
d->update();
d->updateNode(state, "renderState", Qt3DCore::PropertyValueRemoved);
d->m_renderStates.removeOne(state);
// Remove bookkeeping connection
d->unregisterDestructionHelper(state);
......
......@@ -144,7 +144,7 @@ void QTechniqueFilter::addMatch(QFilterKey *filterKey)
if (!filterKey->parent())
filterKey->setParent(this);
d->update();
d->updateNode(filterKey, "matchAll", Qt3DCore::PropertyValueAdded);
}
}
......@@ -155,7 +155,7 @@ void QTechniqueFilter::removeMatch(QFilterKey *filterKey)
{
Q_ASSERT(filterKey);
Q_D(QTechniqueFilter);
d->update();
d->updateNode(filterKey, "matchAll", Qt3DCore::PropertyValueRemoved);
d->m_matchList.removeOne(filterKey);
// Remove bookkeeping connection
d->unregisterDestructionHelper(filterKey);
......@@ -181,7 +181,7 @@ void QTechniqueFilter::addParameter(QParameter *parameter)
if (!parameter->parent())
parameter->setParent(this);
d->update();
d->updateNode(parameter, "parameter", Qt3DCore::PropertyValueAdded);
}
}
......@@ -192,7 +192,7 @@ void QTechniqueFilter::removeParameter(QParameter *parameter)
{
Q_ASSERT(parameter);
Q_D(QTechniqueFilter);
d->update();
d->updateNode(parameter, "parameter", Qt3DCore::PropertyValueRemoved);
d->m_parameters.removeOne(parameter);
// Remove bookkeeping connection
d->unregisterDestructionHelper(parameter);
......
......@@ -123,7 +123,7 @@ void QRenderTarget::addOutput(QRenderTargetOutput *output)
if (!output->parent())
output->setParent(this);
d->update();
d->updateNode(output, "output", Qt3DCore::PropertyValueAdded);
}
}
......@@ -134,7 +134,7 @@ void QRenderTarget::removeOutput(QRenderTargetOutput *output)
{
Q_D(QRenderTarget);
d->update();
d->updateNode(output, "output", Qt3DCore::PropertyValueRemoved);
d->m_outputs.removeOne(output);
// Remove bookkeeping connection
d->unregisterDestructionHelper(output);
......
......@@ -194,7 +194,7 @@ void QGeometry::addAttribute(QAttribute *attribute)
if (!attribute->parent())
attribute->setParent(this);
d->update();
d->updateNode(attribute, "attribute", Qt3DCore::PropertyValueAdded);
}
}
......@@ -209,7 +209,7 @@ void QGeometry::removeAttribute(QAttribute *attribute)
d->m_attributes.removeOne(attribute);
// Remove bookkeeping connection
d->unregisterDestructionHelper(attribute);
d->update();
d->updateNode(attribute, "attribute", Qt3DCore::PropertyValueRemoved);
}
void QGeometry::setBoundingVolumePositionAttribute(QAttribute *boundingVolumePositionAttribute)
......
......@@ -188,7 +188,7 @@ void QEffect::addParameter(QParameter *parameter)
if (!parameter->parent())
parameter->setParent(this);
d->update();
d->updateNode(parameter, "parameter", Qt3DCore::PropertyValueAdded);
}
}
......@@ -202,7 +202,7 @@ void QEffect::removeParameter(QParameter *parameter)
d->m_parameters.removeOne(parameter);
// Remove bookkeeping connection
d->unregisterDestructionHelper(parameter);
d->update();
d->updateNode(parameter, "parameter", Qt3DCore::PropertyValueRemoved);
}
/*!
......@@ -234,7 +234,7 @@ void QEffect::addTechnique(QTechnique *t)
if (!t->parent())
t->setParent(this);
d->update();
d->updateNode(t, "technique", Qt3DCore::PropertyValueAdded);
}
}
......@@ -245,7 +245,7 @@ void QEffect::removeTechnique(QTechnique *t)
{
Q_D(QEffect);
if (t)
d->update();
d->updateNode(t, "technique", Qt3DCore::PropertyValueRemoved);
d->m_techniques.removeOne(t);
// Remove bookkeeping connection
d->unregisterDestructionHelper(t);
......
......@@ -272,7 +272,7 @@ void QMaterial::addParameter(QParameter *parameter)
if (!parameter->parent())
parameter->setParent(this);
d->update();
d->updateNode(parameter, "parameter", Qt3DCore::PropertyValueAdded);
}
}
......@@ -283,7 +283,7 @@ void QMaterial::removeParameter(QParameter *parameter)
{
Q_ASSERT(parameter);
Q_D(QMaterial);
d->update();
d->updateNode(parameter, "parameter", Qt3DCore::PropertyValueRemoved);
d->m_parameters.removeOne(parameter);
}
......
......@@ -274,7 +274,7 @@ void QRenderPass::addFilterKey(QFilterKey *filterKey)
if (!filterKey->parent())
filterKey->setParent(this);
d->update();
d->updateNode(filterKey, "filterKeys", Qt3DCore::PropertyValueAdded);
}
}
......@@ -285,7 +285,7 @@ void QRenderPass::removeFilterKey(QFilterKey *filterKey)
{
Q_ASSERT(filterKey);
Q_D(QRenderPass);
d->update();
d->updateNode(filterKey, "filterKeys", Qt3DCore::PropertyValueRemoved);
d->m_filterKeyList.removeOne(filterKey);
// Remove bookkeeping connection
d->unregisterDestructionHelper(filterKey);
......@@ -322,7 +322,7 @@ void QRenderPass::addRenderState(QRenderState *state)
if (!state->parent())
state->setParent(this);
d->update();
d->updateNode(state, "renderState", Qt3DCore::PropertyValueAdded);
}
}
......@@ -333,7 +333,7 @@ void QRenderPass::removeRenderState(QRenderState *state)
{
Q_ASSERT(state);
Q_D(QRenderPass);
d->update();
d->updateNode(state, "renderState", Qt3DCore::PropertyValueRemoved);
d->m_renderStates.removeOne(state);
// Remove bookkeeping connection
d->unregisterDestructionHelper(state);
......@@ -369,7 +369,7 @@ void QRenderPass::addParameter(QParameter *parameter)
if (!parameter->parent())
parameter->setParent(this);
d->update();
d->updateNode(parameter, "parameter", Qt3DCore::PropertyValueAdded);
}
}
......@@ -380,7 +380,7 @@ void QRenderPass::removeParameter(QParameter *parameter)
{
Q_ASSERT(parameter);
Q_D(QRenderPass);
d->update();
d->updateNode(parameter, "parameter", Qt3DCore::PropertyValueRemoved);
d->m_parameters.removeOne(parameter);
// Remove bookkeeping connection
d->unregisterDestructionHelper(parameter);
......
......@@ -254,7 +254,7 @@ void QTechnique::addFilterKey(QFilterKey *filterKey)
if (!filterKey->parent())
filterKey->setParent(this);
d->update();
d->updateNode(filterKey, "filterKeys", Qt3DCore::PropertyValueAdded);
}
}
......@@ -265,7 +265,7 @@ void QTechnique::removeFilterKey(QFilterKey *filterKey)
{
Q_ASSERT(filterKey);
Q_D(QTechnique);
d->update();
d->updateNode(filterKey, "filterKeys", Qt3DCore::PropertyValueRemoved);
d->m_filterKeys.removeOne(filterKey);
// Remove bookkeeping connection
d->unregisterDestructionHelper(filterKey);
......@@ -301,7 +301,7 @@ void QTechnique::addParameter(QParameter *parameter)
if (!parameter->parent())
parameter->setParent(this);
d->update();
d->updateNode(parameter, "parameter", Qt3DCore::PropertyValueAdded);
}
}
......@@ -312,7 +312,7 @@ void QTechnique::removeParameter(QParameter *parameter)
{
Q_ASSERT(parameter);
Q_D(QTechnique);
d->update();
d->updateNode(parameter, "parameter", Qt3DCore::PropertyValueRemoved);
d->m_parameters.removeOne(parameter);
// Remove bookkeeping connection
d->unregisterDestructionHelper(parameter);
......@@ -338,7 +338,7 @@ void QTechnique::addRenderPass(QRenderPass *pass)
if (!pass->parent())
pass->setParent(this);
d->update();
d->updateNode(pass, "pass", Qt3DCore::PropertyValueAdded);
}
}
......@@ -349,7 +349,7 @@ void QTechnique::removeRenderPass(QRenderPass *pass)
{
Q_ASSERT(pass);
Q_D(QTechnique);
d->update();
d->updateNode(pass, "pass", Qt3DCore::PropertyValueAdded);
d->m_renderPasses.removeOne(pass);
// Remove bookkeeping connection
d->unregisterDestructionHelper(pass);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment