Change the Star Widget to use QImage instead of QPixmap

Also, clean a few calls, this should make the widget a tiny
bit faster. This patch also moves the grayImage function from
the star widget to the global scope, so I can use it on the
Calendar widget.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-06-19 18:45:26 -03:00 committed by Dirk Hohndel
parent f3f03e2ee8
commit be462ae1a6
5 changed files with 30 additions and 25 deletions

View file

@ -17,8 +17,8 @@ public:
/*reimp*/ QSize sizeHint() const;
static QPixmap starActive();
static QPixmap starInactive();
static const QImage& starActive();
static const QImage& starInactive();
signals:
void valueChanged(int stars);
@ -39,9 +39,8 @@ private:
int current;
bool readOnly;
static QPixmap *activeStar;
static QPixmap *inactiveStar;
QPixmap grayImage(QPixmap *coloredImg);
static QImage activeStar;
static QImage inactiveStar;
};
#endif // STARWIDGET_H