30 #include <QStringList> 38 const Ogre::Quaternion& default_value,
39 const QString& description,
41 const char *changed_slot,
43 :
Property( name, QVariant(), description, parent, changed_slot, receiver )
44 , quaternion_( default_value )
45 , ignore_child_updates_( false )
82 QStringList strings = new_value.toString().split(
';' );
83 if( strings.size() >= 4 )
86 float x = strings[ 0 ].toFloat( &x_ok );
88 float y = strings[ 1 ].toFloat( &y_ok );
90 float z = strings[ 2 ].toFloat( &z_ok );
92 float w = strings[ 3 ].toFloat( &w_ok );
93 if( x_ok && y_ok && z_ok && w_ok )
124 value_ = QString(
"%1; %2; %3; %4" )
void changed()
Emitted by setValue() just after the value has changed.
virtual bool setValue(const QVariant &new_value)
Set the new value for this property. Returns true if the new value is different from the old value...
A single element of a property tree, with a name, value, description, and possibly children...
bool mapGetFloat(const QString &key, float *value_out) const
Convenience function for looking up a named float.
virtual void save(Config config) const
Write the value of this property and/or its children into the given Config reference.
bool ignore_child_updates_
void updateFromChildren()
virtual void setReadOnly(bool read_only)
Overridden from Property to propagate read-only-ness to children.
TFSIMD_FORCE_INLINE const tfScalar & y() const
QVariant value_
This is the central property value. If you set it directly in a subclass, do so with care because man...
void mapSetValue(const QString &key, QVariant value)
Set a named child to the given value.
Configuration data storage class.
virtual bool setValue(const QVariant &new_value)
Set the new value for this property. Returns true if the new value is different from the old value...
virtual void load(const Config &config)
Load the value of this property and/or its children from the given Config node.
QuaternionProperty(const QString &name=QString(), const Ogre::Quaternion &default_value=Ogre::Quaternion::IDENTITY, const QString &description=QString(), Property *parent=0, const char *changed_slot=0, QObject *receiver=0)
virtual bool setQuaternion(const Ogre::Quaternion &quaternion)
TFSIMD_FORCE_INLINE const tfScalar & x() const
TFSIMD_FORCE_INLINE const tfScalar & z() const
TFSIMD_FORCE_INLINE const tfScalar & w() const
Ogre::Quaternion quaternion_
Property(const QString &name=QString(), const QVariant default_value=QVariant(), const QString &description=QString(), Property *parent=0, const char *changed_slot=0, QObject *receiver=0)
Constructor.
void aboutToChange()
Emitted by setValue() just before the value has changed.
virtual QVariant getValue() const
Return the value of this Property as a QVariant. If the value has never been set, an invalid QVariant...
virtual void setReadOnly(bool read_only)
Prevent or allow users to edit this property from a PropertyTreeWidget.