00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef QT_SVG_BUTTON_H
00010 #define QT_SVG_BUTTON_H
00011
00012 #include <QtGui/QAbstractButton>
00013 #include <QtGui/QPicture>
00014
00015 class QSvgRenderer;
00016
00017 class QtSvgButton : public QAbstractButton
00018 {
00019 Q_OBJECT
00020 Q_PROPERTY(QString skin READ skin WRITE setSkin)
00021 public:
00022 explicit QtSvgButton(QWidget * parent = 0);
00023 ~QtSvgButton();
00024
00025 void setSkin(const QString& skin);
00026 QString skin() const;
00027
00028 virtual QSize sizeHint() const;
00029
00030 private:
00031 QRect buttonRect() const;
00032
00034 QSize m_defaultSize;
00035
00037 QPicture m_normal;
00039 QPicture m_hovered;
00041 QPicture m_pressed;
00043 QString m_skin;
00044
00045 protected:
00046 virtual void paintEvent(QPaintEvent* event);
00047 };
00048
00049 #endif // QT_SVG_BUTTON_H