Shape: Convert Point to QObject / QPointF

Also add one Q_PROPERTY for each coordinate (x and y) of a Point. This will
enable the controller to set and get these properties.

Since QObjects cannot be copied, we also need to change the Shape class to have
a vector of pointers to Points, instead of actual Point structs.
This commit is contained in:
Vasilis Liaskovitis
2013-12-24 13:50:20 +02:00
parent 92f5d171db
commit 5852cde869
11 changed files with 89 additions and 46 deletions
+7 -7
View File
@@ -60,19 +60,19 @@ int map_int(int value, int istart, int istop, int ostart, int ostop)
Quad* createQuadForTexture(Texture* texture, int frameWidth, int frameHeight)
{
return new Quad(
Point(texture->getX(), texture->getY()),
Point(texture->getX() + texture->getWidth(), texture->getY()),
Point(texture->getX() + texture->getWidth(), texture->getY() + texture->getHeight()),
Point(texture->getX(), texture->getY() + texture->getHeight())
new Point(qreal(texture->getX()), qreal(texture->getY())),
new Point(qreal(texture->getX() + texture->getWidth()), qreal(texture->getY())),
new Point(qreal(texture->getX() + texture->getWidth()), qreal(texture->getY() + texture->getHeight())),
new Point(qreal(texture->getX()), qreal(texture->getY() + texture->getHeight()))
);
}
Triangle* createTriangleForTexture(Texture* texture, int frameWidth, int frameHeight)
{
return new Triangle(
Point(texture->getX(), texture->getY()),
Point(texture->getX() + texture->getWidth(), texture->getY()),
Point(texture->getX() + texture->getWidth() / 2, texture->getY() + texture->getHeight())
new Point(qreal(texture->getX()), qreal(texture->getY())),
new Point(qreal(texture->getX() + texture->getWidth()), qreal(texture->getY())),
new Point(qreal(texture->getX() + texture->getWidth() / 2), qreal(texture->getY() + texture->getHeight()))
);
}