mirror of
https://github.com/mapmapteam/mapmap.git
synced 2026-06-16 12:33:19 +02:00
Fixed signal/slot loop: on property changes model emits signals that are collected by the MainWindow and sent back to the PaintGui/MappingGui (this fixes OSC changes of model objects).
This commit is contained in:
+25
@@ -39,3 +39,28 @@ Element::Element(uid id, UidAllocator* allocator) : _name(""), _isLocked(false),
|
||||
Element::~Element() {
|
||||
_allocator->free(_id);
|
||||
}
|
||||
|
||||
void Element::setLocked(bool locked)
|
||||
{
|
||||
if (locked != _isLocked)
|
||||
{
|
||||
_isLocked = locked;
|
||||
_emitPropertyChanged("locked");
|
||||
}
|
||||
}
|
||||
|
||||
void Element::setOpacity(float opacity)
|
||||
{
|
||||
opacity = qBound(opacity, 0.0f, 1.0f);
|
||||
if (opacity != _opacity)
|
||||
{
|
||||
_opacity = opacity;
|
||||
_emitPropertyChanged("opacity");
|
||||
}
|
||||
}
|
||||
|
||||
void Element::_emitPropertyChanged(const QString& propertyName)
|
||||
{
|
||||
emit propertyChanged(getId(), propertyName, property(propertyName.toAscii()));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user