1 | /* |
---|
2 | |
---|
3 | Copyright 2015 Adam Reichold |
---|
4 | |
---|
5 | This file is part of qpdfview. |
---|
6 | |
---|
7 | qpdfview is free software: you can redistribute it and/or modify |
---|
8 | it under the terms of the GNU General Public License as published by |
---|
9 | the Free Software Foundation, either version 2 of the License, or |
---|
10 | (at your option) any later version. |
---|
11 | |
---|
12 | qpdfview is distributed in the hope that it will be useful, |
---|
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
15 | GNU General Public License for more details. |
---|
16 | |
---|
17 | You should have received a copy of the GNU General Public License |
---|
18 | along with qpdfview. If not, see <http://www.gnu.org/licenses/>. |
---|
19 | |
---|
20 | */ |
---|
21 | |
---|
22 | #ifndef SEARCHITEMDELEGATE_H |
---|
23 | #define SEARCHITEMDELEGATE_H |
---|
24 | |
---|
25 | #include <QStyledItemDelegate> |
---|
26 | |
---|
27 | namespace qpdfview |
---|
28 | { |
---|
29 | |
---|
30 | class SearchItemDelegate : public QStyledItemDelegate |
---|
31 | { |
---|
32 | Q_OBJECT |
---|
33 | |
---|
34 | public: |
---|
35 | explicit SearchItemDelegate(QObject* parent = 0); |
---|
36 | |
---|
37 | void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const; |
---|
38 | |
---|
39 | private: |
---|
40 | void paintProgress(QPainter* painter, const QStyleOptionViewItem& option, |
---|
41 | int progress) const; |
---|
42 | void paintText(QPainter* painter, const QStyleOptionViewItem& option, |
---|
43 | const QString& matchedText, const QString& surroundingText) const; |
---|
44 | |
---|
45 | }; |
---|
46 | |
---|
47 | } // qpdfview |
---|
48 | |
---|
49 | #endif // SEARCHITEMDELEGATE_H |
---|