diff options
author | Anselmo Lacerda S. de Melo <anselmo.melo@openbossa.org> | 2010-05-29 21:08:09 -0300 |
---|---|---|
committer | Anselmo Lacerda S. de Melo <anselmo.melo@openbossa.org> | 2010-05-30 11:04:33 -0300 |
commit | 75400545f25b394b9c6925ab80ab9fd48e2920e2 (patch) | |
tree | 192b41c59d8e37dff0d486087210a19f37142283 /weather/src/pixmapbutton.h | |
parent | 4d86ebb587dc4f822569ecab3d4d25a5b3ca3939 (diff) |
weather: code moved to src/
Signed-off-by: Anselmo Lacerda S. de Melo <anselmo.melo@openbossa.org>
Diffstat (limited to 'weather/src/pixmapbutton.h')
-rw-r--r-- | weather/src/pixmapbutton.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/weather/src/pixmapbutton.h b/weather/src/pixmapbutton.h new file mode 100644 index 0000000..60c95a3 --- /dev/null +++ b/weather/src/pixmapbutton.h @@ -0,0 +1,29 @@ +#ifndef PIXMAPBUTTON_H +#define PIXMAPBUTTON_H + +#include <QObject> +#include <QGraphicsPixmapItem> + +class PixmapButton: public QObject, public QGraphicsPixmapItem +{ + Q_OBJECT + Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity); +public: + PixmapButton(qreal minSize, const QPixmap &pixmap, QGraphicsItem *parent = 0); + QRectF boundingRect() const; + QPainterPath shape() const; + +public slots: + void doHide() { hide(); } + +signals: + void clicked(); + +protected: + void mousePressEvent(QGraphicsSceneMouseEvent *event); + +private: + const qreal m_minSize; +}; + +#endif // PIXMAPBUTTON_H |