Esempio n. 1
0
File: qnode.cpp Progetto: RSATom/Qt
void QNodePrivate::propertyChanged(int propertyIndex)
{
    // Bail out early if we can to avoid the cost below
    if (m_blockNotifications)
        return;

    Q_Q(QNode);

    const QMetaProperty property = q->metaObject()->property(propertyIndex);

    const QVariant data = property.read(q);
    if (data.canConvert<QNode*>()) {
        QNode *node = data.value<QNode*>();

        // Ensure the node has issued a node creation change. We can end
        // up here if a newly created node with a parent is immediately set
        // as a property on another node. In this case the deferred call to
        // _q_postConstructorInit() will not have happened yet as the event
        // loop will still be blocked. So force it here and we catch this
        // eventuality in the _q_postConstructorInit() function so that we
        // do not repeat the creation and new child scene change events.
        if (node)
            QNodePrivate::get(node)->_q_postConstructorInit();

        const QNodeId id = node ? node->id() : QNodeId();
        notifyPropertyChange(property.name(), QVariant::fromValue(id));
    } else {
        notifyPropertyChange(property.name(), data);
    }
}
Esempio n. 2
0
void StoryActor::onObservedPropertyChanged( ReflectionProperty& property )
{
   if ( property.getName() == "m_localMtx" )
   {
      // item instance was moved - copy its transform
      Matrix* itemLocalMtx = (Matrix*)property.edit();
      if ( m_transform != *itemLocalMtx )
      {
         m_transform = *itemLocalMtx;

         ReflectionProperty* property = getProperty( "m_transform" );
         notifyPropertyChange( *property );
         delete property;
      }
   }
}
Esempio n. 3
0
/*! \internal */
void QRenderSettingsPrivate::_q_onPickingMethodChanged(QPickingSettings::PickMethod pickMethod)
{
    notifyPropertyChange("pickMethod", pickMethod);
}
Esempio n. 4
0
/*! \internal */
void QRenderSettingsPrivate::_q_onWorldSpaceToleranceChanged(float worldSpaceTolerance)
{
    notifyPropertyChange("pickWorldSpaceTolerance", worldSpaceTolerance);
}
Esempio n. 5
0
/*! \internal */
void QRenderSettingsPrivate::_q_onFaceOrientationPickingModeChanged(QPickingSettings::FaceOrientationPickingMode faceOrientationPickingMode)
{
    notifyPropertyChange("faceOrientationPickingMode", faceOrientationPickingMode);
}
Esempio n. 6
0
/*! \internal */
void QRenderSettingsPrivate::_q_onPickResultModeChanged(QPickingSettings::PickResultMode pickResultMode)
{
    notifyPropertyChange("pickResultMode", pickResultMode);
}