Properly emit valueChanged in Rect setters

This commit is contained in:
Jonas Kulla 2013-09-23 00:03:43 +02:00
parent 660cb9e05a
commit abce6c94b0
2 changed files with 33 additions and 4 deletions

View File

@ -284,6 +284,30 @@ void Rect::empty()
valueChanged();
}
void Rect::setX(int value)
{
x = value;
valueChanged();
}
void Rect::setY(int value)
{
y = value;
valueChanged();
}
void Rect::setWidth(int value)
{
width = value;
valueChanged();
}
void Rect::setHeight(int value)
{
height = value;
valueChanged();
}
int Rect::serialSize() const
{
return 4 * 4;

View File

@ -165,10 +165,15 @@ struct Rect : public Serializable
return !(x || y || width || height);
}
DECL_ATTR_INLINE(X, int, x)
DECL_ATTR_INLINE(Y, int, y)
DECL_ATTR_INLINE(Width, int, width)
DECL_ATTR_INLINE(Height, int, height)
void setX(int value);
void setY(int value);
void setWidth(int value);
void setHeight(int value);
int getX() const { return x; }
int getY() const { return y; }
int getWidth() const { return width; }
int getHeight() const { return height; }
int serialSize() const;
void serialize(char *buffer) const;