Line | Source Code | Coverage |
---|
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | using namespace QCss; | - |
7 | StyleSheet QStyleSheetStyle::getDefaultStyleSheet() const | - |
8 | { | - |
9 | StyleSheet sheet; | - |
10 | StyleRule styleRule; | - |
11 | BasicSelector bSelector; | - |
12 | Selector selector; | - |
13 | Declaration decl; | - |
14 | QCss::Value value; | - |
15 | Pseudo pseudo; | - |
16 | AttributeSelector attr; | - |
17 | | - |
18 | | - |
19 | bool styleIsPixmapBased = baseStyle()->inherits("QMacStyle") partially evaluated: baseStyle()->inherits("QMacStyle") no Evaluation Count:0 | yes Evaluation Count:401 |
| 0-401 |
20 | || baseStyle()->inherits("QWindowsXPStyle") partially evaluated: baseStyle()->inherits("QWindowsXPStyle") no Evaluation Count:0 | yes Evaluation Count:401 |
| 0-401 |
21 | || baseStyle()->inherits("QGtkStyle"); partially evaluated: baseStyle()->inherits("QGtkStyle") no Evaluation Count:0 | yes Evaluation Count:401 |
| 0-401 |
22 | | - |
23 | | - |
24 | | - |
25 | | - |
26 | | - |
27 | | - |
28 | | - |
29 | { | - |
30 | bSelector.elementName = (QLatin1String("QLineEdit")); | - |
31 | selector.basicSelectors << bSelector; bSelector.ids.clear(); bSelector.pseudos.clear(); bSelector.attributeSelectors.clear(); | - |
32 | styleRule.selectors << selector; selector.basicSelectors.clear(); | - |
33 | | - |
34 | decl.d->property = (QLatin1String("-qt-background-role")); decl.d->propertyId = (QtBackgroundRole); | - |
35 | value.type = (Value::KnownIdentifier); value.variant = (Value_Base); decl.d->values << value; | - |
36 | styleRule.declarations << decl; decl.d.detach(); decl.d->values.clear(); | - |
37 | | - |
38 | decl.d->property = (QLatin1String("border")); decl.d->propertyId = (Border); | - |
39 | value.type = (Value::KnownIdentifier); value.variant = (Value_Native); decl.d->values << value; | - |
40 | styleRule.declarations << decl; decl.d.detach(); decl.d->values.clear(); | - |
41 | | - |
42 | decl.d->property = (QLatin1String("-qt-style-features")); decl.d->propertyId = (QtStyleFeatures); | - |
43 | value.type = (Value::Identifier); value.variant = (QString::fromLatin1("background-color")); decl.d->values << value; | - |
44 | styleRule.declarations << decl; decl.d.detach(); decl.d->values.clear(); | - |
45 | | - |
46 | sheet.styleRules << styleRule; styleRule.selectors.clear(); styleRule.declarations.clear(); | - |
47 | } | - |
48 | | - |
49 | | - |
50 | | - |
51 | | - |
52 | { | - |
53 | bSelector.elementName = (QLatin1String("QLineEdit")); | - |
54 | pseudo.type = (PseudoClass_Frameless); pseudo.name = (QLatin1String("no-frame")); bSelector.pseudos << pseudo; | - |
55 | selector.basicSelectors << bSelector; bSelector.ids.clear(); bSelector.pseudos.clear(); bSelector.attributeSelectors.clear(); | - |
56 | styleRule.selectors << selector; selector.basicSelectors.clear(); | - |
57 | | - |
58 | decl.d->property = (QLatin1String("border")); decl.d->propertyId = (Border); | - |
59 | value.type = (Value::KnownIdentifier); value.variant = (Value_None); decl.d->values << value; | - |
60 | styleRule.declarations << decl; decl.d.detach(); decl.d->values.clear(); | - |
61 | | - |
62 | sheet.styleRules << styleRule; styleRule.selectors.clear(); styleRule.declarations.clear(); | - |
63 | } | - |
64 | | - |
65 | | - |
66 | | - |
67 | | - |
68 | { | - |
69 | bSelector.elementName = (QLatin1String("QFrame")); | - |
70 | selector.basicSelectors << bSelector; bSelector.ids.clear(); bSelector.pseudos.clear(); bSelector.attributeSelectors.clear(); | - |
71 | styleRule.selectors << selector; selector.basicSelectors.clear(); | - |
72 | | - |
73 | decl.d->property = (QLatin1String("border")); decl.d->propertyId = (Border); | - |
74 | value.type = (Value::KnownIdentifier); value.variant = (Value_Native); decl.d->values << value; | - |
75 | styleRule.declarations << decl; decl.d.detach(); decl.d->values.clear(); | - |
76 | | - |
77 | sheet.styleRules << styleRule; styleRule.selectors.clear(); styleRule.declarations.clear(); | - |
78 | } | - |
79 | | - |
80 | | - |
81 | | - |
82 | | - |
83 | | - |
84 | { | - |
85 | bSelector.elementName = (QLatin1String("QLabel")); | - |
86 | selector.basicSelectors << bSelector; bSelector.ids.clear(); bSelector.pseudos.clear(); bSelector.attributeSelectors.clear(); | - |
87 | styleRule.selectors << selector; selector.basicSelectors.clear(); | - |
88 | | - |
89 | bSelector.elementName = (QLatin1String("QToolBox")); | - |
90 | selector.basicSelectors << bSelector; bSelector.ids.clear(); bSelector.pseudos.clear(); bSelector.attributeSelectors.clear(); | - |
91 | styleRule.selectors << selector; selector.basicSelectors.clear(); | - |
92 | | - |
93 | decl.d->property = (QLatin1String("background")); decl.d->propertyId = (Background); | - |
94 | value.type = (Value::KnownIdentifier); value.variant = (Value_None); decl.d->values << value; | - |
95 | styleRule.declarations << decl; decl.d.detach(); decl.d->values.clear(); | - |
96 | | - |
97 | decl.d->property = (QLatin1String("border-image")); decl.d->propertyId = (BorderImage); | - |
98 | value.type = (Value::KnownIdentifier); value.variant = (Value_None); decl.d->values << value; | - |
99 | styleRule.declarations << decl; decl.d.detach(); decl.d->values.clear(); | - |
100 | | - |
101 | sheet.styleRules << styleRule; styleRule.selectors.clear(); styleRule.declarations.clear(); | - |
102 | } | - |
103 | | - |
104 | | - |
105 | | - |
106 | | - |
107 | { | - |
108 | bSelector.elementName = (QLatin1String("QGroupBox")); | - |
109 | selector.basicSelectors << bSelector; bSelector.ids.clear(); bSelector.pseudos.clear(); bSelector.attributeSelectors.clear(); | - |
110 | styleRule.selectors << selector; selector.basicSelectors.clear(); | - |
111 | | - |
112 | decl.d->property = (QLatin1String("border")); decl.d->propertyId = (Border); | - |
113 | value.type = (Value::KnownIdentifier); value.variant = (Value_Native); decl.d->values << value; | - |
114 | styleRule.declarations << decl; decl.d.detach(); decl.d->values.clear(); | - |
115 | | - |
116 | sheet.styleRules << styleRule; styleRule.selectors.clear(); styleRule.declarations.clear(); | - |
117 | } | - |
118 | | - |
119 | | - |
120 | | - |
121 | | - |
122 | | - |
123 | | - |
124 | { | - |
125 | bSelector.elementName = (QLatin1String("QToolTip")); | - |
126 | selector.basicSelectors << bSelector; bSelector.ids.clear(); bSelector.pseudos.clear(); bSelector.attributeSelectors.clear(); | - |
127 | styleRule.selectors << selector; selector.basicSelectors.clear(); | - |
128 | | - |
129 | decl.d->property = (QLatin1String("-qt-background-role")); decl.d->propertyId = (QtBackgroundRole); | - |
130 | value.type = (Value::KnownIdentifier); value.variant = (Value_Window); decl.d->values << value; | - |
131 | styleRule.declarations << decl; decl.d.detach(); decl.d->values.clear(); | - |
132 | | - |
133 | decl.d->property = (QLatin1String("border")); decl.d->propertyId = (Border); | - |
134 | value.type = (Value::KnownIdentifier); value.variant = (Value_Native); decl.d->values << value; | - |
135 | styleRule.declarations << decl; decl.d.detach(); decl.d->values.clear(); | - |
136 | | - |
137 | sheet.styleRules << styleRule; styleRule.selectors.clear(); styleRule.declarations.clear(); | - |
138 | } | - |
139 | | - |
140 | | - |
141 | | - |
142 | | - |
143 | | - |
144 | { | - |
145 | bSelector.elementName = (QLatin1String("QPushButton")); | - |
146 | selector.basicSelectors << bSelector; bSelector.ids.clear(); bSelector.pseudos.clear(); bSelector.attributeSelectors.clear(); | - |
147 | styleRule.selectors << selector; selector.basicSelectors.clear(); | - |
148 | | - |
149 | bSelector.elementName = (QLatin1String("QToolButton")); | - |
150 | selector.basicSelectors << bSelector; bSelector.ids.clear(); bSelector.pseudos.clear(); bSelector.attributeSelectors.clear(); | - |
151 | styleRule.selectors << selector; selector.basicSelectors.clear(); | - |
152 | | - |
153 | decl.d->property = (QLatin1String("border-style")); decl.d->propertyId = (BorderStyles); | - |
154 | value.type = (Value::KnownIdentifier); value.variant = (Value_Native); decl.d->values << value; | - |
155 | styleRule.declarations << decl; decl.d.detach(); decl.d->values.clear(); | - |
156 | | - |
157 | if (!styleIsPixmapBased) { partially evaluated: !styleIsPixmapBased yes Evaluation Count:401 | no Evaluation Count:0 |
| 0-401 |
158 | decl.d->property = (QLatin1String("-qt-style-features")); decl.d->propertyId = (QtStyleFeatures); | - |
159 | value.type = (Value::Identifier); value.variant = (QString::fromLatin1("background-color")); decl.d->values << value; | - |
160 | styleRule.declarations << decl; decl.d.detach(); decl.d->values.clear(); | - |
161 | } executed: } Execution Count:401 | 401 |
162 | | - |
163 | | - |
164 | sheet.styleRules << styleRule; styleRule.selectors.clear(); styleRule.declarations.clear(); | - |
165 | } | - |
166 | { | - |
167 | bSelector.elementName = (QLatin1String("QComboBox")); | - |
168 | selector.basicSelectors << bSelector; bSelector.ids.clear(); bSelector.pseudos.clear(); bSelector.attributeSelectors.clear(); | - |
169 | styleRule.selectors << selector; selector.basicSelectors.clear(); | - |
170 | | - |
171 | decl.d->property = (QLatin1String("border")); decl.d->propertyId = (Border); | - |
172 | value.type = (Value::KnownIdentifier); value.variant = (Value_Native); decl.d->values << value; | - |
173 | styleRule.declarations << decl; decl.d.detach(); decl.d->values.clear(); | - |
174 | | - |
175 | if (!styleIsPixmapBased) { partially evaluated: !styleIsPixmapBased yes Evaluation Count:401 | no Evaluation Count:0 |
| 0-401 |
176 | decl.d->property = (QLatin1String("-qt-style-features")); decl.d->propertyId = (QtStyleFeatures); | - |
177 | value.type = (Value::Identifier); value.variant = (QString::fromLatin1("background-color")); decl.d->values << value; | - |
178 | value.type = (Value::Identifier); value.variant = (QString::fromLatin1("background-gradient")); decl.d->values << value; | - |
179 | styleRule.declarations << decl; decl.d.detach(); decl.d->values.clear(); | - |
180 | } executed: } Execution Count:401 | 401 |
181 | | - |
182 | decl.d->property = (QLatin1String("-qt-background-role")); decl.d->propertyId = (QtBackgroundRole); | - |
183 | value.type = (Value::KnownIdentifier); value.variant = (Value_Base); decl.d->values << value; | - |
184 | styleRule.declarations << decl; decl.d.detach(); decl.d->values.clear(); | - |
185 | | - |
186 | sheet.styleRules << styleRule; styleRule.selectors.clear(); styleRule.declarations.clear(); | - |
187 | } | - |
188 | | - |
189 | | - |
190 | | - |
191 | | - |
192 | | - |
193 | | - |
194 | | - |
195 | if (baseStyle()->inherits("QPlastiqueStyle") || baseStyle()->inherits("QCleanlooksStyle") || baseStyle()->inherits("QFusionStyle")) partially evaluated: baseStyle()->inherits("QPlastiqueStyle") no Evaluation Count:0 | yes Evaluation Count:401 |
partially evaluated: baseStyle()->inherits("QCleanlooksStyle") no Evaluation Count:0 | yes Evaluation Count:401 |
evaluated: baseStyle()->inherits("QFusionStyle") yes Evaluation Count:192 | yes Evaluation Count:209 |
| 0-401 |
196 | { | - |
197 | bSelector.elementName = (QLatin1String("QComboBox")); | - |
198 | attr.name = (QLatin1String("readOnly")); attr.value = (QLatin1String("true")); attr.valueMatchCriterium = (AttributeSelector::MatchEqual); bSelector.attributeSelectors << attr; | - |
199 | selector.basicSelectors << bSelector; bSelector.ids.clear(); bSelector.pseudos.clear(); bSelector.attributeSelectors.clear(); | - |
200 | styleRule.selectors << selector; selector.basicSelectors.clear(); | - |
201 | | - |
202 | decl.d->property = (QLatin1String("-qt-background-role")); decl.d->propertyId = (QtBackgroundRole); | - |
203 | value.type = (Value::KnownIdentifier); value.variant = (Value_Button); decl.d->values << value; | - |
204 | styleRule.declarations << decl; decl.d.detach(); decl.d->values.clear(); | - |
205 | | - |
206 | sheet.styleRules << styleRule; styleRule.selectors.clear(); styleRule.declarations.clear(); | - |
207 | } executed: } Execution Count:192 | 192 |
208 | | - |
209 | | - |
210 | | - |
211 | | - |
212 | | - |
213 | | - |
214 | { | - |
215 | bSelector.elementName = (QLatin1String("QAbstractSpinBox")); | - |
216 | selector.basicSelectors << bSelector; bSelector.ids.clear(); bSelector.pseudos.clear(); bSelector.attributeSelectors.clear(); | - |
217 | styleRule.selectors << selector; selector.basicSelectors.clear(); | - |
218 | | - |
219 | decl.d->property = (QLatin1String("border")); decl.d->propertyId = (Border); | - |
220 | value.type = (Value::KnownIdentifier); value.variant = (Value_Native); decl.d->values << value; | - |
221 | styleRule.declarations << decl; decl.d.detach(); decl.d->values.clear(); | - |
222 | | - |
223 | decl.d->property = (QLatin1String("-qt-style-features")); decl.d->propertyId = (QtStyleFeatures); | - |
224 | value.type = (Value::Identifier); value.variant = (QString::fromLatin1("background-color")); decl.d->values << value; | - |
225 | styleRule.declarations << decl; decl.d.detach(); decl.d->values.clear(); | - |
226 | | - |
227 | decl.d->property = (QLatin1String("-qt-background-role")); decl.d->propertyId = (QtBackgroundRole); | - |
228 | value.type = (Value::KnownIdentifier); value.variant = (Value_Base); decl.d->values << value; | - |
229 | styleRule.declarations << decl; decl.d.detach(); decl.d->values.clear(); | - |
230 | | - |
231 | sheet.styleRules << styleRule; styleRule.selectors.clear(); styleRule.declarations.clear(); | - |
232 | } | - |
233 | | - |
234 | | - |
235 | | - |
236 | | - |
237 | { | - |
238 | bSelector.elementName = (QLatin1String("QMenu")); | - |
239 | selector.basicSelectors << bSelector; bSelector.ids.clear(); bSelector.pseudos.clear(); bSelector.attributeSelectors.clear(); | - |
240 | styleRule.selectors << selector; selector.basicSelectors.clear(); | - |
241 | | - |
242 | decl.d->property = (QLatin1String("-qt-background-role")); decl.d->propertyId = (QtBackgroundRole); | - |
243 | value.type = (Value::KnownIdentifier); value.variant = (Value_Window); decl.d->values << value; | - |
244 | styleRule.declarations << decl; decl.d.detach(); decl.d->values.clear(); | - |
245 | | - |
246 | sheet.styleRules << styleRule; styleRule.selectors.clear(); styleRule.declarations.clear(); | - |
247 | } | - |
248 | | - |
249 | | - |
250 | | - |
251 | if (!styleIsPixmapBased) { partially evaluated: !styleIsPixmapBased yes Evaluation Count:401 | no Evaluation Count:0 |
| 0-401 |
252 | bSelector.elementName = (QLatin1String("QMenu")); | - |
253 | pseudo.type = (PseudoClass_Unknown); pseudo.name = (QLatin1String("item")); bSelector.pseudos << pseudo; | - |
254 | selector.basicSelectors << bSelector; bSelector.ids.clear(); bSelector.pseudos.clear(); bSelector.attributeSelectors.clear(); | - |
255 | styleRule.selectors << selector; selector.basicSelectors.clear(); | - |
256 | | - |
257 | decl.d->property = (QLatin1String("-qt-style-features")); decl.d->propertyId = (QtStyleFeatures); | - |
258 | value.type = (Value::Identifier); value.variant = (QString::fromLatin1("background-color")); decl.d->values << value; | - |
259 | styleRule.declarations << decl; decl.d.detach(); decl.d->values.clear(); | - |
260 | | - |
261 | sheet.styleRules << styleRule; styleRule.selectors.clear(); styleRule.declarations.clear(); | - |
262 | } executed: } Execution Count:401 | 401 |
263 | | - |
264 | | - |
265 | | - |
266 | | - |
267 | { | - |
268 | bSelector.elementName = (QLatin1String("QHeaderView")); | - |
269 | selector.basicSelectors << bSelector; bSelector.ids.clear(); bSelector.pseudos.clear(); bSelector.attributeSelectors.clear(); | - |
270 | styleRule.selectors << selector; selector.basicSelectors.clear(); | - |
271 | | - |
272 | decl.d->property = (QLatin1String("-qt-background-role")); decl.d->propertyId = (QtBackgroundRole); | - |
273 | value.type = (Value::KnownIdentifier); value.variant = (Value_Window); decl.d->values << value; | - |
274 | styleRule.declarations << decl; decl.d.detach(); decl.d->values.clear(); | - |
275 | | - |
276 | sheet.styleRules << styleRule; styleRule.selectors.clear(); styleRule.declarations.clear(); | - |
277 | } | - |
278 | | - |
279 | | - |
280 | | - |
281 | | - |
282 | | - |
283 | | - |
284 | { | - |
285 | bSelector.elementName = (QLatin1String("QTableCornerButton")); | - |
286 | pseudo.type = (PseudoClass_Unknown); pseudo.name = (QLatin1String("section")); bSelector.pseudos << pseudo; | - |
287 | selector.basicSelectors << bSelector; bSelector.ids.clear(); bSelector.pseudos.clear(); bSelector.attributeSelectors.clear(); | - |
288 | styleRule.selectors << selector; selector.basicSelectors.clear(); | - |
289 | | - |
290 | bSelector.elementName = (QLatin1String("QHeaderView")); | - |
291 | pseudo.type = (PseudoClass_Unknown); pseudo.name = (QLatin1String("section")); bSelector.pseudos << pseudo; | - |
292 | selector.basicSelectors << bSelector; bSelector.ids.clear(); bSelector.pseudos.clear(); bSelector.attributeSelectors.clear(); | - |
293 | styleRule.selectors << selector; selector.basicSelectors.clear(); | - |
294 | | - |
295 | decl.d->property = (QLatin1String("-qt-background-role")); decl.d->propertyId = (QtBackgroundRole); | - |
296 | value.type = (Value::KnownIdentifier); value.variant = (Value_Button); decl.d->values << value; | - |
297 | styleRule.declarations << decl; decl.d.detach(); decl.d->values.clear(); | - |
298 | | - |
299 | if (!styleIsPixmapBased) { partially evaluated: !styleIsPixmapBased yes Evaluation Count:401 | no Evaluation Count:0 |
| 0-401 |
300 | decl.d->property = (QLatin1String("-qt-style-features")); decl.d->propertyId = (QtStyleFeatures); | - |
301 | value.type = (Value::Identifier); value.variant = (QString::fromLatin1("background-color")); decl.d->values << value; | - |
302 | styleRule.declarations << decl; decl.d.detach(); decl.d->values.clear(); | - |
303 | } executed: } Execution Count:401 | 401 |
304 | | - |
305 | decl.d->property = (QLatin1String("border")); decl.d->propertyId = (Border); | - |
306 | value.type = (Value::KnownIdentifier); value.variant = (Value_Native); decl.d->values << value; | - |
307 | styleRule.declarations << decl; decl.d.detach(); decl.d->values.clear(); | - |
308 | | - |
309 | sheet.styleRules << styleRule; styleRule.selectors.clear(); styleRule.declarations.clear(); | - |
310 | } | - |
311 | | - |
312 | | - |
313 | | - |
314 | | - |
315 | { | - |
316 | bSelector.elementName = (QLatin1String("QProgressBar")); | - |
317 | selector.basicSelectors << bSelector; bSelector.ids.clear(); bSelector.pseudos.clear(); bSelector.attributeSelectors.clear(); | - |
318 | styleRule.selectors << selector; selector.basicSelectors.clear(); | - |
319 | | - |
320 | decl.d->property = (QLatin1String("-qt-background-role")); decl.d->propertyId = (QtBackgroundRole); | - |
321 | value.type = (Value::KnownIdentifier); value.variant = (Value_Base); decl.d->values << value; | - |
322 | styleRule.declarations << decl; decl.d.detach(); decl.d->values.clear(); | - |
323 | | - |
324 | sheet.styleRules << styleRule; styleRule.selectors.clear(); styleRule.declarations.clear(); | - |
325 | } | - |
326 | | - |
327 | | - |
328 | | - |
329 | | - |
330 | { | - |
331 | bSelector.elementName = (QLatin1String("QScrollBar")); | - |
332 | selector.basicSelectors << bSelector; bSelector.ids.clear(); bSelector.pseudos.clear(); bSelector.attributeSelectors.clear(); | - |
333 | styleRule.selectors << selector; selector.basicSelectors.clear(); | - |
334 | | - |
335 | decl.d->property = (QLatin1String("-qt-background-role")); decl.d->propertyId = (QtBackgroundRole); | - |
336 | value.type = (Value::KnownIdentifier); value.variant = (Value_Window); decl.d->values << value; | - |
337 | styleRule.declarations << decl; decl.d.detach(); decl.d->values.clear(); | - |
338 | | - |
339 | sheet.styleRules << styleRule; styleRule.selectors.clear(); styleRule.declarations.clear(); | - |
340 | } | - |
341 | | - |
342 | | - |
343 | | - |
344 | | - |
345 | { | - |
346 | bSelector.elementName = (QLatin1String("QDockWidget")); | - |
347 | selector.basicSelectors << bSelector; bSelector.ids.clear(); bSelector.pseudos.clear(); bSelector.attributeSelectors.clear(); | - |
348 | styleRule.selectors << selector; selector.basicSelectors.clear(); | - |
349 | | - |
350 | decl.d->property = (QLatin1String("border")); decl.d->propertyId = (Border); | - |
351 | value.type = (Value::KnownIdentifier); value.variant = (Value_Native); decl.d->values << value; | - |
352 | styleRule.declarations << decl; decl.d.detach(); decl.d->values.clear(); | - |
353 | | - |
354 | sheet.styleRules << styleRule; styleRule.selectors.clear(); styleRule.declarations.clear(); | - |
355 | } | - |
356 | | - |
357 | sheet.origin = StyleSheetOrigin_UserAgent; | - |
358 | sheet.buildIndexes(); | - |
359 | return sheet; executed: return sheet; Execution Count:401 | 401 |
360 | } | - |
361 | | - |
362 | | - |
363 | | - |
364 | | - |
365 | | - |
| | |