subsurface/qt-ui/starwidget.h
Tomaz Canabrava c5e7a025e4 Added option to edit the selected dive.
Added option to edit the selected dive.
Now the user can click on 'Edit', and a nice box will
appear stating that the dive is in edit mode, and the user
can edit all of the 'Notes' tab fields, including the
rating. When the edition is finished, the user needs to
click on 'edit' again to mark as accepted, or in
reset to reset the fields to it's original state

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-18 17:06:48 -07:00

39 lines
774 B
C++

#ifndef STARWIDGET_H
#define STARWIDGET_H
#include <QWidget>
enum StarConfig {SPACING = 2, IMG_SIZE = 16, TOTALSTARS = 5};
class StarWidget : public QWidget
{
Q_OBJECT
public:
explicit StarWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
int currentStars() const;
/*reimp*/ QSize sizeHint() const;
static QPixmap starActive();
static QPixmap starInactive();
Q_SIGNALS:
void valueChanged(int stars);
public Q_SLOTS:
void setCurrentStars(int value);
void setReadOnly( bool readOnly);
protected:
/*reimp*/ void mouseReleaseEvent(QMouseEvent* );
/*reimp*/ void paintEvent(QPaintEvent* );
private:
int current;
static QPixmap* activeStar;
static QPixmap* inactiveStar;
QPixmap grayImage(QPixmap *coloredImg);
bool readOnly;
};
#endif // STARWIDGET_H