void VectorProperty::emitAboutToChange() { if( !ignore_child_updates_ ) { Q_EMIT aboutToChange(); } }
void QuaternionProperty::emitAboutToChange() { if( !ignore_child_updates_ ) { Q_EMIT aboutToChange(); } }
KoRulerController::KoRulerController(KoRuler *horizontalRuler, KoCanvasResourceManager *crp) : QObject(horizontalRuler), d(new Private(horizontalRuler, crp)) { connect(crp, SIGNAL(canvasResourceChanged(int, const QVariant &)), this, SLOT(canvasResourceChanged(int))); connect(horizontalRuler, SIGNAL(indentsChanged(bool)), this, SLOT(indentsChanged())); connect(horizontalRuler, SIGNAL(aboutToChange()), this, SLOT(tabChangeInitiated())); connect(horizontalRuler, SIGNAL(tabChanged(int, KoRuler::Tab*)), this, SLOT(tabChanged(int, KoRuler::Tab*))); }
bool Property::setValue( const QVariant& new_value ) { if( new_value != value_ ) { Q_EMIT aboutToChange(); value_ = new_value; Q_EMIT changed(); if( model_ ) { model_->emitDataChanged( this ); } return true; } return false; }
QuaternionProperty::QuaternionProperty( const QString& name, const Ogre::Quaternion& default_value, const QString& description, Property* parent, const char *changed_slot, QObject* receiver ) : Property( name, QVariant(), description, parent, changed_slot, receiver ) , quaternion_( default_value ) , ignore_child_updates_( false ) { x_ = new Property( "X", quaternion_.x, "X coordinate", this ); y_ = new Property( "Y", quaternion_.y, "Y coordinate", this ); z_ = new Property( "Z", quaternion_.z, "Z coordinate", this ); w_ = new Property( "W", quaternion_.w, "W coordinate", this ); updateString(); connect( x_, SIGNAL( aboutToChange() ), this, SLOT( emitAboutToChange() )); connect( y_, SIGNAL( aboutToChange() ), this, SLOT( emitAboutToChange() )); connect( z_, SIGNAL( aboutToChange() ), this, SLOT( emitAboutToChange() )); connect( w_, SIGNAL( aboutToChange() ), this, SLOT( emitAboutToChange() )); connect( x_, SIGNAL( changed() ), this, SLOT( updateFromChildren() )); connect( y_, SIGNAL( changed() ), this, SLOT( updateFromChildren() )); connect( z_, SIGNAL( changed() ), this, SLOT( updateFromChildren() )); connect( w_, SIGNAL( changed() ), this, SLOT( updateFromChildren() )); }
bool QuaternionProperty::setQuaternion( const Ogre::Quaternion& new_quaternion ) { if( new_quaternion != quaternion_ ) { Q_EMIT aboutToChange(); quaternion_ = new_quaternion; ignore_child_updates_ = true; x_->setValue( quaternion_.x ); y_->setValue( quaternion_.y ); z_->setValue( quaternion_.z ); w_->setValue( quaternion_.w ); ignore_child_updates_ = false; updateString(); Q_EMIT changed(); return true; } return false; }