diff options
author | David Boddie <david.boddie@nokia.com> | 2011-05-11 17:35:46 +0200 |
---|---|---|
committer | David Boddie <david.boddie@nokia.com> | 2011-05-23 14:24:07 +0200 |
commit | 0cbcc61ef35b9bce1d65d048853c79004b755b87 (patch) | |
tree | 0e10f00827d9d3b84862e371d163f1b2774ee996 /examples/animation | |
parent | 0748751c9f097d9d866605306bbdd4b96e2a5c4e (diff) | |
download | qtbase-0cbcc61ef35b9bce1d65d048853c79004b755b87.tar.gz |
Squashed commit of changes from the 4.8-temp branch.
Diffstat (limited to 'examples/animation')
-rw-r--r-- | examples/animation/animatedtiles/animatedtiles.desktop | 11 | ||||
-rw-r--r-- | examples/animation/appchooser/appchooser.desktop | 11 | ||||
-rw-r--r-- | examples/animation/easing/easing.desktop | 11 | ||||
-rw-r--r-- | examples/animation/moveblocks/moveblocks.desktop | 11 | ||||
-rw-r--r-- | examples/animation/states/states.desktop | 11 | ||||
-rw-r--r-- | examples/animation/stickman/rectbutton.cpp | 33 | ||||
-rw-r--r-- | examples/animation/stickman/rectbutton.h | 25 | ||||
-rw-r--r-- | examples/animation/stickman/stickman.desktop | 11 |
8 files changed, 124 insertions, 0 deletions
diff --git a/examples/animation/animatedtiles/animatedtiles.desktop b/examples/animation/animatedtiles/animatedtiles.desktop new file mode 100644 index 0000000000..97e646fdf8 --- /dev/null +++ b/examples/animation/animatedtiles/animatedtiles.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Animated Tiles +Exec=/opt/usr/bin/animatedtiles +Icon=animatedtiles +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/animation/appchooser/appchooser.desktop b/examples/animation/appchooser/appchooser.desktop new file mode 100644 index 0000000000..8e413e96c2 --- /dev/null +++ b/examples/animation/appchooser/appchooser.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Application Chooser +Exec=/opt/usr/bin/appchooser +Icon=appchooser +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/animation/easing/easing.desktop b/examples/animation/easing/easing.desktop new file mode 100644 index 0000000000..56d122217a --- /dev/null +++ b/examples/animation/easing/easing.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Easing Curves +Exec=/opt/usr/bin/easing +Icon=easing +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/animation/moveblocks/moveblocks.desktop b/examples/animation/moveblocks/moveblocks.desktop new file mode 100644 index 0000000000..4100f448df --- /dev/null +++ b/examples/animation/moveblocks/moveblocks.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Move Blocks +Exec=/opt/usr/bin/moveblocks +Icon=moveblocks +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/animation/states/states.desktop b/examples/animation/states/states.desktop new file mode 100644 index 0000000000..8429979f23 --- /dev/null +++ b/examples/animation/states/states.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=States +Exec=/opt/usr/bin/states +Icon=states +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/animation/stickman/rectbutton.cpp b/examples/animation/stickman/rectbutton.cpp new file mode 100644 index 0000000000..f8b00daa9d --- /dev/null +++ b/examples/animation/stickman/rectbutton.cpp @@ -0,0 +1,33 @@ +#include "rectbutton.h" +#include <QPainter> + +RectButton::RectButton(QString buttonText) : m_ButtonText(buttonText) +{ +} + + +RectButton::~RectButton() +{ +} + + +void RectButton::mousePressEvent (QGraphicsSceneMouseEvent *event) +{ + emit clicked(); +} + + +QRectF RectButton::boundingRect() const +{ + return QRectF(0.0, 0.0, 90.0, 40.0); +} + + +void RectButton::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +{ + painter->setBrush(Qt::gray); + painter->drawRoundedRect(boundingRect(), 5, 5); + + painter->setPen(Qt::white); + painter->drawText(20, 25, m_ButtonText); +} diff --git a/examples/animation/stickman/rectbutton.h b/examples/animation/stickman/rectbutton.h new file mode 100644 index 0000000000..95ca2e2a21 --- /dev/null +++ b/examples/animation/stickman/rectbutton.h @@ -0,0 +1,25 @@ +#ifndef RECTBUTTON_H +#define RECTBUTTON_H + +#include <QGraphicsObject> + +class RectButton : public QGraphicsObject +{ + Q_OBJECT +public: + RectButton(QString buttonText); + ~RectButton(); + + virtual QRectF boundingRect() const; + virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); + +protected: + QString m_ButtonText; + + virtual void mousePressEvent (QGraphicsSceneMouseEvent *event); + +signals: + void clicked(); +}; + +#endif // RECTBUTTON_H diff --git a/examples/animation/stickman/stickman.desktop b/examples/animation/stickman/stickman.desktop new file mode 100644 index 0000000000..1722d4db3e --- /dev/null +++ b/examples/animation/stickman/stickman.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Stickman +Exec=/opt/usr/bin/stickman +Icon=stickman +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable |