summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativeflipable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativeflipable.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflipable.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeflipable.cpp b/src/declarative/graphicsitems/qdeclarativeflipable.cpp
index 1fa08bb..e670d3e 100644
--- a/src/declarative/graphicsitems/qdeclarativeflipable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflipable.cpp
@@ -59,8 +59,8 @@ public:
void updateSceneTransformFromParent();
QDeclarativeFlipable::Side current;
- QDeclarativeGuard<QDeclarativeItem> front;
- QDeclarativeGuard<QDeclarativeItem> back;
+ QDeclarativeGuard<QGraphicsObject> front;
+ QDeclarativeGuard<QGraphicsObject> back;
};
/*!
@@ -112,13 +112,13 @@ QDeclarativeFlipable::~QDeclarativeFlipable()
The front and back sides of the flipable.
*/
-QDeclarativeItem *QDeclarativeFlipable::front()
+QGraphicsObject *QDeclarativeFlipable::front()
{
Q_D(const QDeclarativeFlipable);
return d->front;
}
-void QDeclarativeFlipable::setFront(QDeclarativeItem *front)
+void QDeclarativeFlipable::setFront(QGraphicsObject *front)
{
Q_D(QDeclarativeFlipable);
if (d->front) {
@@ -131,13 +131,13 @@ void QDeclarativeFlipable::setFront(QDeclarativeItem *front)
d->front->setOpacity(0.);
}
-QDeclarativeItem *QDeclarativeFlipable::back()
+QGraphicsObject *QDeclarativeFlipable::back()
{
Q_D(const QDeclarativeFlipable);
return d->back;
}
-void QDeclarativeFlipable::setBack(QDeclarativeItem *back)
+void QDeclarativeFlipable::setBack(QGraphicsObject *back)
{
Q_D(QDeclarativeFlipable);
if (d->back) {
@@ -195,12 +195,13 @@ void QDeclarativeFlipablePrivate::updateSceneTransformFromParent()
current = newSide;
if (current == QDeclarativeFlipable::Back && back) {
QTransform mat;
- mat.translate(back->width()/2,back->height()/2);
- if (back->width() && p1.x() >= p2.x())
+ QGraphicsItemPrivate *dBack = QGraphicsItemPrivate::get(back);
+ mat.translate(dBack->width()/2,dBack->height()/2);
+ if (dBack->width() && p1.x() >= p2.x())
mat.rotate(180, Qt::YAxis);
- if (back->height() && p2.y() >= p3.y())
+ if (dBack->height() && p2.y() >= p3.y())
mat.rotate(180, Qt::XAxis);
- mat.translate(-back->width()/2,-back->height()/2);
+ mat.translate(-dBack->width()/2,-dBack->height()/2);
back->setTransform(mat);
}
if (front)