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(); 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 int Rect::serialSize() const
{ {
return 4 * 4; return 4 * 4;

View File

@ -165,10 +165,15 @@ struct Rect : public Serializable
return !(x || y || width || height); return !(x || y || width || height);
} }
DECL_ATTR_INLINE(X, int, x) void setX(int value);
DECL_ATTR_INLINE(Y, int, y) void setY(int value);
DECL_ATTR_INLINE(Width, int, width) void setWidth(int value);
DECL_ATTR_INLINE(Height, int, height) 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; int serialSize() const;
void serialize(char *buffer) const; void serialize(char *buffer) const;