1/*******************************************************************
2* backtraceratingwidget.h
3* Copyright 2009 Dario Andres Rodriguez <andresbajotierra@gmail.com>
4*
5* This program is free software; you can redistribute it and/or
6* modify it under the terms of the GNU General Public License as
7* published by the Free Software Foundation; either version 2 of
8* the License, or (at your option) any later version.
9*
10* This program is distributed in the hope that it will be useful,
11* but WITHOUT ANY WARRANTY; without even the implied warranty of
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13* GNU General Public License for more details.
14*
15* You should have received a copy of the GNU General Public License
16* along with this program. If not, see <http://www.gnu.org/licenses/>.
17*
18******************************************************************/
19
20#ifndef BACKTRACERATINGWIDGET__H
21#define BACKTRACERATINGWIDGET__H
22
23#include <QWidget>
24
25#include "parser/backtraceparser.h"
26#include "backtracegenerator.h"
27
28class QPixmap;
29
30class BacktraceRatingWidget: public QWidget
31{
32 Q_OBJECT
33
34public:
35
36 explicit BacktraceRatingWidget(QWidget *);
37 void setUsefulness(BacktraceParser::Usefulness);
38 void setState(BacktraceGenerator::State s) {
39 m_state = s; update();
40 }
41
42protected:
43
44 void paintEvent(QPaintEvent * event);
45
46private:
47
48 BacktraceGenerator::State m_state;
49
50 bool m_star1;
51 bool m_star2;
52 bool m_star3;
53
54 QPixmap m_errorPixmap;
55
56 QPixmap m_starPixmap;
57 QPixmap m_disabledStarPixmap;
58};
59
60#endif
61