create properties to rotatestackedanimation
svn path=/trunk/KDE/kdelibs/; revision=1039220
This commit is contained in:
parent
526fbaf825
commit
2f02dbb602
@ -1,5 +1,5 @@
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* stackedlayout.h */
|
/* rotationstacked.h */
|
||||||
/* */
|
/* */
|
||||||
/* Copyright(C) 2009 Igor Trindade Oliveira <igor.oliveira@indt.org.br>*/
|
/* Copyright(C) 2009 Igor Trindade Oliveira <igor.oliveira@indt.org.br>*/
|
||||||
/* */
|
/* */
|
||||||
@ -35,7 +35,7 @@ class RotationStackedAnimationPrivate {
|
|||||||
|
|
||||||
AbstractAnimation::Reference reference;
|
AbstractAnimation::Reference reference;
|
||||||
|
|
||||||
QPair<QGraphicsWidget *, QGraphicsWidget *> animObjects;
|
QGraphicsWidget *backWidget;
|
||||||
|
|
||||||
StackedLayout *sLayout;
|
StackedLayout *sLayout;
|
||||||
};
|
};
|
||||||
@ -65,12 +65,19 @@ AbstractAnimation::Reference RotationStackedAnimation::reference()
|
|||||||
return d->reference;
|
return d->reference;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RotationStackedAnimation::setWidgetsToAnimate(QGraphicsWidget *front, QGraphicsWidget *back)
|
QGraphicsWidget *RotationStackedAnimation::backWidget()
|
||||||
{
|
{
|
||||||
d->animObjects = qMakePair(front, back);
|
return d->backWidget;
|
||||||
|
}
|
||||||
|
|
||||||
d->sLayout->addWidget(front);
|
void RotationStackedAnimation::setBackWidget(QGraphicsWidget *backWidget)
|
||||||
d->sLayout->addWidget(back);
|
{
|
||||||
|
d->backWidget = backWidget;
|
||||||
|
|
||||||
|
if(widgetToAnimate()) {
|
||||||
|
d->sLayout->addWidget(widgetToAnimate());
|
||||||
|
d->sLayout->addWidget(backWidget);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QGraphicsLayoutItem *RotationStackedAnimation::layout()
|
QGraphicsLayoutItem *RotationStackedAnimation::layout()
|
||||||
@ -78,16 +85,11 @@ QGraphicsLayoutItem *RotationStackedAnimation::layout()
|
|||||||
return d->sLayout;
|
return d->sLayout;
|
||||||
}
|
}
|
||||||
|
|
||||||
QPair<QGraphicsWidget *,QGraphicsWidget *> RotationStackedAnimation::widgetsToAnimate()
|
|
||||||
{
|
|
||||||
return d->animObjects;
|
|
||||||
}
|
|
||||||
|
|
||||||
QAbstractAnimation *RotationStackedAnimation::render(QObject *parent)
|
QAbstractAnimation *RotationStackedAnimation::render(QObject *parent)
|
||||||
{
|
{
|
||||||
Q_UNUSED(parent);
|
Q_UNUSED(parent);
|
||||||
|
|
||||||
QPair<QGraphicsWidget *,QGraphicsWidget *> widgets = widgetsToAnimate();
|
QPair<QGraphicsWidget *,QGraphicsWidget *> widgets = qMakePair(widgetToAnimate(), d->backWidget);
|
||||||
|
|
||||||
QSequentialAnimationGroup *groupAnim = new QSequentialAnimationGroup(parent);
|
QSequentialAnimationGroup *groupAnim = new QSequentialAnimationGroup(parent);
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#////////////////////////////////////////////////////////////////////////
|
#////////////////////////////////////////////////////////////////////////
|
||||||
// rotation.cpp //
|
// rotationstacked.h //
|
||||||
// //
|
// //
|
||||||
// Copyright(C) 2009 Igor Trindade Oliveira <igor.oliveira@indt.org.br>//
|
// Copyright(C) 2009 Igor Trindade Oliveira <igor.oliveira@indt.org.br>//
|
||||||
// //
|
// //
|
||||||
@ -25,14 +25,24 @@
|
|||||||
#include <plasma/animations/animation.h>
|
#include <plasma/animations/animation.h>
|
||||||
#include <plasma/plasma_export.h>
|
#include <plasma/plasma_export.h>
|
||||||
|
|
||||||
|
#include <QGraphicsLayoutItem>
|
||||||
|
|
||||||
namespace Plasma {
|
namespace Plasma {
|
||||||
|
|
||||||
class RotationStackedAnimationPrivate;
|
class RotationStackedAnimationPrivate;
|
||||||
|
|
||||||
|
/* TODO:
|
||||||
|
* create a parent class for rotations
|
||||||
|
*/
|
||||||
|
|
||||||
class RotationStackedAnimation : public Animation
|
class RotationStackedAnimation : public Animation
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
Q_PROPERTY(QGraphicsLayoutItem* layout READ layout)
|
||||||
|
Q_PROPERTY(Reference reference READ reference WRITE setReference)
|
||||||
|
Q_PROPERTY(QGraphicsWidget* backWidget READ backWidget WRITE setBackWidget)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RotationStackedAnimation(QObject *parent = 0);
|
RotationStackedAnimation(QObject *parent = 0);
|
||||||
~RotationStackedAnimation();
|
~RotationStackedAnimation();
|
||||||
@ -44,9 +54,8 @@ class RotationStackedAnimation : public Animation
|
|||||||
|
|
||||||
QGraphicsLayoutItem *layout();
|
QGraphicsLayoutItem *layout();
|
||||||
|
|
||||||
void setWidgetsToAnimate(QGraphicsWidget *front, QGraphicsWidget *back);
|
QGraphicsWidget *backWidget();
|
||||||
|
void setBackWidget(QGraphicsWidget *backWidget);
|
||||||
QPair<QGraphicsWidget *, QGraphicsWidget *> widgetsToAnimate();
|
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
void rotateBackWidget();
|
void rotateBackWidget();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* stackedlayout.h */
|
/* stackedlayout.c */
|
||||||
/* */
|
/* */
|
||||||
/* Copyright(C) 2009 Igor Trindade Oliveira <igor.oliveira@indt.org.br>*/
|
/* Copyright(C) 2009 Igor Trindade Oliveira <igor.oliveira@indt.org.br>*/
|
||||||
/* */
|
/* */
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
// rotation.cpp //
|
// stackedlayout.h //
|
||||||
// //
|
// //
|
||||||
// Copyright(C) 2009 Igor Trindade Oliveira <igor.oliveira@indt.org.br>//
|
// Copyright(C) 2009 Igor Trindade Oliveira <igor.oliveira@indt.org.br>//
|
||||||
// //
|
// //
|
||||||
|
Loading…
x
Reference in New Issue
Block a user