void BorderChangeListener::propertyChanged(QtProperty * property) { if (!drawer) return; if (!command) command = new BorderChangeCommand(drawer); QtIntPropertyManager * integerManager = qobject_cast<QtIntPropertyManager*>(property->propertyManager()); if (integerManager) { command->setPropertyValue(property->propertyName(), integerManager->value(property)); return; } QtDoublePropertyManager * doubleManager = qobject_cast<QtDoublePropertyManager*>(property->propertyManager()); if (doubleManager) { command->setPropertyValue(property->propertyName(), doubleManager->value(property)); return; } QtVariantPropertyManager * variantManager = qobject_cast<QtVariantPropertyManager*>(property->propertyManager()); if (variantManager) { command->setPropertyValue(property->propertyName(), variantManager->value(property)); return; } }
void QtSpinBoxFactory::slotRangeChanged(QtProperty *property, int min, int max) { if (!m_createdEditors.contains(property)) return; QtIntPropertyManager *manager = this->propertyManager(property); if (!manager) return; QListIterator<QSpinBox *> itEditor(m_createdEditors[property]); while (itEditor.hasNext()) { QSpinBox *editor = itEditor.next(); editor->blockSignals(true); editor->setRange(min, max); editor->setValue(manager->value(property)); editor->blockSignals(false); } }
void BlurPhotoEffect::propertyChanged(QtProperty * property) { QtIntPropertyManager * manager = qobject_cast<QtIntPropertyManager*>(property->propertyManager()); int radius = m_radius; if (property->propertyName() == RADIUS_STRING) radius = manager->value(property); else { PhotoEffectsLoader::propertyChanged(property); return; } beginUndoCommandChange(); if (m_undo_command) { BlurUndoCommand * undo = dynamic_cast<BlurUndoCommand*>(m_undo_command); undo->setRadius(radius); } else m_undo_command = new BlurUndoCommand(this,radius); endUndoCommandChange(); }