Line | Source | Count |
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
12 | | - |
13 | | - |
14 | | - |
15 | | - |
16 | | - |
17 | | - |
18 | | - |
19 | | - |
20 | | - |
21 | | - |
22 | | - |
23 | | - |
24 | | - |
25 | | - |
26 | | - |
27 | | - |
28 | | - |
29 | | - |
30 | | - |
31 | | - |
32 | | - |
33 | | - |
34 | | - |
35 | | - |
36 | | - |
37 | | - |
38 | | - |
39 | | - |
40 | #include "qstylefactory.h" | - |
41 | #include "qstyleplugin.h" | - |
42 | #include "private/qfactoryloader_p.h" | - |
43 | #include "qmutex.h" | - |
44 | | - |
45 | #include "qapplication.h" | - |
46 | #include "qwindowsstyle_p.h" | - |
47 | #ifndef QT_NO_STYLE_FUSION | - |
48 | #include "qfusionstyle_p.h" | - |
49 | #ifndef QT_NO_STYLE_ANDROID | - |
50 | #include "qandroidstyle_p.h" | - |
| #endif#endif | |
| #ifndef QT_NO_STYLE_GTK | |
| #include "qgtkstyle_p.h"#endif | |
53 | #ifndef QT_NO_STYLE_WINDOWSXP | - |
54 | #include "qwindowsxpstyle_p.h" | - |
55 | #endif | - |
56 | #ifndef QT_NO_STYLE_WINDOWSVISTA | - |
57 | #include "qwindowsvistastyle_p.h" | - |
58 | #endif | - |
59 | #ifndef QT_NO_STYLE_WINDOWSCE | - |
60 | #include "qwindowscestyle_p.h" | - |
61 | #endif | - |
62 | #ifndef QT_NO_STYLE_WINDOWSMOBILE | - |
63 | #include "qwindowsmobilestyle_p.h" | - |
64 | #endif | - |
65 | | - |
66 | #if !defined(QT_NO_STYLE_MAC) && defined(Q_OS_MAC) | - |
67 | # include "qmacstyle_mac_p.h" | - |
68 | #endif | - |
69 | | - |
70 | QT_BEGIN_NAMESPACE | - |
71 | | - |
| #ifndef QT_NO_LIBRARYQ_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, | |
73 | (QStyleFactoryInterface_iid, QLatin1String("/styles"), Qt::CaseInsensitive)) | - |
74 | | - |
| #endif | |
| | |
75 | | - |
76 | | - |
77 | | - |
78 | | - |
79 | | - |
80 | | - |
81 | | - |
82 | | - |
83 | | - |
84 | | - |
85 | | - |
86 | | - |
87 | | - |
88 | | - |
89 | | - |
90 | | - |
91 | | - |
92 | | - |
93 | | - |
94 | | - |
95 | | - |
96 | | - |
97 | | - |
98 | | - |
99 | | - |
100 | | - |
101 | | - |
102 | | - |
103 | | - |
104 | | - |
105 | | - |
106 | | - |
107 | | - |
108 | QStyle *QStyleFactory::create(const QString& key) | - |
109 | { | - |
110 | QStyle *ret = 0; | - |
111 | QString style = key.toLower(); | - |
112 | #ifndef QT_NO_STYLE_WINDOWS | - |
113 | if (style == QLatin1String("windows"))TRUE | never evaluated | FALSE | never evaluated |
| 0 |
114 | ret = new QWindowsStyle; never executed: ret = new QWindowsStyle; | 0 |
115 | else | - |
116 | #endif | - |
117 | #ifndef QT_NO_STYLE_WINDOWSCE | - |
118 | if (style == QLatin1String("windowsce")) | - |
119 | ret = new QWindowsCEStyle; | - |
120 | else | - |
121 | #endif | - |
122 | #ifndef QT_NO_STYLE_WINDOWSMOBILE | - |
123 | if (style == QLatin1String("windowsmobile")) | - |
124 | ret = new QWindowsMobileStyle; | - |
125 | else | - |
126 | #endif | - |
127 | #ifndef QT_NO_STYLE_WINDOWSXP | - |
128 | if (style == QLatin1String("windowsxp")) | - |
129 | ret = new QWindowsXPStyle; | - |
130 | else | - |
131 | #endif | - |
132 | #ifndef QT_NO_STYLE_WINDOWSVISTA | - |
133 | if (style == QLatin1String("windowsvista")) | - |
134 | ret = new QWindowsVistaStyle; | - |
135 | else | - |
136 | #endif | - |
137 | #ifndef QT_NO_STYLE_FUSION | - |
138 | if (style == QLatin1String("fusion"))TRUE | never evaluated | FALSE | never evaluated |
| 0 |
139 | ret = new QFusionStyle; never executed: ret = new QFusionStyle; | 0 |
140 | else | - |
141 | #endif | - |
142 | #ifndef QT_NO_STYLE_ANDROID | - |
143 | if (style == QLatin1String("android")) | - |
144 | ret = new QAndroidStyle; | - |
| else | |
| #endif | |
| #ifndef QT_NO_STYLE_GTK | |
| if (style == QLatin1String("gtk") || style == QLatin1String("gtk+")) | |
| ret = new QGtkStyle; | |
145 | else | - |
146 | #endif | - |
147 | #ifndef QT_NO_STYLE_MAC | - |
148 | if (style.startsWith(QLatin1String("macintosh"))) { | - |
149 | ret = new QMacStyle; | - |
150 | # ifdef Q_DEAD_CODE_FROM_QT4_MAC | - |
151 | if (style == QLatin1String("macintosh")) | - |
152 | style += QLatin1String(" (aqua)"); | - |
153 | # endif | - |
154 | } else | - |
155 | #endif | - |
156 | { } never executed: end of block | 0 |
157 | #ifndef QT_NO_LIBRARYif (!ret)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
158 | ret = qLoadPlugin<QStyle, QStylePlugin>(loader(), style); never executed: ret = qLoadPlugin<QStyle, QStylePlugin>(loader(), style); | 0 |
159 | #endifif(ret)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
160 | ret->setObjectName(style); never executed: ret->setObjectName(style); | 0 |
161 | return ret; never executed: return ret; | 0 |
162 | } | - |
163 | | - |
164 | | - |
165 | | - |
166 | | - |
167 | | - |
168 | | - |
169 | | - |
170 | QStringList QStyleFactory::keys() | - |
171 | { | - |
172 | QStringList list; | - |
173 | #ifndef QT_NO_LIBRARYtypedef QMultiMap<int, QString> PluginKeyMap; | - |
174 | | - |
175 | const PluginKeyMap keyMap = loader()->keyMap(); | - |
176 | const PluginKeyMap::const_iterator cend = keyMap.constEnd(); | - |
177 | for (PluginKeyMap::const_iterator it = keyMap.constBegin(); it != cend; ++it)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
178 | list.append(it.value()); never executed: list.append(it.value()); | 0 |
| #endif#ifndef QT_NO_STYLE_WINDOWS | |
180 | if (!list.contains(QLatin1String("Windows")))TRUE | never evaluated | FALSE | never evaluated |
| 0 |
181 | list << QLatin1String("Windows"); never executed: list << QLatin1String("Windows"); | 0 |
182 | #endif | - |
183 | #ifndef QT_NO_STYLE_WINDOWSCE | - |
184 | if (!list.contains(QLatin1String("WindowsCE"))) | - |
185 | list << QLatin1String("WindowsCE"); | - |
186 | #endif | - |
187 | #ifndef QT_NO_STYLE_WINDOWSMOBILE | - |
188 | if (!list.contains(QLatin1String("WindowsMobile"))) | - |
189 | list << QLatin1String("WindowsMobile"); | - |
190 | #endif | - |
191 | #ifndef QT_NO_STYLE_WINDOWSXP | - |
192 | if (!list.contains(QLatin1String("WindowsXP")) && | - |
193 | (QSysInfo::WindowsVersion >= QSysInfo::WV_XP && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based))) | - |
194 | list << QLatin1String("WindowsXP"); | - |
195 | #endif | - |
196 | #ifndef QT_NO_STYLE_WINDOWSVISTA | - |
197 | if (!list.contains(QLatin1String("WindowsVista")) && | - |
198 | (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based))) | - |
199 | list << QLatin1String("WindowsVista"); | - |
200 | #endif | - |
201 | #ifndef QT_NO_STYLE_ANDROID | - |
202 | if (!list.contains(QLatin1String("Android"))) | - |
203 | list << QLatin1String("Android"); | - |
| #endif | |
| #ifndef QT_NO_STYLE_GTK | |
| if (!list.contains(QLatin1String("GTK+"))) | |
| list << QLatin1String("GTK+"); | |
204 | #endif | - |
205 | #ifndef QT_NO_STYLE_FUSION | - |
206 | if (!list.contains(QLatin1String("Fusion")))TRUE | never evaluated | FALSE | never evaluated |
| 0 |
207 | list << QLatin1String("Fusion"); never executed: list << QLatin1String("Fusion"); | 0 |
208 | #endif | - |
209 | #ifndef QT_NO_STYLE_MAC | - |
210 | QString mstyle = QLatin1String("Macintosh"); | - |
211 | # ifdef Q_DEAD_CODE_FROM_QT4_MAC | - |
212 | mstyle += QLatin1String(" (aqua)"); | - |
213 | # endif | - |
214 | if (!list.contains(mstyle)) | - |
215 | list << mstyle; | - |
216 | #endif | - |
217 | return list; never executed: return list; | 0 |
218 | } | - |
219 | | - |
220 | QT_END_NAMESPACE | - |
| | |