1 | /* |
2 | Copyright (C) 2010 Marco Mentasti <marcomentasti@gmail.com> |
3 | |
4 | This library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Library General Public |
6 | License version 2 as published by the Free Software Foundation. |
7 | |
8 | This library is distributed in the hope that it will be useful, |
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
11 | Library General Public License for more details. |
12 | |
13 | You should have received a copy of the GNU Library General Public License |
14 | along with this library; see the file COPYING.LIB. If not, write to |
15 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
16 | Boston, MA 02110-1301, USA. |
17 | */ |
18 | |
19 | #ifndef DATAOUTPUTMODEL_H |
20 | #define DATAOUTPUTMODEL_H |
21 | |
22 | struct OutputStyle; |
23 | |
24 | #include "cachedsqlquerymodel.h" |
25 | |
26 | #include <qcolor.h> |
27 | #include <qfont.h> |
28 | |
29 | |
30 | /// provide colors and styles |
31 | class DataOutputModel : public CachedSqlQueryModel |
32 | { |
33 | Q_OBJECT |
34 | |
35 | public: |
36 | DataOutputModel(QObject *parent = 0); |
37 | ~DataOutputModel(); |
38 | |
39 | bool useSystemLocale() const; |
40 | void setUseSystemLocale(bool useSystemLocale); |
41 | |
42 | QVariant data ( const QModelIndex & index, int role = Qt::DisplayRole ) const; |
43 | |
44 | void clear(); |
45 | void readConfig(); |
46 | |
47 | private: |
48 | QHash<QString,OutputStyle*> m_styles; |
49 | bool m_useSystemLocale; |
50 | }; |
51 | |
52 | #endif // DATAOUTPUTMODEL_H |
53 | |