7965a966ab11d2b92c84bb935f644a7f707a481c
[mdictionary] / src / mdictionary / gui / WordListProxyStyle.h
1 /*******************************************************************************
2
3
4     This file is part of mDictionary.
5
6     mDictionary is free software: you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation, either version 3 of the License, or
9     (at your option) any later version.
10
11     mDictionary is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with mDictionary.  If not, see <http://www.gnu.org/licenses/>.
18
19     Copyright 2010 Comarch S.A.
20
21 *******************************************************************************/
22 //! \file WordListProxyStyle.h
23 //! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
24
25 #ifndef WORDLISTPROXYSTYLE_H
26 #define WORDLISTPROXYSTYLE_H
27
28 #include <QProxyStyle>
29 #include <QtGui>
30
31 //! Custom proxy style that draws checkboxes as stars.
32 //! It will automatically wrap set style and change only
33 //! checkboxes drawing.
34 class WordListProxyStyle : public QProxyStyle
35 {
36 public:
37     WordListProxyStyle();
38     //! Reimplemented drawPrimitive method which only draws different
39     //! PE_IndicatorCheckBox elements
40     //! \sa QProxyStyle::drawPrimitive()
41     void drawPrimitive(PrimitiveElement element,
42                        const QStyleOption *option,
43                        QPainter *painter,
44                        const QWidget *widget) const;
45
46 private:
47     QPixmap starPixmapOn;
48     QPixmap starPixmapOff;
49 };
50
51 #endif // WORDLISTPROXYSTYLE_H