styles/qstylesheetstyle.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4 -
5 -
6 -
7 -
8using namespace QCss; -
9 -
10 -
11class QStyleSheetStylePrivate : public QWindowsStylePrivate -
12{ -
13 inline QStyleSheetStyle* q_func() { return static_cast<QStyleSheetStyle *>(q_ptr); } inline const QStyleSheetStyle* q_func() const { return static_cast<const QStyleSheetStyle *>(q_ptr); } friend class QStyleSheetStyle; -
14public: -
15 QStyleSheetStylePrivate() { } -
16}; -
17 -
18 -
19static QStyleSheetStyleCaches *styleSheetCaches = 0; -
20static const QStyleSheetStyle *globalStyleSheetStyle = 0; -
21class QStyleSheetStyleRecursionGuard -
22{ -
23 public: -
24 QStyleSheetStyleRecursionGuard(const QStyleSheetStyle *that) -
25 : guarded(globalStyleSheetStyle == 0) -
26 { -
27 if (guarded) globalStyleSheetStyle = that;
executed: globalStyleSheetStyle = that;
Execution Count:47083
evaluated: guarded
TRUEFALSE
yes
Evaluation Count:47083
yes
Evaluation Count:778
778-47083
28 }
executed: }
Execution Count:47861
47861
29 ~QStyleSheetStyleRecursionGuard() { if (guarded) globalStyleSheetStyle = 0; }
evaluated: guarded
TRUEFALSE
yes
Evaluation Count:47083
yes
Evaluation Count:778
executed: globalStyleSheetStyle = 0;
Execution Count:47083
executed: }
Execution Count:47861
778-47861
30 bool guarded; -
31}; -
32 -
33 -
34 -
35 -
36 -
37 -
38enum PseudoElement { -
39 PseudoElement_None, -
40 PseudoElement_DownArrow, -
41 PseudoElement_UpArrow, -
42 PseudoElement_LeftArrow, -
43 PseudoElement_RightArrow, -
44 PseudoElement_Indicator, -
45 PseudoElement_ExclusiveIndicator, -
46 PseudoElement_PushButtonMenuIndicator, -
47 PseudoElement_ComboBoxDropDown, -
48 PseudoElement_ComboBoxArrow, -
49 PseudoElement_Item, -
50 PseudoElement_SpinBoxUpButton, -
51 PseudoElement_SpinBoxUpArrow, -
52 PseudoElement_SpinBoxDownButton, -
53 PseudoElement_SpinBoxDownArrow, -
54 PseudoElement_GroupBoxTitle, -
55 PseudoElement_GroupBoxIndicator, -
56 PseudoElement_ToolButtonMenu, -
57 PseudoElement_ToolButtonMenuArrow, -
58 PseudoElement_ToolButtonDownArrow, -
59 PseudoElement_ToolBoxTab, -
60 PseudoElement_ScrollBarSlider, -
61 PseudoElement_ScrollBarAddPage, -
62 PseudoElement_ScrollBarSubPage, -
63 PseudoElement_ScrollBarAddLine, -
64 PseudoElement_ScrollBarSubLine, -
65 PseudoElement_ScrollBarFirst, -
66 PseudoElement_ScrollBarLast, -
67 PseudoElement_ScrollBarUpArrow, -
68 PseudoElement_ScrollBarDownArrow, -
69 PseudoElement_ScrollBarLeftArrow, -
70 PseudoElement_ScrollBarRightArrow, -
71 PseudoElement_SplitterHandle, -
72 PseudoElement_ToolBarHandle, -
73 PseudoElement_ToolBarSeparator, -
74 PseudoElement_MenuScroller, -
75 PseudoElement_MenuTearoff, -
76 PseudoElement_MenuCheckMark, -
77 PseudoElement_MenuSeparator, -
78 PseudoElement_MenuIcon, -
79 PseudoElement_MenuRightArrow, -
80 PseudoElement_TreeViewBranch, -
81 PseudoElement_HeaderViewSection, -
82 PseudoElement_HeaderViewUpArrow, -
83 PseudoElement_HeaderViewDownArrow, -
84 PseudoElement_ProgressBarChunk, -
85 PseudoElement_TabBarTab, -
86 PseudoElement_TabBarScroller, -
87 PseudoElement_TabBarTear, -
88 PseudoElement_SliderGroove, -
89 PseudoElement_SliderHandle, -
90 PseudoElement_SliderAddPage, -
91 PseudoElement_SliderSubPage, -
92 PseudoElement_SliderTickmark, -
93 PseudoElement_TabWidgetPane, -
94 PseudoElement_TabWidgetTabBar, -
95 PseudoElement_TabWidgetLeftCorner, -
96 PseudoElement_TabWidgetRightCorner, -
97 PseudoElement_DockWidgetTitle, -
98 PseudoElement_DockWidgetCloseButton, -
99 PseudoElement_DockWidgetFloatButton, -
100 PseudoElement_DockWidgetSeparator, -
101 PseudoElement_MdiCloseButton, -
102 PseudoElement_MdiMinButton, -
103 PseudoElement_MdiNormalButton, -
104 PseudoElement_TitleBar, -
105 PseudoElement_TitleBarCloseButton, -
106 PseudoElement_TitleBarMinButton, -
107 PseudoElement_TitleBarMaxButton, -
108 PseudoElement_TitleBarShadeButton, -
109 PseudoElement_TitleBarUnshadeButton, -
110 PseudoElement_TitleBarNormalButton, -
111 PseudoElement_TitleBarContextHelpButton, -
112 PseudoElement_TitleBarSysMenu, -
113 PseudoElement_ViewItem, -
114 PseudoElement_ViewItemIcon, -
115 PseudoElement_ViewItemText, -
116 PseudoElement_ViewItemIndicator, -
117 PseudoElement_ScrollAreaCorner, -
118 PseudoElement_TabBarTabCloseButton, -
119 NumPseudoElements -
120}; -
121 -
122struct PseudoElementInfo { -
123 QStyle::SubControl subControl; -
124 const char *name; -
125}; -
126 -
127static const PseudoElementInfo knownPseudoElements[NumPseudoElements] = { -
128 { QStyle::SC_None, "" }, -
129 { QStyle::SC_None, "down-arrow" }, -
130 { QStyle::SC_None, "up-arrow" }, -
131 { QStyle::SC_None, "left-arrow" }, -
132 { QStyle::SC_None, "right-arrow" }, -
133 { QStyle::SC_None, "indicator" }, -
134 { QStyle::SC_None, "indicator" }, -
135 { QStyle::SC_None, "menu-indicator" }, -
136 { QStyle::SC_ComboBoxArrow, "drop-down" }, -
137 { QStyle::SC_ComboBoxArrow, "down-arrow" }, -
138 { QStyle::SC_None, "item" }, -
139 { QStyle::SC_SpinBoxUp, "up-button" }, -
140 { QStyle::SC_SpinBoxUp, "up-arrow" }, -
141 { QStyle::SC_SpinBoxDown, "down-button" }, -
142 { QStyle::SC_SpinBoxDown, "down-arrow" }, -
143 { QStyle::SC_GroupBoxLabel, "title" }, -
144 { QStyle::SC_GroupBoxCheckBox, "indicator" }, -
145 { QStyle::SC_ToolButtonMenu, "menu-button" }, -
146 { QStyle::SC_ToolButtonMenu, "menu-arrow" }, -
147 { QStyle::SC_None, "menu-indicator" }, -
148 { QStyle::SC_None, "tab" }, -
149 { QStyle::SC_ScrollBarSlider, "handle" }, -
150 { QStyle::SC_ScrollBarAddPage, "add-page" }, -
151 { QStyle::SC_ScrollBarSubPage, "sub-page" }, -
152 { QStyle::SC_ScrollBarAddLine, "add-line" }, -
153 { QStyle::SC_ScrollBarSubLine, "sub-line" }, -
154 { QStyle::SC_ScrollBarFirst, "first" }, -
155 { QStyle::SC_ScrollBarLast, "last" }, -
156 { QStyle::SC_ScrollBarSubLine, "up-arrow" }, -
157 { QStyle::SC_ScrollBarAddLine, "down-arrow" }, -
158 { QStyle::SC_ScrollBarSubLine, "left-arrow" }, -
159 { QStyle::SC_ScrollBarAddLine, "right-arrow" }, -
160 { QStyle::SC_None, "handle" }, -
161 { QStyle::SC_None, "handle" }, -
162 { QStyle::SC_None, "separator" }, -
163 { QStyle::SC_None, "scroller" }, -
164 { QStyle::SC_None, "tearoff" }, -
165 { QStyle::SC_None, "indicator" }, -
166 { QStyle::SC_None, "separator" }, -
167 { QStyle::SC_None, "icon" }, -
168 { QStyle::SC_None, "right-arrow" }, -
169 { QStyle::SC_None, "branch" }, -
170 { QStyle::SC_None, "section" }, -
171 { QStyle::SC_None, "down-arrow" }, -
172 { QStyle::SC_None, "up-arrow" }, -
173 { QStyle::SC_None, "chunk" }, -
174 { QStyle::SC_None, "tab" }, -
175 { QStyle::SC_None, "scroller" }, -
176 { QStyle::SC_None, "tear" }, -
177 { QStyle::SC_SliderGroove, "groove" }, -
178 { QStyle::SC_SliderHandle, "handle" }, -
179 { QStyle::SC_None, "add-page" }, -
180 { QStyle::SC_None, "sub-page"}, -
181 { QStyle::SC_SliderTickmarks, "tick-mark" }, -
182 { QStyle::SC_None, "pane" }, -
183 { QStyle::SC_None, "tab-bar" }, -
184 { QStyle::SC_None, "left-corner" }, -
185 { QStyle::SC_None, "right-corner" }, -
186 { QStyle::SC_None, "title" }, -
187 { QStyle::SC_None, "close-button" }, -
188 { QStyle::SC_None, "float-button" }, -
189 { QStyle::SC_None, "separator" }, -
190 { QStyle::SC_MdiCloseButton, "close-button" }, -
191 { QStyle::SC_MdiMinButton, "minimize-button" }, -
192 { QStyle::SC_MdiNormalButton, "normal-button" }, -
193 { QStyle::SC_TitleBarLabel, "title" }, -
194 { QStyle::SC_TitleBarCloseButton, "close-button" }, -
195 { QStyle::SC_TitleBarMinButton, "minimize-button" }, -
196 { QStyle::SC_TitleBarMaxButton, "maximize-button" }, -
197 { QStyle::SC_TitleBarShadeButton, "shade-button" }, -
198 { QStyle::SC_TitleBarUnshadeButton, "unshade-button" }, -
199 { QStyle::SC_TitleBarNormalButton, "normal-button" }, -
200 { QStyle::SC_TitleBarContextHelpButton, "contexthelp-button" }, -
201 { QStyle::SC_TitleBarSysMenu, "sys-menu" }, -
202 { QStyle::SC_None, "item" }, -
203 { QStyle::SC_None, "icon" }, -
204 { QStyle::SC_None, "text" }, -
205 { QStyle::SC_None, "indicator" }, -
206 { QStyle::SC_None, "corner" }, -
207 { QStyle::SC_None, "close-button" }, -
208}; -
209 -
210 -
211struct QStyleSheetBorderImageData : public QSharedData -
212{ -
213 QStyleSheetBorderImageData() -
214 : horizStretch(QCss::TileMode_Unknown), vertStretch(QCss::TileMode_Unknown) -
215 { -
216 for (int i = 0; i < 4; i++)
never evaluated: i < 4
0
217 cuts[i] = -1;
never executed: cuts[i] = -1;
0
218 }
never executed: }
0
219 int cuts[4]; -
220 QPixmap pixmap; -
221 QImage image; -
222 QCss::TileMode horizStretch, vertStretch; -
223}; -
224 -
225struct QStyleSheetBackgroundData : public QSharedData -
226{ -
227 QStyleSheetBackgroundData(const QBrush& b, const QPixmap& p, QCss::Repeat r, -
228 Qt::Alignment a, QCss::Origin o, Attachment t, QCss::Origin c) -
229 : brush(b), pixmap(p), repeat(r), position(a), origin(o), attachment(t), clip(c) { }
executed: }
Execution Count:54
54
230 -
231 bool isTransparent() const { -
232 if (brush.style() != Qt::NoBrush)
partially evaluated: brush.style() != Qt::NoBrush
TRUEFALSE
yes
Evaluation Count:9
no
Evaluation Count:0
0-9
233 return !brush.isOpaque();
executed: return !brush.isOpaque();
Execution Count:9
9
234 return pixmap.isNull() ? false : pixmap.hasAlpha();
never executed: return pixmap.isNull() ? false : pixmap.hasAlpha();
0
235 } -
236 QBrush brush; -
237 QPixmap pixmap; -
238 QCss::Repeat repeat; -
239 Qt::Alignment position; -
240 QCss::Origin origin; -
241 QCss::Attachment attachment; -
242 QCss::Origin clip; -
243}; -
244 -
245struct QStyleSheetBorderData : public QSharedData -
246{ -
247 QStyleSheetBorderData() : bi(0) -
248 { -
249 for (int i = 0; i < 4; i++) {
never evaluated: i < 4
0
250 borders[i] = 0; -
251 styles[i] = QCss::BorderStyle_None; -
252 }
never executed: }
0
253 }
never executed: }
0
254 -
255 QStyleSheetBorderData(int *b, QBrush *c, QCss::BorderStyle *s, QSize *r) : bi(0) -
256 { -
257 for (int i = 0; i < 4; i++) {
evaluated: i < 4
TRUEFALSE
yes
Evaluation Count:4904
yes
Evaluation Count:1226
1226-4904
258 borders[i] = b[i]; -
259 styles[i] = s[i]; -
260 colors[i] = c[i]; -
261 radii[i] = r[i]; -
262 }
executed: }
Execution Count:4904
4904
263 }
executed: }
Execution Count:1226
1226
264 -
265 int borders[4]; -
266 QBrush colors[4]; -
267 QCss::BorderStyle styles[4]; -
268 QSize radii[4]; -
269 -
270 const QStyleSheetBorderImageData *borderImage() const -
271 { return bi; }
never executed: return bi;
0
272 bool hasBorderImage() const { return bi!=0; }
executed: return bi!=0;
Execution Count:6519
6519
273 -
274 QSharedDataPointer<QStyleSheetBorderImageData> bi; -
275 -
276 bool isOpaque() const -
277 { -
278 for (int i = 0; i < 4; i++) {
evaluated: i < 4
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:2
2-8
279 if (styles[i] == QCss::BorderStyle_Native || styles[i] == QCss::BorderStyle_None)
partially evaluated: styles[i] == QCss::BorderStyle_Native
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
partially evaluated: styles[i] == QCss::BorderStyle_None
TRUEFALSE
yes
Evaluation Count:8
no
Evaluation Count:0
0-8
280 continue;
executed: continue;
Execution Count:8
8
281 if (styles[i] >= QCss::BorderStyle_Dotted && styles[i] <= QCss::BorderStyle_DotDotDash
never evaluated: styles[i] >= QCss::BorderStyle_Dotted
never evaluated: styles[i] <= QCss::BorderStyle_DotDotDash
0
282 && styles[i] != BorderStyle_Solid)
never evaluated: styles[i] != BorderStyle_Solid
0
283 return false;
never executed: return false;
0
284 if (!colors[i].isOpaque())
never evaluated: !colors[i].isOpaque()
0
285 return false;
never executed: return false;
0
286 if (!radii[i].isEmpty())
never evaluated: !radii[i].isEmpty()
0
287 return false;
never executed: return false;
0
288 }
never executed: }
0
289 if (bi != 0 && bi->pixmap.hasAlpha())
partially evaluated: bi != 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
never evaluated: bi->pixmap.hasAlpha()
0-2
290 return false;
never executed: return false;
0
291 return true;
executed: return true;
Execution Count:2
2
292 } -
293}; -
294 -
295 -
296struct QStyleSheetOutlineData : public QStyleSheetBorderData -
297{ -
298 QStyleSheetOutlineData() -
299 { -
300 for (int i = 0; i < 4; i++) {
never evaluated: i < 4
0
301 offsets[i] = 0; -
302 }
never executed: }
0
303 }
never executed: }
0
304 -
305 QStyleSheetOutlineData(int *b, QBrush *c, QCss::BorderStyle *s, QSize *r, int *o) -
306 : QStyleSheetBorderData(b, c, s, r) -
307 { -
308 for (int i = 0; i < 4; i++) {
never evaluated: i < 4
0
309 offsets[i] = o[i]; -
310 }
never executed: }
0
311 }
never executed: }
0
312 -
313 int offsets[4]; -
314}; -
315 -
316struct QStyleSheetBoxData : public QSharedData -
317{ -
318 QStyleSheetBoxData(int *m, int *p, int s) : spacing(s) -
319 { -
320 for (int i = 0; i < 4; i++) {
never evaluated: i < 4
0
321 margins[i] = m[i]; -
322 paddings[i] = p[i]; -
323 }
never executed: }
0
324 }
never executed: }
0
325 -
326 int margins[4]; -
327 int paddings[4]; -
328 -
329 int spacing; -
330}; -
331 -
332struct QStyleSheetPaletteData : public QSharedData -
333{ -
334 QStyleSheetPaletteData(const QBrush &fg, const QBrush &sfg, const QBrush &sbg, -
335 const QBrush &abg) -
336 : foreground(fg), selectionForeground(sfg), selectionBackground(sbg), -
337 alternateBackground(abg) { }
never executed: }
0
338 -
339 QBrush foreground; -
340 QBrush selectionForeground; -
341 QBrush selectionBackground; -
342 QBrush alternateBackground; -
343}; -
344 -
345struct QStyleSheetGeometryData : public QSharedData -
346{ -
347 QStyleSheetGeometryData(int w, int h, int minw, int minh, int maxw, int maxh) -
348 : minWidth(minw), minHeight(minh), width(w), height(h), maxWidth(maxw), maxHeight(maxh) { }
never executed: }
0
349 -
350 int minWidth, minHeight, width, height, maxWidth, maxHeight; -
351}; -
352 -
353struct QStyleSheetPositionData : public QSharedData -
354{ -
355 QStyleSheetPositionData(int l, int t, int r, int b, Origin o, Qt::Alignment p, QCss::PositionMode m, Qt::Alignment a = 0) -
356 : left(l), top(t), bottom(b), right(r), origin(o), position(p), mode(m), textAlignment(a) { }
never executed: }
0
357 -
358 int left, top, bottom, right; -
359 Origin origin; -
360 Qt::Alignment position; -
361 QCss::PositionMode mode; -
362 Qt::Alignment textAlignment; -
363}; -
364 -
365struct QStyleSheetImageData : public QSharedData -
366{ -
367 QStyleSheetImageData(const QIcon &i, Qt::Alignment a, const QSize &sz) -
368 : icon(i), alignment(a), size(sz) { }
never executed: }
0
369 -
370 QIcon icon; -
371 Qt::Alignment alignment; -
372 QSize size; -
373}; -
374 -
375class QRenderRule -
376{ -
377public: -
378 QRenderRule() : features(0), hasFont(false), pal(0), b(0), bg(0), bd(0), ou(0), geo(0), p(0), img(0), clipset(0) { }
executed: }
Execution Count:32096
32096
379 QRenderRule(const QVector<QCss::Declaration> &, const QObject *); -
380 ~QRenderRule() { } -
381 -
382 QRect borderRect(const QRect &r) const; -
383 QRect outlineRect(const QRect &r) const; -
384 QRect paddingRect(const QRect &r) const; -
385 QRect contentsRect(const QRect &r) const; -
386 -
387 enum { Margin = 1, Border = 2, Padding = 4, All=Margin|Border|Padding }; -
388 QRect boxRect(const QRect &r, int flags = All) const; -
389 QSize boxSize(const QSize &s, int flags = All) const; -
390 QRect originRect(const QRect &rect, Origin origin) const; -
391 -
392 QPainterPath borderClip(QRect rect); -
393 void drawBorder(QPainter *, const QRect&); -
394 void drawOutline(QPainter *, const QRect&); -
395 void drawBorderImage(QPainter *, const QRect&); -
396 void drawBackground(QPainter *, const QRect&, const QPoint& = QPoint(0, 0)); -
397 void drawBackgroundImage(QPainter *, const QRect&, QPoint = QPoint(0, 0)); -
398 void drawFrame(QPainter *, const QRect&); -
399 void drawImage(QPainter *p, const QRect &rect); -
400 void drawRule(QPainter *, const QRect&); -
401 void configurePalette(QPalette *, QPalette::ColorGroup, const QWidget *, bool); -
402 void configurePalette(QPalette *p, QPalette::ColorRole fr, QPalette::ColorRole br); -
403 -
404 const QStyleSheetPaletteData *palette() const { return pal; }
never executed: return pal;
0
405 const QStyleSheetBoxData *box() const { return b; }
never executed: return b;
0
406 const QStyleSheetBackgroundData *background() const { return bg; }
executed: return bg;
Execution Count:23
23
407 const QStyleSheetBorderData *border() const { return bd; }
executed: return bd;
Execution Count:2792
2792
408 const QStyleSheetOutlineData *outline() const { return ou; }
never executed: return ou;
0
409 const QStyleSheetGeometryData *geometry() const { return geo; }
executed: return geo;
Execution Count:1957
1957
410 const QStyleSheetPositionData *position() const { return p; }
never executed: return p;
0
411 -
412 bool hasPalette() const { return pal != 0; }
executed: return pal != 0;
Execution Count:6775
6775
413 bool hasBackground() const { return bg != 0 && (!bg->pixmap.isNull() || bg->brush.style() != Qt::NoBrush); }
executed: return bg != 0 && (!bg->pixmap.isNull() || bg->brush.style() != Qt::NoBrush);
Execution Count:4458
4458
414 bool hasGradientBackground() const { return bg && bg->brush.style() >= Qt::LinearGradientPattern 7
415 && bg->brush.style() <= Qt::ConicalGradientPattern; }
executed: return bg && bg->brush.style() >= Qt::LinearGradientPattern && bg->brush.style() <= Qt::ConicalGradientPattern;
Execution Count:7
7
416 -
417 bool hasNativeBorder() const { -
418 return bd == 0 4874
419 || (!bd->hasBorderImage() && bd->styles[0] == BorderStyle_Native);
executed: return bd == 0 || (!bd->hasBorderImage() && bd->styles[0] == BorderStyle_Native);
Execution Count:4874
4874
420 } -
421 -
422 bool hasNativeOutline() const { -
423 return (ou == 0 0
424 || (!ou->hasBorderImage() && ou->styles[0] == BorderStyle_Native));
never executed: return (ou == 0 || (!ou->hasBorderImage() && ou->styles[0] == BorderStyle_Native));
0
425 } -
426 -
427 bool baseStyleCanDraw() const { -
428 if (!hasBackground() || (background()->brush.style() == Qt::NoBrush && bg->pixmap.isNull()))
evaluated: !hasBackground()
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:7
partially evaluated: background()->brush.style() == Qt::NoBrush
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
never evaluated: bg->pixmap.isNull()
0-12
429 return true;
executed: return true;
Execution Count:12
12
430 if (bg && !bg->pixmap.isNull())
partially evaluated: bg
TRUEFALSE
yes
Evaluation Count:7
no
Evaluation Count:0
partially evaluated: !bg->pixmap.isNull()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
0-7
431 return false;
never executed: return false;
0
432 if (hasGradientBackground())
partially evaluated: hasGradientBackground()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
0-7
433 return features & StyleFeature_BackgroundGradient;
never executed: return features & StyleFeature_BackgroundGradient;
0
434 return features & StyleFeature_BackgroundColor;
executed: return features & StyleFeature_BackgroundColor;
Execution Count:7
7
435 } -
436 -
437 bool hasBox() const { return b != 0; }
executed: return b != 0;
Execution Count:9015
9015
438 bool hasBorder() const { return bd != 0; }
executed: return bd != 0;
Execution Count:10374
10374
439 bool hasOutline() const { return ou != 0; }
never executed: return ou != 0;
0
440 bool hasPosition() const { return p != 0; }
executed: return p != 0;
Execution Count:2
2
441 bool hasGeometry() const { return geo != 0; }
executed: return geo != 0;
Execution Count:1966
1966
442 bool hasDrawable() const { return !hasNativeBorder() || hasBackground() || hasImage(); }
executed: return !hasNativeBorder() || hasBackground() || hasImage();
Execution Count:2571
2571
443 bool hasImage() const { return img != 0; }
executed: return img != 0;
Execution Count:2544
2544
444 -
445 QSize minimumContentsSize() const -
446 { return geo ? QSize(geo->minWidth, geo->minHeight) : QSize(0, 0); }
never executed: return geo ? QSize(geo->minWidth, geo->minHeight) : QSize(0, 0);
0
447 QSize minimumSize() const -
448 { return boxSize(minimumContentsSize()); }
never executed: return boxSize(minimumContentsSize());
0
449 -
450 QSize contentsSize() const -
451 { return geo ? QSize(geo->width, geo->height) 0
452 : ((img && img->size.isValid()) ? img->size : QSize()); }
never executed: return geo ? QSize(geo->width, geo->height) : ((img && img->size.isValid()) ? img->size : QSize());
0
453 QSize contentsSize(const QSize &sz) const -
454 { -
455 QSize csz = contentsSize(); -
456 if (csz.width() == -1) csz.setWidth(sz.width());
never evaluated: csz.width() == -1
never executed: csz.setWidth(sz.width());
0
457 if (csz.height() == -1) csz.setHeight(sz.height());
never evaluated: csz.height() == -1
never executed: csz.setHeight(sz.height());
0
458 return csz;
never executed: return csz;
0
459 } -
460 bool hasContentsSize() const -
461 { return (geo && (geo->width != -1 || geo->height != -1)) || (img && img->size.isValid()); }
executed: return (geo && (geo->width != -1 || geo->height != -1)) || (img && img->size.isValid());
Execution Count:6609
6609
462 -
463 QSize size() const { return boxSize(contentsSize()); }
never executed: return boxSize(contentsSize());
0
464 QSize size(const QSize &sz) const { return boxSize(contentsSize(sz)); }
never executed: return boxSize(contentsSize(sz));
0
465 QSize adjustSize(const QSize &sz) -
466 { -
467 if (!geo)
partially evaluated: !geo
TRUEFALSE
yes
Evaluation Count:5101
no
Evaluation Count:0
0-5101
468 return sz;
executed: return sz;
Execution Count:5101
5101
469 QSize csz = contentsSize(); -
470 if (csz.width() == -1) csz.setWidth(sz.width());
never evaluated: csz.width() == -1
never executed: csz.setWidth(sz.width());
0
471 if (csz.height() == -1) csz.setHeight(sz.height());
never evaluated: csz.height() == -1
never executed: csz.setHeight(sz.height());
0
472 if (geo->maxWidth != -1 && csz.width() > geo->maxWidth) csz.setWidth(geo->maxWidth);
never evaluated: geo->maxWidth != -1
never evaluated: csz.width() > geo->maxWidth
never executed: csz.setWidth(geo->maxWidth);
0
473 if (geo->maxHeight != -1 && csz.height() > geo->maxHeight) csz.setHeight(geo->maxHeight);
never evaluated: geo->maxHeight != -1
never evaluated: csz.height() > geo->maxHeight
never executed: csz.setHeight(geo->maxHeight);
0
474 csz=csz.expandedTo(QSize(geo->minWidth, geo->minHeight)); -
475 return csz;
never executed: return csz;
0
476 } -
477 -
478 int features; -
479 QBrush defaultBackground; -
480 QFont font; -
481 bool hasFont; -
482 -
483 QHash<QString, QVariant> styleHints; -
484 bool hasStyleHint(const QString& sh) const { return styleHints.contains(sh); }
executed: return styleHints.contains(sh);
Execution Count:2065
2065
485 QVariant styleHint(const QString& sh) const { return styleHints.value(sh); }
never executed: return styleHints.value(sh);
0
486 -
487 void fixupBorder(int); -
488 -
489 QSharedDataPointer<QStyleSheetPaletteData> pal; -
490 QSharedDataPointer<QStyleSheetBoxData> b; -
491 QSharedDataPointer<QStyleSheetBackgroundData> bg; -
492 QSharedDataPointer<QStyleSheetBorderData> bd; -
493 QSharedDataPointer<QStyleSheetOutlineData> ou; -
494 QSharedDataPointer<QStyleSheetGeometryData> geo; -
495 QSharedDataPointer<QStyleSheetPositionData> p; -
496 QSharedDataPointer<QStyleSheetImageData> img; -
497 -
498 -
499 void setClip(QPainter *p, const QRect &rect); -
500 void unsetClip(QPainter *); -
501 int clipset; -
502 QPainterPath clipPath; -
503}; -
504 -
505 -
506static const char *knownStyleHints[] = { -
507 "activate-on-singleclick", -
508 "alignment", -
509 "arrow-keys-navigate-into-children", -
510 "backward-icon", -
511 "button-layout", -
512 "cd-icon", -
513 "combobox-list-mousetracking", -
514 "combobox-popup", -
515 "computer-icon", -
516 "desktop-icon", -
517 "dialog-apply-icon", -
518 "dialog-cancel-icon", -
519 "dialog-close-icon", -
520 "dialog-discard-icon", -
521 "dialog-help-icon", -
522 "dialog-no-icon", -
523 "dialog-ok-icon", -
524 "dialog-open-icon", -
525 "dialog-reset-icon", -
526 "dialog-save-icon", -
527 "dialog-yes-icon", -
528 "dialogbuttonbox-buttons-have-icons", -
529 "directory-closed-icon", -
530 "directory-icon", -
531 "directory-link-icon", -
532 "directory-open-icon", -
533 "dither-disable-text", -
534 "dockwidget-close-icon", -
535 "downarrow-icon", -
536 "dvd-icon", -
537 "etch-disabled-text", -
538 "file-icon", -
539 "file-link-icon", -
540 "filedialog-backward-icon", -
541 "filedialog-contentsview-icon", -
542 "filedialog-detailedview-icon", -
543 "filedialog-end-icon", -
544 "filedialog-infoview-icon", -
545 "filedialog-listview-icon", -
546 "filedialog-new-directory-icon", -
547 "filedialog-parent-directory-icon", -
548 "filedialog-start-icon", -
549 "floppy-icon", -
550 "forward-icon", -
551 "gridline-color", -
552 "harddisk-icon", -
553 "home-icon", -
554 "icon-size", -
555 "leftarrow-icon", -
556 "lineedit-password-character", -
557 "mdi-fill-space-on-maximize", -
558 "menu-scrollable", -
559 "menubar-altkey-navigation", -
560 "menubar-separator", -
561 "messagebox-critical-icon", -
562 "messagebox-information-icon", -
563 "messagebox-question-icon", -
564 "messagebox-text-interaction-flags", -
565 "messagebox-warning-icon", -
566 "mouse-tracking", -
567 "network-icon", -
568 "opacity", -
569 "paint-alternating-row-colors-for-empty-area", -
570 "rightarrow-icon", -
571 "scrollbar-contextmenu", -
572 "scrollbar-leftclick-absolute-position", -
573 "scrollbar-middleclick-absolute-position", -
574 "scrollbar-roll-between-buttons", -
575 "scrollbar-scroll-when-pointer-leaves-control", -
576 "scrollview-frame-around-contents", -
577 "show-decoration-selected", -
578 "spinbox-click-autorepeat-rate", -
579 "spincontrol-disable-on-bounds", -
580 "tabbar-elide-mode", -
581 "tabbar-prefer-no-arrows", -
582 "titlebar-close-icon", -
583 "titlebar-contexthelp-icon", -
584 "titlebar-maximize-icon", -
585 "titlebar-menu-icon", -
586 "titlebar-minimize-icon", -
587 "titlebar-normal-icon", -
588 "titlebar-shade-icon", -
589 "titlebar-unshade-icon", -
590 "toolbutton-popup-delay", -
591 "trash-icon", -
592 "uparrow-icon" -
593}; -
594 -
595static const int numKnownStyleHints = sizeof(knownStyleHints)/sizeof(knownStyleHints[0]); -
596 -
597static QList<QVariant> subControlLayout(const QString& layout) -
598{ -
599 QList<QVariant> buttons; -
600 for (int i = 0; i < layout.count(); i++) {
never evaluated: i < layout.count()
0
601 int button = layout[i].toLatin1(); -
602 switch (button) { -
603 case 'm': -
604 buttons.append(PseudoElement_MdiMinButton); -
605 buttons.append(PseudoElement_TitleBarMinButton); -
606 break;
never executed: break;
0
607 case 'M': -
608 buttons.append(PseudoElement_TitleBarMaxButton); -
609 break;
never executed: break;
0
610 case 'X': -
611 buttons.append(PseudoElement_MdiCloseButton); -
612 buttons.append(PseudoElement_TitleBarCloseButton); -
613 break;
never executed: break;
0
614 case 'N': -
615 buttons.append(PseudoElement_MdiNormalButton); -
616 buttons.append(PseudoElement_TitleBarNormalButton); -
617 break;
never executed: break;
0
618 case 'I': -
619 buttons.append(PseudoElement_TitleBarSysMenu); -
620 break;
never executed: break;
0
621 case 'T': -
622 buttons.append(PseudoElement_TitleBar); -
623 break;
never executed: break;
0
624 case 'H': -
625 buttons.append(PseudoElement_TitleBarContextHelpButton); -
626 break;
never executed: break;
0
627 case 'S': -
628 buttons.append(PseudoElement_TitleBarShadeButton); -
629 break;
never executed: break;
0
630 default: -
631 buttons.append(button); -
632 break;
never executed: break;
0
633 } -
634 }
never executed: }
0
635 return buttons;
never executed: return buttons;
0
636} -
637 -
638namespace { -
639 struct ButtonInfo { -
640 QRenderRule rule; -
641 int element; -
642 int offset; -
643 int where; -
644 int width; -
645 }; -
646} -
647 -
648QHash<QStyle::SubControl, QRect> QStyleSheetStyle::titleBarLayout(const QWidget *w, const QStyleOptionTitleBar *tb) const -
649{ -
650 QHash<QStyle::SubControl, QRect> layoutRects; -
651 const bool isMinimized = tb->titleBarState & Qt::WindowMinimized; -
652 const bool isMaximized = tb->titleBarState & Qt::WindowMaximized; -
653 QRenderRule subRule = renderRule(w, tb); -
654 QRect cr = subRule.contentsRect(tb->rect); -
655 QList<QVariant> layout = subRule.styleHint(QLatin1String("button-layout")).toList(); -
656 if (layout.isEmpty())
never evaluated: layout.isEmpty()
0
657 layout = subControlLayout(QLatin1String("I(T)HSmMX"));
never executed: layout = subControlLayout(QLatin1String("I(T)HSmMX"));
0
658 -
659 int offsets[3] = { 0, 0, 0 }; -
660 enum Where { Left, Right, Center, NoWhere } where = Left; -
661 QList<ButtonInfo> infos; -
662 for (int i = 0; i < layout.count(); i++) {
never evaluated: i < layout.count()
0
663 ButtonInfo info; -
664 info.element = layout[i].toInt(); -
665 if (info.element == '(') {
never evaluated: info.element == '('
0
666 where = Center; -
667 } else if (info.element == ')') {
never evaluated: info.element == ')'
never executed: }
0
668 where = Right; -
669 } else {
never executed: }
0
670 switch (info.element) { -
671 case PseudoElement_TitleBar: -
672 if (!(tb->titleBarFlags & (Qt::WindowTitleHint | Qt::WindowSystemMenuHint)))
never evaluated: !(tb->titleBarFlags & (Qt::WindowTitleHint | Qt::WindowSystemMenuHint))
0
673 continue;
never executed: continue;
0
674 break;
never executed: break;
0
675 case PseudoElement_TitleBarContextHelpButton: -
676 if (!(tb->titleBarFlags & Qt::WindowContextHelpButtonHint))
never evaluated: !(tb->titleBarFlags & Qt::WindowContextHelpButtonHint)
0
677 continue;
never executed: continue;
0
678 break;
never executed: break;
0
679 case PseudoElement_TitleBarMinButton: -
680 if (!(tb->titleBarFlags & Qt::WindowMinimizeButtonHint))
never evaluated: !(tb->titleBarFlags & Qt::WindowMinimizeButtonHint)
0
681 continue;
never executed: continue;
0
682 if (isMinimized)
never evaluated: isMinimized
0
683 info.element = PseudoElement_TitleBarNormalButton;
never executed: info.element = PseudoElement_TitleBarNormalButton;
0
684 break;
never executed: break;
0
685 case PseudoElement_TitleBarMaxButton: -
686 if (!(tb->titleBarFlags & Qt::WindowMaximizeButtonHint))
never evaluated: !(tb->titleBarFlags & Qt::WindowMaximizeButtonHint)
0
687 continue;
never executed: continue;
0
688 if (isMaximized)
never evaluated: isMaximized
0
689 info.element = PseudoElement_TitleBarNormalButton;
never executed: info.element = PseudoElement_TitleBarNormalButton;
0
690 break;
never executed: break;
0
691 case PseudoElement_TitleBarShadeButton: -
692 if (!(tb->titleBarFlags & Qt::WindowShadeButtonHint))
never evaluated: !(tb->titleBarFlags & Qt::WindowShadeButtonHint)
0
693 continue;
never executed: continue;
0
694 if (isMinimized)
never evaluated: isMinimized
0
695 info.element = PseudoElement_TitleBarUnshadeButton;
never executed: info.element = PseudoElement_TitleBarUnshadeButton;
0
696 break;
never executed: break;
0
697 case PseudoElement_TitleBarCloseButton: -
698 case PseudoElement_TitleBarSysMenu: -
699 if (!(tb->titleBarFlags & Qt::WindowSystemMenuHint))
never evaluated: !(tb->titleBarFlags & Qt::WindowSystemMenuHint)
0
700 continue;
never executed: continue;
0
701 break;
never executed: break;
0
702 default: -
703 continue;
never executed: continue;
0
704 } -
705 if (info.element == PseudoElement_TitleBar) {
never evaluated: info.element == PseudoElement_TitleBar
0
706 info.width = tb->fontMetrics.width(tb->text) + 6; -
707 subRule.geo = new QStyleSheetGeometryData(info.width, tb->fontMetrics.height(), -1, -1, -1, -1); -
708 } else {
never executed: }
0
709 subRule = renderRule(w, tb, info.element); -
710 info.width = subRule.size().width(); -
711 }
never executed: }
0
712 info.rule = subRule; -
713 info.offset = offsets[where]; -
714 info.where = where; -
715 infos.append(info); -
716 -
717 offsets[where] += info.width; -
718 }
never executed: }
0
719 } -
720 -
721 for (int i = 0; i < infos.count(); i++) {
never evaluated: i < infos.count()
0
722 ButtonInfo info = infos[i]; -
723 QRect lr = cr; -
724 switch (info.where) { -
725 case Center: { -
726 lr.setLeft(cr.left() + offsets[Left]); -
727 lr.setRight(cr.right() - offsets[Right]); -
728 QRect r(0, 0, offsets[Center], lr.height()); -
729 r.moveCenter(lr.center()); -
730 r.setLeft(r.left()+info.offset); -
731 r.setWidth(info.width); -
732 lr = r; -
733 break; }
never executed: break;
0
734 case Left: -
735 lr.translate(info.offset, 0); -
736 lr.setWidth(info.width); -
737 break;
never executed: break;
0
738 case Right: -
739 lr.moveLeft(cr.right() + 1 - offsets[Right] + info.offset); -
740 lr.setWidth(info.width); -
741 break;
never executed: break;
0
742 default: -
743 break;
never executed: break;
0
744 } -
745 QStyle::SubControl control = knownPseudoElements[info.element].subControl; -
746 layoutRects[control] = positionRect(w, info.rule, info.element, lr, tb->direction); -
747 }
never executed: }
0
748 -
749 return layoutRects;
never executed: return layoutRects;
0
750} -
751 -
752static QStyle::StandardPixmap subControlIcon(int pe) -
753{ -
754 switch (pe) { -
755 case PseudoElement_MdiCloseButton: return QStyle::SP_TitleBarCloseButton;
never executed: return QStyle::SP_TitleBarCloseButton;
0
756 case PseudoElement_MdiMinButton: return QStyle::SP_TitleBarMinButton;
never executed: return QStyle::SP_TitleBarMinButton;
0
757 case PseudoElement_MdiNormalButton: return QStyle::SP_TitleBarNormalButton;
never executed: return QStyle::SP_TitleBarNormalButton;
0
758 case PseudoElement_TitleBarCloseButton: return QStyle::SP_TitleBarCloseButton;
never executed: return QStyle::SP_TitleBarCloseButton;
0
759 case PseudoElement_TitleBarMinButton: return QStyle::SP_TitleBarMinButton;
never executed: return QStyle::SP_TitleBarMinButton;
0
760 case PseudoElement_TitleBarMaxButton: return QStyle::SP_TitleBarMaxButton;
never executed: return QStyle::SP_TitleBarMaxButton;
0
761 case PseudoElement_TitleBarShadeButton: return QStyle::SP_TitleBarShadeButton;
never executed: return QStyle::SP_TitleBarShadeButton;
0
762 case PseudoElement_TitleBarUnshadeButton: return QStyle::SP_TitleBarUnshadeButton;
never executed: return QStyle::SP_TitleBarUnshadeButton;
0
763 case PseudoElement_TitleBarNormalButton: return QStyle::SP_TitleBarNormalButton;
never executed: return QStyle::SP_TitleBarNormalButton;
0
764 case PseudoElement_TitleBarContextHelpButton: return QStyle::SP_TitleBarContextHelpButton;
never executed: return QStyle::SP_TitleBarContextHelpButton;
0
765 default: break;
never executed: break;
0
766 } -
767 return QStyle::SP_CustomBase;
never executed: return QStyle::SP_CustomBase;
0
768} -
769 -
770QRenderRule::QRenderRule(const QVector<Declaration> &declarations, const QObject *object) -
771: features(0), hasFont(false), pal(0), b(0), bg(0), bd(0), ou(0), geo(0), p(0), img(0), clipset(0) -
772{ -
773 QPalette palette = QApplication::palette(); -
774 ValueExtractor v(declarations, palette); -
775 features = v.extractStyleFeatures(); -
776 -
777 int w = -1, h = -1, minw = -1, minh = -1, maxw = -1, maxh = -1; -
778 if (v.extractGeometry(&w, &h, &minw, &minh, &maxw, &maxh))
partially evaluated: v.extractGeometry(&w, &h, &minw, &minh, &maxw, &maxh)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3726
0-3726
779 geo = new QStyleSheetGeometryData(w, h, minw, minh, maxw, maxh);
never executed: geo = new QStyleSheetGeometryData(w, h, minw, minh, maxw, maxh);
0
780 -
781 int left = 0, top = 0, right = 0, bottom = 0; -
782 Origin origin = Origin_Unknown; -
783 Qt::Alignment position = 0; -
784 QCss::PositionMode mode = PositionMode_Unknown; -
785 Qt::Alignment textAlignment = 0; -
786 if (v.extractPosition(&left, &top, &right, &bottom, &origin, &position, &mode, &textAlignment))
partially evaluated: v.extractPosition(&left, &top, &right, &bottom, &origin, &position, &mode, &textAlignment)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3726
0-3726
787 p = new QStyleSheetPositionData(left, top, right, bottom, origin, position, mode, textAlignment);
never executed: p = new QStyleSheetPositionData(left, top, right, bottom, origin, position, mode, textAlignment);
0
788 -
789 int margins[4], paddings[4], spacing = -1; -
790 for (int i = 0; i < 4; i++)
evaluated: i < 4
TRUEFALSE
yes
Evaluation Count:14904
yes
Evaluation Count:3726
3726-14904
791 margins[i] = paddings[i] = 0;
executed: margins[i] = paddings[i] = 0;
Execution Count:14904
14904
792 if (v.extractBox(margins, paddings, &spacing))
partially evaluated: v.extractBox(margins, paddings, &spacing)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3726
0-3726
793 b = new QStyleSheetBoxData(margins, paddings, spacing);
never executed: b = new QStyleSheetBoxData(margins, paddings, spacing);
0
794 -
795 int borders[4]; -
796 QBrush colors[4]; -
797 QCss::BorderStyle styles[4]; -
798 QSize radii[4]; -
799 for (int i = 0; i < 4; i++) {
evaluated: i < 4
TRUEFALSE
yes
Evaluation Count:14904
yes
Evaluation Count:3726
3726-14904
800 borders[i] = 0; -
801 styles[i] = BorderStyle_None; -
802 }
executed: }
Execution Count:14904
14904
803 if (v.extractBorder(borders, colors, styles, radii))
evaluated: v.extractBorder(borders, colors, styles, radii)
TRUEFALSE
yes
Evaluation Count:1226
yes
Evaluation Count:2500
1226-2500
804 bd = new QStyleSheetBorderData(borders, colors, styles, radii);
executed: bd = new QStyleSheetBorderData(borders, colors, styles, radii);
Execution Count:1226
1226
805 -
806 int offsets[4]; -
807 for (int i = 0; i < 4; i++) {
evaluated: i < 4
TRUEFALSE
yes
Evaluation Count:14904
yes
Evaluation Count:3726
3726-14904
808 borders[i] = offsets[i] = 0; -
809 styles[i] = BorderStyle_None; -
810 }
executed: }
Execution Count:14904
14904
811 if (v.extractOutline(borders, colors, styles, radii, offsets))
partially evaluated: v.extractOutline(borders, colors, styles, radii, offsets)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3726
0-3726
812 ou = new QStyleSheetOutlineData(borders, colors, styles, radii, offsets);
never executed: ou = new QStyleSheetOutlineData(borders, colors, styles, radii, offsets);
0
813 -
814 QBrush brush; -
815 QString uri; -
816 Repeat repeat = Repeat_XY; -
817 Qt::Alignment alignment = Qt::AlignTop | Qt::AlignLeft; -
818 Attachment attachment = Attachment_Scroll; -
819 origin = Origin_Padding; -
820 Origin clip = Origin_Border; -
821 if (v.extractBackground(&brush, &uri, &repeat, &alignment, &origin, &attachment, &clip))
evaluated: v.extractBackground(&brush, &uri, &repeat, &alignment, &origin, &attachment, &clip)
TRUEFALSE
yes
Evaluation Count:54
yes
Evaluation Count:3672
54-3672
822 bg = new QStyleSheetBackgroundData(brush, QPixmap(uri), repeat, alignment, origin, attachment, clip);
executed: bg = new QStyleSheetBackgroundData(brush, QPixmap(uri), repeat, alignment, origin, attachment, clip);
Execution Count:54
54
823 -
824 QBrush sfg, fg; -
825 QBrush sbg, abg; -
826 if (v.extractPalette(&fg, &sfg, &sbg, &abg))
partially evaluated: v.extractPalette(&fg, &sfg, &sbg, &abg)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3726
0-3726
827 pal = new QStyleSheetPaletteData(fg, sfg, sbg, abg);
never executed: pal = new QStyleSheetPaletteData(fg, sfg, sbg, abg);
0
828 -
829 QIcon icon; -
830 alignment = Qt::AlignCenter; -
831 QSize size; -
832 if (v.extractImage(&icon, &alignment, &size))
partially evaluated: v.extractImage(&icon, &alignment, &size)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3726
0-3726
833 img = new QStyleSheetImageData(icon, alignment, size);
never executed: img = new QStyleSheetImageData(icon, alignment, size);
0
834 -
835 int adj = -255; -
836 hasFont = v.extractFont(&font, &adj); -
837 -
838 -
839 if (object && qstrcmp(object->metaObject()->className(), "QTipLabel") == 0)
partially evaluated: object
TRUEFALSE
yes
Evaluation Count:3726
no
Evaluation Count:0
partially evaluated: qstrcmp(object->metaObject()->className(), "QTipLabel") == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3726
0-3726
840 palette = QToolTip::palette();
never executed: palette = QToolTip::palette();
0
841 -
842 -
843 for (int i = 0; i < declarations.count(); i++) {
evaluated: i < declarations.count()
TRUEFALSE
yes
Evaluation Count:2915
yes
Evaluation Count:3726
2915-3726
844 const Declaration& decl = declarations.at(i); -
845 if (decl.d->propertyId == BorderImage) {
partially evaluated: decl.d->propertyId == BorderImage
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2915
0-2915
846 QString uri; -
847 QCss::TileMode horizStretch, vertStretch; -
848 int cuts[4]; -
849 -
850 decl.borderImageValue(&uri, cuts, &horizStretch, &vertStretch); -
851 if (uri.isEmpty() || uri == QLatin1String("none")) {
never evaluated: uri.isEmpty()
never evaluated: uri == QLatin1String("none")
0
852 if (bd && bd->bi)
never evaluated: bd
never evaluated: bd->bi
0
853 bd->bi->pixmap = QPixmap();
never executed: bd->bi->pixmap = QPixmap();
0
854 } else {
never executed: }
0
855 if (!bd)
never evaluated: !bd
0
856 bd = new QStyleSheetBorderData;
never executed: bd = new QStyleSheetBorderData;
0
857 if (!bd->bi)
never evaluated: !bd->bi
0
858 bd->bi = new QStyleSheetBorderImageData;
never executed: bd->bi = new QStyleSheetBorderImageData;
0
859 -
860 QStyleSheetBorderImageData *bi = bd->bi; -
861 bi->pixmap = QPixmap(uri); -
862 for (int i = 0; i < 4; i++)
never evaluated: i < 4
0
863 bi->cuts[i] = cuts[i];
never executed: bi->cuts[i] = cuts[i];
0
864 bi->horizStretch = horizStretch; -
865 bi->vertStretch = vertStretch; -
866 }
never executed: }
0
867 } else if (decl.d->propertyId == QtBackgroundRole) {
evaluated: decl.d->propertyId == QtBackgroundRole
TRUEFALSE
yes
Evaluation Count:1593
yes
Evaluation Count:1322
1322-1593
868 if (bg && bg->brush.style() != Qt::NoBrush)
evaluated: bg
TRUEFALSE
yes
Evaluation Count:21
yes
Evaluation Count:1572
partially evaluated: bg->brush.style() != Qt::NoBrush
TRUEFALSE
yes
Evaluation Count:21
no
Evaluation Count:0
0-1572
869 continue;
executed: continue;
Execution Count:21
21
870 int role = decl.d->values.at(0).variant.toInt(); -
871 if (role >= Value_FirstColorRole && role <= Value_LastColorRole)
partially evaluated: role >= Value_FirstColorRole
TRUEFALSE
yes
Evaluation Count:1572
no
Evaluation Count:0
partially evaluated: role <= Value_LastColorRole
TRUEFALSE
yes
Evaluation Count:1572
no
Evaluation Count:0
0-1572
872 defaultBackground = palette.color((QPalette::ColorRole)(role-Value_FirstColorRole));
executed: defaultBackground = palette.color((QPalette::ColorRole)(role-Value_FirstColorRole));
Execution Count:1572
1572
873 } else if (decl.d->property.startsWith(QLatin1String("qproperty-"), Qt::CaseInsensitive)) {
executed: }
Execution Count:1572
partially evaluated: decl.d->property.startsWith(QLatin1String("qproperty-"), Qt::CaseInsensitive)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1322
0-1572
874 -
875 } else if (decl.d->propertyId == UnknownProperty) {
partially evaluated: decl.d->propertyId == UnknownProperty
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1322
never executed: }
0-1322
876 bool knownStyleHint = false; -
877 for (int i = 0; i < numKnownStyleHints; i++) {
never evaluated: i < numKnownStyleHints
0
878 QLatin1String styleHint(knownStyleHints[i]); -
879 if (decl.d->property.compare(styleHint) == 0) {
never evaluated: decl.d->property.compare(styleHint) == 0
0
880 QString hintName = QString(styleHint); -
881 QVariant hintValue; -
882 if (hintName.endsWith(QLatin1String("alignment"))) {
never evaluated: hintName.endsWith(QLatin1String("alignment"))
0
883 hintValue = (int) decl.alignmentValue(); -
884 } else if (hintName.endsWith(QLatin1String("color"))) {
never executed: }
never evaluated: hintName.endsWith(QLatin1String("color"))
0
885 hintValue = (int) decl.colorValue().rgba(); -
886 } else if (hintName.endsWith(QLatin1String("size"))) {
never executed: }
never evaluated: hintName.endsWith(QLatin1String("size"))
0
887 hintValue = decl.sizeValue(); -
888 } else if (hintName.endsWith(QLatin1String("icon"))) {
never executed: }
never evaluated: hintName.endsWith(QLatin1String("icon"))
0
889 hintValue = decl.iconValue(); -
890 } else if (hintName == QLatin1String("button-layout")
never executed: }
never evaluated: hintName == QLatin1String("button-layout")
0
891 && decl.d->values.count() != 0 && decl.d->values.at(0).type == Value::String) {
never evaluated: decl.d->values.count() != 0
never evaluated: decl.d->values.at(0).type == Value::String
0
892 hintValue = subControlLayout(decl.d->values.at(0).variant.toString()); -
893 } else {
never executed: }
0
894 int integer; -
895 decl.intValue(&integer); -
896 hintValue = integer; -
897 }
never executed: }
0
898 styleHints[decl.d->property] = hintValue; -
899 knownStyleHint = true; -
900 break;
never executed: break;
0
901 } -
902 }
never executed: }
0
903 if (!knownStyleHint)
never evaluated: !knownStyleHint
0
904 QMessageLogger("styles/qstylesheetstyle.cpp", 995, __PRETTY_FUNCTION__).debug("Unknown property %s", QString(decl.d->property).toLocal8Bit().constData());
never executed: QMessageLogger("styles/qstylesheetstyle.cpp", 995, __PRETTY_FUNCTION__).debug("Unknown property %s", QString(decl.d->property).toLocal8Bit().constData());
0
905 }
never executed: }
0
906 } -
907 -
908 if (const QWidget *widget = qobject_cast<const QWidget *>(object)) {
partially evaluated: const QWidget *widget = qobject_cast<const QWidget *>(object)
TRUEFALSE
yes
Evaluation Count:3726
no
Evaluation Count:0
0-3726
909 QStyleSheetStyle *style = const_cast<QStyleSheetStyle *>(globalStyleSheetStyle); -
910 if (!style)
partially evaluated: !style
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3726
0-3726
911 style = qobject_cast<QStyleSheetStyle *>(widget->style());
never executed: style = qobject_cast<QStyleSheetStyle *>(widget->style());
0
912 if (style)
partially evaluated: style
TRUEFALSE
yes
Evaluation Count:3726
no
Evaluation Count:0
0-3726
913 fixupBorder(style->nativeFrameWidth(widget));
executed: fixupBorder(style->nativeFrameWidth(widget));
Execution Count:3726
3726
914 }
executed: }
Execution Count:3726
3726
915 if (hasBorder() && border()->hasBorderImage())
evaluated: hasBorder()
TRUEFALSE
yes
Evaluation Count:1226
yes
Evaluation Count:2500
partially evaluated: border()->hasBorderImage()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1226
0-2500
916 defaultBackground = QBrush();
never executed: defaultBackground = QBrush();
0
917}
executed: }
Execution Count:3726
3726
918 -
919QRect QRenderRule::borderRect(const QRect& r) const -
920{ -
921 if (!hasBox())
partially evaluated: !hasBox()
TRUEFALSE
yes
Evaluation Count:789
no
Evaluation Count:0
0-789
922 return r;
executed: return r;
Execution Count:789
789
923 const int* m = box()->margins; -
924 return r.adjusted(m[LeftEdge], m[TopEdge], -m[RightEdge], -m[BottomEdge]);
never executed: return r.adjusted(m[LeftEdge], m[TopEdge], -m[RightEdge], -m[BottomEdge]);
0
925} -
926 -
927QRect QRenderRule::outlineRect(const QRect& r) const -
928{ -
929 QRect br = borderRect(r); -
930 if (!hasOutline())
never evaluated: !hasOutline()
0
931 return br;
never executed: return br;
0
932 const int *b = outline()->borders; -
933 return r.adjusted(b[LeftEdge], b[TopEdge], -b[RightEdge], -b[BottomEdge]);
never executed: return r.adjusted(b[LeftEdge], b[TopEdge], -b[RightEdge], -b[BottomEdge]);
0
934} -
935 -
936QRect QRenderRule::paddingRect(const QRect& r) const -
937{ -
938 QRect br = borderRect(r); -
939 if (!hasBorder())
partially evaluated: !hasBorder()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
0-6
940 return br;
never executed: return br;
0
941 const int *b = border()->borders; -
942 return br.adjusted(b[LeftEdge], b[TopEdge], -b[RightEdge], -b[BottomEdge]);
executed: return br.adjusted(b[LeftEdge], b[TopEdge], -b[RightEdge], -b[BottomEdge]);
Execution Count:6
6
943} -
944 -
945QRect QRenderRule::contentsRect(const QRect& r) const -
946{ -
947 QRect pr = paddingRect(r); -
948 if (!hasBox())
partially evaluated: !hasBox()
TRUEFALSE
yes
Evaluation Count:6
no
Evaluation Count:0
0-6
949 return pr;
executed: return pr;
Execution Count:6
6
950 const int *p = box()->paddings; -
951 return pr.adjusted(p[LeftEdge], p[TopEdge], -p[RightEdge], -p[BottomEdge]);
never executed: return pr.adjusted(p[LeftEdge], p[TopEdge], -p[RightEdge], -p[BottomEdge]);
0
952} -
953 -
954QRect QRenderRule::boxRect(const QRect& cr, int flags) const -
955{ -
956 QRect r = cr; -
957 if (hasBox()) {
never evaluated: hasBox()
0
958 if (flags & Margin) {
never evaluated: flags & Margin
0
959 const int *m = box()->margins; -
960 r.adjust(-m[LeftEdge], -m[TopEdge], m[RightEdge], m[BottomEdge]); -
961 }
never executed: }
0
962 if (flags & Padding) {
never evaluated: flags & Padding
0
963 const int *p = box()->paddings; -
964 r.adjust(-p[LeftEdge], -p[TopEdge], p[RightEdge], p[BottomEdge]); -
965 }
never executed: }
0
966 }
never executed: }
0
967 if (hasBorder() && (flags & Border)) {
never evaluated: hasBorder()
never evaluated: (flags & Border)
0
968 const int *b = border()->borders; -
969 r.adjust(-b[LeftEdge], -b[TopEdge], b[RightEdge], b[BottomEdge]); -
970 }
never executed: }
0
971 return r;
never executed: return r;
0
972} -
973 -
974QSize QRenderRule::boxSize(const QSize &cs, int flags) const -
975{ -
976 QSize bs = boxRect(QRect(QPoint(0, 0), cs), flags).size(); -
977 if (cs.width() < 0) bs.setWidth(-1);
never evaluated: cs.width() < 0
never executed: bs.setWidth(-1);
0
978 if (cs.height() < 0) bs.setHeight(-1);
never evaluated: cs.height() < 0
never executed: bs.setHeight(-1);
0
979 return bs;
never executed: return bs;
0
980} -
981 -
982void QRenderRule::fixupBorder(int nativeWidth) -
983{ -
984 if (bd == 0)
evaluated: bd == 0
TRUEFALSE
yes
Evaluation Count:2500
yes
Evaluation Count:1226
1226-2500
985 return;
executed: return;
Execution Count:2500
2500
986 -
987 if (!bd->hasBorderImage() || bd->bi->pixmap.isNull()) {
partially evaluated: !bd->hasBorderImage()
TRUEFALSE
yes
Evaluation Count:1226
no
Evaluation Count:0
never evaluated: bd->bi->pixmap.isNull()
0-1226
988 bd->bi = 0; -
989 -
990 QBrush color = pal ? pal->foreground : QBrush();
partially evaluated: pal
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1226
0-1226
991 const bool hasRadius = bd->radii[0].isValid() || bd->radii[1].isValid()
partially evaluated: bd->radii[0].isValid()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1226
partially evaluated: bd->radii[1].isValid()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1226
0-1226
992 || bd->radii[2].isValid() || bd->radii[3].isValid();
partially evaluated: bd->radii[2].isValid()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1226
partially evaluated: bd->radii[3].isValid()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1226
0-1226
993 for (int i = 0; i < 4; i++) {
evaluated: i < 4
TRUEFALSE
yes
Evaluation Count:4904
yes
Evaluation Count:1226
1226-4904
994 if ((bd->styles[i] == BorderStyle_Native) && hasRadius)
evaluated: (bd->styles[i] == BorderStyle_Native)
TRUEFALSE
yes
Evaluation Count:4752
yes
Evaluation Count:152
partially evaluated: hasRadius
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4752
0-4752
995 bd->styles[i] = BorderStyle_None;
never executed: bd->styles[i] = BorderStyle_None;
0
996 -
997 switch (bd->styles[i]) { -
998 case BorderStyle_None: -
999 -
1000 bd->colors[i] = QBrush(); -
1001 bd->borders[i] = 0; -
1002 break;
executed: break;
Execution Count:8
8
1003 case BorderStyle_Native: -
1004 if (bd->borders[i] == 0)
partially evaluated: bd->borders[i] == 0
TRUEFALSE
yes
Evaluation Count:4752
no
Evaluation Count:0
0-4752
1005 bd->borders[i] = nativeWidth;
executed: bd->borders[i] = nativeWidth;
Execution Count:4752
4752
1006 -
1007 default:
code before this statement executed: default:
Execution Count:4752
4752
1008 if (!bd->colors[i].style() != Qt::NoBrush)
evaluated: !bd->colors[i].style() != Qt::NoBrush
TRUEFALSE
yes
Evaluation Count:84
yes
Evaluation Count:4812
84-4812
1009 bd->colors[i] = color;
executed: bd->colors[i] = color;
Execution Count:84
84
1010 break;
executed: break;
Execution Count:4896
4896
1011 } -
1012 }
executed: }
Execution Count:4904
4904
1013 -
1014 return;
executed: return;
Execution Count:1226
1226
1015 } -
1016 -
1017 -
1018 QStyleSheetBorderImageData *bi = bd->bi; -
1019 if (bi->cuts[0] == -1) {
never evaluated: bi->cuts[0] == -1
0
1020 for (int i = 0; i < 4; i++)
never evaluated: i < 4
0
1021 bi->cuts[i] = int(border()->borders[i]);
never executed: bi->cuts[i] = int(border()->borders[i]);
0
1022 }
never executed: }
0
1023}
never executed: }
0
1024 -
1025void QRenderRule::drawBorderImage(QPainter *p, const QRect& rect) -
1026{ -
1027 setClip(p, rect); -
1028 static const Qt::TileRule tileMode2TileRule[] = { -
1029 Qt::StretchTile, Qt::RoundTile, Qt::StretchTile, Qt::RepeatTile, Qt::StretchTile }; -
1030 -
1031 const QStyleSheetBorderImageData *borderImageData = border()->borderImage(); -
1032 const int *targetBorders = border()->borders; -
1033 const int *sourceBorders = borderImageData->cuts; -
1034 QMargins sourceMargins(sourceBorders[LeftEdge], sourceBorders[TopEdge], -
1035 sourceBorders[RightEdge], sourceBorders[BottomEdge]); -
1036 QMargins targetMargins(targetBorders[LeftEdge], targetBorders[TopEdge], -
1037 targetBorders[RightEdge], targetBorders[BottomEdge]); -
1038 -
1039 bool wasSmoothPixmapTransform = p->renderHints() & QPainter::SmoothPixmapTransform; -
1040 p->setRenderHint(QPainter::SmoothPixmapTransform); -
1041 qDrawBorderPixmap(p, rect, targetMargins, borderImageData->pixmap, -
1042 QRect(QPoint(), borderImageData->pixmap.size()), sourceMargins, -
1043 QTileRules(tileMode2TileRule[borderImageData->horizStretch], tileMode2TileRule[borderImageData->vertStretch])); -
1044 p->setRenderHint(QPainter::SmoothPixmapTransform, wasSmoothPixmapTransform); -
1045 unsetClip(p); -
1046}
never executed: }
0
1047 -
1048QRect QRenderRule::originRect(const QRect &rect, Origin origin) const -
1049{ -
1050 switch (origin) { -
1051 case Origin_Padding: -
1052 return paddingRect(rect);
never executed: return paddingRect(rect);
0
1053 case Origin_Border: -
1054 return borderRect(rect);
never executed: return borderRect(rect);
0
1055 case Origin_Content: -
1056 return contentsRect(rect);
never executed: return contentsRect(rect);
0
1057 case Origin_Margin: -
1058 default: -
1059 return rect;
never executed: return rect;
0
1060 } -
1061}
never executed: }
0
1062 -
1063void QRenderRule::drawBackgroundImage(QPainter *p, const QRect &rect, QPoint off) -
1064{ -
1065 if (!hasBackground())
evaluated: !hasBackground()
TRUEFALSE
yes
Evaluation Count:292
yes
Evaluation Count:7
7-292
1066 return;
executed: return;
Execution Count:292
292
1067 -
1068 const QPixmap& bgp = background()->pixmap; -
1069 if (bgp.isNull())
partially evaluated: bgp.isNull()
TRUEFALSE
yes
Evaluation Count:7
no
Evaluation Count:0
0-7
1070 return;
executed: return;
Execution Count:7
7
1071 -
1072 setClip(p, borderRect(rect)); -
1073 -
1074 if (background()->origin != background()->clip) {
never evaluated: background()->origin != background()->clip
0
1075 p->save(); -
1076 p->setClipRect(originRect(rect, background()->clip), Qt::IntersectClip); -
1077 }
never executed: }
0
1078 -
1079 if (background()->attachment == Attachment_Fixed)
never evaluated: background()->attachment == Attachment_Fixed
0
1080 off = QPoint(0, 0);
never executed: off = QPoint(0, 0);
0
1081 -
1082 QRect r = originRect(rect, background()->origin); -
1083 QRect aligned = QStyle::alignedRect(Qt::LeftToRight, background()->position, bgp.size(), r); -
1084 QRect inter = aligned.translated(-off).intersected(r); -
1085 -
1086 switch (background()->repeat) { -
1087 case Repeat_Y: -
1088 p->drawTiledPixmap(inter.x(), r.y(), inter.width(), r.height(), bgp, -
1089 inter.x() - aligned.x() + off.x(), -
1090 bgp.height() - int(aligned.y() - r.y()) % bgp.height() + off.y()); -
1091 break;
never executed: break;
0
1092 case Repeat_X: -
1093 p->drawTiledPixmap(r.x(), inter.y(), r.width(), inter.height(), bgp, -
1094 bgp.width() - int(aligned.x() - r.x())%bgp.width() + off.x(), -
1095 inter.y() - aligned.y() + off.y()); -
1096 break;
never executed: break;
0
1097 case Repeat_XY: -
1098 p->drawTiledPixmap(r, bgp, -
1099 QPoint(bgp.width() - int(aligned.x() - r.x())% bgp.width() + off.x(), -
1100 bgp.height() - int(aligned.y() - r.y())%bgp.height() + off.y())); -
1101 break;
never executed: break;
0
1102 case Repeat_None: -
1103 default: -
1104 p->drawPixmap(inter.x(), inter.y(), bgp, inter.x() - aligned.x() + off.x(), -
1105 inter.y() - aligned.y() + off.y(), inter.width(), inter.height()); -
1106 break;
never executed: break;
0
1107 } -
1108 -
1109 -
1110 if (background()->origin != background()->clip)
never evaluated: background()->origin != background()->clip
0
1111 p->restore();
never executed: p->restore();
0
1112 -
1113 unsetClip(p); -
1114}
never executed: }
0
1115 -
1116void QRenderRule::drawOutline(QPainter *p, const QRect &rect) -
1117{ -
1118 if (!hasOutline())
never evaluated: !hasOutline()
0
1119 return;
never executed: return;
0
1120 -
1121 bool wasAntialiased = p->renderHints() & QPainter::Antialiasing; -
1122 p->setRenderHint(QPainter::Antialiasing); -
1123 qDrawBorder(p, rect, ou->styles, ou->borders, ou->colors, ou->radii); -
1124 p->setRenderHint(QPainter::Antialiasing, wasAntialiased); -
1125}
never executed: }
0
1126 -
1127void QRenderRule::drawBorder(QPainter *p, const QRect& rect) -
1128{ -
1129 if (!hasBorder())
partially evaluated: !hasBorder()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1130 return;
never executed: return;
0
1131 -
1132 if (border()->hasBorderImage()) {
partially evaluated: border()->hasBorderImage()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1133 drawBorderImage(p, rect); -
1134 return;
never executed: return;
0
1135 } -
1136 -
1137 bool wasAntialiased = p->renderHints() & QPainter::Antialiasing; -
1138 p->setRenderHint(QPainter::Antialiasing); -
1139 qDrawBorder(p, rect, bd->styles, bd->borders, bd->colors, bd->radii); -
1140 p->setRenderHint(QPainter::Antialiasing, wasAntialiased); -
1141}
executed: }
Execution Count:2
2
1142 -
1143QPainterPath QRenderRule::borderClip(QRect r) -
1144{ -
1145 if (!hasBorder())
never evaluated: !hasBorder()
0
1146 return QPainterPath();
never executed: return QPainterPath();
0
1147 -
1148 QSize tlr, trr, blr, brr; -
1149 qNormalizeRadii(r, bd->radii, &tlr, &trr, &blr, &brr); -
1150 if (tlr.isNull() && trr.isNull() && blr.isNull() && brr.isNull())
never evaluated: tlr.isNull()
never evaluated: trr.isNull()
never evaluated: blr.isNull()
never evaluated: brr.isNull()
0
1151 return QPainterPath();
never executed: return QPainterPath();
0
1152 -
1153 const QRectF rect(r); -
1154 const int *borders = border()->borders; -
1155 QPainterPath path; -
1156 qreal curY = rect.y() + borders[TopEdge]/2.0; -
1157 path.moveTo(rect.x() + tlr.width(), curY); -
1158 path.lineTo(rect.right() - trr.width(), curY); -
1159 qreal curX = rect.right() - borders[RightEdge]/2.0; -
1160 path.arcTo(curX - 2*trr.width() + borders[RightEdge], curY, -
1161 trr.width()*2 - borders[RightEdge], trr.height()*2 - borders[TopEdge], 90, -90); -
1162 -
1163 path.lineTo(curX, rect.bottom() - brr.height()); -
1164 curY = rect.bottom() - borders[BottomEdge]/2.0; -
1165 path.arcTo(curX - 2*brr.width() + borders[RightEdge], curY - 2*brr.height() + borders[BottomEdge], -
1166 brr.width()*2 - borders[RightEdge], brr.height()*2 - borders[BottomEdge], 0, -90); -
1167 -
1168 path.lineTo(rect.x() + blr.width(), curY); -
1169 curX = rect.left() + borders[LeftEdge]/2.0; -
1170 path.arcTo(curX, rect.bottom() - 2*blr.height() + borders[BottomEdge]/2, -
1171 blr.width()*2 - borders[LeftEdge], blr.height()*2 - borders[BottomEdge], 270, -90); -
1172 -
1173 path.lineTo(curX, rect.top() + tlr.height()); -
1174 path.arcTo(curX, rect.top() + borders[TopEdge]/2, -
1175 tlr.width()*2 - borders[LeftEdge], tlr.height()*2 - borders[TopEdge], 180, -90); -
1176 -
1177 path.closeSubpath(); -
1178 return path;
never executed: return path;
0
1179} -
1180 -
1181 -
1182 -
1183 -
1184void QRenderRule::setClip(QPainter *p, const QRect &rect) -
1185{ -
1186 if (clipset++)
never evaluated: clipset++
0
1187 return;
never executed: return;
0
1188 clipPath = borderClip(rect); -
1189 if (!clipPath.isEmpty()) {
never evaluated: !clipPath.isEmpty()
0
1190 p->save(); -
1191 p->setClipPath(clipPath, Qt::IntersectClip); -
1192 }
never executed: }
0
1193}
never executed: }
0
1194 -
1195void QRenderRule::unsetClip(QPainter *p) -
1196{ -
1197 if (--clipset)
never evaluated: --clipset
0
1198 return;
never executed: return;
0
1199 if (!clipPath.isEmpty())
never evaluated: !clipPath.isEmpty()
0
1200 p->restore();
never executed: p->restore();
0
1201}
never executed: }
0
1202 -
1203void QRenderRule::drawBackground(QPainter *p, const QRect& rect, const QPoint& off) -
1204{ -
1205 QBrush brush = hasBackground() ? background()->brush : QBrush();
partially evaluated: hasBackground()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1206 if (brush.style() == Qt::NoBrush)
partially evaluated: brush.style() == Qt::NoBrush
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
1207 brush = defaultBackground;
executed: brush = defaultBackground;
Execution Count:2
2
1208 -
1209 if (brush.style() != Qt::NoBrush) {
partially evaluated: brush.style() != Qt::NoBrush
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1210 Origin origin = hasBackground() ? background()->clip : Origin_Border;
never evaluated: hasBackground()
0
1211 -
1212 const QPainterPath &borderPath = borderClip(originRect(rect, origin)); -
1213 if (!borderPath.isEmpty()) {
never evaluated: !borderPath.isEmpty()
0
1214 -
1215 bool wasAntialiased = p->renderHints() & QPainter::Antialiasing; -
1216 p->setRenderHint(QPainter::Antialiasing); -
1217 p->fillPath(borderPath, brush); -
1218 p->setRenderHint(QPainter::Antialiasing, wasAntialiased); -
1219 } else {
never executed: }
0
1220 p->fillRect(originRect(rect, origin), brush); -
1221 }
never executed: }
0
1222 } -
1223 -
1224 drawBackgroundImage(p, rect, off); -
1225}
executed: }
Execution Count:2
2
1226 -
1227void QRenderRule::drawFrame(QPainter *p, const QRect& rect) -
1228{ -
1229 drawBackground(p, rect); -
1230 if (hasBorder())
never evaluated: hasBorder()
0
1231 drawBorder(p, borderRect(rect));
never executed: drawBorder(p, borderRect(rect));
0
1232}
never executed: }
0
1233 -
1234void QRenderRule::drawImage(QPainter *p, const QRect &rect) -
1235{ -
1236 if (!hasImage())
never evaluated: !hasImage()
0
1237 return;
never executed: return;
0
1238 img->icon.paint(p, rect, img->alignment); -
1239}
never executed: }
0
1240 -
1241void QRenderRule::drawRule(QPainter *p, const QRect& rect) -
1242{ -
1243 drawFrame(p, rect); -
1244 drawImage(p, contentsRect(rect)); -
1245}
never executed: }
0
1246 -
1247 -
1248void QRenderRule::configurePalette(QPalette *p, QPalette::ColorRole fr, QPalette::ColorRole br) -
1249{ -
1250 if (bg && bg->brush.style() != Qt::NoBrush) {
evaluated: bg
TRUEFALSE
yes
Evaluation Count:7
yes
Evaluation Count:886
partially evaluated: bg->brush.style() != Qt::NoBrush
TRUEFALSE
yes
Evaluation Count:7
no
Evaluation Count:0
0-886
1251 if (br != QPalette::NoRole)
partially evaluated: br != QPalette::NoRole
TRUEFALSE
yes
Evaluation Count:7
no
Evaluation Count:0
0-7
1252 p->setBrush(br, bg->brush);
executed: p->setBrush(br, bg->brush);
Execution Count:7
7
1253 p->setBrush(QPalette::Window, bg->brush); -
1254 if (bg->brush.style() == Qt::SolidPattern) {
partially evaluated: bg->brush.style() == Qt::SolidPattern
TRUEFALSE
yes
Evaluation Count:7
no
Evaluation Count:0
0-7
1255 p->setBrush(QPalette::Light, bg->brush.color().lighter(115)); -
1256 p->setBrush(QPalette::Midlight, bg->brush.color().lighter(107)); -
1257 p->setBrush(QPalette::Dark, bg->brush.color().darker(150)); -
1258 p->setBrush(QPalette::Shadow, bg->brush.color().darker(300)); -
1259 }
executed: }
Execution Count:7
7
1260 }
executed: }
Execution Count:7
7
1261 -
1262 if (!hasPalette())
partially evaluated: !hasPalette()
TRUEFALSE
yes
Evaluation Count:893
no
Evaluation Count:0
0-893
1263 return;
executed: return;
Execution Count:893
893
1264 -
1265 if (pal->foreground.style() != Qt::NoBrush) {
never evaluated: pal->foreground.style() != Qt::NoBrush
0
1266 if (fr != QPalette::NoRole)
never evaluated: fr != QPalette::NoRole
0
1267 p->setBrush(fr, pal->foreground);
never executed: p->setBrush(fr, pal->foreground);
0
1268 p->setBrush(QPalette::WindowText, pal->foreground); -
1269 p->setBrush(QPalette::Text, pal->foreground); -
1270 }
never executed: }
0
1271 if (pal->selectionBackground.style() != Qt::NoBrush)
never evaluated: pal->selectionBackground.style() != Qt::NoBrush
0
1272 p->setBrush(QPalette::Highlight, pal->selectionBackground);
never executed: p->setBrush(QPalette::Highlight, pal->selectionBackground);
0
1273 if (pal->selectionForeground.style() != Qt::NoBrush)
never evaluated: pal->selectionForeground.style() != Qt::NoBrush
0
1274 p->setBrush(QPalette::HighlightedText, pal->selectionForeground);
never executed: p->setBrush(QPalette::HighlightedText, pal->selectionForeground);
0
1275 if (pal->alternateBackground.style() != Qt::NoBrush)
never evaluated: pal->alternateBackground.style() != Qt::NoBrush
0
1276 p->setBrush(QPalette::AlternateBase, pal->alternateBackground);
never executed: p->setBrush(QPalette::AlternateBase, pal->alternateBackground);
0
1277}
never executed: }
0
1278 -
1279void QRenderRule::configurePalette(QPalette *p, QPalette::ColorGroup cg, const QWidget *w, bool embedded) -
1280{ -
1281 if (bg && bg->brush.style() != Qt::NoBrush) {
evaluated: bg
TRUEFALSE
yes
Evaluation Count:27
yes
Evaluation Count:5844
partially evaluated: bg->brush.style() != Qt::NoBrush
TRUEFALSE
yes
Evaluation Count:27
no
Evaluation Count:0
0-5844
1282 p->setBrush(cg, QPalette::Base, bg->brush); -
1283 p->setBrush(cg, QPalette::Button, bg->brush); -
1284 p->setBrush(cg, w->backgroundRole(), bg->brush); -
1285 p->setBrush(cg, QPalette::Window, bg->brush); -
1286 }
executed: }
Execution Count:27
27
1287 -
1288 if (embedded) {
evaluated: embedded
TRUEFALSE
yes
Evaluation Count:1167
yes
Evaluation Count:4704
1167-4704
1289 -
1290 -
1291 if ((hasBackground() && background()->isTransparent())
partially evaluated: hasBackground()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1167
never evaluated: background()->isTransparent()
0-1167
1292 || (hasBorder() && border()->hasBorderImage() && !border()->borderImage()->pixmap.isNull()))
partially evaluated: hasBorder()
TRUEFALSE
yes
Evaluation Count:1167
no
Evaluation Count:0
partially evaluated: border()->hasBorderImage()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1167
never evaluated: !border()->borderImage()->pixmap.isNull()
0-1167
1293 p->setBrush(cg, w->backgroundRole(), Qt::NoBrush);
never executed: p->setBrush(cg, w->backgroundRole(), Qt::NoBrush);
0
1294 }
executed: }
Execution Count:1167
1167
1295 -
1296 if (!hasPalette())
partially evaluated: !hasPalette()
TRUEFALSE
yes
Evaluation Count:5871
no
Evaluation Count:0
0-5871
1297 return;
executed: return;
Execution Count:5871
5871
1298 -
1299 if (pal->foreground.style() != Qt::NoBrush) {
never evaluated: pal->foreground.style() != Qt::NoBrush
0
1300 p->setBrush(cg, QPalette::ButtonText, pal->foreground); -
1301 p->setBrush(cg, w->foregroundRole(), pal->foreground); -
1302 p->setBrush(cg, QPalette::WindowText, pal->foreground); -
1303 p->setBrush(cg, QPalette::Text, pal->foreground); -
1304 }
never executed: }
0
1305 if (pal->selectionBackground.style() != Qt::NoBrush)
never evaluated: pal->selectionBackground.style() != Qt::NoBrush
0
1306 p->setBrush(cg, QPalette::Highlight, pal->selectionBackground);
never executed: p->setBrush(cg, QPalette::Highlight, pal->selectionBackground);
0
1307 if (pal->selectionForeground.style() != Qt::NoBrush)
never evaluated: pal->selectionForeground.style() != Qt::NoBrush
0
1308 p->setBrush(cg, QPalette::HighlightedText, pal->selectionForeground);
never executed: p->setBrush(cg, QPalette::HighlightedText, pal->selectionForeground);
0
1309 if (pal->alternateBackground.style() != Qt::NoBrush)
never evaluated: pal->alternateBackground.style() != Qt::NoBrush
0
1310 p->setBrush(cg, QPalette::AlternateBase, pal->alternateBackground);
never executed: p->setBrush(cg, QPalette::AlternateBase, pal->alternateBackground);
0
1311}
never executed: }
0
1312 -
1313 -
1314 -
1315 -
1316 -
1317static inline QObject *parentObject(const QObject *obj) -
1318{ -
1319 if (qobject_cast<const QLabel *>(obj) && qstrcmp(obj->metaObject()->className(), "QTipLabel") == 0) {
partially evaluated: qobject_cast<const QLabel *>(obj)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4825
never evaluated: qstrcmp(obj->metaObject()->className(), "QTipLabel") == 0
0-4825
1320 QObject *p = qvariant_cast<QObject *>(obj->property("_q_stylesheet_parent")); -
1321 if (p)
never evaluated: p
0
1322 return p;
never executed: return p;
0
1323 }
never executed: }
0
1324 return obj->parent();
executed: return obj->parent();
Execution Count:4825
4825
1325} -
1326 -
1327class QStyleSheetStyleSelector : public StyleSelector -
1328{ -
1329public: -
1330 QStyleSheetStyleSelector() { } -
1331 -
1332 QStringList nodeNames(NodePtr node) const -
1333 { -
1334 if (isNullNode(node))
partially evaluated: isNullNode(node)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2423
0-2423
1335 return QStringList();
never executed: return QStringList();
0
1336 const QMetaObject *metaObject = (static_cast<QObject *>(node.ptr))->metaObject(); -
1337 -
1338 if (qstrcmp(metaObject->className(), "QTipLabel") == 0)
partially evaluated: qstrcmp(metaObject->className(), "QTipLabel") == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2423
0-2423
1339 return QStringList(QLatin1String("QToolTip"));
never executed: return QStringList(QLatin1String("QToolTip"));
0
1340 -
1341 QStringList result; -
1342 do { -
1343 result += QString::fromLatin1(metaObject->className()).replace(QLatin1Char(':'), QLatin1Char('-')); -
1344 metaObject = metaObject->superClass(); -
1345 } while (metaObject != 0);
evaluated: metaObject != 0
TRUEFALSE
yes
Evaluation Count:6469
yes
Evaluation Count:2423
executed: }
Execution Count:8892
2423-8892
1346 return result;
executed: return result;
Execution Count:2423
2423
1347 } -
1348 QString attribute(NodePtr node, const QString& name) const -
1349 { -
1350 if (isNullNode(node))
partially evaluated: isNullNode(node)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
0-6
1351 return QString();
never executed: return QString();
0
1352 -
1353 QHash<QString, QString> &cache = m_attributeCache[(static_cast<QObject *>(node.ptr))]; -
1354 QHash<QString, QString>::const_iterator cacheIt = cache.constFind(name); -
1355 if (cacheIt != cache.constEnd())
partially evaluated: cacheIt != cache.constEnd()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
0-6
1356 return cacheIt.value();
never executed: return cacheIt.value();
0
1357 -
1358 QObject *obj = (static_cast<QObject *>(node.ptr)); -
1359 QVariant value = obj->property(name.toLatin1()); -
1360 if (!value.isValid()) {
evaluated: !value.isValid()
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:3
3
1361 if (name == QLatin1String("class")) {
partially evaluated: name == QLatin1String("class")
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
1362 QString className = QString::fromLatin1(obj->metaObject()->className()); -
1363 if (className.contains(QLatin1Char(':')))
never evaluated: className.contains(QLatin1Char(':'))
0
1364 className.replace(QLatin1Char(':'), QLatin1Char('-'));
never executed: className.replace(QLatin1Char(':'), QLatin1Char('-'));
0
1365 cache[name] = className; -
1366 return className;
never executed: return className;
0
1367 } else if (name == QLatin1String("style")) {
partially evaluated: name == QLatin1String("style")
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
1368 QWidget *w = qobject_cast<QWidget *>(obj); -
1369 QStyleSheetStyle *proxy = w ? qobject_cast<QStyleSheetStyle *>(w->style()) : 0;
never evaluated: w
0
1370 if (proxy) {
never evaluated: proxy
0
1371 QString styleName = QString::fromLatin1(proxy->baseStyle()->metaObject()->className()); -
1372 cache[name] = styleName; -
1373 return styleName;
never executed: return styleName;
0
1374 } -
1375 }
never executed: }
0
1376 } -
1377 QString valueStr; -
1378 if(value.type() == QVariant::StringList || value.type() == QVariant::List)
partially evaluated: value.type() == QVariant::StringList
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
partially evaluated: value.type() == QVariant::List
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
0-6
1379 valueStr = value.toStringList().join(QLatin1Char(' '));
never executed: valueStr = value.toStringList().join(QLatin1Char(' '));
0
1380 else -
1381 valueStr = value.toString();
executed: valueStr = value.toString();
Execution Count:6
6
1382 cache[name] = valueStr; -
1383 return valueStr;
executed: return valueStr;
Execution Count:6
6
1384 } -
1385 bool nodeNameEquals(NodePtr node, const QString& nodeName) const -
1386 { -
1387 if (isNullNode(node))
partially evaluated: isNullNode(node)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1650
0-1650
1388 return false;
never executed: return false;
0
1389 const QMetaObject *metaObject = (static_cast<QObject *>(node.ptr))->metaObject(); -
1390 -
1391 if (qstrcmp(metaObject->className(), "QTipLabel") == 0)
partially evaluated: qstrcmp(metaObject->className(), "QTipLabel") == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1650
0-1650
1392 return nodeName == QLatin1String("QToolTip");
never executed: return nodeName == QLatin1String("QToolTip");
0
1393 -
1394 do { -
1395 const ushort *uc = (const ushort *)nodeName.constData(); -
1396 const ushort *e = uc + nodeName.length(); -
1397 const uchar *c = (uchar *)metaObject->className(); -
1398 while (*c && uc != e && (*uc == *c || (*c == ':' && *uc == '-'))) {
evaluated: *c
TRUEFALSE
yes
Evaluation Count:16563
yes
Evaluation Count:1650
partially evaluated: uc != e
TRUEFALSE
yes
Evaluation Count:16563
no
Evaluation Count:0
evaluated: *uc == *c
TRUEFALSE
yes
Evaluation Count:14943
yes
Evaluation Count:1620
partially evaluated: *c == ':'
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1620
never evaluated: *uc == '-'
0-16563
1399 ++uc; -
1400 ++c; -
1401 }
executed: }
Execution Count:14943
14943
1402 if (uc == e && !*c)
evaluated: uc == e
TRUEFALSE
yes
Evaluation Count:1650
yes
Evaluation Count:1620
partially evaluated: !*c
TRUEFALSE
yes
Evaluation Count:1650
no
Evaluation Count:0
0-1650
1403 return true;
executed: return true;
Execution Count:1650
1650
1404 metaObject = metaObject->superClass(); -
1405 } while (metaObject != 0);
partially evaluated: metaObject != 0
TRUEFALSE
yes
Evaluation Count:1620
no
Evaluation Count:0
executed: }
Execution Count:1620
0-1620
1406 return false;
never executed: return false;
0
1407 } -
1408 bool hasAttributes(NodePtr) const -
1409 { return true; }
executed: return true;
Execution Count:6
6
1410 QStringList nodeIds(NodePtr node) const -
1411 { return isNullNode(node) ? QStringList() : QStringList((static_cast<QObject *>(node.ptr))->objectName()); }
never executed: return isNullNode(node) ? QStringList() : QStringList((static_cast<QObject *>(node.ptr))->objectName());
0
1412 bool isNullNode(NodePtr node) const -
1413 { return node.ptr == 0; }
executed: return node.ptr == 0;
Execution Count:4079
4079
1414 NodePtr parentNode(NodePtr node) const -
1415 { NodePtr n; n.ptr = isNullNode(node) ? 0 : parentObject((static_cast<QObject *>(node.ptr))); return n; }
never evaluated: isNullNode(node)
never executed: return n;
0
1416 NodePtr previousSiblingNode(NodePtr) const -
1417 { NodePtr n; n.ptr = 0; return n; }
never executed: return n;
0
1418 NodePtr duplicateNode(NodePtr node) const -
1419 { return node; }
executed: return node;
Execution Count:4
4
1420 void freeNode(NodePtr) const -
1421 { } -
1422 -
1423private: -
1424 mutable QHash<const QObject *, QHash<QString, QString> > m_attributeCache; -
1425}; -
1426 -
1427QVector<QCss::StyleRule> QStyleSheetStyle::styleRules(const QObject *obj) const -
1428{ -
1429 QHash<const QObject *, QVector<StyleRule> >::const_iterator cacheIt = styleSheetCaches->styleRulesCache.constFind(obj); -
1430 if (cacheIt != styleSheetCaches->styleRulesCache.constEnd())
evaluated: cacheIt != styleSheetCaches->styleRulesCache.constEnd()
TRUEFALSE
yes
Evaluation Count:16725
yes
Evaluation Count:2392
2392-16725
1431 return cacheIt.value();
executed: return cacheIt.value();
Execution Count:16725
16725
1432 -
1433 if (!initObject(obj)) {
partially evaluated: !initObject(obj)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2392
0-2392
1434 return QVector<StyleRule>();
never executed: return QVector<StyleRule>();
0
1435 } -
1436 -
1437 QStyleSheetStyleSelector styleSelector; -
1438 -
1439 StyleSheet defaultSs; -
1440 QHash<const void *, StyleSheet>::const_iterator defaultCacheIt = styleSheetCaches->styleSheetCache.constFind(baseStyle()); -
1441 if (defaultCacheIt == styleSheetCaches->styleSheetCache.constEnd()) {
evaluated: defaultCacheIt == styleSheetCaches->styleSheetCache.constEnd()
TRUEFALSE
yes
Evaluation Count:401
yes
Evaluation Count:1991
401-1991
1442 defaultSs = getDefaultStyleSheet(); -
1443 QStyle *bs = baseStyle(); -
1444 styleSheetCaches->styleSheetCache.insert(bs, defaultSs); -
1445 QObject::connect(bs, "2""destroyed(QObject*)", styleSheetCaches, "1""styleDestroyed(QObject*)", Qt::UniqueConnection); -
1446 } else {
executed: }
Execution Count:401
401
1447 defaultSs = defaultCacheIt.value(); -
1448 }
executed: }
Execution Count:1991
1991
1449 styleSelector.styleSheets += defaultSs; -
1450 -
1451 if (!(static_cast<QApplication *>(QCoreApplication::instance()))->styleSheet().isEmpty()) {
evaluated: !(static_cast<QApplication *>(QCoreApplication::instance()))->styleSheet().isEmpty()
TRUEFALSE
yes
Evaluation Count:19
yes
Evaluation Count:2373
19-2373
1452 StyleSheet appSs; -
1453 QHash<const void *, StyleSheet>::const_iterator appCacheIt = styleSheetCaches->styleSheetCache.constFind((static_cast<QApplication *>(QCoreApplication::instance()))); -
1454 if (appCacheIt == styleSheetCaches->styleSheetCache.constEnd()) {
evaluated: appCacheIt == styleSheetCaches->styleSheetCache.constEnd()
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:16
3-16
1455 QString ss = (static_cast<QApplication *>(QCoreApplication::instance()))->styleSheet(); -
1456 if (ss.startsWith(QLatin1String("file:///")))
partially evaluated: ss.startsWith(QLatin1String("file:///"))
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
1457 ss.remove(0, 8);
never executed: ss.remove(0, 8);
0
1458 parser.init(ss, (static_cast<QApplication *>(QCoreApplication::instance()))->styleSheet() != ss); -
1459 if (!parser.parse(&appSs))
partially evaluated: !parser.parse(&appSs)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
1460 QMessageLogger("styles/qstylesheetstyle.cpp", 1551, __PRETTY_FUNCTION__).warning("Could not parse application stylesheet");
never executed: QMessageLogger("styles/qstylesheetstyle.cpp", 1551, __PRETTY_FUNCTION__).warning("Could not parse application stylesheet");
0
1461 appSs.origin = StyleSheetOrigin_Inline; -
1462 appSs.depth = 1; -
1463 styleSheetCaches->styleSheetCache.insert((static_cast<QApplication *>(QCoreApplication::instance())), appSs); -
1464 } else {
executed: }
Execution Count:3
3
1465 appSs = appCacheIt.value(); -
1466 }
executed: }
Execution Count:16
16
1467 styleSelector.styleSheets += appSs; -
1468 }
executed: }
Execution Count:19
19
1469 -
1470 QVector<QCss::StyleSheet> objectSs; -
1471 for (const QObject *o = obj; o; o = parentObject(o)) {
evaluated: o
TRUEFALSE
yes
Evaluation Count:4825
yes
Evaluation Count:2392
2392-4825
1472 QString styleSheet = o->property("styleSheet").toString(); -
1473 if (styleSheet.isEmpty())
evaluated: styleSheet.isEmpty()
TRUEFALSE
yes
Evaluation Count:2452
yes
Evaluation Count:2373
2373-2452
1474 continue;
executed: continue;
Execution Count:2452
2452
1475 StyleSheet ss; -
1476 QHash<const void *, StyleSheet>::const_iterator objCacheIt = styleSheetCaches->styleSheetCache.constFind(o); -
1477 if (objCacheIt == styleSheetCaches->styleSheetCache.constEnd()) {
evaluated: objCacheIt == styleSheetCaches->styleSheetCache.constEnd()
TRUEFALSE
yes
Evaluation Count:399
yes
Evaluation Count:1974
399-1974
1478 parser.init(styleSheet); -
1479 if (!parser.parse(&ss)) {
evaluated: !parser.parse(&ss)
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:395
4-395
1480 parser.init(QLatin1String("* {") + styleSheet + QLatin1Char('}')); -
1481 if (!parser.parse(&ss))
partially evaluated: !parser.parse(&ss)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4
0-4
1482 QMessageLogger("styles/qstylesheetstyle.cpp", 1573, __PRETTY_FUNCTION__).warning("Could not parse stylesheet of object %p", o);
never executed: QMessageLogger("styles/qstylesheetstyle.cpp", 1573, __PRETTY_FUNCTION__).warning("Could not parse stylesheet of object %p", o);
0
1483 }
executed: }
Execution Count:4
4
1484 ss.origin = StyleSheetOrigin_Inline; -
1485 styleSheetCaches->styleSheetCache.insert(o, ss); -
1486 } else {
executed: }
Execution Count:399
399
1487 ss = objCacheIt.value(); -
1488 }
executed: }
Execution Count:1974
1974
1489 objectSs.append(ss); -
1490 }
executed: }
Execution Count:2373
2373
1491 -
1492 for (int i = 0; i < objectSs.count(); i++)
evaluated: i < objectSs.count()
TRUEFALSE
yes
Evaluation Count:2373
yes
Evaluation Count:2392
2373-2392
1493 objectSs[i].depth = objectSs.count() - i + 2;
executed: objectSs[i].depth = objectSs.count() - i + 2;
Execution Count:2373
2373
1494 -
1495 styleSelector.styleSheets += objectSs; -
1496 -
1497 StyleSelector::NodePtr n; -
1498 n.ptr = (void *)obj; -
1499 QVector<QCss::StyleRule> rules = styleSelector.styleRulesForNode(n); -
1500 styleSheetCaches->styleRulesCache.insert(obj, rules); -
1501 return rules;
executed: return rules;
Execution Count:2392
2392
1502} -
1503 -
1504 -
1505 -
1506static QVector<Declaration> declarations(const QVector<StyleRule> &styleRules, const QString &part, quint64 pseudoClass = PseudoClass_Unspecified) -
1507{ -
1508 QVector<Declaration> decls; -
1509 for (int i = 0; i < styleRules.count(); i++) {
evaluated: i < styleRules.count()
TRUEFALSE
yes
Evaluation Count:4258
yes
Evaluation Count:5683
4258-5683
1510 const Selector& selector = styleRules.at(i).selectors.at(0); -
1511 -
1512 -
1513 if (part.compare(selector.pseudoElement(), Qt::CaseInsensitive) != 0)
evaluated: part.compare(selector.pseudoElement(), Qt::CaseInsensitive) != 0
TRUEFALSE
yes
Evaluation Count:170
yes
Evaluation Count:4088
170-4088
1514 continue;
executed: continue;
Execution Count:170
170
1515 quint64 negated = 0; -
1516 quint64 cssClass = selector.pseudoClass(&negated); -
1517 if ((pseudoClass == PseudoClass_Any) || (cssClass == PseudoClass_Unspecified)
evaluated: (pseudoClass == PseudoClass_Any)
TRUEFALSE
yes
Evaluation Count:1206
yes
Evaluation Count:2882
evaluated: (cssClass == PseudoClass_Unspecified)
TRUEFALSE
yes
Evaluation Count:2875
yes
Evaluation Count:7
7-2882
1518 || ((((cssClass & pseudoClass) == cssClass)) && ((negated & pseudoClass) == 0)))
evaluated: (((cssClass & pseudoClass) == cssClass))
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:6
partially evaluated: ((negated & pseudoClass) == 0)
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-6
1519 decls += styleRules.at(i).declarations;
executed: decls += styleRules.at(i).declarations;
Execution Count:4082
4082
1520 }
executed: }
Execution Count:4088
4088
1521 return decls;
executed: return decls;
Execution Count:5683
5683
1522} -
1523 -
1524int QStyleSheetStyle::nativeFrameWidth(const QWidget *w) -
1525{ -
1526 QStyle *base = baseStyle(); -
1527 -
1528 -
1529 if (qobject_cast<const QAbstractSpinBox *>(w))
evaluated: qobject_cast<const QAbstractSpinBox *>(w)
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:3723
3-3723
1530 return base->pixelMetric(QStyle::PM_SpinBoxFrameWidth, 0, w);
executed: return base->pixelMetric(QStyle::PM_SpinBoxFrameWidth, 0, w);
Execution Count:3
3
1531 -
1532 -
1533 -
1534 if (qobject_cast<const QComboBox *>(w))
partially evaluated: qobject_cast<const QComboBox *>(w)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3723
0-3723
1535 return base->pixelMetric(QStyle::PM_ComboBoxFrameWidth, 0, w);
never executed: return base->pixelMetric(QStyle::PM_ComboBoxFrameWidth, 0, w);
0
1536 -
1537 -
1538 -
1539 if (qobject_cast<const QMenu *>(w))
evaluated: qobject_cast<const QMenu *>(w)
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:3722
1-3722
1540 return base->pixelMetric(QStyle::PM_MenuPanelWidth, 0, w);
executed: return base->pixelMetric(QStyle::PM_MenuPanelWidth, 0, w);
Execution Count:1
1
1541 -
1542 -
1543 -
1544 if (qobject_cast<const QMenuBar *>(w))
evaluated: qobject_cast<const QMenuBar *>(w)
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:3721
1-3721
1545 return base->pixelMetric(QStyle::PM_MenuBarPanelWidth, 0, w);
executed: return base->pixelMetric(QStyle::PM_MenuBarPanelWidth, 0, w);
Execution Count:1
1
1546 -
1547 -
1548 if (const QFrame *frame = qobject_cast<const QFrame *>(w)) {
evaluated: const QFrame *frame = qobject_cast<const QFrame *>(w)
TRUEFALSE
yes
Evaluation Count:1317
yes
Evaluation Count:2404
1317-2404
1549 if (frame->frameShape() == QFrame::NoFrame)
evaluated: frame->frameShape() == QFrame::NoFrame
TRUEFALSE
yes
Evaluation Count:637
yes
Evaluation Count:680
637-680
1550 return 0;
executed: return 0;
Execution Count:637
637
1551 }
executed: }
Execution Count:680
680
1552 -
1553 -
1554 if (qstrcmp(w->metaObject()->className(), "QTipLabel") == 0)
partially evaluated: qstrcmp(w->metaObject()->className(), "QTipLabel") == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3084
0-3084
1555 return base->pixelMetric(QStyle::PM_ToolTipLabelFrameWidth, 0, w);
never executed: return base->pixelMetric(QStyle::PM_ToolTipLabelFrameWidth, 0, w);
0
1556 -
1557 return base->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, w);
executed: return base->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, w);
Execution Count:3084
3084
1558} -
1559 -
1560static quint64 pseudoClass(QStyle::State state) -
1561{ -
1562 quint64 pc = 0; -
1563 if (state & QStyle::State_Enabled) {
evaluated: state & QStyle::State_Enabled
TRUEFALSE
yes
Evaluation Count:20967
yes
Evaluation Count:10935
10935-20967
1564 pc |= PseudoClass_Enabled; -
1565 if (state & QStyle::State_MouseOver)
evaluated: state & QStyle::State_MouseOver
TRUEFALSE
yes
Evaluation Count:755
yes
Evaluation Count:20212
755-20212
1566 pc |= PseudoClass_Hover;
executed: pc |= PseudoClass_Hover;
Execution Count:755
755
1567 } else {
executed: }
Execution Count:20967
20967
1568 pc |= PseudoClass_Disabled; -
1569 }
executed: }
Execution Count:10935
10935
1570 if (state & QStyle::State_Active)
evaluated: state & QStyle::State_Active
TRUEFALSE
yes
Evaluation Count:3275
yes
Evaluation Count:28627
3275-28627
1571 pc |= PseudoClass_Active;
executed: pc |= PseudoClass_Active;
Execution Count:3275
3275
1572 if (state & QStyle::State_Window)
evaluated: state & QStyle::State_Window
TRUEFALSE
yes
Evaluation Count:5141
yes
Evaluation Count:26761
5141-26761
1573 pc |= PseudoClass_Window;
executed: pc |= PseudoClass_Window;
Execution Count:5141
5141
1574 if (state & QStyle::State_Sunken)
evaluated: state & QStyle::State_Sunken
TRUEFALSE
yes
Evaluation Count:15
yes
Evaluation Count:31887
15-31887
1575 pc |= PseudoClass_Pressed;
executed: pc |= PseudoClass_Pressed;
Execution Count:15
15
1576 if (state & QStyle::State_HasFocus)
evaluated: state & QStyle::State_HasFocus
TRUEFALSE
yes
Evaluation Count:786
yes
Evaluation Count:31116
786-31116
1577 pc |= PseudoClass_Focus;
executed: pc |= PseudoClass_Focus;
Execution Count:786
786
1578 if (state & QStyle::State_On)
evaluated: state & QStyle::State_On
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:31901
1-31901
1579 pc |= (PseudoClass_On | PseudoClass_Checked);
executed: pc |= (PseudoClass_On | PseudoClass_Checked);
Execution Count:1
1
1580 if (state & QStyle::State_Off)
evaluated: state & QStyle::State_Off
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:31901
1-31901
1581 pc |= (PseudoClass_Off | PseudoClass_Unchecked);
executed: pc |= (PseudoClass_Off | PseudoClass_Unchecked);
Execution Count:1
1
1582 if (state & QStyle::State_NoChange)
partially evaluated: state & QStyle::State_NoChange
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:31902
0-31902
1583 pc |= PseudoClass_Indeterminate;
never executed: pc |= PseudoClass_Indeterminate;
0
1584 if (state & QStyle::State_Selected)
partially evaluated: state & QStyle::State_Selected
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:31902
0-31902
1585 pc |= PseudoClass_Selected;
never executed: pc |= PseudoClass_Selected;
0
1586 if (state & QStyle::State_Horizontal)
evaluated: state & QStyle::State_Horizontal
TRUEFALSE
yes
Evaluation Count:7576
yes
Evaluation Count:24326
7576-24326
1587 pc |= PseudoClass_Horizontal;
executed: pc |= PseudoClass_Horizontal;
Execution Count:7576
7576
1588 else -
1589 pc |= PseudoClass_Vertical;
executed: pc |= PseudoClass_Vertical;
Execution Count:24326
24326
1590 if (state & (QStyle::State_Open | QStyle::State_On | QStyle::State_Sunken))
evaluated: state & (QStyle::State_Open | QStyle::State_On | QStyle::State_Sunken)
TRUEFALSE
yes
Evaluation Count:16
yes
Evaluation Count:31886
16-31886
1591 pc |= PseudoClass_Open;
executed: pc |= PseudoClass_Open;
Execution Count:16
16
1592 else -
1593 pc |= PseudoClass_Closed;
executed: pc |= PseudoClass_Closed;
Execution Count:31886
31886
1594 if (state & QStyle::State_Children)
evaluated: state & QStyle::State_Children
TRUEFALSE
yes
Evaluation Count:96
yes
Evaluation Count:31806
96-31806
1595 pc |= PseudoClass_Children;
executed: pc |= PseudoClass_Children;
Execution Count:96
96
1596 if (state & QStyle::State_Sibling)
evaluated: state & QStyle::State_Sibling
TRUEFALSE
yes
Evaluation Count:84
yes
Evaluation Count:31818
84-31818
1597 pc |= PseudoClass_Sibling;
executed: pc |= PseudoClass_Sibling;
Execution Count:84
84
1598 if (state & QStyle::State_ReadOnly)
partially evaluated: state & QStyle::State_ReadOnly
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:31902
0-31902
1599 pc |= PseudoClass_ReadOnly;
never executed: pc |= PseudoClass_ReadOnly;
0
1600 if (state & QStyle::State_Item)
evaluated: state & QStyle::State_Item
TRUEFALSE
yes
Evaluation Count:32
yes
Evaluation Count:31870
32-31870
1601 pc |= PseudoClass_Item;
executed: pc |= PseudoClass_Item;
Execution Count:32
32
1602 -
1603 -
1604 -
1605 -
1606 return pc;
executed: return pc;
Execution Count:31902
31902
1607} -
1608 -
1609static void qt_check_if_internal_object(const QObject **obj, int *element) -
1610{ -
1611 -
1612 -
1613 -
1614 -
1615 if (*obj && qstrcmp((*obj)->metaObject()->className(), "QDockWidgetTitleButton") == 0) {
evaluated: *obj
TRUEFALSE
yes
Evaluation Count:43644
yes
Evaluation Count:778
partially evaluated: qstrcmp((*obj)->metaObject()->className(), "QDockWidgetTitleButton") == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:43644
0-43644
1616 if ((*obj)->objectName() == QLatin1String("qt_dockwidget_closebutton")) {
never evaluated: (*obj)->objectName() == QLatin1String("qt_dockwidget_closebutton")
0
1617 *element = PseudoElement_DockWidgetCloseButton; -
1618 } else if ((*obj)->objectName() == QLatin1String("qt_dockwidget_floatbutton")) {
never evaluated: (*obj)->objectName() == QLatin1String("qt_dockwidget_floatbutton")
never executed: }
0
1619 *element = PseudoElement_DockWidgetFloatButton; -
1620 }
never executed: }
0
1621 *obj = (*obj)->parent(); -
1622 }
never executed: }
0
1623 -
1624}
executed: }
Execution Count:44422
44422
1625 -
1626QRenderRule QStyleSheetStyle::renderRule(const QObject *obj, int element, quint64 state) const -
1627{ -
1628 qt_check_if_internal_object(&obj, &element); -
1629 QHash<quint64, QRenderRule> &cache = styleSheetCaches->renderRulesCache[obj][element]; -
1630 QHash<quint64, QRenderRule>::const_iterator cacheIt = cache.constFind(state); -
1631 if (cacheIt != cache.constEnd())
evaluated: cacheIt != cache.constEnd()
TRUEFALSE
yes
Evaluation Count:29225
yes
Evaluation Count:15197
15197-29225
1632 return cacheIt.value();
executed: return cacheIt.value();
Execution Count:29225
29225
1633 -
1634 if (!initObject(obj))
evaluated: !initObject(obj)
TRUEFALSE
yes
Evaluation Count:782
yes
Evaluation Count:14415
782-14415
1635 return QRenderRule();
executed: return QRenderRule();
Execution Count:782
782
1636 -
1637 quint64 stateMask = 0; -
1638 const QVector<StyleRule> rules = styleRules(obj); -
1639 for (int i = 0; i < rules.count(); i++) {
evaluated: i < rules.count()
TRUEFALSE
yes
Evaluation Count:10815
yes
Evaluation Count:14415
10815-14415
1640 const Selector& selector = rules.at(i).selectors.at(0); -
1641 quint64 negated = 0; -
1642 stateMask |= selector.pseudoClass(&negated); -
1643 stateMask |= negated; -
1644 }
executed: }
Execution Count:10815
10815
1645 -
1646 cacheIt = cache.constFind(state & stateMask); -
1647 if (cacheIt != cache.constEnd()) {
evaluated: cacheIt != cache.constEnd()
TRUEFALSE
yes
Evaluation Count:10689
yes
Evaluation Count:3726
3726-10689
1648 const QRenderRule &newRule = cacheIt.value(); -
1649 cache[state] = newRule; -
1650 return newRule;
executed: return newRule;
Execution Count:10689
10689
1651 } -
1652 -
1653 -
1654 const QString part = QLatin1String(knownPseudoElements[element].name); -
1655 QVector<Declaration> decls = declarations(rules, part, state); -
1656 QRenderRule newRule(decls, obj); -
1657 cache[state] = newRule; -
1658 if ((state & stateMask) != state)
partially evaluated: (state & stateMask) != state
TRUEFALSE
yes
Evaluation Count:3726
no
Evaluation Count:0
0-3726
1659 cache[state&stateMask] = newRule;
executed: cache[state&stateMask] = newRule;
Execution Count:3726
3726
1660 return newRule;
executed: return newRule;
Execution Count:3726
3726
1661} -
1662 -
1663QRenderRule QStyleSheetStyle::renderRule(const QObject *obj, const QStyleOption *opt, int pseudoElement) const -
1664{ -
1665 quint64 extraClass = 0; -
1666 QStyle::State state = opt ? opt->state : QStyle::State(QStyle::State_None);
evaluated: opt
TRUEFALSE
yes
Evaluation Count:20960
yes
Evaluation Count:10935
10935-20960
1667 -
1668 if (const QStyleOptionComplex *complex = qstyleoption_cast<const QStyleOptionComplex *>(opt)) {
evaluated: const QStyleOptionComplex *complex = qstyleoption_cast<const QStyleOptionComplex *>(opt)
TRUEFALSE
yes
Evaluation Count:15511
yes
Evaluation Count:16384
15511-16384
1669 if (pseudoElement != PseudoElement_None) {
evaluated: pseudoElement != PseudoElement_None
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:15509
2-15509
1670 -
1671 QStyle::SubControl subControl = knownPseudoElements[pseudoElement].subControl; -
1672 -
1673 if (!(complex->activeSubControls & subControl))
partially evaluated: !(complex->activeSubControls & subControl)
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
1674 state &= (QStyle::State_Enabled | QStyle::State_Horizontal | QStyle::State_HasFocus);
executed: state &= (QStyle::State_Enabled | QStyle::State_Horizontal | QStyle::State_HasFocus);
Execution Count:2
2
1675 }
executed: }
Execution Count:2
2
1676 -
1677 switch (pseudoElement) { -
1678 case PseudoElement_ComboBoxDropDown: -
1679 case PseudoElement_ComboBoxArrow: -
1680 state |= (complex->state & (QStyle::State_On|QStyle::State_ReadOnly)); -
1681 break;
never executed: break;
0
1682 case PseudoElement_SpinBoxUpButton: -
1683 case PseudoElement_SpinBoxDownButton: -
1684 case PseudoElement_SpinBoxUpArrow: -
1685 case PseudoElement_SpinBoxDownArrow: -
1686 -
1687 if (const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
partially evaluated: const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
1688 bool on = false; -
1689 bool up = pseudoElement == PseudoElement_SpinBoxUpButton
evaluated: pseudoElement == PseudoElement_SpinBoxUpButton
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1
1690 || pseudoElement == PseudoElement_SpinBoxUpArrow;
partially evaluated: pseudoElement == PseudoElement_SpinBoxUpArrow
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1691 if ((sb->stepEnabled & QAbstractSpinBox::StepUpEnabled) && up)
partially evaluated: (sb->stepEnabled & QAbstractSpinBox::StepUpEnabled)
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
evaluated: up
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
0-2
1692 on = true;
executed: on = true;
Execution Count:1
1
1693 else if ((sb->stepEnabled & QAbstractSpinBox::StepDownEnabled) && !up)
partially evaluated: (sb->stepEnabled & QAbstractSpinBox::StepDownEnabled)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
never evaluated: !up
0-1
1694 on = true;
never executed: on = true;
0
1695 state |= (on ? QStyle::State_On : QStyle::State_Off);
evaluated: on
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1
1696 }
executed: }
Execution Count:2
2
1697 -
1698 break;
executed: break;
Execution Count:2
2
1699 case PseudoElement_GroupBoxTitle: -
1700 state |= (complex->state & (QStyle::State_MouseOver | QStyle::State_Sunken)); -
1701 break;
never executed: break;
0
1702 case PseudoElement_ToolButtonMenu: -
1703 case PseudoElement_ToolButtonMenuArrow: -
1704 case PseudoElement_ToolButtonDownArrow: -
1705 state |= complex->state & QStyle::State_MouseOver; -
1706 if (complex->state & QStyle::State_Sunken ||
never evaluated: complex->state & QStyle::State_Sunken
0
1707 complex->activeSubControls & QStyle::SC_ToolButtonMenu)
never evaluated: complex->activeSubControls & QStyle::SC_ToolButtonMenu
0
1708 state |= QStyle::State_Sunken;
never executed: state |= QStyle::State_Sunken;
0
1709 break;
never executed: break;
0
1710 case PseudoElement_SliderGroove: -
1711 state |= complex->state & QStyle::State_MouseOver; -
1712 break;
never executed: break;
0
1713 default: -
1714 break;
executed: break;
Execution Count:15509
15509
1715 } -
1716 -
1717 if (const QStyleOptionComboBox *combo = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
partially evaluated: const QStyleOptionComboBox *combo = qstyleoption_cast<const QStyleOptionComboBox *>(opt)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15511
0-15511
1718 -
1719 -
1720 if (pseudoElement == PseudoElement_None
never evaluated: pseudoElement == PseudoElement_None
0
1721 && (complex->activeSubControls & QStyle::SC_ComboBoxEditField)
never evaluated: (complex->activeSubControls & QStyle::SC_ComboBoxEditField)
0
1722 && (!(state & QStyle::State_MouseOver))) {
never evaluated: (!(state & QStyle::State_MouseOver))
0
1723 state |= QStyle::State_Sunken; -
1724 }
never executed: }
0
1725 -
1726 if (!combo->frame)
never evaluated: !combo->frame
0
1727 extraClass |= PseudoClass_Frameless;
never executed: extraClass |= PseudoClass_Frameless;
0
1728 if (!combo->editable)
never evaluated: !combo->editable
0
1729 extraClass |= PseudoClass_ReadOnly;
never executed: extraClass |= PseudoClass_ReadOnly;
0
1730 else -
1731 extraClass |= PseudoClass_Editable;
never executed: extraClass |= PseudoClass_Editable;
0
1732 -
1733 } else if (const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
evaluated: const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:15506
5-15506
1734 if (!spin->frame)
partially evaluated: !spin->frame
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5
0-5
1735 extraClass |= PseudoClass_Frameless;
never executed: extraClass |= PseudoClass_Frameless;
0
1736 -
1737 } else if (const QStyleOptionGroupBox *gb = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)) {
partially evaluated: const QStyleOptionGroupBox *gb = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15506
executed: }
Execution Count:5
0-15506
1738 if (gb->features & QStyleOptionFrameV2::Flat)
never evaluated: gb->features & QStyleOptionFrameV2::Flat
0
1739 extraClass |= PseudoClass_Flat;
never executed: extraClass |= PseudoClass_Flat;
0
1740 if (gb->lineWidth == 0)
never evaluated: gb->lineWidth == 0
0
1741 extraClass |= PseudoClass_Frameless;
never executed: extraClass |= PseudoClass_Frameless;
0
1742 } else if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)) {
partially evaluated: const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15506
never executed: }
0-15506
1743 if (tb->titleBarState & Qt::WindowMinimized) {
never evaluated: tb->titleBarState & Qt::WindowMinimized
0
1744 extraClass |= PseudoClass_Minimized; -
1745 }
never executed: }
0
1746 else if (tb->titleBarState & Qt::WindowMaximized)
never evaluated: tb->titleBarState & Qt::WindowMaximized
0
1747 extraClass |= PseudoClass_Maximized;
never executed: extraClass |= PseudoClass_Maximized;
0
1748 } -
1749 } else { -
1750 -
1751 if (const QStyleOptionMenuItem *mi = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
partially evaluated: const QStyleOptionMenuItem *mi = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16384
0-16384
1752 if (mi->menuItemType == QStyleOptionMenuItem::DefaultItem)
never evaluated: mi->menuItemType == QStyleOptionMenuItem::DefaultItem
0
1753 extraClass |= PseudoClass_Default;
never executed: extraClass |= PseudoClass_Default;
0
1754 if (mi->checkType == QStyleOptionMenuItem::Exclusive)
never evaluated: mi->checkType == QStyleOptionMenuItem::Exclusive
0
1755 extraClass |= PseudoClass_Exclusive;
never executed: extraClass |= PseudoClass_Exclusive;
0
1756 else if (mi->checkType == QStyleOptionMenuItem::NonExclusive)
never evaluated: mi->checkType == QStyleOptionMenuItem::NonExclusive
0
1757 extraClass |= PseudoClass_NonExclusive;
never executed: extraClass |= PseudoClass_NonExclusive;
0
1758 if (mi->checkType != QStyleOptionMenuItem::NotCheckable)
never evaluated: mi->checkType != QStyleOptionMenuItem::NotCheckable
0
1759 extraClass |= (mi->checked) ? (PseudoClass_On|PseudoClass_Checked)
never evaluated: (mi->checked)
0
1760 : (PseudoClass_Off|PseudoClass_Unchecked);
never executed: extraClass |= (mi->checked) ? (PseudoClass_On|PseudoClass_Checked) : (PseudoClass_Off|PseudoClass_Unchecked);
0
1761 } else if (const QStyleOptionHeader *hdr = qstyleoption_cast<const QStyleOptionHeader *>(opt)) {
evaluated: const QStyleOptionHeader *hdr = qstyleoption_cast<const QStyleOptionHeader *>(opt)
TRUEFALSE
yes
Evaluation Count:22
yes
Evaluation Count:16362
never executed: }
0-16362
1762 if (hdr->position == QStyleOptionHeader::OnlyOneSection)
evaluated: hdr->position == QStyleOptionHeader::OnlyOneSection
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:14
8-14
1763 extraClass |= PseudoClass_OnlyOne;
executed: extraClass |= PseudoClass_OnlyOne;
Execution Count:8
8
1764 else if (hdr->position == QStyleOptionHeader::Beginning)
partially evaluated: hdr->position == QStyleOptionHeader::Beginning
TRUEFALSE
yes
Evaluation Count:14
no
Evaluation Count:0
0-14
1765 extraClass |= PseudoClass_First;
executed: extraClass |= PseudoClass_First;
Execution Count:14
14
1766 else if (hdr->position == QStyleOptionHeader::End)
never evaluated: hdr->position == QStyleOptionHeader::End
0
1767 extraClass |= PseudoClass_Last;
never executed: extraClass |= PseudoClass_Last;
0
1768 else if (hdr->position == QStyleOptionHeader::Middle)
never evaluated: hdr->position == QStyleOptionHeader::Middle
0
1769 extraClass |= PseudoClass_Middle;
never executed: extraClass |= PseudoClass_Middle;
0
1770 -
1771 if (hdr->selectedPosition == QStyleOptionHeader::NextAndPreviousAreSelected)
partially evaluated: hdr->selectedPosition == QStyleOptionHeader::NextAndPreviousAreSelected
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:22
0-22
1772 extraClass |= (PseudoClass_NextSelected | PseudoClass_PreviousSelected);
never executed: extraClass |= (PseudoClass_NextSelected | PseudoClass_PreviousSelected);
0
1773 else if (hdr->selectedPosition == QStyleOptionHeader::NextIsSelected)
partially evaluated: hdr->selectedPosition == QStyleOptionHeader::NextIsSelected
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:22
0-22
1774 extraClass |= PseudoClass_NextSelected;
never executed: extraClass |= PseudoClass_NextSelected;
0
1775 else if (hdr->selectedPosition == QStyleOptionHeader::PreviousIsSelected)
partially evaluated: hdr->selectedPosition == QStyleOptionHeader::PreviousIsSelected
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:22
0-22
1776 extraClass |= PseudoClass_PreviousSelected;
never executed: extraClass |= PseudoClass_PreviousSelected;
0
1777 -
1778 } else if (const QStyleOptionTabWidgetFrame *tab = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)) {
partially evaluated: const QStyleOptionTabWidgetFrame *tab = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16362
0-16362
1779 switch (tab->shape) { -
1780 case QTabBar::RoundedNorth: -
1781 case QTabBar::TriangularNorth: -
1782 extraClass |= PseudoClass_Top; -
1783 break;
never executed: break;
0
1784 case QTabBar::RoundedSouth: -
1785 case QTabBar::TriangularSouth: -
1786 extraClass |= PseudoClass_Bottom; -
1787 break;
never executed: break;
0
1788 case QTabBar::RoundedEast: -
1789 case QTabBar::TriangularEast: -
1790 extraClass |= PseudoClass_Left; -
1791 break;
never executed: break;
0
1792 case QTabBar::RoundedWest: -
1793 case QTabBar::TriangularWest: -
1794 extraClass |= PseudoClass_Right; -
1795 break;
never executed: break;
0
1796 default: -
1797 break;
never executed: break;
0
1798 } -
1799 -
1800 -
1801 } else if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
partially evaluated: const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16362
never executed: }
0-16362
1802 if (tab->position == QStyleOptionTab::OnlyOneTab)
never evaluated: tab->position == QStyleOptionTab::OnlyOneTab
0
1803 extraClass |= PseudoClass_OnlyOne;
never executed: extraClass |= PseudoClass_OnlyOne;
0
1804 else if (tab->position == QStyleOptionTab::Beginning)
never evaluated: tab->position == QStyleOptionTab::Beginning
0
1805 extraClass |= PseudoClass_First;
never executed: extraClass |= PseudoClass_First;
0
1806 else if (tab->position == QStyleOptionTab::End)
never evaluated: tab->position == QStyleOptionTab::End
0
1807 extraClass |= PseudoClass_Last;
never executed: extraClass |= PseudoClass_Last;
0
1808 else if (tab->position == QStyleOptionTab::Middle)
never evaluated: tab->position == QStyleOptionTab::Middle
0
1809 extraClass |= PseudoClass_Middle;
never executed: extraClass |= PseudoClass_Middle;
0
1810 -
1811 if (tab->selectedPosition == QStyleOptionTab::NextIsSelected)
never evaluated: tab->selectedPosition == QStyleOptionTab::NextIsSelected
0
1812 extraClass |= PseudoClass_NextSelected;
never executed: extraClass |= PseudoClass_NextSelected;
0
1813 else if (tab->selectedPosition == QStyleOptionTab::PreviousIsSelected)
never evaluated: tab->selectedPosition == QStyleOptionTab::PreviousIsSelected
0
1814 extraClass |= PseudoClass_PreviousSelected;
never executed: extraClass |= PseudoClass_PreviousSelected;
0
1815 -
1816 switch (tab->shape) { -
1817 case QTabBar::RoundedNorth: -
1818 case QTabBar::TriangularNorth: -
1819 extraClass |= PseudoClass_Top; -
1820 break;
never executed: break;
0
1821 case QTabBar::RoundedSouth: -
1822 case QTabBar::TriangularSouth: -
1823 extraClass |= PseudoClass_Bottom; -
1824 break;
never executed: break;
0
1825 case QTabBar::RoundedEast: -
1826 case QTabBar::TriangularEast: -
1827 extraClass |= PseudoClass_Left; -
1828 break;
never executed: break;
0
1829 case QTabBar::RoundedWest: -
1830 case QTabBar::TriangularWest: -
1831 extraClass |= PseudoClass_Right; -
1832 break;
never executed: break;
0
1833 default: -
1834 break;
never executed: break;
0
1835 } -
1836 -
1837 } else if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
partially evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16362
never executed: }
0-16362
1838 if (btn->features & QStyleOptionButton::Flat)
never evaluated: btn->features & QStyleOptionButton::Flat
0
1839 extraClass |= PseudoClass_Flat;
never executed: extraClass |= PseudoClass_Flat;
0
1840 if (btn->features & QStyleOptionButton::DefaultButton)
never evaluated: btn->features & QStyleOptionButton::DefaultButton
0
1841 extraClass |= PseudoClass_Default;
never executed: extraClass |= PseudoClass_Default;
0
1842 } else if (const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
evaluated: const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(opt)
TRUEFALSE
yes
Evaluation Count:2093
yes
Evaluation Count:14269
never executed: }
0-14269
1843 if (frm->lineWidth == 0)
evaluated: frm->lineWidth == 0
TRUEFALSE
yes
Evaluation Count:118
yes
Evaluation Count:1975
118-1975
1844 extraClass |= PseudoClass_Frameless;
executed: extraClass |= PseudoClass_Frameless;
Execution Count:118
118
1845 if (const QStyleOptionFrameV2 *frame2 = qstyleoption_cast<const QStyleOptionFrameV2 *>(opt)) {
partially evaluated: const QStyleOptionFrameV2 *frame2 = qstyleoption_cast<const QStyleOptionFrameV2 *>(opt)
TRUEFALSE
yes
Evaluation Count:2093
no
Evaluation Count:0
0-2093
1846 if (frame2->features & QStyleOptionFrameV2::Flat)
partially evaluated: frame2->features & QStyleOptionFrameV2::Flat
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2093
0-2093
1847 extraClass |= PseudoClass_Flat;
never executed: extraClass |= PseudoClass_Flat;
0
1848 }
executed: }
Execution Count:2093
2093
1849 }
executed: }
Execution Count:2093
2093
1850 -
1851 else if (const QStyleOptionToolBar *tb = qstyleoption_cast<const QStyleOptionToolBar *>(opt)) {
partially evaluated: const QStyleOptionToolBar *tb = qstyleoption_cast<const QStyleOptionToolBar *>(opt)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:14269
0-14269
1852 if (tb->toolBarArea == Qt::LeftToolBarArea)
never evaluated: tb->toolBarArea == Qt::LeftToolBarArea
0
1853 extraClass |= PseudoClass_Left;
never executed: extraClass |= PseudoClass_Left;
0
1854 else if (tb->toolBarArea == Qt::RightToolBarArea)
never evaluated: tb->toolBarArea == Qt::RightToolBarArea
0
1855 extraClass |= PseudoClass_Right;
never executed: extraClass |= PseudoClass_Right;
0
1856 else if (tb->toolBarArea == Qt::TopToolBarArea)
never evaluated: tb->toolBarArea == Qt::TopToolBarArea
0
1857 extraClass |= PseudoClass_Top;
never executed: extraClass |= PseudoClass_Top;
0
1858 else if (tb->toolBarArea == Qt::BottomToolBarArea)
never evaluated: tb->toolBarArea == Qt::BottomToolBarArea
0
1859 extraClass |= PseudoClass_Bottom;
never executed: extraClass |= PseudoClass_Bottom;
0
1860 -
1861 if (tb->positionWithinLine == QStyleOptionToolBar::Beginning)
never evaluated: tb->positionWithinLine == QStyleOptionToolBar::Beginning
0
1862 extraClass |= PseudoClass_First;
never executed: extraClass |= PseudoClass_First;
0
1863 else if (tb->positionWithinLine == QStyleOptionToolBar::Middle)
never evaluated: tb->positionWithinLine == QStyleOptionToolBar::Middle
0
1864 extraClass |= PseudoClass_Middle;
never executed: extraClass |= PseudoClass_Middle;
0
1865 else if (tb->positionWithinLine == QStyleOptionToolBar::End)
never evaluated: tb->positionWithinLine == QStyleOptionToolBar::End
0
1866 extraClass |= PseudoClass_Last;
never executed: extraClass |= PseudoClass_Last;
0
1867 else if (tb->positionWithinLine == QStyleOptionToolBar::OnlyOne)
never evaluated: tb->positionWithinLine == QStyleOptionToolBar::OnlyOne
0
1868 extraClass |= PseudoClass_OnlyOne;
never executed: extraClass |= PseudoClass_OnlyOne;
0
1869 } -
1870 -
1871 -
1872 else if (const QStyleOptionToolBoxV2 *tab = qstyleoption_cast<const QStyleOptionToolBoxV2 *>(opt)) {
partially evaluated: const QStyleOptionToolBoxV2 *tab = qstyleoption_cast<const QStyleOptionToolBoxV2 *>(opt)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:14269
0-14269
1873 if (tab->position == QStyleOptionToolBoxV2::OnlyOneTab)
never evaluated: tab->position == QStyleOptionToolBoxV2::OnlyOneTab
0
1874 extraClass |= PseudoClass_OnlyOne;
never executed: extraClass |= PseudoClass_OnlyOne;
0
1875 else if (tab->position == QStyleOptionToolBoxV2::Beginning)
never evaluated: tab->position == QStyleOptionToolBoxV2::Beginning
0
1876 extraClass |= PseudoClass_First;
never executed: extraClass |= PseudoClass_First;
0
1877 else if (tab->position == QStyleOptionToolBoxV2::End)
never evaluated: tab->position == QStyleOptionToolBoxV2::End
0
1878 extraClass |= PseudoClass_Last;
never executed: extraClass |= PseudoClass_Last;
0
1879 else if (tab->position == QStyleOptionToolBoxV2::Middle)
never evaluated: tab->position == QStyleOptionToolBoxV2::Middle
0
1880 extraClass |= PseudoClass_Middle;
never executed: extraClass |= PseudoClass_Middle;
0
1881 -
1882 if (tab->selectedPosition == QStyleOptionToolBoxV2::NextIsSelected)
never evaluated: tab->selectedPosition == QStyleOptionToolBoxV2::NextIsSelected
0
1883 extraClass |= PseudoClass_NextSelected;
never executed: extraClass |= PseudoClass_NextSelected;
0
1884 else if (tab->selectedPosition == QStyleOptionToolBoxV2::PreviousIsSelected)
never evaluated: tab->selectedPosition == QStyleOptionToolBoxV2::PreviousIsSelected
0
1885 extraClass |= PseudoClass_PreviousSelected;
never executed: extraClass |= PseudoClass_PreviousSelected;
0
1886 } -
1887 -
1888 -
1889 else if (const QStyleOptionDockWidgetV2 *dw = qstyleoption_cast<const QStyleOptionDockWidgetV2 *>(opt)) {
partially evaluated: const QStyleOptionDockWidgetV2 *dw = qstyleoption_cast<const QStyleOptionDockWidgetV2 *>(opt)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:14269
0-14269
1890 if (dw->verticalTitleBar)
never evaluated: dw->verticalTitleBar
0
1891 extraClass |= PseudoClass_Vertical;
never executed: extraClass |= PseudoClass_Vertical;
0
1892 else -
1893 extraClass |= PseudoClass_Horizontal;
never executed: extraClass |= PseudoClass_Horizontal;
0
1894 if (dw->closable)
never evaluated: dw->closable
0
1895 extraClass |= PseudoClass_Closable;
never executed: extraClass |= PseudoClass_Closable;
0
1896 if (dw->floatable)
never evaluated: dw->floatable
0
1897 extraClass |= PseudoClass_Floatable;
never executed: extraClass |= PseudoClass_Floatable;
0
1898 if (dw->movable)
never evaluated: dw->movable
0
1899 extraClass |= PseudoClass_Movable;
never executed: extraClass |= PseudoClass_Movable;
0
1900 }
never executed: }
0
1901 -
1902 -
1903 else if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) {
evaluated: const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)
TRUEFALSE
yes
Evaluation Count:118
yes
Evaluation Count:14151
118-14151
1904 if (vopt->features & QStyleOptionViewItem::Alternate)
partially evaluated: vopt->features & QStyleOptionViewItem::Alternate
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:118
0-118
1905 extraClass |= PseudoClass_Alternate;
never executed: extraClass |= PseudoClass_Alternate;
0
1906 if (vopt->viewItemPosition == QStyleOptionViewItem::OnlyOne)
evaluated: vopt->viewItemPosition == QStyleOptionViewItem::OnlyOne
TRUEFALSE
yes
Evaluation Count:64
yes
Evaluation Count:54
54-64
1907 extraClass |= PseudoClass_OnlyOne;
executed: extraClass |= PseudoClass_OnlyOne;
Execution Count:64
64
1908 else if (vopt->viewItemPosition == QStyleOptionViewItem::Beginning)
partially evaluated: vopt->viewItemPosition == QStyleOptionViewItem::Beginning
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:54
0-54
1909 extraClass |= PseudoClass_First;
never executed: extraClass |= PseudoClass_First;
0
1910 else if (vopt->viewItemPosition == QStyleOptionViewItem::End)
partially evaluated: vopt->viewItemPosition == QStyleOptionViewItem::End
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:54
0-54
1911 extraClass |= PseudoClass_Last;
never executed: extraClass |= PseudoClass_Last;
0
1912 else if (vopt->viewItemPosition == QStyleOptionViewItem::Middle)
partially evaluated: vopt->viewItemPosition == QStyleOptionViewItem::Middle
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:54
0-54
1913 extraClass |= PseudoClass_Middle;
never executed: extraClass |= PseudoClass_Middle;
0
1914 -
1915 } -
1916 -
1917 -
1918 -
1919 if (const QLineEdit *lineEdit = qobject_cast<const QLineEdit *>(obj)) {
evaluated: const QLineEdit *lineEdit = qobject_cast<const QLineEdit *>(obj)
TRUEFALSE
yes
Evaluation Count:49
yes
Evaluation Count:16335
49-16335
1920 state &= ~QStyle::State_Sunken; -
1921 if (lineEdit->hasFrame()) {
partially evaluated: lineEdit->hasFrame()
TRUEFALSE
yes
Evaluation Count:49
no
Evaluation Count:0
0-49
1922 extraClass &= ~PseudoClass_Frameless; -
1923 } else {
executed: }
Execution Count:49
49
1924 extraClass |= PseudoClass_Frameless; -
1925 }
never executed: }
0
1926 } else -
1927 -
1928 if (const QFrame *frm = qobject_cast<const QFrame *>(obj)) {
evaluated: const QFrame *frm = qobject_cast<const QFrame *>(obj)
TRUEFALSE
yes
Evaluation Count:7755
yes
Evaluation Count:8580
7755-8580
1929 if (frm->lineWidth() == 0)
partially evaluated: frm->lineWidth() == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7755
0-7755
1930 extraClass |= PseudoClass_Frameless;
never executed: extraClass |= PseudoClass_Frameless;
0
1931 }
executed: }
Execution Count:7755
7755
1932 } -
1933 -
1934 return renderRule(obj, pseudoElement, pseudoClass(state) | extraClass);
executed: return renderRule(obj, pseudoElement, pseudoClass(state) | extraClass);
Execution Count:31895
31895
1935} -
1936 -
1937bool QStyleSheetStyle::hasStyleRule(const QObject *obj, int part) const -
1938{ -
1939 QHash<int, bool> &cache = styleSheetCaches->hasStyleRuleCache[obj]; -
1940 QHash<int, bool>::const_iterator cacheIt = cache.constFind(part); -
1941 if (cacheIt != cache.constEnd())
evaluated: cacheIt != cache.constEnd()
TRUEFALSE
yes
Evaluation Count:4312
yes
Evaluation Count:788
788-4312
1942 return cacheIt.value();
executed: return cacheIt.value();
Execution Count:4312
4312
1943 -
1944 if (!initObject(obj))
partially evaluated: !initObject(obj)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:788
0-788
1945 return false;
never executed: return false;
0
1946 -
1947 -
1948 const QVector<StyleRule> &rules = styleRules(obj); -
1949 if (part == PseudoElement_None) {
partially evaluated: part == PseudoElement_None
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:788
0-788
1950 bool result = obj && !rules.isEmpty();
never evaluated: obj
never evaluated: !rules.isEmpty()
0
1951 cache[part] = result; -
1952 return result;
never executed: return result;
0
1953 } -
1954 -
1955 QString pseudoElement = QLatin1String(knownPseudoElements[part].name); -
1956 QVector<Declaration> declarations; -
1957 for (int i = 0; i < rules.count(); i++) {
evaluated: i < rules.count()
TRUEFALSE
yes
Evaluation Count:806
yes
Evaluation Count:787
787-806
1958 const Selector& selector = rules.at(i).selectors.at(0); -
1959 if (pseudoElement.compare(selector.pseudoElement(), Qt::CaseInsensitive) == 0) {
evaluated: pseudoElement.compare(selector.pseudoElement(), Qt::CaseInsensitive) == 0
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:805
1-805
1960 cache[part] = true; -
1961 return true;
executed: return true;
Execution Count:1
1
1962 } -
1963 }
executed: }
Execution Count:805
805
1964 -
1965 cache[part] = false; -
1966 return false;
executed: return false;
Execution Count:787
787
1967} -
1968 -
1969static Origin defaultOrigin(int pe) -
1970{ -
1971 switch (pe) { -
1972 case PseudoElement_ScrollBarAddPage: -
1973 case PseudoElement_ScrollBarSubPage: -
1974 case PseudoElement_ScrollBarAddLine: -
1975 case PseudoElement_ScrollBarSubLine: -
1976 case PseudoElement_ScrollBarFirst: -
1977 case PseudoElement_ScrollBarLast: -
1978 case PseudoElement_GroupBoxTitle: -
1979 case PseudoElement_GroupBoxIndicator: -
1980 case PseudoElement_ToolButtonMenu: -
1981 case PseudoElement_SliderAddPage: -
1982 case PseudoElement_SliderSubPage: -
1983 return Origin_Border;
never executed: return Origin_Border;
0
1984 -
1985 case PseudoElement_SpinBoxUpButton: -
1986 case PseudoElement_SpinBoxDownButton: -
1987 case PseudoElement_PushButtonMenuIndicator: -
1988 case PseudoElement_ComboBoxDropDown: -
1989 case PseudoElement_ToolButtonDownArrow: -
1990 case PseudoElement_MenuCheckMark: -
1991 case PseudoElement_MenuIcon: -
1992 case PseudoElement_MenuRightArrow: -
1993 return Origin_Padding;
never executed: return Origin_Padding;
0
1994 -
1995 case PseudoElement_Indicator: -
1996 case PseudoElement_ExclusiveIndicator: -
1997 case PseudoElement_ComboBoxArrow: -
1998 case PseudoElement_ScrollBarSlider: -
1999 case PseudoElement_ScrollBarUpArrow: -
2000 case PseudoElement_ScrollBarDownArrow: -
2001 case PseudoElement_ScrollBarLeftArrow: -
2002 case PseudoElement_ScrollBarRightArrow: -
2003 case PseudoElement_SpinBoxUpArrow: -
2004 case PseudoElement_SpinBoxDownArrow: -
2005 case PseudoElement_ToolButtonMenuArrow: -
2006 case PseudoElement_HeaderViewUpArrow: -
2007 case PseudoElement_HeaderViewDownArrow: -
2008 case PseudoElement_SliderGroove: -
2009 case PseudoElement_SliderHandle: -
2010 return Origin_Content;
never executed: return Origin_Content;
0
2011 -
2012 default: -
2013 return Origin_Margin;
never executed: return Origin_Margin;
0
2014 } -
2015}
never executed: }
0
2016 -
2017static Qt::Alignment defaultPosition(int pe) -
2018{ -
2019 switch (pe) { -
2020 case PseudoElement_Indicator: -
2021 case PseudoElement_ExclusiveIndicator: -
2022 case PseudoElement_MenuCheckMark: -
2023 case PseudoElement_MenuIcon: -
2024 return Qt::AlignLeft | Qt::AlignVCenter;
never executed: return Qt::AlignLeft | Qt::AlignVCenter;
0
2025 -
2026 case PseudoElement_ScrollBarAddLine: -
2027 case PseudoElement_ScrollBarLast: -
2028 case PseudoElement_SpinBoxDownButton: -
2029 case PseudoElement_PushButtonMenuIndicator: -
2030 case PseudoElement_ToolButtonDownArrow: -
2031 return Qt::AlignRight | Qt::AlignBottom;
never executed: return Qt::AlignRight | Qt::AlignBottom;
0
2032 -
2033 case PseudoElement_ScrollBarSubLine: -
2034 case PseudoElement_ScrollBarFirst: -
2035 case PseudoElement_SpinBoxUpButton: -
2036 case PseudoElement_ComboBoxDropDown: -
2037 case PseudoElement_ToolButtonMenu: -
2038 case PseudoElement_DockWidgetCloseButton: -
2039 case PseudoElement_DockWidgetFloatButton: -
2040 return Qt::AlignRight | Qt::AlignTop;
never executed: return Qt::AlignRight | Qt::AlignTop;
0
2041 -
2042 case PseudoElement_ScrollBarUpArrow: -
2043 case PseudoElement_ScrollBarDownArrow: -
2044 case PseudoElement_ScrollBarLeftArrow: -
2045 case PseudoElement_ScrollBarRightArrow: -
2046 case PseudoElement_SpinBoxUpArrow: -
2047 case PseudoElement_SpinBoxDownArrow: -
2048 case PseudoElement_ComboBoxArrow: -
2049 case PseudoElement_DownArrow: -
2050 case PseudoElement_ToolButtonMenuArrow: -
2051 case PseudoElement_SliderGroove: -
2052 return Qt::AlignCenter;
never executed: return Qt::AlignCenter;
0
2053 -
2054 case PseudoElement_GroupBoxTitle: -
2055 case PseudoElement_GroupBoxIndicator: -
2056 return Qt::AlignLeft | Qt::AlignTop;
never executed: return Qt::AlignLeft | Qt::AlignTop;
0
2057 -
2058 case PseudoElement_HeaderViewUpArrow: -
2059 case PseudoElement_HeaderViewDownArrow: -
2060 case PseudoElement_MenuRightArrow: -
2061 return Qt::AlignRight | Qt::AlignVCenter;
never executed: return Qt::AlignRight | Qt::AlignVCenter;
0
2062 -
2063 default: -
2064 return 0;
never executed: return 0;
0
2065 } -
2066}
never executed: }
0
2067 -
2068QSize QStyleSheetStyle::defaultSize(const QWidget *w, QSize sz, const QRect& rect, int pe) const -
2069{ -
2070 QStyle *base = baseStyle(); -
2071 -
2072 switch (pe) { -
2073 case PseudoElement_Indicator: -
2074 case PseudoElement_MenuCheckMark: -
2075 if (sz.width() == -1)
never evaluated: sz.width() == -1
0
2076 sz.setWidth(base->pixelMetric(PM_IndicatorWidth, 0, w));
never executed: sz.setWidth(base->pixelMetric(PM_IndicatorWidth, 0, w));
0
2077 if (sz.height() == -1)
never evaluated: sz.height() == -1
0
2078 sz.setHeight(base->pixelMetric(PM_IndicatorHeight, 0, w));
never executed: sz.setHeight(base->pixelMetric(PM_IndicatorHeight, 0, w));
0
2079 break;
never executed: break;
0
2080 -
2081 case PseudoElement_ExclusiveIndicator: -
2082 case PseudoElement_GroupBoxIndicator: -
2083 if (sz.width() == -1)
never evaluated: sz.width() == -1
0
2084 sz.setWidth(base->pixelMetric(PM_ExclusiveIndicatorWidth, 0, w));
never executed: sz.setWidth(base->pixelMetric(PM_ExclusiveIndicatorWidth, 0, w));
0
2085 if (sz.height() == -1)
never evaluated: sz.height() == -1
0
2086 sz.setHeight(base->pixelMetric(PM_ExclusiveIndicatorHeight, 0, w));
never executed: sz.setHeight(base->pixelMetric(PM_ExclusiveIndicatorHeight, 0, w));
0
2087 break;
never executed: break;
0
2088 -
2089 case PseudoElement_PushButtonMenuIndicator: { -
2090 int pm = base->pixelMetric(PM_MenuButtonIndicator, 0, w); -
2091 if (sz.width() == -1)
never evaluated: sz.width() == -1
0
2092 sz.setWidth(pm);
never executed: sz.setWidth(pm);
0
2093 if (sz.height() == -1)
never evaluated: sz.height() == -1
0
2094 sz.setHeight(pm);
never executed: sz.setHeight(pm);
0
2095 } -
2096 break;
never executed: break;
0
2097 -
2098 case PseudoElement_ComboBoxDropDown: -
2099 if (sz.width() == -1)
never evaluated: sz.width() == -1
0
2100 sz.setWidth(16);
never executed: sz.setWidth(16);
0
2101 break;
never executed: break;
0
2102 -
2103 case PseudoElement_ComboBoxArrow: -
2104 case PseudoElement_DownArrow: -
2105 case PseudoElement_ToolButtonMenuArrow: -
2106 case PseudoElement_ToolButtonDownArrow: -
2107 case PseudoElement_MenuRightArrow: -
2108 if (sz.width() == -1)
never evaluated: sz.width() == -1
0
2109 sz.setWidth(13);
never executed: sz.setWidth(13);
0
2110 if (sz.height() == -1)
never evaluated: sz.height() == -1
0
2111 sz.setHeight(13);
never executed: sz.setHeight(13);
0
2112 break;
never executed: break;
0
2113 -
2114 case PseudoElement_SpinBoxUpButton: -
2115 case PseudoElement_SpinBoxDownButton: -
2116 if (sz.width() == -1)
never evaluated: sz.width() == -1
0
2117 sz.setWidth(16);
never executed: sz.setWidth(16);
0
2118 if (sz.height() == -1)
never evaluated: sz.height() == -1
0
2119 sz.setHeight(rect.height()/2);
never executed: sz.setHeight(rect.height()/2);
0
2120 break;
never executed: break;
0
2121 -
2122 case PseudoElement_ToolButtonMenu: -
2123 if (sz.width() == -1)
never evaluated: sz.width() == -1
0
2124 sz.setWidth(base->pixelMetric(PM_MenuButtonIndicator, 0, w));
never executed: sz.setWidth(base->pixelMetric(PM_MenuButtonIndicator, 0, w));
0
2125 break;
never executed: break;
0
2126 -
2127 case PseudoElement_HeaderViewUpArrow: -
2128 case PseudoElement_HeaderViewDownArrow: { -
2129 int pm = base->pixelMetric(PM_HeaderMargin, 0, w); -
2130 if (sz.width() == -1)
never evaluated: sz.width() == -1
0
2131 sz.setWidth(pm);
never executed: sz.setWidth(pm);
0
2132 if (sz.height() == 1)
never evaluated: sz.height() == 1
0
2133 sz.setHeight(pm);
never executed: sz.setHeight(pm);
0
2134 break;
never executed: break;
0
2135 } -
2136 -
2137 case PseudoElement_ScrollBarFirst: -
2138 case PseudoElement_ScrollBarLast: -
2139 case PseudoElement_ScrollBarAddLine: -
2140 case PseudoElement_ScrollBarSubLine: -
2141 case PseudoElement_ScrollBarSlider: { -
2142 int pm = pixelMetric(QStyle::PM_ScrollBarExtent, 0, w); -
2143 if (sz.width() == -1)
never evaluated: sz.width() == -1
0
2144 sz.setWidth(pm);
never executed: sz.setWidth(pm);
0
2145 if (sz.height() == -1)
never evaluated: sz.height() == -1
0
2146 sz.setHeight(pm);
never executed: sz.setHeight(pm);
0
2147 break;
never executed: break;
0
2148 } -
2149 -
2150 case PseudoElement_DockWidgetCloseButton: -
2151 case PseudoElement_DockWidgetFloatButton: { -
2152 int iconSize = pixelMetric(PM_SmallIconSize, 0, w); -
2153 return QSize(iconSize, iconSize);
never executed: return QSize(iconSize, iconSize);
0
2154 } -
2155 -
2156 default: -
2157 break;
never executed: break;
0
2158 } -
2159 -
2160 -
2161 if (sz.height() == -1)
never evaluated: sz.height() == -1
0
2162 sz.setHeight(rect.height());
never executed: sz.setHeight(rect.height());
0
2163 if (sz.width() == -1)
never evaluated: sz.width() == -1
0
2164 sz.setWidth(rect.width());
never executed: sz.setWidth(rect.width());
0
2165 -
2166 return sz;
never executed: return sz;
0
2167} -
2168 -
2169static PositionMode defaultPositionMode(int pe) -
2170{ -
2171 switch (pe) { -
2172 case PseudoElement_ScrollBarFirst: -
2173 case PseudoElement_ScrollBarLast: -
2174 case PseudoElement_ScrollBarAddLine: -
2175 case PseudoElement_ScrollBarSubLine: -
2176 case PseudoElement_ScrollBarAddPage: -
2177 case PseudoElement_ScrollBarSubPage: -
2178 case PseudoElement_ScrollBarSlider: -
2179 case PseudoElement_SliderGroove: -
2180 case PseudoElement_SliderHandle: -
2181 case PseudoElement_TabWidgetPane: -
2182 return PositionMode_Absolute;
never executed: return PositionMode_Absolute;
0
2183 default: -
2184 return PositionMode_Static;
never executed: return PositionMode_Static;
0
2185 } -
2186}
never executed: }
0
2187 -
2188QRect QStyleSheetStyle::positionRect(const QWidget *w, const QRenderRule &rule2, int pe, -
2189 const QRect &originRect, Qt::LayoutDirection dir) const -
2190{ -
2191 const QStyleSheetPositionData *p = rule2.position(); -
2192 PositionMode mode = (p && p->mode != PositionMode_Unknown) ? p->mode : defaultPositionMode(pe);
never evaluated: p
never evaluated: p->mode != PositionMode_Unknown
0
2193 Qt::Alignment position = (p && p->position != 0) ? p->position : defaultPosition(pe);
never evaluated: p
never evaluated: p->position != 0
0
2194 QRect r; -
2195 -
2196 if (mode != PositionMode_Absolute) {
never evaluated: mode != PositionMode_Absolute
0
2197 QSize sz = defaultSize(w, rule2.size(), originRect, pe); -
2198 sz = sz.expandedTo(rule2.minimumContentsSize()); -
2199 r = QStyle::alignedRect(dir, position, sz, originRect); -
2200 if (p) {
never evaluated: p
0
2201 int left = p->left ? p->left : -p->right;
never evaluated: p->left
0
2202 int top = p->top ? p->top : -p->bottom;
never evaluated: p->top
0
2203 r.translate(dir == Qt::LeftToRight ? left : -left, top); -
2204 }
never executed: }
0
2205 } else {
never executed: }
0
2206 r = p ? originRect.adjusted(dir == Qt::LeftToRight ? p->left : p->right, p->top,
never evaluated: p
0
2207 dir == Qt::LeftToRight ? -p->right : -p->left, -p->bottom) -
2208 : originRect; -
2209 if (rule2.hasContentsSize()) {
never evaluated: rule2.hasContentsSize()
0
2210 QSize sz = rule2.size().expandedTo(rule2.minimumContentsSize()); -
2211 if (sz.width() == -1) sz.setWidth(r.width());
never evaluated: sz.width() == -1
never executed: sz.setWidth(r.width());
0
2212 if (sz.height() == -1) sz.setHeight(r.height());
never evaluated: sz.height() == -1
never executed: sz.setHeight(r.height());
0
2213 r = QStyle::alignedRect(dir, position, sz, r); -
2214 }
never executed: }
0
2215 }
never executed: }
0
2216 return r;
never executed: return r;
0
2217} -
2218 -
2219QRect QStyleSheetStyle::positionRect(const QWidget *w, const QRenderRule& rule1, const QRenderRule& rule2, int pe, -
2220 const QRect& rect, Qt::LayoutDirection dir) const -
2221{ -
2222 const QStyleSheetPositionData *p = rule2.position(); -
2223 Origin origin = (p && p->origin != Origin_Unknown) ? p->origin : defaultOrigin(pe);
never evaluated: p
never evaluated: p->origin != Origin_Unknown
0
2224 QRect originRect = rule1.originRect(rect, origin); -
2225 return positionRect(w, rule2, pe, originRect, dir);
never executed: return positionRect(w, rule2, pe, originRect, dir);
0
2226} -
2227 -
2228 -
2229 -
2230 -
2231 -
2232 -
2233static QWidget *embeddedWidget(QWidget *w) -
2234{ -
2235 -
2236 if (QComboBox *cmb = qobject_cast<QComboBox *>(w)) {
partially evaluated: QComboBox *cmb = qobject_cast<QComboBox *>(w)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1996
0-1996
2237 if (cmb->isEditable())
never evaluated: cmb->isEditable()
0
2238 return cmb->lineEdit();
never executed: return cmb->lineEdit();
0
2239 else -
2240 return cmb;
never executed: return cmb;
0
2241 } -
2242 -
2243 -
2244 -
2245 if (QAbstractSpinBox *sb = qobject_cast<QAbstractSpinBox *>(w))
partially evaluated: QAbstractSpinBox *sb = qobject_cast<QAbstractSpinBox *>(w)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1996
0-1996
2246 return sb->findChild<QLineEdit *>();
never executed: return sb->findChild<QLineEdit *>();
0
2247 -
2248 -
2249 -
2250 if (QAbstractScrollArea *sa = qobject_cast<QAbstractScrollArea *>(w))
evaluated: QAbstractScrollArea *sa = qobject_cast<QAbstractScrollArea *>(w)
TRUEFALSE
yes
Evaluation Count:394
yes
Evaluation Count:1602
394-1602
2251 return sa->viewport();
executed: return sa->viewport();
Execution Count:394
394
2252 -
2253 -
2254 return w;
executed: return w;
Execution Count:1602
1602
2255} -
2256static QWidget *containerWidget(const QWidget *w) -
2257{ -
2258 -
2259 if (qobject_cast<const QLineEdit *>(w)) {
evaluated: qobject_cast<const QLineEdit *>(w)
TRUEFALSE
yes
Evaluation Count:11
yes
Evaluation Count:4333
11-4333
2260 -
2261 -
2262 if (qobject_cast<const QComboBox *>(w->parentWidget()))
partially evaluated: qobject_cast<const QComboBox *>(w->parentWidget())
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:11
0-11
2263 return w->parentWidget();
never executed: return w->parentWidget();
0
2264 -
2265 -
2266 if (qobject_cast<const QAbstractSpinBox *>(w->parentWidget()))
evaluated: qobject_cast<const QAbstractSpinBox *>(w->parentWidget())
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:9
2-9
2267 return w->parentWidget();
executed: return w->parentWidget();
Execution Count:2
2
2268 -
2269 }
executed: }
Execution Count:9
9
2270 -
2271 -
2272 -
2273 if (const QAbstractScrollArea *sa = qobject_cast<const QAbstractScrollArea *>(w->parentWidget())) {
evaluated: const QAbstractScrollArea *sa = qobject_cast<const QAbstractScrollArea *>(w->parentWidget())
TRUEFALSE
yes
Evaluation Count:2350
yes
Evaluation Count:1992
1992-2350
2274 if (sa->viewport() == w)
evaluated: sa->viewport() == w
TRUEFALSE
yes
Evaluation Count:782
yes
Evaluation Count:1568
782-1568
2275 return w->parentWidget();
executed: return w->parentWidget();
Execution Count:782
782
2276 }
executed: }
Execution Count:1568
1568
2277 -
2278 -
2279 return const_cast<QWidget *>(w);
executed: return const_cast<QWidget *>(w);
Execution Count:3560
3560
2280} -
2281 -
2282 -
2283 -
2284 -
2285static bool unstylable(const QWidget *w) -
2286{ -
2287 if (w->windowType() == Qt::Desktop)
partially evaluated: w->windowType() == Qt::Desktop
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2388
0-2388
2288 return true;
never executed: return true;
0
2289 -
2290 if (!w->styleSheet().isEmpty())
evaluated: !w->styleSheet().isEmpty()
TRUEFALSE
yes
Evaluation Count:399
yes
Evaluation Count:1989
399-1989
2291 return false;
executed: return false;
Execution Count:399
399
2292 -
2293 if (containerWidget(w) != w)
evaluated: containerWidget(w) != w
TRUEFALSE
yes
Evaluation Count:393
yes
Evaluation Count:1596
393-1596
2294 return true;
executed: return true;
Execution Count:393
393
2295 -
2296 -
2297 -
2298 else if (qobject_cast<const QFrame *>(w)) {
evaluated: qobject_cast<const QFrame *>(w)
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:1590
6-1590
2299 if (0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
0-6
2300 -
2301 || qobject_cast<const QComboBox *>(w->parentWidget())
partially evaluated: qobject_cast<const QComboBox *>(w->parentWidget())
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
0-6
2302 -
2303 ) -
2304 return true;
never executed: return true;
0
2305 }
executed: }
Execution Count:6
6
2306 -
2307 return false;
executed: return false;
Execution Count:1596
1596
2308} -
2309 -
2310static quint64 extendedPseudoClass(const QWidget *w) -
2311{ -
2312 quint64 pc = w->isWindow() ? quint64(PseudoClass_Window) : 0;
evaluated: w->isWindow()
TRUEFALSE
yes
Evaluation Count:2320
yes
Evaluation Count:7861
2320-7861
2313 if (const QAbstractSlider *slider = qobject_cast<const QAbstractSlider *>(w)) {
evaluated: const QAbstractSlider *slider = qobject_cast<const QAbstractSlider *>(w)
TRUEFALSE
yes
Evaluation Count:3920
yes
Evaluation Count:6261
3920-6261
2314 pc |= ((slider->orientation() == Qt::Vertical) ? PseudoClass_Vertical : PseudoClass_Horizontal);
evaluated: (slider->orientation() == Qt::Vertical)
TRUEFALSE
yes
Evaluation Count:1960
yes
Evaluation Count:1960
1960
2315 } else
executed: }
Execution Count:3920
3920
2316 -
2317 if (const QComboBox *combo = qobject_cast<const QComboBox *>(w)) {
partially evaluated: const QComboBox *combo = qobject_cast<const QComboBox *>(w)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6261
0-6261
2318 if (combo->isEditable())
never evaluated: combo->isEditable()
0
2319 pc |= (combo->isEditable() ? PseudoClass_Editable : PseudoClass_ReadOnly);
never evaluated: combo->isEditable()
never executed: pc |= (combo->isEditable() ? PseudoClass_Editable : PseudoClass_ReadOnly);
0
2320 } else
never executed: }
0
2321 -
2322 -
2323 if (const QLineEdit *edit = qobject_cast<const QLineEdit *>(w)) {
evaluated: const QLineEdit *edit = qobject_cast<const QLineEdit *>(w)
TRUEFALSE
yes
Evaluation Count:17
yes
Evaluation Count:6244
17-6244
2324 pc |= (edit->isReadOnly() ? PseudoClass_ReadOnly : PseudoClass_Editable);
partially evaluated: edit->isReadOnly()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:17
0-17
2325 } else
executed: }
Execution Count:17
17
2326 -
2327 { }
executed: }
Execution Count:6244
6244
2328 return pc;
executed: return pc;
Execution Count:10181
10181
2329} -
2330 -
2331 -
2332 -
2333 -
2334 -
2335 -
2336 -
2337void QStyleSheetStyle::setGeometry(QWidget *w) -
2338{ -
2339 QRenderRule rule = renderRule(w, PseudoElement_None, PseudoClass_Enabled | extendedPseudoClass(w)); -
2340 const QStyleSheetGeometryData *geo = rule.geometry(); -
2341 if (w->property("_q_stylesheet_minw").toBool()
partially evaluated: w->property("_q_stylesheet_minw").toBool()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1957
0-1957
2342 && ((!rule.hasGeometry() || geo->minWidth == -1))) {
never evaluated: !rule.hasGeometry()
never evaluated: geo->minWidth == -1
0
2343 w->setMinimumWidth(0); -
2344 w->setProperty("_q_stylesheet_minw", QVariant()); -
2345 }
never executed: }
0
2346 if (w->property("_q_stylesheet_minh").toBool()
partially evaluated: w->property("_q_stylesheet_minh").toBool()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1957
0-1957
2347 && ((!rule.hasGeometry() || geo->minHeight == -1))) {
never evaluated: !rule.hasGeometry()
never evaluated: geo->minHeight == -1
0
2348 w->setMinimumHeight(0); -
2349 w->setProperty("_q_stylesheet_minh", QVariant()); -
2350 }
never executed: }
0
2351 if (w->property("_q_stylesheet_maxw").toBool()
partially evaluated: w->property("_q_stylesheet_maxw").toBool()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1957
0-1957
2352 && ((!rule.hasGeometry() || geo->maxWidth == -1))) {
never evaluated: !rule.hasGeometry()
never evaluated: geo->maxWidth == -1
0
2353 w->setMaximumWidth(((1<<24)-1)); -
2354 w->setProperty("_q_stylesheet_maxw", QVariant()); -
2355 }
never executed: }
0
2356 if (w->property("_q_stylesheet_maxh").toBool()
partially evaluated: w->property("_q_stylesheet_maxh").toBool()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1957
0-1957
2357 && ((!rule.hasGeometry() || geo->maxHeight == -1))) {
never evaluated: !rule.hasGeometry()
never evaluated: geo->maxHeight == -1
0
2358 w->setMaximumHeight(((1<<24)-1)); -
2359 w->setProperty("_q_stylesheet_maxh", QVariant()); -
2360 }
never executed: }
0
2361 -
2362 -
2363 if (rule.hasGeometry()) {
partially evaluated: rule.hasGeometry()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1957
0-1957
2364 if (geo->minWidth != -1) {
never evaluated: geo->minWidth != -1
0
2365 w->setProperty("_q_stylesheet_minw", true); -
2366 w->setMinimumWidth(rule.boxSize(QSize(qMax(geo->width, geo->minWidth), 0)).width()); -
2367 }
never executed: }
0
2368 if (geo->minHeight != -1) {
never evaluated: geo->minHeight != -1
0
2369 w->setProperty("_q_stylesheet_minh", true); -
2370 w->setMinimumHeight(rule.boxSize(QSize(0, qMax(geo->height, geo->minHeight))).height()); -
2371 }
never executed: }
0
2372 if (geo->maxWidth != -1) {
never evaluated: geo->maxWidth != -1
0
2373 w->setProperty("_q_stylesheet_maxw", true); -
2374 w->setMaximumWidth(rule.boxSize(QSize(qMin(geo->width == -1 ? ((1<<24)-1) : geo->width, -
2375 geo->maxWidth == -1 ? ((1<<24)-1) : geo->maxWidth), 0)).width()); -
2376 }
never executed: }
0
2377 if (geo->maxHeight != -1) {
never evaluated: geo->maxHeight != -1
0
2378 w->setProperty("_q_stylesheet_maxh", true); -
2379 w->setMaximumHeight(rule.boxSize(QSize(0, qMin(geo->height == -1 ? ((1<<24)-1) : geo->height, -
2380 geo->maxHeight == -1 ? ((1<<24)-1) : geo->maxHeight))).height()); -
2381 }
never executed: }
0
2382 }
never executed: }
0
2383}
executed: }
Execution Count:1957
1957
2384 -
2385void QStyleSheetStyle::setProperties(QWidget *w) -
2386{ -
2387 -
2388 -
2389 -
2390 -
2391 const QVector<Declaration> decls = declarations(styleRules(w), QString()); -
2392 QVector<int> finals; -
2393 -
2394 { -
2395 -
2396 QSet<const QString> propertySet; -
2397 for (int i = decls.count() - 1; i >= 0; --i) {
evaluated: i >= 0
TRUEFALSE
yes
Evaluation Count:1208
yes
Evaluation Count:1957
1208-1957
2398 const QString property = decls.at(i).d->property; -
2399 if (!property.startsWith(QString::fromUtf8("" "qproperty-" "", sizeof("qproperty-") - 1), Qt::CaseInsensitive))
partially evaluated: !property.startsWith(QString::fromUtf8("" "qproperty-" "", sizeof("qproperty-") - 1), Qt::CaseInsensitive)
TRUEFALSE
yes
Evaluation Count:1208
no
Evaluation Count:0
0-1208
2400 continue;
executed: continue;
Execution Count:1208
1208
2401 if (!propertySet.contains(property)) {
never evaluated: !propertySet.contains(property)
0
2402 propertySet.insert(property); -
2403 finals.append(i); -
2404 }
never executed: }
0
2405 }
never executed: }
0
2406 } -
2407 -
2408 for (int i = finals.count() - 1; i >= 0; --i) {
partially evaluated: i >= 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1957
0-1957
2409 const Declaration &decl = decls.at(finals[i]); -
2410 QString property = decl.d->property; -
2411 property.remove(0, 10); -
2412 -
2413 const QMetaObject *metaObject = w->metaObject(); -
2414 int index = metaObject->indexOfProperty(property.toLatin1()); -
2415 if (index == -1) {
never evaluated: index == -1
0
2416 QMessageLogger("styles/qstylesheetstyle.cpp", 2515, __PRETTY_FUNCTION__).warning() << w << " does not have a property named " << property; -
2417 continue;
never executed: continue;
0
2418 } -
2419 const QMetaProperty metaProperty = metaObject->property(index); -
2420 if (!metaProperty.isWritable() || !metaProperty.isDesignable()) {
never evaluated: !metaProperty.isWritable()
never evaluated: !metaProperty.isDesignable()
0
2421 QMessageLogger("styles/qstylesheetstyle.cpp", 2520, __PRETTY_FUNCTION__).warning() << w << " cannot design property named " << property; -
2422 continue;
never executed: continue;
0
2423 } -
2424 -
2425 QVariant v; -
2426 const QVariant value = w->property(property.toLatin1()); -
2427 switch (value.type()) { -
2428 case QVariant::Icon: v = decl.iconValue(); break;
never executed: break;
0
2429 case QVariant::Image: v = QImage(decl.uriValue()); break;
never executed: break;
0
2430 case QVariant::Pixmap: v = QPixmap(decl.uriValue()); break;
never executed: break;
0
2431 case QVariant::Rect: v = decl.rectValue(); break;
never executed: break;
0
2432 case QVariant::Size: v = decl.sizeValue(); break;
never executed: break;
0
2433 case QVariant::Color: v = decl.colorValue(); break;
never executed: break;
0
2434 case QVariant::Brush: v = decl.brushValue(); break;
never executed: break;
0
2435 -
2436 case QVariant::KeySequence: v = QKeySequence(decl.d->values.at(0).variant.toString()); break;
never executed: break;
0
2437 -
2438 default: v = decl.d->values.at(0).variant; break;
never executed: break;
0
2439 } -
2440 -
2441 w->setProperty(property.toLatin1(), v); -
2442 }
never executed: }
0
2443}
executed: }
Execution Count:1957
1957
2444 -
2445void QStyleSheetStyle::setPalette(QWidget *w) -
2446{ -
2447 struct RuleRoleMap { -
2448 int state; -
2449 QPalette::ColorGroup group; -
2450 } map[3] = { -
2451 { int(PseudoClass_Active | PseudoClass_Enabled), QPalette::Active }, -
2452 { PseudoClass_Disabled, QPalette::Disabled }, -
2453 { PseudoClass_Enabled, QPalette::Inactive } -
2454 }; -
2455 -
2456 QPalette p = w->palette(); -
2457 QWidget *ew = embeddedWidget(w); -
2458 -
2459 for (int i = 0; i < 3; i++) {
evaluated: i < 3
TRUEFALSE
yes
Evaluation Count:5871
yes
Evaluation Count:1957
1957-5871
2460 QRenderRule rule = renderRule(w, PseudoElement_None, map[i].state | extendedPseudoClass(w)); -
2461 if (i == 0) {
evaluated: i == 0
TRUEFALSE
yes
Evaluation Count:1957
yes
Evaluation Count:3914
1957-3914
2462 if (!w->property("_q_styleSheetWidgetFont").isValid()) {
partially evaluated: !w->property("_q_styleSheetWidgetFont").isValid()
TRUEFALSE
yes
Evaluation Count:1957
no
Evaluation Count:0
0-1957
2463 saveWidgetFont(w, w->font()); -
2464 }
executed: }
Execution Count:1957
1957
2465 updateStyleSheetFont(w); -
2466 if (ew != w)
evaluated: ew != w
TRUEFALSE
yes
Evaluation Count:389
yes
Evaluation Count:1568
389-1568
2467 updateStyleSheetFont(ew);
executed: updateStyleSheetFont(ew);
Execution Count:389
389
2468 }
executed: }
Execution Count:1957
1957
2469 -
2470 rule.configurePalette(&p, map[i].group, ew, ew != w); -
2471 }
executed: }
Execution Count:5871
5871
2472 -
2473 styleSheetCaches->customPaletteWidgets.insert(w, w->palette()); -
2474 w->setPalette(p); -
2475 if (ew != w)
evaluated: ew != w
TRUEFALSE
yes
Evaluation Count:389
yes
Evaluation Count:1568
389-1568
2476 ew->setPalette(p);
executed: ew->setPalette(p);
Execution Count:389
389
2477}
executed: }
Execution Count:1957
1957
2478 -
2479void QStyleSheetStyle::unsetPalette(QWidget *w) -
2480{ -
2481 if (styleSheetCaches->customPaletteWidgets.contains(w)) {
evaluated: styleSheetCaches->customPaletteWidgets.contains(w)
TRUEFALSE
yes
Evaluation Count:14
yes
Evaluation Count:1957
14-1957
2482 QPalette p = styleSheetCaches->customPaletteWidgets.value(w); -
2483 w->setPalette(p); -
2484 QWidget *ew = embeddedWidget(w); -
2485 if (ew != w)
evaluated: ew != w
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:12
2-12
2486 ew->setPalette(p);
executed: ew->setPalette(p);
Execution Count:2
2
2487 styleSheetCaches->customPaletteWidgets.remove(w); -
2488 }
executed: }
Execution Count:14
14
2489 QVariant oldFont = w->property("_q_styleSheetWidgetFont"); -
2490 if (oldFont.isValid()) {
evaluated: oldFont.isValid()
TRUEFALSE
yes
Evaluation Count:14
yes
Evaluation Count:1957
14-1957
2491 w->setFont(qvariant_cast<QFont>(oldFont)); -
2492 }
executed: }
Execution Count:14
14
2493 if (styleSheetCaches->autoFillDisabledWidgets.contains(w)) {
partially evaluated: styleSheetCaches->autoFillDisabledWidgets.contains(w)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1971
0-1971
2494 embeddedWidget(w)->setAutoFillBackground(true); -
2495 styleSheetCaches->autoFillDisabledWidgets.remove(w); -
2496 }
never executed: }
0
2497}
executed: }
Execution Count:1971
1971
2498 -
2499static void updateObjects(const QList<const QObject *>& objects) -
2500{ -
2501 if (!styleSheetCaches->styleRulesCache.isEmpty() || !styleSheetCaches->hasStyleRuleCache.isEmpty() || !styleSheetCaches->renderRulesCache.isEmpty()) {
never evaluated: !styleSheetCaches->styleRulesCache.isEmpty()
never evaluated: !styleSheetCaches->hasStyleRuleCache.isEmpty()
never evaluated: !styleSheetCaches->renderRulesCache.isEmpty()
0
2502 for (int i = 0; i < objects.size(); ++i) {
never evaluated: i < objects.size()
0
2503 const QObject *object = objects.at(i); -
2504 styleSheetCaches->styleRulesCache.remove(object); -
2505 styleSheetCaches->hasStyleRuleCache.remove(object); -
2506 styleSheetCaches->renderRulesCache.remove(object); -
2507 }
never executed: }
0
2508 }
never executed: }
0
2509 -
2510 QWidgetList widgets; -
2511 for (QForeachContainer<__typeof__(objects)> _container_(objects); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (const QObject *object = *_container_.i;; __extension__ ({--_container_.brk; break;})) { -
2512 if (QWidget *w = qobject_cast<QWidget*>(const_cast<QObject*>(object)))
never evaluated: QWidget *w = qobject_cast<QWidget*>(const_cast<QObject*>(object))
0
2513 widgets << w;
never executed: widgets << w;
0
2514 }
never executed: }
0
2515 -
2516 QEvent event(QEvent::StyleChange); -
2517 for (QForeachContainer<__typeof__(widgets)> _container_(widgets); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QWidget *widget = *_container_.i;; __extension__ ({--_container_.brk; break;})) { -
2518 widget->style()->polish(widget); -
2519 QApplication::sendEvent(widget, &event); -
2520 }
never executed: }
0
2521}
never executed: }
0
2522 -
2523 -
2524 -
2525int QStyleSheetStyle::numinstances = 0; -
2526 -
2527QStyleSheetStyle::QStyleSheetStyle(QStyle *base) -
2528 : QWindowsStyle(*new QStyleSheetStylePrivate), base(base), refcount(1) -
2529{ -
2530 ++numinstances; -
2531 if (numinstances == 1) {
evaluated: numinstances == 1
TRUEFALSE
yes
Evaluation Count:401
yes
Evaluation Count:1
1-401
2532 styleSheetCaches = new QStyleSheetStyleCaches; -
2533 }
executed: }
Execution Count:401
401
2534}
executed: }
Execution Count:402
402
2535 -
2536QStyleSheetStyle::~QStyleSheetStyle() -
2537{ -
2538 --numinstances; -
2539 if (numinstances == 0) {
evaluated: numinstances == 0
TRUEFALSE
yes
Evaluation Count:401
yes
Evaluation Count:1
1-401
2540 delete styleSheetCaches; -
2541 }
executed: }
Execution Count:401
401
2542}
executed: }
Execution Count:402
402
2543QStyle *QStyleSheetStyle::baseStyle() const -
2544{ -
2545 if (base)
evaluated: base
TRUEFALSE
yes
Evaluation Count:56458
yes
Evaluation Count:1048
1048-56458
2546 return base;
executed: return base;
Execution Count:56458
56458
2547 if (QStyleSheetStyle *me = qobject_cast<QStyleSheetStyle *>(QApplication::style()))
partially evaluated: QStyleSheetStyle *me = qobject_cast<QStyleSheetStyle *>(QApplication::style())
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1048
0-1048
2548 return me->base;
never executed: return me->base;
0
2549 return QApplication::style();
executed: return QApplication::style();
Execution Count:1048
1048
2550} -
2551 -
2552void QStyleSheetStyleCaches::objectDestroyed(QObject *o) -
2553{ -
2554 styleRulesCache.remove(o); -
2555 hasStyleRuleCache.remove(o); -
2556 renderRulesCache.remove(o); -
2557 customPaletteWidgets.remove((const QWidget *)o); -
2558 styleSheetCache.remove(o); -
2559 autoFillDisabledWidgets.remove((const QWidget *)o); -
2560}
executed: }
Execution Count:1981
1981
2561 -
2562void QStyleSheetStyleCaches::styleDestroyed(QObject *o) -
2563{ -
2564 styleSheetCache.remove(o); -
2565}
never executed: }
0
2566 -
2567 -
2568 -
2569 -
2570 -
2571bool QStyleSheetStyle::initObject(const QObject *obj) const -
2572{ -
2573 if (!obj)
evaluated: !obj
TRUEFALSE
yes
Evaluation Count:778
yes
Evaluation Count:19945
778-19945
2574 return false;
executed: return false;
Execution Count:778
778
2575 if (const QWidget *w = qobject_cast<const QWidget*>(obj)) {
partially evaluated: const QWidget *w = qobject_cast<const QWidget*>(obj)
TRUEFALSE
yes
Evaluation Count:19945
no
Evaluation Count:0
0-19945
2576 if (w->testAttribute(Qt::WA_StyleSheet))
evaluated: w->testAttribute(Qt::WA_StyleSheet)
TRUEFALSE
yes
Evaluation Count:17557
yes
Evaluation Count:2388
2388-17557
2577 return true;
executed: return true;
Execution Count:17557
17557
2578 if (unstylable(w))
evaluated: unstylable(w)
TRUEFALSE
yes
Evaluation Count:393
yes
Evaluation Count:1995
393-1995
2579 return false;
executed: return false;
Execution Count:393
393
2580 const_cast<QWidget *>(w)->setAttribute(Qt::WA_StyleSheet, true); -
2581 }
executed: }
Execution Count:1995
1995
2582 -
2583 QObject::connect(obj, "2""destroyed(QObject*)", styleSheetCaches, "1""objectDestroyed(QObject*)", Qt::UniqueConnection); -
2584 return true;
executed: return true;
Execution Count:1995
1995
2585} -
2586 -
2587void QStyleSheetStyle::polish(QWidget *w) -
2588{ -
2589 baseStyle()->polish(w); -
2590 if (globalStyleSheetStyle != 0 && globalStyleSheetStyle != this) { return; } QStyleSheetStyleRecursionGuard recursion_guard(this);
partially evaluated: globalStyleSheetStyle != 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2346
never evaluated: globalStyleSheetStyle != this
never executed: return;
0-2346
2591 -
2592 if (!initObject(w))
evaluated: !initObject(w)
TRUEFALSE
yes
Evaluation Count:389
yes
Evaluation Count:1957
389-1957
2593 return;
executed: return;
Execution Count:389
389
2594 -
2595 if (styleSheetCaches->styleRulesCache.contains(w)) {
evaluated: styleSheetCaches->styleRulesCache.contains(w)
TRUEFALSE
yes
Evaluation Count:397
yes
Evaluation Count:1560
397-1560
2596 -
2597 -
2598 styleSheetCaches->styleRulesCache.remove(w); -
2599 styleSheetCaches->hasStyleRuleCache.remove(w); -
2600 styleSheetCaches->renderRulesCache.remove(w); -
2601 }
executed: }
Execution Count:397
397
2602 setGeometry(w); -
2603 setProperties(w); -
2604 unsetPalette(w); -
2605 setPalette(w); -
2606 -
2607 -
2608 QVector<StyleRule> rules = styleRules(w); -
2609 for (int i = 0; i < rules.count(); i++) {
evaluated: i < rules.count()
TRUEFALSE
yes
Evaluation Count:1211
yes
Evaluation Count:1957
1211-1957
2610 const Selector& selector = rules.at(i).selectors.at(0); -
2611 quint64 negated = 0; -
2612 quint64 cssClass = selector.pseudoClass(&negated); -
2613 if ( cssClass & PseudoClass_Hover || negated & PseudoClass_Hover) {
partially evaluated: cssClass & PseudoClass_Hover
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1211
partially evaluated: negated & PseudoClass_Hover
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1211
0-1211
2614 w->setAttribute(Qt::WA_Hover); -
2615 embeddedWidget(w)->setAttribute(Qt::WA_Hover); -
2616 }
never executed: }
0
2617 }
executed: }
Execution Count:1211
1211
2618 -
2619 -
2620 -
2621 if (QAbstractScrollArea *sa = qobject_cast<QAbstractScrollArea *>(w)) {
evaluated: QAbstractScrollArea *sa = qobject_cast<QAbstractScrollArea *>(w)
TRUEFALSE
yes
Evaluation Count:389
yes
Evaluation Count:1568
389-1568
2622 QRenderRule rule = renderRule(sa, PseudoElement_None, PseudoClass_Enabled); -
2623 if ((rule.hasBorder() && rule.border()->hasBorderImage())
partially evaluated: rule.hasBorder()
TRUEFALSE
yes
Evaluation Count:389
no
Evaluation Count:0
partially evaluated: rule.border()->hasBorderImage()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:389
0-389
2624 || (rule.hasBackground() && !rule.background()->pixmap.isNull())) {
partially evaluated: rule.hasBackground()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:389
never evaluated: !rule.background()->pixmap.isNull()
0-389
2625 QObject::connect(sa->horizontalScrollBar(), "2""valueChanged(int)", -
2626 sa, "1""update()", Qt::UniqueConnection); -
2627 QObject::connect(sa->verticalScrollBar(), "2""valueChanged(int)", -
2628 sa, "1""update()", Qt::UniqueConnection); -
2629 }
never executed: }
0
2630 }
executed: }
Execution Count:389
389
2631 -
2632 -
2633 QRenderRule rule = renderRule(w, PseudoElement_None, PseudoClass_Any); -
2634 if (rule.hasDrawable() || rule.hasBox()) {
evaluated: rule.hasDrawable()
TRUEFALSE
yes
Evaluation Count:25
yes
Evaluation Count:1932
partially evaluated: rule.hasBox()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1932
0-1932
2635 if (w->metaObject() == &QWidget::staticMetaObject
evaluated: w->metaObject() == &QWidget::staticMetaObject
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:19
6-19
2636 -
2637 || qobject_cast<QHeaderView *>(w)
evaluated: qobject_cast<QHeaderView *>(w)
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:17
2-17
2638 -
2639 -
2640 || qobject_cast<QTabBar *>(w)
partially evaluated: qobject_cast<QTabBar *>(w)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:17
0-17
2641 -
2642 -
2643 || qobject_cast<QFrame *>(w)
evaluated: qobject_cast<QFrame *>(w)
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:16
1-16
2644 -
2645 -
2646 || qobject_cast<QMainWindow *>(w)
partially evaluated: qobject_cast<QMainWindow *>(w)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16
0-16
2647 -
2648 -
2649 || qobject_cast<QMdiSubWindow *>(w)
partially evaluated: qobject_cast<QMdiSubWindow *>(w)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16
0-16
2650 -
2651 -
2652 || qobject_cast<QMenuBar *>(w)
partially evaluated: qobject_cast<QMenuBar *>(w)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16
0-16
2653 -
2654 || qobject_cast<QDialog *>(w)) {
partially evaluated: qobject_cast<QDialog *>(w)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16
0-16
2655 w->setAttribute(Qt::WA_StyledBackground, true); -
2656 }
executed: }
Execution Count:9
9
2657 QWidget *ew = embeddedWidget(w); -
2658 if (ew->autoFillBackground()) {
evaluated: ew->autoFillBackground()
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:22
3-22
2659 ew->setAutoFillBackground(false); -
2660 styleSheetCaches->autoFillDisabledWidgets.insert(w); -
2661 if (ew != w) {
partially evaluated: ew != w
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
0-3
2662 -
2663 ew->setAttribute(Qt::WA_StyledBackground, true); -
2664 }
executed: }
Execution Count:3
3
2665 }
executed: }
Execution Count:3
3
2666 if (!rule.hasBackground() || rule.background()->isTransparent() || rule.hasBox()
evaluated: !rule.hasBackground()
TRUEFALSE
yes
Evaluation Count:16
yes
Evaluation Count:9
partially evaluated: rule.background()->isTransparent()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9
partially evaluated: rule.hasBox()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9
0-16
2667 || (!rule.hasNativeBorder() && !rule.border()->isOpaque()))
evaluated: !rule.hasNativeBorder()
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:7
partially evaluated: !rule.border()->isOpaque()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-7
2668 w->setAttribute(Qt::WA_OpaquePaintEvent, false);
executed: w->setAttribute(Qt::WA_OpaquePaintEvent, false);
Execution Count:16
16
2669 }
executed: }
Execution Count:25
25
2670}
executed: }
Execution Count:1957
1957
2671 -
2672void QStyleSheetStyle::polish(QApplication *app) -
2673{ -
2674 baseStyle()->polish(app); -
2675}
executed: }
Execution Count:3
3
2676 -
2677void QStyleSheetStyle::polish(QPalette &pal) -
2678{ -
2679 baseStyle()->polish(pal); -
2680}
executed: }
Execution Count:3
3
2681 -
2682void QStyleSheetStyle::repolish(QWidget *w) -
2683{ -
2684 QList<const QObject *> children = w->findChildren<const QObject *>(QString()); -
2685 children.append(w); -
2686 styleSheetCaches->styleSheetCache.remove(w); -
2687 updateObjects(children); -
2688}
never executed: }
0
2689 -
2690void QStyleSheetStyle::repolish(QApplication *app) -
2691{ -
2692 (void)app;; -
2693 const QList<const QObject*> allObjects = styleSheetCaches->styleRulesCache.keys(); -
2694 styleSheetCaches->styleSheetCache.remove((static_cast<QApplication *>(QCoreApplication::instance()))); -
2695 styleSheetCaches->styleRulesCache.clear(); -
2696 styleSheetCaches->hasStyleRuleCache.clear(); -
2697 styleSheetCaches->renderRulesCache.clear(); -
2698 updateObjects(allObjects); -
2699}
never executed: }
0
2700 -
2701void QStyleSheetStyle::unpolish(QWidget *w) -
2702{ -
2703 if (!w || !w->testAttribute(Qt::WA_StyleSheet)) {
partially evaluated: !w
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16
evaluated: !w->testAttribute(Qt::WA_StyleSheet)
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:14
0-16
2704 baseStyle()->unpolish(w); -
2705 return;
executed: return;
Execution Count:2
2
2706 } -
2707 -
2708 styleSheetCaches->styleRulesCache.remove(w); -
2709 styleSheetCaches->hasStyleRuleCache.remove(w); -
2710 styleSheetCaches->renderRulesCache.remove(w); -
2711 styleSheetCaches->styleSheetCache.remove(w); -
2712 unsetPalette(w); -
2713 w->setProperty("_q_stylesheet_minw", QVariant()); -
2714 w->setProperty("_q_stylesheet_minh", QVariant()); -
2715 w->setProperty("_q_stylesheet_maxw", QVariant()); -
2716 w->setProperty("_q_stylesheet_maxh", QVariant()); -
2717 w->setAttribute(Qt::WA_StyleSheet, false); -
2718 QObject::disconnect(w, 0, this, 0); -
2719 -
2720 if (QAbstractScrollArea *sa = qobject_cast<QAbstractScrollArea *>(w)) {
evaluated: QAbstractScrollArea *sa = qobject_cast<QAbstractScrollArea *>(w)
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:12
2-12
2721 QObject::disconnect(sa->horizontalScrollBar(), "2""valueChanged(int)", -
2722 sa, "1""update()"); -
2723 QObject::disconnect(sa->verticalScrollBar(), "2""valueChanged(int)", -
2724 sa, "1""update()"); -
2725 }
executed: }
Execution Count:2
2
2726 -
2727 baseStyle()->unpolish(w); -
2728}
executed: }
Execution Count:14
14
2729 -
2730void QStyleSheetStyle::unpolish(QApplication *app) -
2731{ -
2732 baseStyle()->unpolish(app); -
2733 if (globalStyleSheetStyle != 0 && globalStyleSheetStyle != this) { return; } QStyleSheetStyleRecursionGuard recursion_guard(this);
partially evaluated: globalStyleSheetStyle != 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
never evaluated: globalStyleSheetStyle != this
never executed: return;
0-2
2734 styleSheetCaches->styleRulesCache.clear(); -
2735 styleSheetCaches->hasStyleRuleCache.clear(); -
2736 styleSheetCaches->renderRulesCache.clear(); -
2737 styleSheetCaches->styleSheetCache.remove((static_cast<QApplication *>(QCoreApplication::instance()))); -
2738}
executed: }
Execution Count:2
2
2739 -
2740 -
2741inline static bool verticalTabs(QTabBar::Shape shape) -
2742{ -
2743 return shape == QTabBar::RoundedWest 0
2744 || shape == QTabBar::RoundedEast 0
2745 || shape == QTabBar::TriangularWest 0
2746 || shape == QTabBar::TriangularEast;
never executed: return shape == QTabBar::RoundedWest || shape == QTabBar::RoundedEast || shape == QTabBar::TriangularWest || shape == QTabBar::TriangularEast;
0
2747} -
2748 -
2749 -
2750void QStyleSheetStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, -
2751 const QWidget *w) const -
2752{ -
2753 if (globalStyleSheetStyle != 0 && globalStyleSheetStyle != this) { baseStyle()->drawComplexControl(cc, opt, p, w); return; } QStyleSheetStyleRecursionGuard recursion_guard(this);
partially evaluated: globalStyleSheetStyle != 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:290
never evaluated: globalStyleSheetStyle != this
never executed: return;
0-290
2754 -
2755 QRenderRule rule = renderRule(w, opt); -
2756 -
2757 switch (cc) { -
2758 case CC_ComboBox: -
2759 if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
never evaluated: const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)
0
2760 QStyleOptionComboBox cmbOpt(*cmb); -
2761 cmbOpt.rect = rule.borderRect(opt->rect); -
2762 if (rule.hasNativeBorder()) {
never evaluated: rule.hasNativeBorder()
0
2763 rule.drawBackgroundImage(p, cmbOpt.rect); -
2764 rule.configurePalette(&cmbOpt.palette, QPalette::ButtonText, QPalette::Button); -
2765 bool customDropDown = (opt->subControls & QStyle::SC_ComboBoxArrow)
never evaluated: (opt->subControls & QStyle::SC_ComboBoxArrow)
0
2766 && (hasStyleRule(w, PseudoElement_ComboBoxDropDown) || hasStyleRule(w, PseudoElement_ComboBoxArrow));
never evaluated: hasStyleRule(w, PseudoElement_ComboBoxDropDown)
never evaluated: hasStyleRule(w, PseudoElement_ComboBoxArrow)
0
2767 if (customDropDown)
never evaluated: customDropDown
0
2768 cmbOpt.subControls &= ~QStyle::SC_ComboBoxArrow;
never executed: cmbOpt.subControls &= ~QStyle::SC_ComboBoxArrow;
0
2769 if (rule.baseStyleCanDraw()) {
never evaluated: rule.baseStyleCanDraw()
0
2770 baseStyle()->drawComplexControl(cc, &cmbOpt, p, w); -
2771 } else {
never executed: }
0
2772 QWindowsStyle::drawComplexControl(cc, &cmbOpt, p, w); -
2773 }
never executed: }
0
2774 if (!customDropDown)
never evaluated: !customDropDown
0
2775 return;
never executed: return;
0
2776 } else {
never executed: }
0
2777 rule.drawRule(p, opt->rect); -
2778 }
never executed: }
0
2779 -
2780 if (opt->subControls & QStyle::SC_ComboBoxArrow) {
never evaluated: opt->subControls & QStyle::SC_ComboBoxArrow
0
2781 QRenderRule subRule = renderRule(w, opt, PseudoElement_ComboBoxDropDown); -
2782 if (subRule.hasDrawable()) {
never evaluated: subRule.hasDrawable()
0
2783 QRect r = subControlRect(CC_ComboBox, opt, SC_ComboBoxArrow, w); -
2784 subRule.drawRule(p, r); -
2785 QRenderRule subRule2 = renderRule(w, opt, PseudoElement_ComboBoxArrow); -
2786 r = positionRect(w, subRule, subRule2, PseudoElement_ComboBoxArrow, r, opt->direction); -
2787 subRule2.drawRule(p, r); -
2788 } else {
never executed: }
0
2789 cmbOpt.subControls = QStyle::SC_ComboBoxArrow; -
2790 QWindowsStyle::drawComplexControl(cc, &cmbOpt, p, w); -
2791 }
never executed: }
0
2792 } -
2793 -
2794 return;
never executed: return;
0
2795 } -
2796 break;
never executed: break;
0
2797 -
2798 -
2799 case CC_SpinBox: -
2800 if (const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
never evaluated: const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)
0
2801 QStyleOptionSpinBox spinOpt(*spin); -
2802 rule.configurePalette(&spinOpt.palette, QPalette::ButtonText, QPalette::Button); -
2803 rule.configurePalette(&spinOpt.palette, QPalette::Text, QPalette::Base); -
2804 spinOpt.rect = rule.borderRect(opt->rect); -
2805 bool customUp = true, customDown = true; -
2806 QRenderRule upRule = renderRule(w, opt, PseudoElement_SpinBoxUpButton); -
2807 QRenderRule downRule = renderRule(w, opt, PseudoElement_SpinBoxDownButton); -
2808 bool upRuleMatch = upRule.hasGeometry() || upRule.hasPosition();
never evaluated: upRule.hasGeometry()
never evaluated: upRule.hasPosition()
0
2809 bool downRuleMatch = downRule.hasGeometry() || downRule.hasPosition();
never evaluated: downRule.hasGeometry()
never evaluated: downRule.hasPosition()
0
2810 if (rule.hasNativeBorder() && !upRuleMatch && !downRuleMatch) {
never evaluated: rule.hasNativeBorder()
never evaluated: !upRuleMatch
never evaluated: !downRuleMatch
0
2811 rule.drawBackgroundImage(p, spinOpt.rect); -
2812 customUp = (opt->subControls & QStyle::SC_SpinBoxUp)
never evaluated: (opt->subControls & QStyle::SC_SpinBoxUp)
0
2813 && (hasStyleRule(w, PseudoElement_SpinBoxUpButton) || hasStyleRule(w, PseudoElement_UpArrow));
never evaluated: hasStyleRule(w, PseudoElement_SpinBoxUpButton)
never evaluated: hasStyleRule(w, PseudoElement_UpArrow)
0
2814 if (customUp)
never evaluated: customUp
0
2815 spinOpt.subControls &= ~QStyle::SC_SpinBoxUp;
never executed: spinOpt.subControls &= ~QStyle::SC_SpinBoxUp;
0
2816 customDown = (opt->subControls & QStyle::SC_SpinBoxDown)
never evaluated: (opt->subControls & QStyle::SC_SpinBoxDown)
0
2817 && (hasStyleRule(w, PseudoElement_SpinBoxDownButton) || hasStyleRule(w, PseudoElement_DownArrow));
never evaluated: hasStyleRule(w, PseudoElement_SpinBoxDownButton)
never evaluated: hasStyleRule(w, PseudoElement_DownArrow)
0
2818 if (customDown)
never evaluated: customDown
0
2819 spinOpt.subControls &= ~QStyle::SC_SpinBoxDown;
never executed: spinOpt.subControls &= ~QStyle::SC_SpinBoxDown;
0
2820 if (rule.baseStyleCanDraw()) {
never evaluated: rule.baseStyleCanDraw()
0
2821 baseStyle()->drawComplexControl(cc, &spinOpt, p, w); -
2822 } else {
never executed: }
0
2823 QWindowsStyle::drawComplexControl(cc, &spinOpt, p, w); -
2824 }
never executed: }
0
2825 if (!customUp && !customDown)
never evaluated: !customUp
never evaluated: !customDown
0
2826 return;
never executed: return;
0
2827 } else {
never executed: }
0
2828 rule.drawRule(p, opt->rect); -
2829 }
never executed: }
0
2830 -
2831 if ((opt->subControls & QStyle::SC_SpinBoxUp) && customUp) {
never evaluated: (opt->subControls & QStyle::SC_SpinBoxUp)
never evaluated: customUp
0
2832 QRenderRule subRule = renderRule(w, opt, PseudoElement_SpinBoxUpButton); -
2833 if (subRule.hasDrawable()) {
never evaluated: subRule.hasDrawable()
0
2834 QRect r = subControlRect(CC_SpinBox, opt, SC_SpinBoxUp, w); -
2835 subRule.drawRule(p, r); -
2836 QRenderRule subRule2 = renderRule(w, opt, PseudoElement_SpinBoxUpArrow); -
2837 r = positionRect(w, subRule, subRule2, PseudoElement_SpinBoxUpArrow, r, opt->direction); -
2838 subRule2.drawRule(p, r); -
2839 } else {
never executed: }
0
2840 spinOpt.subControls = QStyle::SC_SpinBoxUp; -
2841 QWindowsStyle::drawComplexControl(cc, &spinOpt, p, w); -
2842 }
never executed: }
0
2843 } -
2844 -
2845 if ((opt->subControls & QStyle::SC_SpinBoxDown) && customDown) {
never evaluated: (opt->subControls & QStyle::SC_SpinBoxDown)
never evaluated: customDown
0
2846 QRenderRule subRule = renderRule(w, opt, PseudoElement_SpinBoxDownButton); -
2847 if (subRule.hasDrawable()) {
never evaluated: subRule.hasDrawable()
0
2848 QRect r = subControlRect(CC_SpinBox, opt, SC_SpinBoxDown, w); -
2849 subRule.drawRule(p, r); -
2850 QRenderRule subRule2 = renderRule(w, opt, PseudoElement_SpinBoxDownArrow); -
2851 r = positionRect(w, subRule, subRule2, PseudoElement_SpinBoxDownArrow, r, opt->direction); -
2852 subRule2.drawRule(p, r); -
2853 } else {
never executed: }
0
2854 spinOpt.subControls = QStyle::SC_SpinBoxDown; -
2855 QWindowsStyle::drawComplexControl(cc, &spinOpt, p, w); -
2856 }
never executed: }
0
2857 } -
2858 return;
never executed: return;
0
2859 } -
2860 break;
never executed: break;
0
2861 -
2862 -
2863 case CC_GroupBox: -
2864 if (const QStyleOptionGroupBox *gb = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)) {
never evaluated: const QStyleOptionGroupBox *gb = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)
0
2865 -
2866 QRect labelRect, checkBoxRect, titleRect, frameRect; -
2867 bool hasTitle = (gb->subControls & QStyle::SC_GroupBoxCheckBox) || !gb->text.isEmpty();
never evaluated: (gb->subControls & QStyle::SC_GroupBoxCheckBox)
never evaluated: !gb->text.isEmpty()
0
2868 -
2869 if (!rule.hasDrawable() && (!hasTitle || !hasStyleRule(w, PseudoElement_GroupBoxTitle))
never evaluated: !rule.hasDrawable()
never evaluated: !hasTitle
never evaluated: !hasStyleRule(w, PseudoElement_GroupBoxTitle)
0
2870 && !hasStyleRule(w, PseudoElement_Indicator) && !rule.hasBox() && !rule.hasFont && !rule.hasPalette()) {
never evaluated: !hasStyleRule(w, PseudoElement_Indicator)
never evaluated: !rule.hasBox()
never evaluated: !rule.hasFont
never evaluated: !rule.hasPalette()
0
2871 -
2872 break;
never executed: break;
0
2873 } -
2874 rule.drawBackground(p, opt->rect); -
2875 -
2876 QRenderRule titleRule = renderRule(w, opt, PseudoElement_GroupBoxTitle); -
2877 bool clipSet = false; -
2878 -
2879 if (hasTitle) {
never evaluated: hasTitle
0
2880 labelRect = subControlRect(CC_GroupBox, opt, SC_GroupBoxLabel, w); -
2881 -
2882 labelRect.setSize(labelRect.size().expandedTo(ParentStyle::subControlRect(CC_GroupBox, opt, SC_GroupBoxLabel, w).size())); -
2883 if (gb->subControls & QStyle::SC_GroupBoxCheckBox) {
never evaluated: gb->subControls & QStyle::SC_GroupBoxCheckBox
0
2884 checkBoxRect = subControlRect(CC_GroupBox, opt, SC_GroupBoxCheckBox, w); -
2885 titleRect = titleRule.boxRect(checkBoxRect.united(labelRect)); -
2886 } else {
never executed: }
0
2887 titleRect = titleRule.boxRect(labelRect); -
2888 }
never executed: }
0
2889 if (!titleRule.hasBackground() || !titleRule.background()->isTransparent()) {
never evaluated: !titleRule.hasBackground()
never evaluated: !titleRule.background()->isTransparent()
0
2890 clipSet = true; -
2891 p->save(); -
2892 p->setClipRegion(QRegion(opt->rect) - titleRect); -
2893 }
never executed: }
0
2894 }
never executed: }
0
2895 -
2896 frameRect = subControlRect(CC_GroupBox, opt, SC_GroupBoxFrame, w); -
2897 QStyleOptionFrameV2 frame; -
2898 frame.QStyleOption::operator=(*gb); -
2899 frame.features = gb->features; -
2900 frame.lineWidth = gb->lineWidth; -
2901 frame.midLineWidth = gb->midLineWidth; -
2902 frame.rect = frameRect; -
2903 drawPrimitive(PE_FrameGroupBox, &frame, p, w); -
2904 -
2905 if (clipSet)
never evaluated: clipSet
0
2906 p->restore();
never executed: p->restore();
0
2907 -
2908 -
2909 if (hasTitle)
never evaluated: hasTitle
0
2910 titleRule.drawRule(p, titleRect);
never executed: titleRule.drawRule(p, titleRect);
0
2911 -
2912 -
2913 if (gb->subControls & QStyle::SC_GroupBoxCheckBox) {
never evaluated: gb->subControls & QStyle::SC_GroupBoxCheckBox
0
2914 QStyleOptionButton box; -
2915 box.QStyleOption::operator=(*gb); -
2916 box.rect = checkBoxRect; -
2917 drawPrimitive(PE_IndicatorCheckBox, &box, p, w); -
2918 }
never executed: }
0
2919 -
2920 -
2921 if (!gb->text.isEmpty()) {
never evaluated: !gb->text.isEmpty()
0
2922 int alignment = int(Qt::AlignCenter | Qt::TextShowMnemonic); -
2923 if (!styleHint(QStyle::SH_UnderlineShortcut, opt, w)) {
never evaluated: !styleHint(QStyle::SH_UnderlineShortcut, opt, w)
0
2924 alignment |= Qt::TextHideMnemonic; -
2925 }
never executed: }
0
2926 -
2927 QPalette pal = gb->palette; -
2928 if (gb->textColor.isValid())
never evaluated: gb->textColor.isValid()
0
2929 pal.setColor(QPalette::WindowText, gb->textColor);
never executed: pal.setColor(QPalette::WindowText, gb->textColor);
0
2930 titleRule.configurePalette(&pal, QPalette::WindowText, QPalette::Window); -
2931 drawItemText(p, labelRect, alignment, pal, gb->state & State_Enabled, -
2932 gb->text, QPalette::WindowText); -
2933 -
2934 if (gb->state & State_HasFocus) {
never evaluated: gb->state & State_HasFocus
0
2935 QStyleOptionFocusRect fropt; -
2936 fropt.QStyleOption::operator=(*gb); -
2937 fropt.rect = labelRect; -
2938 drawPrimitive(PE_FrameFocusRect, &fropt, p, w); -
2939 }
never executed: }
0
2940 }
never executed: }
0
2941 -
2942 return;
never executed: return;
0
2943 } -
2944 break;
never executed: break;
0
2945 -
2946 case CC_ToolButton: -
2947 if (const QStyleOptionToolButton *tool = qstyleoption_cast<const QStyleOptionToolButton *>(opt)) {
never evaluated: const QStyleOptionToolButton *tool = qstyleoption_cast<const QStyleOptionToolButton *>(opt)
0
2948 QStyleOptionToolButton toolOpt(*tool); -
2949 rule.configurePalette(&toolOpt.palette, QPalette::ButtonText, QPalette::Button); -
2950 toolOpt.font = rule.font.resolve(toolOpt.font); -
2951 toolOpt.rect = rule.borderRect(opt->rect); -
2952 bool customArrow = (tool->features & (QStyleOptionToolButton::HasMenu | QStyleOptionToolButton::MenuButtonPopup)); -
2953 bool customDropDown = tool->features & QStyleOptionToolButton::MenuButtonPopup; -
2954 if (rule.hasNativeBorder()) {
never evaluated: rule.hasNativeBorder()
0
2955 if (tool->subControls & SC_ToolButton) {
never evaluated: tool->subControls & SC_ToolButton
0
2956 -
2957 -
2958 -
2959 State bflags = tool->state & ~State_Sunken; -
2960 if (bflags & State_AutoRaise && (!(bflags & State_MouseOver) || !(bflags & State_Enabled)))
never evaluated: bflags & State_AutoRaise
never evaluated: !(bflags & State_MouseOver)
never evaluated: !(bflags & State_Enabled)
0
2961 bflags &= ~State_Raised;
never executed: bflags &= ~State_Raised;
0
2962 if (tool->state & State_Sunken && tool->activeSubControls & SC_ToolButton)
never evaluated: tool->state & State_Sunken
never evaluated: tool->activeSubControls & SC_ToolButton
0
2963 bflags |= State_Sunken;
never executed: bflags |= State_Sunken;
0
2964 if (!(bflags & (State_Sunken | State_On | State_Raised)))
never evaluated: !(bflags & (State_Sunken | State_On | State_Raised))
0
2965 rule.drawBackground(p, toolOpt.rect);
never executed: rule.drawBackground(p, toolOpt.rect);
0
2966 }
never executed: }
0
2967 customArrow = customArrow && hasStyleRule(w, PseudoElement_ToolButtonDownArrow);
never evaluated: customArrow
never evaluated: hasStyleRule(w, PseudoElement_ToolButtonDownArrow)
0
2968 if (customArrow)
never evaluated: customArrow
0
2969 toolOpt.features &= ~QStyleOptionToolButton::HasMenu;
never executed: toolOpt.features &= ~QStyleOptionToolButton::HasMenu;
0
2970 customDropDown = customDropDown && hasStyleRule(w, PseudoElement_ToolButtonMenu);
never evaluated: customDropDown
never evaluated: hasStyleRule(w, PseudoElement_ToolButtonMenu)
0
2971 if (customDropDown)
never evaluated: customDropDown
0
2972 toolOpt.subControls &= ~QStyle::SC_ToolButtonMenu;
never executed: toolOpt.subControls &= ~QStyle::SC_ToolButtonMenu;
0
2973 -
2974 if (rule.baseStyleCanDraw() && !(tool->features & QStyleOptionToolButton::Arrow)) {
never evaluated: rule.baseStyleCanDraw()
never evaluated: !(tool->features & QStyleOptionToolButton::Arrow)
0
2975 baseStyle()->drawComplexControl(cc, &toolOpt, p, w); -
2976 } else {
never executed: }
0
2977 QWindowsStyle::drawComplexControl(cc, &toolOpt, p, w); -
2978 }
never executed: }
0
2979 -
2980 if (!customArrow && !customDropDown)
never evaluated: !customArrow
never evaluated: !customDropDown
0
2981 return;
never executed: return;
0
2982 } else {
never executed: }
0
2983 rule.drawRule(p, opt->rect); -
2984 toolOpt.rect = rule.contentsRect(opt->rect); -
2985 if (rule.hasFont)
never evaluated: rule.hasFont
0
2986 toolOpt.font = rule.font;
never executed: toolOpt.font = rule.font;
0
2987 drawControl(CE_ToolButtonLabel, &toolOpt, p, w); -
2988 }
never executed: }
0
2989 -
2990 QRenderRule subRule = renderRule(w, opt, PseudoElement_ToolButtonMenu); -
2991 QRect r = subControlRect(CC_ToolButton, opt, QStyle::SC_ToolButtonMenu, w); -
2992 if (customDropDown) {
never evaluated: customDropDown
0
2993 if (opt->subControls & QStyle::SC_ToolButtonMenu) {
never evaluated: opt->subControls & QStyle::SC_ToolButtonMenu
0
2994 if (subRule.hasDrawable()) {
never evaluated: subRule.hasDrawable()
0
2995 subRule.drawRule(p, r); -
2996 } else {
never executed: }
0
2997 toolOpt.rect = r; -
2998 baseStyle()->drawPrimitive(PE_IndicatorButtonDropDown, &toolOpt, p, w); -
2999 }
never executed: }
0
3000 } -
3001 }
never executed: }
0
3002 -
3003 if (customArrow) {
never evaluated: customArrow
0
3004 QRenderRule subRule2 = customDropDown ? renderRule(w, opt, PseudoElement_ToolButtonMenuArrow)
never evaluated: customDropDown
0
3005 : renderRule(w, opt, PseudoElement_ToolButtonDownArrow); -
3006 QRect r2 = customDropDown
never evaluated: customDropDown
0
3007 ? positionRect(w, subRule, subRule2, PseudoElement_ToolButtonMenuArrow, r, opt->direction) -
3008 : positionRect(w, rule, subRule2, PseudoElement_ToolButtonDownArrow, opt->rect, opt->direction); -
3009 if (subRule2.hasDrawable()) {
never evaluated: subRule2.hasDrawable()
0
3010 subRule2.drawRule(p, r2); -
3011 } else {
never executed: }
0
3012 toolOpt.rect = r2; -
3013 baseStyle()->drawPrimitive(QStyle::PE_IndicatorArrowDown, &toolOpt, p, w); -
3014 }
never executed: }
0
3015 } -
3016 -
3017 return;
never executed: return;
0
3018 } -
3019 break;
never executed: break;
0
3020 -
3021 -
3022 case CC_ScrollBar: -
3023 if (const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
partially evaluated: const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt)
TRUEFALSE
yes
Evaluation Count:290
no
Evaluation Count:0
0-290
3024 QStyleOptionSlider sbOpt(*sb); -
3025 if (!rule.hasDrawable()) {
partially evaluated: !rule.hasDrawable()
TRUEFALSE
yes
Evaluation Count:290
no
Evaluation Count:0
0-290
3026 sbOpt.rect = rule.borderRect(opt->rect); -
3027 rule.drawBackgroundImage(p, opt->rect); -
3028 baseStyle()->drawComplexControl(cc, &sbOpt, p, w); -
3029 } else {
executed: }
Execution Count:290
290
3030 rule.drawRule(p, opt->rect); -
3031 QWindowsStyle::drawComplexControl(cc, opt, p, w); -
3032 }
never executed: }
0
3033 return;
executed: return;
Execution Count:290
290
3034 } -
3035 break;
never executed: break;
0
3036 -
3037 -
3038 -
3039 case CC_Slider: -
3040 if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
never evaluated: const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)
0
3041 rule.drawRule(p, opt->rect); -
3042 -
3043 QRenderRule grooveSubRule = renderRule(w, opt, PseudoElement_SliderGroove); -
3044 QRenderRule handleSubRule = renderRule(w, opt, PseudoElement_SliderHandle); -
3045 if (!grooveSubRule.hasDrawable()) {
never evaluated: !grooveSubRule.hasDrawable()
0
3046 QStyleOptionSlider slOpt(*slider); -
3047 bool handleHasRule = handleSubRule.hasDrawable(); -
3048 -
3049 if (handleHasRule)
never evaluated: handleHasRule
0
3050 slOpt.subControls &= ~SC_SliderHandle;
never executed: slOpt.subControls &= ~SC_SliderHandle;
0
3051 baseStyle()->drawComplexControl(cc, &slOpt, p, w); -
3052 if (!handleHasRule)
never evaluated: !handleHasRule
0
3053 return;
never executed: return;
0
3054 }
never executed: }
0
3055 -
3056 QRect gr = subControlRect(cc, opt, SC_SliderGroove, w); -
3057 if (slider->subControls & SC_SliderGroove) {
never evaluated: slider->subControls & SC_SliderGroove
0
3058 grooveSubRule.drawRule(p, gr); -
3059 }
never executed: }
0
3060 -
3061 if (slider->subControls & SC_SliderHandle) {
never evaluated: slider->subControls & SC_SliderHandle
0
3062 QRect hr = subControlRect(cc, opt, SC_SliderHandle, w); -
3063 -
3064 QRenderRule subRule1 = renderRule(w, opt, PseudoElement_SliderSubPage); -
3065 if (subRule1.hasDrawable()) {
never evaluated: subRule1.hasDrawable()
0
3066 QRect r(gr.topLeft(), -
3067 slider->orientation == Qt::Horizontal -
3068 ? QPoint(hr.x()+hr.width()/2, gr.y()+gr.height() - 1) -
3069 : QPoint(gr.x()+gr.width() - 1, hr.y()+hr.height()/2)); -
3070 subRule1.drawRule(p, r); -
3071 }
never executed: }
0
3072 -
3073 QRenderRule subRule2 = renderRule(w, opt, PseudoElement_SliderAddPage); -
3074 if (subRule2.hasDrawable()) {
never evaluated: subRule2.hasDrawable()
0
3075 QRect r(slider->orientation == Qt::Horizontal -
3076 ? QPoint(hr.x()+hr.width()/2+1, gr.y()) -
3077 : QPoint(gr.x(), hr.y()+hr.height()/2+1), -
3078 gr.bottomRight()); -
3079 subRule2.drawRule(p, r); -
3080 }
never executed: }
0
3081 -
3082 handleSubRule.drawRule(p, handleSubRule.boxRect(hr, Margin)); -
3083 }
never executed: }
0
3084 -
3085 if (slider->subControls & SC_SliderTickmarks) {
never evaluated: slider->subControls & SC_SliderTickmarks
0
3086 -
3087 }
never executed: }
0
3088 -
3089 return;
never executed: return;
0
3090 } -
3091 break;
never executed: break;
0
3092 -
3093 -
3094 case CC_MdiControls: -
3095 if (hasStyleRule(w, PseudoElement_MdiCloseButton)
never evaluated: hasStyleRule(w, PseudoElement_MdiCloseButton)
0
3096 || hasStyleRule(w, PseudoElement_MdiNormalButton)
never evaluated: hasStyleRule(w, PseudoElement_MdiNormalButton)
0
3097 || hasStyleRule(w, PseudoElement_MdiMinButton)) {
never evaluated: hasStyleRule(w, PseudoElement_MdiMinButton)
0
3098 QList<QVariant> layout = rule.styleHint(QLatin1String("button-layout")).toList(); -
3099 if (layout.isEmpty())
never evaluated: layout.isEmpty()
0
3100 layout = subControlLayout(QLatin1String("mNX"));
never executed: layout = subControlLayout(QLatin1String("mNX"));
0
3101 -
3102 QStyleOptionComplex optCopy(*opt); -
3103 optCopy.subControls = 0; -
3104 for (int i = 0; i < layout.count(); i++) {
never evaluated: i < layout.count()
0
3105 int layoutButton = layout[i].toInt(); -
3106 if (layoutButton < PseudoElement_MdiCloseButton
never evaluated: layoutButton < PseudoElement_MdiCloseButton
0
3107 || layoutButton > PseudoElement_MdiNormalButton)
never evaluated: layoutButton > PseudoElement_MdiNormalButton
0
3108 continue;
never executed: continue;
0
3109 QStyle::SubControl control = knownPseudoElements[layoutButton].subControl; -
3110 if (!(opt->subControls & control))
never evaluated: !(opt->subControls & control)
0
3111 continue;
never executed: continue;
0
3112 QRenderRule subRule = renderRule(w, opt, layoutButton); -
3113 if (subRule.hasDrawable()) {
never evaluated: subRule.hasDrawable()
0
3114 QRect rect = subRule.boxRect(subControlRect(CC_MdiControls, opt, control, w), Margin); -
3115 subRule.drawRule(p, rect); -
3116 QIcon icon = standardIcon(subControlIcon(layoutButton), opt); -
3117 icon.paint(p, subRule.contentsRect(rect), Qt::AlignCenter); -
3118 } else {
never executed: }
0
3119 optCopy.subControls |= control; -
3120 }
never executed: }
0
3121 } -
3122 -
3123 if (optCopy.subControls)
never evaluated: optCopy.subControls
0
3124 baseStyle()->drawComplexControl(CC_MdiControls, &optCopy, p, w);
never executed: baseStyle()->drawComplexControl(CC_MdiControls, &optCopy, p, w);
0
3125 return;
never executed: return;
0
3126 } -
3127 break;
never executed: break;
0
3128 -
3129 case CC_TitleBar: -
3130 if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)) {
never evaluated: const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)
0
3131 QRenderRule subRule = renderRule(w, opt, PseudoElement_TitleBar); -
3132 if (!subRule.hasDrawable() && !subRule.hasBox() && !subRule.hasBorder())
never evaluated: !subRule.hasDrawable()
never evaluated: !subRule.hasBox()
never evaluated: !subRule.hasBorder()
0
3133 break;
never executed: break;
0
3134 subRule.drawRule(p, opt->rect); -
3135 QHash<QStyle::SubControl, QRect> layout = titleBarLayout(w, tb); -
3136 -
3137 QRect ir; -
3138 ir = layout[SC_TitleBarLabel]; -
3139 if (ir.isValid()) {
never evaluated: ir.isValid()
0
3140 if (subRule.hasPalette())
never evaluated: subRule.hasPalette()
0
3141 p->setPen(subRule.palette()->foreground.color());
never executed: p->setPen(subRule.palette()->foreground.color());
0
3142 p->fillRect(ir, Qt::white); -
3143 p->drawText(ir.x(), ir.y(), ir.width(), ir.height(), Qt::AlignLeft | Qt::AlignVCenter | Qt::TextSingleLine, tb->text); -
3144 }
never executed: }
0
3145 -
3146 QPixmap pm; -
3147 -
3148 ir = layout[SC_TitleBarSysMenu]; -
3149 if (ir.isValid()) {
never evaluated: ir.isValid()
0
3150 QRenderRule subSubRule = renderRule(w, opt, PseudoElement_TitleBarSysMenu); -
3151 subSubRule.drawRule(p, ir); -
3152 ir = subSubRule.contentsRect(ir); -
3153 if (!tb->icon.isNull()) {
never evaluated: !tb->icon.isNull()
0
3154 tb->icon.paint(p, ir); -
3155 } else {
never executed: }
0
3156 int iconSize = pixelMetric(PM_SmallIconSize, tb, w); -
3157 pm = standardIcon(SP_TitleBarMenuButton, 0, w).pixmap(iconSize, iconSize); -
3158 drawItemPixmap(p, ir, Qt::AlignCenter, pm); -
3159 }
never executed: }
0
3160 } -
3161 -
3162 ir = layout[SC_TitleBarCloseButton]; -
3163 if (ir.isValid()) {
never evaluated: ir.isValid()
0
3164 QRenderRule subSubRule = renderRule(w, opt, PseudoElement_TitleBarCloseButton); -
3165 subSubRule.drawRule(p, ir); -
3166 -
3167 QSize sz = subSubRule.contentsRect(ir).size(); -
3168 if ((tb->titleBarFlags & Qt::WindowType_Mask) == Qt::Tool)
never evaluated: (tb->titleBarFlags & Qt::WindowType_Mask) == Qt::Tool
0
3169 pm = standardIcon(SP_DockWidgetCloseButton, 0, w).pixmap(sz);
never executed: pm = standardIcon(SP_DockWidgetCloseButton, 0, w).pixmap(sz);
0
3170 else -
3171 pm = standardIcon(SP_TitleBarCloseButton, 0, w).pixmap(sz);
never executed: pm = standardIcon(SP_TitleBarCloseButton, 0, w).pixmap(sz);
0
3172 drawItemPixmap(p, ir, Qt::AlignCenter, pm); -
3173 }
never executed: }
0
3174 -
3175 int pes[] = { -
3176 PseudoElement_TitleBarMaxButton, -
3177 PseudoElement_TitleBarMinButton, -
3178 PseudoElement_TitleBarNormalButton, -
3179 PseudoElement_TitleBarShadeButton, -
3180 PseudoElement_TitleBarUnshadeButton, -
3181 PseudoElement_TitleBarContextHelpButton -
3182 }; -
3183 -
3184 for (unsigned int i = 0; i < sizeof(pes)/sizeof(int); i++) {
never evaluated: i < sizeof(pes)/sizeof(int)
0
3185 int pe = pes[i]; -
3186 QStyle::SubControl sc = knownPseudoElements[pe].subControl; -
3187 ir = layout[sc]; -
3188 if (!ir.isValid())
never evaluated: !ir.isValid()
0
3189 continue;
never executed: continue;
0
3190 QRenderRule subSubRule = renderRule(w, opt, pe); -
3191 subSubRule.drawRule(p, ir); -
3192 pm = standardIcon(subControlIcon(pe), 0, w).pixmap(subSubRule.contentsRect(ir).size()); -
3193 drawItemPixmap(p, ir, Qt::AlignCenter, pm); -
3194 }
never executed: }
0
3195 -
3196 return;
never executed: return;
0
3197 } -
3198 break;
never executed: break;
0
3199 -
3200 -
3201 default: -
3202 break;
never executed: break;
0
3203 } -
3204 -
3205 baseStyle()->drawComplexControl(cc, opt, p, w); -
3206}
never executed: }
0
3207 -
3208void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter *p, -
3209 const QWidget *w) const -
3210{ -
3211 if (globalStyleSheetStyle != 0 && globalStyleSheetStyle != this) { baseStyle()->drawControl(ce, opt, p, w); return; } QStyleSheetStyleRecursionGuard recursion_guard(this);
partially evaluated: globalStyleSheetStyle != 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:505
never evaluated: globalStyleSheetStyle != this
never executed: return;
0-505
3212 -
3213 QRenderRule rule = renderRule(w, opt); -
3214 int pe1 = PseudoElement_None, pe2 = PseudoElement_None; -
3215 bool fallback = false; -
3216 -
3217 switch (ce) { -
3218 case CE_ToolButtonLabel: -
3219 if (const QStyleOptionToolButton *btn = qstyleoption_cast<const QStyleOptionToolButton *>(opt)) {
never evaluated: const QStyleOptionToolButton *btn = qstyleoption_cast<const QStyleOptionToolButton *>(opt)
0
3220 if (rule.hasBox() || btn->features & QStyleOptionToolButton::Arrow) {
never evaluated: rule.hasBox()
never evaluated: btn->features & QStyleOptionToolButton::Arrow
0
3221 QCommonStyle::drawControl(ce, opt, p, w); -
3222 } else {
never executed: }
0
3223 QStyleOptionToolButton butOpt(*btn); -
3224 rule.configurePalette(&butOpt.palette, QPalette::ButtonText, QPalette::Button); -
3225 baseStyle()->drawControl(ce, &butOpt, p, w); -
3226 }
never executed: }
0
3227 return;
never executed: return;
0
3228 } -
3229 break;
never executed: break;
0
3230 -
3231 case CE_FocusFrame: -
3232 if (!rule.hasNativeBorder()) {
never evaluated: !rule.hasNativeBorder()
0
3233 rule.drawBorder(p, opt->rect); -
3234 return;
never executed: return;
0
3235 } -
3236 break;
never executed: break;
0
3237 -
3238 case CE_PushButton: -
3239 if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
never evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)
0
3240 if (rule.hasDrawable() || rule.hasBox() || rule.hasPosition() || rule.hasPalette() ||
never evaluated: rule.hasDrawable()
never evaluated: rule.hasBox()
never evaluated: rule.hasPosition()
never evaluated: rule.hasPalette()
0
3241 ((btn->features & QStyleOptionButton::HasMenu) && hasStyleRule(w, PseudoElement_PushButtonMenuIndicator))) {
never evaluated: (btn->features & QStyleOptionButton::HasMenu)
never evaluated: hasStyleRule(w, PseudoElement_PushButtonMenuIndicator)
0
3242 ParentStyle::drawControl(ce, opt, p, w); -
3243 return;
never executed: return;
0
3244 } -
3245 }
never executed: }
0
3246 break;
never executed: break;
0
3247 case CE_PushButtonBevel: -
3248 if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
never evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)
0
3249 QStyleOptionButton btnOpt(*btn); -
3250 btnOpt.rect = rule.borderRect(opt->rect); -
3251 if (rule.hasNativeBorder()) {
never evaluated: rule.hasNativeBorder()
0
3252 rule.drawBackgroundImage(p, btnOpt.rect); -
3253 rule.configurePalette(&btnOpt.palette, QPalette::ButtonText, QPalette::Button); -
3254 bool customMenu = (btn->features & QStyleOptionButton::HasMenu
never evaluated: btn->features & QStyleOptionButton::HasMenu
0
3255 && hasStyleRule(w, PseudoElement_PushButtonMenuIndicator));
never evaluated: hasStyleRule(w, PseudoElement_PushButtonMenuIndicator)
0
3256 if (customMenu)
never evaluated: customMenu
0
3257 btnOpt.features &= ~QStyleOptionButton::HasMenu;
never executed: btnOpt.features &= ~QStyleOptionButton::HasMenu;
0
3258 if (rule.baseStyleCanDraw()) {
never evaluated: rule.baseStyleCanDraw()
0
3259 baseStyle()->drawControl(ce, &btnOpt, p, w); -
3260 } else {
never executed: }
0
3261 QWindowsStyle::drawControl(ce, &btnOpt, p, w); -
3262 }
never executed: }
0
3263 if (!customMenu)
never evaluated: !customMenu
0
3264 return;
never executed: return;
0
3265 } else {
never executed: }
0
3266 rule.drawRule(p, opt->rect); -
3267 }
never executed: }
0
3268 -
3269 if (btn->features & QStyleOptionButton::HasMenu) {
never evaluated: btn->features & QStyleOptionButton::HasMenu
0
3270 QRenderRule subRule = renderRule(w, opt, PseudoElement_PushButtonMenuIndicator); -
3271 QRect ir = positionRect(w, rule, subRule, PseudoElement_PushButtonMenuIndicator, opt->rect, opt->direction); -
3272 if (subRule.hasDrawable()) {
never evaluated: subRule.hasDrawable()
0
3273 subRule.drawRule(p, ir); -
3274 } else {
never executed: }
0
3275 btnOpt.rect = ir; -
3276 baseStyle()->drawPrimitive(PE_IndicatorArrowDown, &btnOpt, p, w); -
3277 }
never executed: }
0
3278 } -
3279 }
never executed: }
0
3280 return;
never executed: return;
0
3281 -
3282 case CE_PushButtonLabel: -
3283 if (const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
never evaluated: const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton *>(opt)
0
3284 QStyleOptionButton butOpt(*button); -
3285 rule.configurePalette(&butOpt.palette, QPalette::ButtonText, QPalette::Button); -
3286 if (rule.hasPosition() && rule.position()->textAlignment != 0) {
never evaluated: rule.hasPosition()
never evaluated: rule.position()->textAlignment != 0
0
3287 Qt::Alignment textAlignment = rule.position()->textAlignment; -
3288 QRect textRect = button->rect; -
3289 uint tf = Qt::TextShowMnemonic; -
3290 const uint verticalAlignMask = Qt::AlignVCenter | Qt::AlignTop | Qt::AlignLeft; -
3291 tf |= (textAlignment & verticalAlignMask) ? (textAlignment & verticalAlignMask) : Qt::AlignVCenter;
never evaluated: (textAlignment & verticalAlignMask)
0
3292 if (!styleHint(SH_UnderlineShortcut, button, w))
never evaluated: !styleHint(SH_UnderlineShortcut, button, w)
0
3293 tf |= Qt::TextHideMnemonic;
never executed: tf |= Qt::TextHideMnemonic;
0
3294 if (!button->icon.isNull()) {
never evaluated: !button->icon.isNull()
0
3295 -
3296 QRect iconRect; -
3297 QIcon::Mode mode = button->state & State_Enabled ? QIcon::Normal : QIcon::Disabled;
never evaluated: button->state & State_Enabled
0
3298 if (mode == QIcon::Normal && button->state & State_HasFocus)
never evaluated: mode == QIcon::Normal
never evaluated: button->state & State_HasFocus
0
3299 mode = QIcon::Active;
never executed: mode = QIcon::Active;
0
3300 QIcon::State state = QIcon::Off; -
3301 if (button->state & State_On)
never evaluated: button->state & State_On
0
3302 state = QIcon::On;
never executed: state = QIcon::On;
0
3303 -
3304 QPixmap pixmap = button->icon.pixmap(button->iconSize, mode, state); -
3305 int labelWidth = pixmap.width(); -
3306 int labelHeight = pixmap.height(); -
3307 int iconSpacing = 4; -
3308 int textWidth = button->fontMetrics.boundingRect(opt->rect, tf, button->text).width(); -
3309 if (!button->text.isEmpty())
never evaluated: !button->text.isEmpty()
0
3310 labelWidth += (textWidth + iconSpacing);
never executed: labelWidth += (textWidth + iconSpacing);
0
3311 -
3312 -
3313 if (textAlignment & Qt::AlignLeft) {
never evaluated: textAlignment & Qt::AlignLeft
0
3314 iconRect = QRect(textRect.x(), textRect.y() + (textRect.height() - labelHeight) / 2, -
3315 pixmap.width(), pixmap.height()); -
3316 } else if (textAlignment & Qt::AlignHCenter) {
never evaluated: textAlignment & Qt::AlignHCenter
never executed: }
0
3317 iconRect = QRect(textRect.x() + (textRect.width() - labelWidth) / 2, -
3318 textRect.y() + (textRect.height() - labelHeight) / 2, -
3319 pixmap.width(), pixmap.height()); -
3320 } else {
never executed: }
0
3321 iconRect = QRect(textRect.x() + textRect.width() - labelWidth, -
3322 textRect.y() + (textRect.height() - labelHeight) / 2, -
3323 pixmap.width(), pixmap.height()); -
3324 }
never executed: }
0
3325 -
3326 iconRect = visualRect(button->direction, textRect, iconRect); -
3327 -
3328 tf |= Qt::AlignLeft; -
3329 -
3330 if (button->direction == Qt::RightToLeft)
never evaluated: button->direction == Qt::RightToLeft
0
3331 textRect.setRight(iconRect.left() - iconSpacing);
never executed: textRect.setRight(iconRect.left() - iconSpacing);
0
3332 else -
3333 textRect.setLeft(iconRect.left() + iconRect.width() + iconSpacing);
never executed: textRect.setLeft(iconRect.left() + iconRect.width() + iconSpacing);
0
3334 -
3335 if (button->state & (State_On | State_Sunken))
never evaluated: button->state & (State_On | State_Sunken)
0
3336 iconRect.translate(pixelMetric(PM_ButtonShiftHorizontal, opt, w), 0
3337 pixelMetric(PM_ButtonShiftVertical, opt, w));
never executed: iconRect.translate(pixelMetric(PM_ButtonShiftHorizontal, opt, w), pixelMetric(PM_ButtonShiftVertical, opt, w));
0
3338 p->drawPixmap(iconRect, pixmap); -
3339 } else {
never executed: }
0
3340 tf |= textAlignment; -
3341 }
never executed: }
0
3342 if (button->state & (State_On | State_Sunken))
never evaluated: button->state & (State_On | State_Sunken)
0
3343 textRect.translate(pixelMetric(PM_ButtonShiftHorizontal, opt, w), 0
3344 pixelMetric(PM_ButtonShiftVertical, opt, w));
never executed: textRect.translate(pixelMetric(PM_ButtonShiftHorizontal, opt, w), pixelMetric(PM_ButtonShiftVertical, opt, w));
0
3345 -
3346 if (button->features & QStyleOptionButton::HasMenu) {
never evaluated: button->features & QStyleOptionButton::HasMenu
0
3347 int indicatorSize = pixelMetric(PM_MenuButtonIndicator, button, w); -
3348 if (button->direction == Qt::LeftToRight)
never evaluated: button->direction == Qt::LeftToRight
0
3349 textRect = textRect.adjusted(0, 0, -indicatorSize, 0);
never executed: textRect = textRect.adjusted(0, 0, -indicatorSize, 0);
0
3350 else -
3351 textRect = textRect.adjusted(indicatorSize, 0, 0, 0);
never executed: textRect = textRect.adjusted(indicatorSize, 0, 0, 0);
0
3352 } -
3353 drawItemText(p, textRect, tf, butOpt.palette, (button->state & State_Enabled), -
3354 button->text, QPalette::ButtonText); -
3355 } else {
never executed: }
0
3356 ParentStyle::drawControl(ce, &butOpt, p, w); -
3357 }
never executed: }
0
3358 } -
3359 return;
never executed: return;
0
3360 -
3361 case CE_RadioButton: -
3362 case CE_CheckBox: -
3363 if (rule.hasBox() || !rule.hasNativeBorder() || rule.hasDrawable() || hasStyleRule(w, PseudoElement_Indicator)) {
never evaluated: rule.hasBox()
never evaluated: !rule.hasNativeBorder()
never evaluated: rule.hasDrawable()
never evaluated: hasStyleRule(w, PseudoElement_Indicator)
0
3364 rule.drawRule(p, opt->rect); -
3365 ParentStyle::drawControl(ce, opt, p, w); -
3366 return;
never executed: return;
0
3367 } else if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
never evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)
0
3368 QStyleOptionButton butOpt(*btn); -
3369 rule.configurePalette(&butOpt.palette, QPalette::ButtonText, QPalette::Button); -
3370 baseStyle()->drawControl(ce, &butOpt, p, w); -
3371 return;
never executed: return;
0
3372 } -
3373 break;
never executed: break;
0
3374 case CE_RadioButtonLabel: -
3375 case CE_CheckBoxLabel: -
3376 if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
never evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)
0
3377 QStyleOptionButton butOpt(*btn); -
3378 rule.configurePalette(&butOpt.palette, QPalette::ButtonText, QPalette::Button); -
3379 ParentStyle::drawControl(ce, &butOpt, p, w); -
3380 }
never executed: }
0
3381 return;
never executed: return;
0
3382 -
3383 case CE_Splitter: -
3384 pe1 = PseudoElement_SplitterHandle; -
3385 break;
never executed: break;
0
3386 -
3387 case CE_ToolBar: -
3388 if (rule.hasBackground()) {
never evaluated: rule.hasBackground()
0
3389 rule.drawBackground(p, opt->rect); -
3390 }
never executed: }
0
3391 if (rule.hasBorder()) {
never evaluated: rule.hasBorder()
0
3392 rule.drawBorder(p, rule.borderRect(opt->rect)); -
3393 } else {
never executed: }
0
3394 -
3395 if (const QStyleOptionToolBar *tb = qstyleoption_cast<const QStyleOptionToolBar *>(opt)) {
never evaluated: const QStyleOptionToolBar *tb = qstyleoption_cast<const QStyleOptionToolBar *>(opt)
0
3396 QStyleOptionToolBar newTb(*tb); -
3397 newTb.rect = rule.borderRect(opt->rect); -
3398 baseStyle()->drawControl(ce, &newTb, p, w); -
3399 }
never executed: }
0
3400 -
3401 }
never executed: }
0
3402 return;
never executed: return;
0
3403 -
3404 case CE_MenuEmptyArea: -
3405 case CE_MenuBarEmptyArea: -
3406 if (rule.hasDrawable()) {
never evaluated: rule.hasDrawable()
0
3407 -
3408 return;
never executed: return;
0
3409 } -
3410 break;
never executed: break;
0
3411 -
3412 case CE_MenuTearoff: -
3413 case CE_MenuScroller: -
3414 if (const QStyleOptionMenuItem *m = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
never evaluated: const QStyleOptionMenuItem *m = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)
0
3415 QStyleOptionMenuItem mi(*m); -
3416 int pe = ce == CE_MenuTearoff ? PseudoElement_MenuTearoff : PseudoElement_MenuScroller;
never evaluated: ce == CE_MenuTearoff
0
3417 QRenderRule subRule = renderRule(w, opt, pe); -
3418 mi.rect = subRule.contentsRect(opt->rect); -
3419 rule.configurePalette(&mi.palette, QPalette::ButtonText, QPalette::Button); -
3420 subRule.configurePalette(&mi.palette, QPalette::ButtonText, QPalette::Button); -
3421 -
3422 if (subRule.hasDrawable()) {
never evaluated: subRule.hasDrawable()
0
3423 subRule.drawRule(p, opt->rect); -
3424 } else {
never executed: }
0
3425 baseStyle()->drawControl(ce, &mi, p, w); -
3426 }
never executed: }
0
3427 } -
3428 return;
never executed: return;
0
3429 -
3430 case CE_MenuItem: -
3431 if (const QStyleOptionMenuItem *m = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
never evaluated: const QStyleOptionMenuItem *m = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)
0
3432 QStyleOptionMenuItem mi(*m); -
3433 -
3434 int pseudo = (mi.menuItemType == QStyleOptionMenuItem::Separator) ? PseudoElement_MenuSeparator : PseudoElement_Item;
never evaluated: (mi.menuItemType == QStyleOptionMenuItem::Separator)
0
3435 QRenderRule subRule = renderRule(w, opt, pseudo); -
3436 mi.rect = subRule.contentsRect(opt->rect); -
3437 rule.configurePalette(&mi.palette, QPalette::ButtonText, QPalette::Button); -
3438 rule.configurePalette(&mi.palette, QPalette::HighlightedText, QPalette::Highlight); -
3439 subRule.configurePalette(&mi.palette, QPalette::ButtonText, QPalette::Button); -
3440 subRule.configurePalette(&mi.palette, QPalette::HighlightedText, QPalette::Highlight); -
3441 QFont oldFont = p->font(); -
3442 if (subRule.hasFont)
never evaluated: subRule.hasFont
0
3443 p->setFont(subRule.font.resolve(p->font()));
never executed: p->setFont(subRule.font.resolve(p->font()));
0
3444 -
3445 -
3446 -
3447 QRenderRule allRules = renderRule(w, PseudoElement_Item, PseudoClass_Any); -
3448 -
3449 if ((pseudo == PseudoElement_MenuSeparator) && subRule.hasDrawable()) {
never evaluated: (pseudo == PseudoElement_MenuSeparator)
never evaluated: subRule.hasDrawable()
0
3450 subRule.drawRule(p, opt->rect); -
3451 } else if ((pseudo == PseudoElement_Item)
never evaluated: (pseudo == PseudoElement_Item)
never executed: }
0
3452 && (allRules.hasBox() || allRules.hasBorder()
never evaluated: allRules.hasBox()
never evaluated: allRules.hasBorder()
0
3453 || (allRules.background() && !allRules.background()->pixmap.isNull()))) {
never evaluated: allRules.background()
never evaluated: !allRules.background()->pixmap.isNull()
0
3454 subRule.drawRule(p, opt->rect); -
3455 if (subRule.hasBackground()) {
never evaluated: subRule.hasBackground()
0
3456 mi.palette.setBrush(QPalette::Highlight, Qt::NoBrush); -
3457 mi.palette.setBrush(QPalette::Button, Qt::NoBrush); -
3458 } else {
never executed: }
0
3459 mi.palette.setBrush(QPalette::Highlight, mi.palette.brush(QPalette::Button)); -
3460 }
never executed: }
0
3461 mi.palette.setBrush(QPalette::HighlightedText, mi.palette.brush(QPalette::ButtonText)); -
3462 -
3463 bool checkable = mi.checkType != QStyleOptionMenuItem::NotCheckable; -
3464 bool checked = checkable ? mi.checked : false;
never evaluated: checkable
0
3465 -
3466 bool dis = !(opt->state & QStyle::State_Enabled), -
3467 act = opt->state & QStyle::State_Selected; -
3468 -
3469 if (!mi.icon.isNull()) {
never evaluated: !mi.icon.isNull()
0
3470 QIcon::Mode mode = dis ? QIcon::Disabled : QIcon::Normal;
never evaluated: dis
0
3471 if (act && !dis)
never evaluated: act
never evaluated: !dis
0
3472 mode = QIcon::Active;
never executed: mode = QIcon::Active;
0
3473 QPixmap pixmap; -
3474 if (checked)
never evaluated: checked
0
3475 pixmap = mi.icon.pixmap(pixelMetric(PM_SmallIconSize), mode, QIcon::On);
never executed: pixmap = mi.icon.pixmap(pixelMetric(PM_SmallIconSize), mode, QIcon::On);
0
3476 else -
3477 pixmap = mi.icon.pixmap(pixelMetric(PM_SmallIconSize), mode);
never executed: pixmap = mi.icon.pixmap(pixelMetric(PM_SmallIconSize), mode);
0
3478 int pixw = pixmap.width(); -
3479 int pixh = pixmap.height(); -
3480 QRenderRule iconRule = renderRule(w, opt, PseudoElement_MenuIcon); -
3481 if (!iconRule.hasGeometry()) {
never evaluated: !iconRule.hasGeometry()
0
3482 iconRule.geo = new QStyleSheetGeometryData(pixw, pixh, pixw, pixh, -1, -1); -
3483 } else {
never executed: }
0
3484 iconRule.geo->width = pixw; -
3485 iconRule.geo->height = pixh; -
3486 }
never executed: }
0
3487 QRect iconRect = positionRect(w, subRule, iconRule, PseudoElement_MenuIcon, opt->rect, opt->direction); -
3488 iconRule.drawRule(p, iconRect); -
3489 QRect pmr(0, 0, pixw, pixh); -
3490 pmr.moveCenter(iconRect.center()); -
3491 p->drawPixmap(pmr.topLeft(), pixmap); -
3492 } else if (checkable) {
never evaluated: checkable
never executed: }
0
3493 QRenderRule subSubRule = renderRule(w, opt, PseudoElement_MenuCheckMark); -
3494 if (subSubRule.hasDrawable() || checked) {
never evaluated: subSubRule.hasDrawable()
never evaluated: checked
0
3495 QStyleOptionMenuItem newMi = mi; -
3496 newMi.rect = positionRect(w, subRule, subSubRule, PseudoElement_MenuCheckMark, opt->rect, opt->direction); -
3497 drawPrimitive(PE_IndicatorMenuCheckMark, &newMi, p, w); -
3498 }
never executed: }
0
3499 }
never executed: }
0
3500 -
3501 QRect textRect = subRule.contentsRect(opt->rect); -
3502 textRect.setWidth(textRect.width() - mi.tabWidth); -
3503 QString s = mi.text; -
3504 p->setPen(mi.palette.buttonText().color()); -
3505 if (!s.isEmpty()) {
never evaluated: !s.isEmpty()
0
3506 int text_flags = Qt::AlignLeft | Qt::AlignVCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine; -
3507 if (!styleHint(SH_UnderlineShortcut, &mi, w))
never evaluated: !styleHint(SH_UnderlineShortcut, &mi, w)
0
3508 text_flags |= Qt::TextHideMnemonic;
never executed: text_flags |= Qt::TextHideMnemonic;
0
3509 int t = s.indexOf(QLatin1Char('\t')); -
3510 if (t >= 0) {
never evaluated: t >= 0
0
3511 QRect vShortcutRect = visualRect(opt->direction, mi.rect, -
3512 QRect(textRect.topRight(), QPoint(mi.rect.right(), textRect.bottom()))); -
3513 p->drawText(vShortcutRect, text_flags, s.mid(t + 1)); -
3514 s = s.left(t); -
3515 }
never executed: }
0
3516 p->drawText(textRect, text_flags, s.left(t)); -
3517 }
never executed: }
0
3518 -
3519 if (mi.menuItemType == QStyleOptionMenuItem::SubMenu) {
never evaluated: mi.menuItemType == QStyleOptionMenuItem::SubMenu
0
3520 PrimitiveElement arrow = (opt->direction == Qt::RightToLeft) ? PE_IndicatorArrowLeft : PE_IndicatorArrowRight;
never evaluated: (opt->direction == Qt::RightToLeft)
0
3521 QRenderRule subRule2 = renderRule(w, opt, PseudoElement_MenuRightArrow); -
3522 mi.rect = positionRect(w, subRule, subRule2, PseudoElement_MenuRightArrow, opt->rect, mi.direction); -
3523 drawPrimitive(arrow, &mi, p, w); -
3524 }
never executed: }
0
3525 } else if (hasStyleRule(w, PseudoElement_MenuCheckMark) || hasStyleRule(w, PseudoElement_MenuRightArrow)) {
never evaluated: hasStyleRule(w, PseudoElement_MenuCheckMark)
never evaluated: hasStyleRule(w, PseudoElement_MenuRightArrow)
never executed: }
0
3526 QWindowsStyle::drawControl(ce, &mi, p, w); -
3527 if (mi.checkType != QStyleOptionMenuItem::NotCheckable && !mi.checked) {
never evaluated: mi.checkType != QStyleOptionMenuItem::NotCheckable
never evaluated: !mi.checked
0
3528 -
3529 -
3530 int checkcol = qMax<int>(mi.maxIconWidth, QWindowsStylePrivate::windowsCheckMarkWidth); -
3531 QRect vCheckRect = visualRect(opt->direction, mi.rect, QRect(mi.rect.x(), mi.rect.y(), checkcol, mi.rect.height())); -
3532 if (mi.state.testFlag(State_Enabled) && mi.state.testFlag(State_Selected)) {
never evaluated: mi.state.testFlag(State_Enabled)
never evaluated: mi.state.testFlag(State_Selected)
0
3533 qDrawShadePanel(p, vCheckRect, mi.palette, true, 1, &mi.palette.brush(QPalette::Button)); -
3534 } else {
never executed: }
0
3535 QBrush fill(mi.palette.light().color(), Qt::Dense4Pattern); -
3536 qDrawShadePanel(p, vCheckRect, mi.palette, true, 1, &fill); -
3537 }
never executed: }
0
3538 QRenderRule subSubRule = renderRule(w, opt, PseudoElement_MenuCheckMark); -
3539 if (subSubRule.hasDrawable()) {
never evaluated: subSubRule.hasDrawable()
0
3540 QStyleOptionMenuItem newMi(mi); -
3541 newMi.rect = visualRect(opt->direction, mi.rect, QRect(mi.rect.x() + QWindowsStylePrivate::windowsItemFrame, -
3542 mi.rect.y() + QWindowsStylePrivate::windowsItemFrame, -
3543 checkcol - 2 * QWindowsStylePrivate::windowsItemFrame, -
3544 mi.rect.height() - 2 * QWindowsStylePrivate::windowsItemFrame)); -
3545 drawPrimitive(PE_IndicatorMenuCheckMark, &newMi, p, w); -
3546 }
never executed: }
0
3547 }
never executed: }
0
3548 } else {
never executed: }
0
3549 if (rule.hasDrawable() && !subRule.hasDrawable() && !(opt->state & QStyle::State_Selected)) {
never evaluated: rule.hasDrawable()
never evaluated: !subRule.hasDrawable()
never evaluated: !(opt->state & QStyle::State_Selected)
0
3550 mi.palette.setColor(QPalette::Window, Qt::transparent); -
3551 mi.palette.setColor(QPalette::Button, Qt::transparent); -
3552 }
never executed: }
0
3553 if (rule.baseStyleCanDraw() && subRule.baseStyleCanDraw()) {
never evaluated: rule.baseStyleCanDraw()
never evaluated: subRule.baseStyleCanDraw()
0
3554 baseStyle()->drawControl(ce, &mi, p, w); -
3555 } else {
never executed: }
0
3556 ParentStyle::drawControl(ce, &mi, p, w); -
3557 }
never executed: }
0
3558 } -
3559 -
3560 if (subRule.hasFont)
never evaluated: subRule.hasFont
0
3561 p->setFont(oldFont);
never executed: p->setFont(oldFont);
0
3562 -
3563 return;
never executed: return;
0
3564 } -
3565 return;
never executed: return;
0
3566 -
3567 case CE_MenuBarItem: -
3568 if (const QStyleOptionMenuItem *m = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
never evaluated: const QStyleOptionMenuItem *m = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)
0
3569 QStyleOptionMenuItem mi(*m); -
3570 QRenderRule subRule = renderRule(w, opt, PseudoElement_Item); -
3571 mi.rect = subRule.contentsRect(opt->rect); -
3572 rule.configurePalette(&mi.palette, QPalette::ButtonText, QPalette::Button); -
3573 subRule.configurePalette(&mi.palette, QPalette::ButtonText, QPalette::Button); -
3574 -
3575 if (subRule.hasDrawable()) {
never evaluated: subRule.hasDrawable()
0
3576 subRule.drawRule(p, opt->rect); -
3577 QCommonStyle::drawControl(ce, &mi, p, w); -
3578 } else {
never executed: }
0
3579 if (rule.hasDrawable() && !(opt->state & QStyle::State_Selected)) {
never evaluated: rule.hasDrawable()
never evaluated: !(opt->state & QStyle::State_Selected)
0
3580 -
3581 mi.palette.setColor(QPalette::Window, Qt::transparent); -
3582 mi.palette.setColor(QPalette::Button, Qt::transparent); -
3583 }
never executed: }
0
3584 baseStyle()->drawControl(ce, &mi, p, w); -
3585 }
never executed: }
0
3586 } -
3587 return;
never executed: return;
0
3588 -
3589 -
3590 case CE_ComboBoxLabel: -
3591 if (!rule.hasBox())
never evaluated: !rule.hasBox()
0
3592 break;
never executed: break;
0
3593 if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
never evaluated: const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)
0
3594 QRect editRect = subControlRect(CC_ComboBox, cb, SC_ComboBoxEditField, w); -
3595 p->save(); -
3596 p->setClipRect(editRect); -
3597 if (!cb->currentIcon.isNull()) {
never evaluated: !cb->currentIcon.isNull()
0
3598 int spacing = rule.hasBox() ? rule.box()->spacing : -1;
never evaluated: rule.hasBox()
0
3599 if (spacing == -1)
never evaluated: spacing == -1
0
3600 spacing = 6;
never executed: spacing = 6;
0
3601 QIcon::Mode mode = cb->state & State_Enabled ? QIcon::Normal : QIcon::Disabled;
never evaluated: cb->state & State_Enabled
0
3602 QPixmap pixmap = cb->currentIcon.pixmap(cb->iconSize, mode); -
3603 QRect iconRect(editRect); -
3604 iconRect.setWidth(cb->iconSize.width()); -
3605 iconRect = alignedRect(cb->direction, -
3606 Qt::AlignLeft | Qt::AlignVCenter, -
3607 iconRect.size(), editRect); -
3608 drawItemPixmap(p, iconRect, Qt::AlignCenter, pixmap); -
3609 -
3610 if (cb->direction == Qt::RightToLeft)
never evaluated: cb->direction == Qt::RightToLeft
0
3611 editRect.translate(-spacing - cb->iconSize.width(), 0);
never executed: editRect.translate(-spacing - cb->iconSize.width(), 0);
0
3612 else -
3613 editRect.translate(cb->iconSize.width() + spacing, 0);
never executed: editRect.translate(cb->iconSize.width() + spacing, 0);
0
3614 } -
3615 if (!cb->currentText.isEmpty() && !cb->editable) {
never evaluated: !cb->currentText.isEmpty()
never evaluated: !cb->editable
0
3616 QPalette styledPalette(cb->palette); -
3617 rule.configurePalette(&styledPalette, QPalette::Text, QPalette::Base); -
3618 drawItemText(p, editRect.adjusted(0, 0, 0, 0), Qt::AlignLeft | Qt::AlignVCenter, styledPalette, -
3619 cb->state & State_Enabled, cb->currentText, QPalette::Text); -
3620 }
never executed: }
0
3621 p->restore(); -
3622 return;
never executed: return;
0
3623 } -
3624 break;
never executed: break;
0
3625 -
3626 -
3627 case CE_Header: -
3628 if (hasStyleRule(w, PseudoElement_HeaderViewUpArrow)
partially evaluated: hasStyleRule(w, PseudoElement_HeaderViewUpArrow)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4
0-4
3629 || hasStyleRule(w, PseudoElement_HeaderViewDownArrow)) {
partially evaluated: hasStyleRule(w, PseudoElement_HeaderViewDownArrow)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4
0-4
3630 ParentStyle::drawControl(ce, opt, p, w); -
3631 return;
never executed: return;
0
3632 } -
3633 if(hasStyleRule(w, PseudoElement_HeaderViewSection)) {
partially evaluated: hasStyleRule(w, PseudoElement_HeaderViewSection)
TRUEFALSE
yes
Evaluation Count:4
no
Evaluation Count:0
0-4
3634 QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection); -
3635 if (!subRule.hasNativeBorder() || !subRule.baseStyleCanDraw()
partially evaluated: !subRule.hasNativeBorder()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4
partially evaluated: !subRule.baseStyleCanDraw()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4
0-4
3636 || subRule.hasBackground() || subRule.hasPalette()) {
partially evaluated: subRule.hasBackground()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4
partially evaluated: subRule.hasPalette()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4
0-4
3637 ParentStyle::drawControl(ce, opt, p, w); -
3638 return;
never executed: return;
0
3639 } -
3640 }
executed: }
Execution Count:4
4
3641 break;
executed: break;
Execution Count:4
4
3642 case CE_HeaderSection: -
3643 if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt)) {
never evaluated: const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt)
0
3644 QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection); -
3645 if (subRule.hasNativeBorder()) {
never evaluated: subRule.hasNativeBorder()
0
3646 QStyleOptionHeader hdr(*header); -
3647 subRule.configurePalette(&hdr.palette, QPalette::ButtonText, QPalette::Button); -
3648 -
3649 if (subRule.baseStyleCanDraw()) {
never evaluated: subRule.baseStyleCanDraw()
0
3650 baseStyle()->drawControl(CE_HeaderSection, &hdr, p, w); -
3651 } else {
never executed: }
0
3652 QWindowsStyle::drawControl(CE_HeaderSection, &hdr, p, w); -
3653 }
never executed: }
0
3654 } else { -
3655 subRule.drawRule(p, opt->rect); -
3656 }
never executed: }
0
3657 return;
never executed: return;
0
3658 } -
3659 break;
never executed: break;
0
3660 -
3661 case CE_HeaderLabel: -
3662 if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt)) {
never evaluated: const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt)
0
3663 QStyleOptionHeader hdr(*header); -
3664 QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection); -
3665 subRule.configurePalette(&hdr.palette, QPalette::ButtonText, QPalette::Button); -
3666 QFont oldFont = p->font(); -
3667 if (subRule.hasFont)
never evaluated: subRule.hasFont
0
3668 p->setFont(subRule.font.resolve(p->font()));
never executed: p->setFont(subRule.font.resolve(p->font()));
0
3669 baseStyle()->drawControl(ce, &hdr, p, w); -
3670 if (subRule.hasFont)
never evaluated: subRule.hasFont
0
3671 p->setFont(oldFont);
never executed: p->setFont(oldFont);
0
3672 return;
never executed: return;
0
3673 } -
3674 break;
never executed: break;
0
3675 -
3676 case CE_HeaderEmptyArea: -
3677 if (rule.hasDrawable()) {
never evaluated: rule.hasDrawable()
0
3678 return;
never executed: return;
0
3679 } -
3680 break;
never executed: break;
0
3681 -
3682 case CE_ProgressBar: -
3683 QWindowsStyle::drawControl(ce, opt, p, w); -
3684 return;
never executed: return;
0
3685 -
3686 case CE_ProgressBarGroove: -
3687 if (!rule.hasNativeBorder()) {
never evaluated: !rule.hasNativeBorder()
0
3688 rule.drawRule(p, rule.boxRect(opt->rect, Margin)); -
3689 return;
never executed: return;
0
3690 } -
3691 break;
never executed: break;
0
3692 -
3693 case CE_ProgressBarContents: { -
3694 QRenderRule subRule = renderRule(w, opt, PseudoElement_ProgressBarChunk); -
3695 if (subRule.hasDrawable()) {
never evaluated: subRule.hasDrawable()
0
3696 if (const QStyleOptionProgressBarV2 *pb = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt)) {
never evaluated: const QStyleOptionProgressBarV2 *pb = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt)
0
3697 p->save(); -
3698 p->setClipRect(pb->rect); -
3699 -
3700 qint64 minimum = qint64(pb->minimum); -
3701 qint64 maximum = qint64(pb->maximum); -
3702 qint64 progress = qint64(pb->progress); -
3703 bool vertical = (pb->orientation == Qt::Vertical); -
3704 bool inverted = pb->invertedAppearance; -
3705 -
3706 QTransform m; -
3707 QRect rect = pb->rect; -
3708 if (vertical) {
never evaluated: vertical
0
3709 rect = QRect(rect.y(), rect.x(), rect.height(), rect.width()); -
3710 m.rotate(90); -
3711 m.translate(0, -(rect.height() + rect.y()*2)); -
3712 }
never executed: }
0
3713 -
3714 bool reverse = ((!vertical && (pb->direction == Qt::RightToLeft)) || vertical);
never evaluated: !vertical
never evaluated: (pb->direction == Qt::RightToLeft)
never evaluated: vertical
0
3715 if (inverted)
never evaluated: inverted
0
3716 reverse = !reverse;
never executed: reverse = !reverse;
0
3717 const bool indeterminate = pb->minimum == pb->maximum; -
3718 qreal fillRatio = indeterminate ? 0.50 : qreal(progress - minimum)/(maximum - minimum);
never evaluated: indeterminate
0
3719 int fillWidth = int(rect.width() * fillRatio); -
3720 int chunkWidth = fillWidth; -
3721 if (subRule.hasContentsSize()) {
never evaluated: subRule.hasContentsSize()
0
3722 QSize sz = subRule.size(); -
3723 chunkWidth = (opt->state & QStyle::State_Horizontal) ? sz.width() : sz.height();
never evaluated: (opt->state & QStyle::State_Horizontal)
0
3724 }
never executed: }
0
3725 -
3726 QRect r = rect; -
3727 const QWindowsStylePrivate * const d = d_func(); -
3728 if (pb->minimum == 0 && pb->maximum == 0) {
never evaluated: pb->minimum == 0
never evaluated: pb->maximum == 0
0
3729 int chunkCount = fillWidth/chunkWidth; -
3730 int offset = 0; -
3731 if (QProgressStyleAnimation *animation = qobject_cast<QProgressStyleAnimation*>(d->animation(opt->styleObject)))
never evaluated: QProgressStyleAnimation *animation = qobject_cast<QProgressStyleAnimation*>(d->animation(opt->styleObject))
0
3732 offset = animation->animationStep() * 8 % rect.width();
never executed: offset = animation->animationStep() * 8 % rect.width();
0
3733 else -
3734 d->startAnimation(new QProgressStyleAnimation(d->animationFps, opt->styleObject));
never executed: d->startAnimation(new QProgressStyleAnimation(d->animationFps, opt->styleObject));
0
3735 int x = reverse ? r.left() + r.width() - offset - chunkWidth : r.x() + offset;
never evaluated: reverse
0
3736 while (chunkCount > 0) {
never evaluated: chunkCount > 0
0
3737 r.setRect(x, rect.y(), chunkWidth, rect.height()); -
3738 r = m.mapRect(QRectF(r)).toRect(); -
3739 subRule.drawRule(p, r); -
3740 x += reverse ? -chunkWidth : chunkWidth;
never evaluated: reverse
0
3741 if (reverse ? x < rect.left() : x > rect.right())
never evaluated: reverse
0
3742 break;
never executed: break;
0
3743 --chunkCount; -
3744 }
never executed: }
0
3745 -
3746 r = rect; -
3747 x = reverse ? r.right() - (r.left() - x - chunkWidth)
never evaluated: reverse
0
3748 : r.left() + (x - r.right() - chunkWidth); -
3749 while (chunkCount > 0) {
never evaluated: chunkCount > 0
0
3750 r.setRect(x, rect.y(), chunkWidth, rect.height()); -
3751 r = m.mapRect(QRectF(r)).toRect(); -
3752 subRule.drawRule(p, r); -
3753 x += reverse ? -chunkWidth : chunkWidth;
never evaluated: reverse
0
3754 --chunkCount; -
3755 };
never executed: }
0
3756 } else {
never executed: }
0
3757 int x = reverse ? r.left() + r.width() - chunkWidth : r.x();
never evaluated: reverse
0
3758 -
3759 for (int i = 0; i < ((int)(qreal(fillWidth)/chunkWidth) + ((qreal(fillWidth)/chunkWidth) > 0 && (qreal(fillWidth)/chunkWidth) != (int)(qreal(fillWidth)/chunkWidth))); ++i) {
never evaluated: i < ((int)(qreal(fillWidth)/chunkWidth) + ((qreal(fillWidth)/chunkWidth) > 0 && (qreal(fillWidth)/chunkWidth) != (int)(qreal(fillWidth)/chunkWidth)))
0
3760 r.setRect(x, rect.y(), chunkWidth, rect.height()); -
3761 r = m.mapRect(QRectF(r)).toRect(); -
3762 subRule.drawRule(p, r); -
3763 x += reverse ? -chunkWidth : chunkWidth;
never evaluated: reverse
0
3764 }
never executed: }
0
3765 -
3766 d->stopAnimation(opt->styleObject); -
3767 }
never executed: }
0
3768 -
3769 p->restore(); -
3770 return;
never executed: return;
0
3771 } -
3772 }
never executed: }
0
3773 } -
3774 break;
never executed: break;
0
3775 -
3776 case CE_ProgressBarLabel: -
3777 if (const QStyleOptionProgressBarV2 *pb = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt)) {
never evaluated: const QStyleOptionProgressBarV2 *pb = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt)
0
3778 if (rule.hasBox() || rule.hasBorder() || hasStyleRule(w, PseudoElement_ProgressBarChunk)) {
never evaluated: rule.hasBox()
never evaluated: rule.hasBorder()
never evaluated: hasStyleRule(w, PseudoElement_ProgressBarChunk)
0
3779 drawItemText(p, pb->rect, pb->textAlignment | Qt::TextSingleLine, pb->palette, -
3780 pb->state & State_Enabled, pb->text, QPalette::Text); -
3781 } else {
never executed: }
0
3782 QStyleOptionProgressBarV2 pbCopy(*pb); -
3783 rule.configurePalette(&pbCopy.palette, QPalette::HighlightedText, QPalette::Highlight); -
3784 baseStyle()->drawControl(ce, &pbCopy, p, w); -
3785 }
never executed: }
0
3786 return;
never executed: return;
0
3787 } -
3788 break;
never executed: break;
0
3789 -
3790 case CE_SizeGrip: -
3791 if (const QStyleOptionSizeGrip *sgOpt = qstyleoption_cast<const QStyleOptionSizeGrip *>(opt)) {
never evaluated: const QStyleOptionSizeGrip *sgOpt = qstyleoption_cast<const QStyleOptionSizeGrip *>(opt)
0
3792 if (rule.hasDrawable()) {
never evaluated: rule.hasDrawable()
0
3793 rule.drawFrame(p, opt->rect); -
3794 p->save(); -
3795 switch (sgOpt->corner) { -
3796 case Qt::BottomRightCorner: break;
never executed: break;
0
3797 case Qt::BottomLeftCorner: p->rotate(90); break;
never executed: break;
0
3798 case Qt::TopLeftCorner: p->rotate(180); break;
never executed: break;
0
3799 case Qt::TopRightCorner: p->rotate(270); break;
never executed: break;
0
3800 default: break;
never executed: break;
0
3801 } -
3802 rule.drawImage(p, opt->rect); -
3803 p->restore(); -
3804 } else {
never executed: }
0
3805 QStyleOptionSizeGrip sg(*sgOpt); -
3806 sg.rect = rule.contentsRect(opt->rect); -
3807 baseStyle()->drawControl(CE_SizeGrip, &sg, p, w); -
3808 }
never executed: }
0
3809 return;
never executed: return;
0
3810 } -
3811 break;
never executed: break;
0
3812 -
3813 case CE_ToolBoxTab: -
3814 QWindowsStyle::drawControl(ce, opt, p, w); -
3815 return;
never executed: return;
0
3816 -
3817 case CE_ToolBoxTabShape: { -
3818 QRenderRule subRule = renderRule(w, opt, PseudoElement_ToolBoxTab); -
3819 if (subRule.hasDrawable()) {
never evaluated: subRule.hasDrawable()
0
3820 subRule.drawRule(p, opt->rect); -
3821 return;
never executed: return;
0
3822 } -
3823 } -
3824 break;
never executed: break;
0
3825 -
3826 case CE_ToolBoxTabLabel: -
3827 if (const QStyleOptionToolBox *box = qstyleoption_cast<const QStyleOptionToolBox *>(opt)) {
never evaluated: const QStyleOptionToolBox *box = qstyleoption_cast<const QStyleOptionToolBox *>(opt)
0
3828 QStyleOptionToolBox boxCopy(*box); -
3829 QRenderRule subRule = renderRule(w, opt, PseudoElement_ToolBoxTab); -
3830 subRule.configurePalette(&boxCopy.palette, QPalette::ButtonText, QPalette::Button); -
3831 QFont oldFont = p->font(); -
3832 if (subRule.hasFont)
never evaluated: subRule.hasFont
0
3833 p->setFont(subRule.font);
never executed: p->setFont(subRule.font);
0
3834 boxCopy.rect = subRule.contentsRect(opt->rect); -
3835 QWindowsStyle::drawControl(ce, &boxCopy, p , w); -
3836 if (subRule.hasFont)
never evaluated: subRule.hasFont
0
3837 p->setFont(oldFont);
never executed: p->setFont(oldFont);
0
3838 return;
never executed: return;
0
3839 } -
3840 break;
never executed: break;
0
3841 -
3842 case CE_ScrollBarAddPage: -
3843 pe1 = PseudoElement_ScrollBarAddPage; -
3844 break;
never executed: break;
0
3845 -
3846 case CE_ScrollBarSubPage: -
3847 pe1 = PseudoElement_ScrollBarSubPage; -
3848 break;
never executed: break;
0
3849 -
3850 case CE_ScrollBarAddLine: -
3851 pe1 = PseudoElement_ScrollBarAddLine; -
3852 pe2 = (opt->state & QStyle::State_Horizontal) ? PseudoElement_ScrollBarRightArrow : PseudoElement_ScrollBarDownArrow;
never evaluated: (opt->state & QStyle::State_Horizontal)
0
3853 fallback = true; -
3854 break;
never executed: break;
0
3855 -
3856 case CE_ScrollBarSubLine: -
3857 pe1 = PseudoElement_ScrollBarSubLine; -
3858 pe2 = (opt->state & QStyle::State_Horizontal) ? PseudoElement_ScrollBarLeftArrow : PseudoElement_ScrollBarUpArrow;
never evaluated: (opt->state & QStyle::State_Horizontal)
0
3859 fallback = true; -
3860 break;
never executed: break;
0
3861 -
3862 case CE_ScrollBarFirst: -
3863 pe1 = PseudoElement_ScrollBarFirst; -
3864 break;
never executed: break;
0
3865 -
3866 case CE_ScrollBarLast: -
3867 pe1 = PseudoElement_ScrollBarLast; -
3868 break;
never executed: break;
0
3869 -
3870 case CE_ScrollBarSlider: -
3871 pe1 = PseudoElement_ScrollBarSlider; -
3872 fallback = true; -
3873 break;
never executed: break;
0
3874 -
3875 -
3876 case CE_ItemViewItem: -
3877 if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) {
partially evaluated: const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)
TRUEFALSE
yes
Evaluation Count:16
no
Evaluation Count:0
0-16
3878 QRenderRule subRule = renderRule(w, opt, PseudoElement_ViewItem); -
3879 if (subRule.hasDrawable() || hasStyleRule(w, PseudoElement_Indicator)) {
partially evaluated: subRule.hasDrawable()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16
partially evaluated: hasStyleRule(w, PseudoElement_Indicator)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16
0-16
3880 QStyleOptionViewItem optCopy(*vopt); -
3881 subRule.configurePalette(&optCopy.palette, vopt->state & QStyle::State_Selected ? QPalette::HighlightedText : QPalette::Text, -
3882 vopt->state & QStyle::State_Selected ? QPalette::Highlight : QPalette::Base); -
3883 QWindowsStyle::drawControl(ce, &optCopy, p, w); -
3884 } else {
never executed: }
0
3885 QStyleOptionViewItem voptCopy(*vopt); -
3886 subRule.configurePalette(&voptCopy.palette, QPalette::Text, QPalette::NoRole); -
3887 baseStyle()->drawControl(ce, &voptCopy, p, w); -
3888 }
executed: }
Execution Count:16
16
3889 return;
executed: return;
Execution Count:16
16
3890 } -
3891 break;
never executed: break;
0
3892 -
3893 -
3894 -
3895 case CE_TabBarTab: -
3896 if (hasStyleRule(w, PseudoElement_TabBarTab)) {
never evaluated: hasStyleRule(w, PseudoElement_TabBarTab)
0
3897 QWindowsStyle::drawControl(ce, opt, p, w); -
3898 return;
never executed: return;
0
3899 } -
3900 break;
never executed: break;
0
3901 -
3902 case CE_TabBarTabLabel: -
3903 case CE_TabBarTabShape: -
3904 if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
never evaluated: const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)
0
3905 QStyleOptionTabV3 tabCopy(*tab); -
3906 QRenderRule subRule = renderRule(w, opt, PseudoElement_TabBarTab); -
3907 QRect r = positionRect(w, subRule, PseudoElement_TabBarTab, opt->rect, opt->direction); -
3908 if (ce == CE_TabBarTabShape && subRule.hasDrawable()) {
never evaluated: ce == CE_TabBarTabShape
never evaluated: subRule.hasDrawable()
0
3909 subRule.drawRule(p, r); -
3910 return;
never executed: return;
0
3911 } -
3912 subRule.configurePalette(&tabCopy.palette, QPalette::WindowText, QPalette::Window); -
3913 QFont oldFont = p->font(); -
3914 if (subRule.hasFont)
never evaluated: subRule.hasFont
0
3915 p->setFont(subRule.font);
never executed: p->setFont(subRule.font);
0
3916 if (subRule.hasBox() || !subRule.hasNativeBorder()) {
never evaluated: subRule.hasBox()
never evaluated: !subRule.hasNativeBorder()
0
3917 tabCopy.rect = ce == CE_TabBarTabShape ? subRule.borderRect(r)
never evaluated: ce == CE_TabBarTabShape
0
3918 : subRule.contentsRect(r); -
3919 QWindowsStyle::drawControl(ce, &tabCopy, p, w); -
3920 } else {
never executed: }
0
3921 baseStyle()->drawControl(ce, &tabCopy, p, w); -
3922 }
never executed: }
0
3923 if (subRule.hasFont)
never evaluated: subRule.hasFont
0
3924 p->setFont(oldFont);
never executed: p->setFont(oldFont);
0
3925 -
3926 return;
never executed: return;
0
3927 } -
3928 break;
never executed: break;
0
3929 -
3930 -
3931 case CE_ColumnViewGrip: -
3932 if (rule.hasDrawable()) {
never evaluated: rule.hasDrawable()
0
3933 rule.drawRule(p, opt->rect); -
3934 return;
never executed: return;
0
3935 } -
3936 break;
never executed: break;
0
3937 -
3938 case CE_DockWidgetTitle: -
3939 if (const QStyleOptionDockWidgetV2 *dwOpt = qstyleoption_cast<const QStyleOptionDockWidgetV2 *>(opt)) {
never evaluated: const QStyleOptionDockWidgetV2 *dwOpt = qstyleoption_cast<const QStyleOptionDockWidgetV2 *>(opt)
0
3940 QRenderRule subRule = renderRule(w, opt, PseudoElement_DockWidgetTitle); -
3941 if (!subRule.hasDrawable() && !subRule.hasPosition())
never evaluated: !subRule.hasDrawable()
never evaluated: !subRule.hasPosition()
0
3942 break;
never executed: break;
0
3943 if (subRule.hasDrawable()) {
never evaluated: subRule.hasDrawable()
0
3944 subRule.drawRule(p, opt->rect); -
3945 } else {
never executed: }
0
3946 QStyleOptionDockWidgetV2 dwCopy(*dwOpt); -
3947 dwCopy.title = QString(); -
3948 baseStyle()->drawControl(ce, &dwCopy, p, w); -
3949 }
never executed: }
0
3950 -
3951 if (!dwOpt->title.isEmpty()) {
never evaluated: !dwOpt->title.isEmpty()
0
3952 QRect r = opt->rect; -
3953 if (dwOpt->verticalTitleBar) {
never evaluated: dwOpt->verticalTitleBar
0
3954 QSize s = r.size(); -
3955 s.transpose(); -
3956 r.setSize(s); -
3957 -
3958 p->save(); -
3959 p->translate(r.left(), r.top() + r.width()); -
3960 p->rotate(-90); -
3961 p->translate(-r.left(), -r.top()); -
3962 }
never executed: }
0
3963 -
3964 Qt::Alignment alignment = 0; -
3965 if (subRule.hasPosition())
never evaluated: subRule.hasPosition()
0
3966 alignment = subRule.position()->textAlignment;
never executed: alignment = subRule.position()->textAlignment;
0
3967 if (alignment == 0)
never evaluated: alignment == 0
0
3968 alignment = Qt::AlignLeft;
never executed: alignment = Qt::AlignLeft;
0
3969 drawItemText(p, subRule.contentsRect(opt->rect), -
3970 alignment | Qt::TextShowMnemonic, dwOpt->palette, -
3971 dwOpt->state & State_Enabled, dwOpt->title, -
3972 QPalette::WindowText); -
3973 -
3974 if (dwOpt->verticalTitleBar)
never evaluated: dwOpt->verticalTitleBar
0
3975 p->restore();
never executed: p->restore();
0
3976 }
never executed: }
0
3977 -
3978 return;
never executed: return;
0
3979 } -
3980 break;
never executed: break;
0
3981 case CE_ShapedFrame: -
3982 if (const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
partially evaluated: const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(opt)
TRUEFALSE
yes
Evaluation Count:485
no
Evaluation Count:0
0-485
3983 if (rule.hasNativeBorder()) {
evaluated: rule.hasNativeBorder()
TRUEFALSE
yes
Evaluation Count:483
yes
Evaluation Count:2
2-483
3984 QStyleOptionFrameV3 frmOpt(*frm); -
3985 rule.configurePalette(&frmOpt.palette, QPalette::Text, QPalette::Base); -
3986 frmOpt.rect = rule.borderRect(frmOpt.rect); -
3987 baseStyle()->drawControl(ce, &frmOpt, p, w); -
3988 }
executed: }
Execution Count:483
483
3989 -
3990 }
executed: }
Execution Count:485
485
3991 return;
executed: return;
Execution Count:485
485
3992 -
3993 -
3994 default: -
3995 break;
never executed: break;
0
3996 } -
3997 -
3998 if (pe1 != PseudoElement_None) {
partially evaluated: pe1 != PseudoElement_None
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4
0-4
3999 QRenderRule subRule = renderRule(w, opt, pe1); -
4000 if (subRule.bg != 0 || subRule.hasDrawable()) {
never evaluated: subRule.bg != 0
never evaluated: subRule.hasDrawable()
0
4001 -
4002 -
4003 subRule.drawRule(p, opt->rect); -
4004 } else if (fallback) {
never evaluated: fallback
never executed: }
0
4005 QWindowsStyle::drawControl(ce, opt, p, w); -
4006 pe2 = PseudoElement_None; -
4007 } else {
never executed: }
0
4008 baseStyle()->drawControl(ce, opt, p, w); -
4009 }
never executed: }
0
4010 if (pe2 != PseudoElement_None) {
never evaluated: pe2 != PseudoElement_None
0
4011 QRenderRule subSubRule = renderRule(w, opt, pe2); -
4012 QRect r = positionRect(w, subRule, subSubRule, pe2, opt->rect, opt->direction); -
4013 subSubRule.drawRule(p, r); -
4014 }
never executed: }
0
4015 return;
never executed: return;
0
4016 } -
4017 -
4018 baseStyle()->drawControl(ce, opt, p, w); -
4019}
executed: }
Execution Count:4
4
4020 -
4021void QStyleSheetStyle::drawItemPixmap(QPainter *p, const QRect &rect, int alignment, const -
4022 QPixmap &pixmap) const -
4023{ -
4024 baseStyle()->drawItemPixmap(p, rect, alignment, pixmap); -
4025}
never executed: }
0
4026 -
4027void QStyleSheetStyle::drawItemText(QPainter *painter, const QRect& rect, int alignment, const QPalette &pal, -
4028 bool enabled, const QString& text, QPalette::ColorRole textRole) const -
4029{ -
4030 baseStyle()->drawItemText(painter, rect, alignment, pal, enabled, text, textRole); -
4031}
never executed: }
0
4032 -
4033void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, -
4034 const QWidget *w) const -
4035{ -
4036 if (globalStyleSheetStyle != 0 && globalStyleSheetStyle != this) { baseStyle()->drawPrimitive(pe, opt, p, w); return; } QStyleSheetStyleRecursionGuard recursion_guard(this);
evaluated: globalStyleSheetStyle != 0
TRUEFALSE
yes
Evaluation Count:387
yes
Evaluation Count:347
partially evaluated: globalStyleSheetStyle != this
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:387
never executed: return;
0-387
4037 -
4038 int pseudoElement = PseudoElement_None; -
4039 QRenderRule rule = renderRule(w, opt); -
4040 QRect rect = opt->rect; -
4041 -
4042 switch (pe) { -
4043 -
4044 case PE_FrameStatusBar: { -
4045 QRenderRule subRule = renderRule(w->parentWidget(), opt, PseudoElement_Item); -
4046 if (subRule.hasDrawable()) {
never evaluated: subRule.hasDrawable()
0
4047 subRule.drawRule(p, opt->rect); -
4048 return;
never executed: return;
0
4049 } -
4050 break;
never executed: break;
0
4051 } -
4052 -
4053 case PE_IndicatorArrowDown: -
4054 pseudoElement = PseudoElement_DownArrow; -
4055 break;
never executed: break;
0
4056 -
4057 case PE_IndicatorArrowUp: -
4058 pseudoElement = PseudoElement_UpArrow; -
4059 break;
never executed: break;
0
4060 -
4061 case PE_IndicatorRadioButton: -
4062 pseudoElement = PseudoElement_ExclusiveIndicator; -
4063 break;
never executed: break;
0
4064 -
4065 case PE_IndicatorViewItemCheck: -
4066 pseudoElement = PseudoElement_ViewItemIndicator; -
4067 break;
never executed: break;
0
4068 -
4069 case PE_IndicatorCheckBox: -
4070 pseudoElement = PseudoElement_Indicator; -
4071 break;
never executed: break;
0
4072 -
4073 case PE_IndicatorHeaderArrow: -
4074 if (const QStyleOptionHeader *hdr = qstyleoption_cast<const QStyleOptionHeader *>(opt)) {
never evaluated: const QStyleOptionHeader *hdr = qstyleoption_cast<const QStyleOptionHeader *>(opt)
0
4075 pseudoElement = hdr->sortIndicator == QStyleOptionHeader::SortUp
never evaluated: hdr->sortIndicator == QStyleOptionHeader::SortUp
0
4076 ? PseudoElement_HeaderViewUpArrow -
4077 : PseudoElement_HeaderViewDownArrow; -
4078 }
never executed: }
0
4079 break;
never executed: break;
0
4080 -
4081 case PE_PanelButtonTool: -
4082 case PE_PanelButtonCommand: -
4083 if (qobject_cast<const QAbstractButton *>(w) && rule.hasBackground() && rule.hasNativeBorder()) {
never evaluated: qobject_cast<const QAbstractButton *>(w)
never evaluated: rule.hasBackground()
never evaluated: rule.hasNativeBorder()
0
4084 -
4085 ParentStyle::drawPrimitive(pe, opt, p, w); -
4086 if (!rule.background()->pixmap.isNull() || rule.hasImage()) {
never evaluated: !rule.background()->pixmap.isNull()
never evaluated: rule.hasImage()
0
4087 rule.drawRule(p, rule.boxRect(opt->rect, QRenderRule::Margin).adjusted(1,1,-1,-1)); -
4088 }
never executed: }
0
4089 return;
never executed: return;
0
4090 } -
4091 if (!rule.hasNativeBorder()) {
never evaluated: !rule.hasNativeBorder()
0
4092 rule.drawRule(p, rule.boxRect(opt->rect, QRenderRule::Margin)); -
4093 return;
never executed: return;
0
4094 } -
4095 break;
never executed: break;
0
4096 -
4097 case PE_IndicatorButtonDropDown: { -
4098 QRenderRule subRule = renderRule(w, opt, PseudoElement_ToolButtonMenu); -
4099 if (!subRule.hasNativeBorder()) {
never evaluated: !subRule.hasNativeBorder()
0
4100 rule.drawBorder(p, opt->rect); -
4101 return;
never executed: return;
0
4102 } -
4103 break;
never executed: break;
0
4104 } -
4105 -
4106 case PE_FrameDefaultButton: -
4107 if (rule.hasNativeBorder()) {
never evaluated: rule.hasNativeBorder()
0
4108 if (rule.baseStyleCanDraw())
never evaluated: rule.baseStyleCanDraw()
0
4109 break;
never executed: break;
0
4110 QWindowsStyle::drawPrimitive(pe, opt, p, w); -
4111 }
never executed: }
0
4112 return;
never executed: return;
0
4113 -
4114 case PE_FrameWindow: -
4115 case PE_FrameDockWidget: -
4116 case PE_Frame: -
4117 if (const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
partially evaluated: const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(opt)
TRUEFALSE
yes
Evaluation Count:387
no
Evaluation Count:0
0-387
4118 if (rule.hasNativeBorder()) {
partially evaluated: rule.hasNativeBorder()
TRUEFALSE
yes
Evaluation Count:387
no
Evaluation Count:0
0-387
4119 QStyleOptionFrameV2 frmOpt(*frm); -
4120 rule.configurePalette(&frmOpt.palette, QPalette::Text, QPalette::Base); -
4121 if (!qstyleoption_cast<const QStyleOptionFrameV3 *>(opt))
partially evaluated: !qstyleoption_cast<const QStyleOptionFrameV3 *>(opt)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:387
0-387
4122 frmOpt.rect = rule.borderRect(frmOpt.rect);
never executed: frmOpt.rect = rule.borderRect(frmOpt.rect);
0
4123 baseStyle()->drawPrimitive(pe, &frmOpt, p, w); -
4124 } else {
executed: }
Execution Count:387
387
4125 rule.drawBorder(p, rule.borderRect(opt->rect)); -
4126 }
never executed: }
0
4127 } -
4128 return;
executed: return;
Execution Count:387
387
4129 -
4130 case PE_PanelLineEdit: -
4131 if (const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
partially evaluated: const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(opt)
TRUEFALSE
yes
Evaluation Count:7
no
Evaluation Count:0
0-7
4132 -
4133 if (w && qobject_cast<const QAbstractSpinBox *>(w->parentWidget())) {
partially evaluated: w
TRUEFALSE
yes
Evaluation Count:7
no
Evaluation Count:0
partially evaluated: qobject_cast<const QAbstractSpinBox *>(w->parentWidget())
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
0-7
4134 QRenderRule spinboxRule = renderRule(w->parentWidget(), opt); -
4135 if (!spinboxRule.hasNativeBorder() || !spinboxRule.baseStyleCanDraw())
never evaluated: !spinboxRule.hasNativeBorder()
never evaluated: !spinboxRule.baseStyleCanDraw()
0
4136 return;
never executed: return;
0
4137 rule = spinboxRule; -
4138 }
never executed: }
0
4139 -
4140 if (rule.hasNativeBorder()) {
partially evaluated: rule.hasNativeBorder()
TRUEFALSE
yes
Evaluation Count:7
no
Evaluation Count:0
0-7
4141 QStyleOptionFrame frmOpt(*frm); -
4142 rule.configurePalette(&frmOpt.palette, QPalette::Text, QPalette::Base); -
4143 frmOpt.rect = rule.borderRect(frmOpt.rect); -
4144 if (rule.baseStyleCanDraw()) {
partially evaluated: rule.baseStyleCanDraw()
TRUEFALSE
yes
Evaluation Count:7
no
Evaluation Count:0
0-7
4145 rule.drawBackgroundImage(p, opt->rect); -
4146 baseStyle()->drawPrimitive(pe, &frmOpt, p, w); -
4147 } else {
executed: }
Execution Count:7
7
4148 rule.drawBackground(p, opt->rect); -
4149 if (frmOpt.lineWidth > 0)
never evaluated: frmOpt.lineWidth > 0
0
4150 baseStyle()->drawPrimitive(PE_FrameLineEdit, &frmOpt, p, w);
never executed: baseStyle()->drawPrimitive(PE_FrameLineEdit, &frmOpt, p, w);
0
4151 }
never executed: }
0
4152 } else { -
4153 rule.drawRule(p, opt->rect); -
4154 }
never executed: }
0
4155 } -
4156 return;
executed: return;
Execution Count:7
7
4157 -
4158 case PE_Widget: -
4159 if (w && !rule.hasDrawable()) {
partially evaluated: w
TRUEFALSE
yes
Evaluation Count:4
no
Evaluation Count:0
evaluated: !rule.hasDrawable()
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:2
0-4
4160 QWidget *container = containerWidget(w); -
4161 if (styleSheetCaches->autoFillDisabledWidgets.contains(container)
partially evaluated: styleSheetCaches->autoFillDisabledWidgets.contains(container)
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
4162 && (container == w || !renderRule(container, opt).hasBackground())) {
partially evaluated: container == w
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
partially evaluated: !renderRule(container, opt).hasBackground()
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
4163 -
4164 -
4165 p->fillRect(opt->rect, opt->palette.brush(w->backgroundRole())); -
4166 }
executed: }
Execution Count:2
2
4167 break;
executed: break;
Execution Count:2
2
4168 } -
4169 -
4170 if (const QAbstractScrollArea *sa = qobject_cast<const QAbstractScrollArea *>(w)) {
partially evaluated: const QAbstractScrollArea *sa = qobject_cast<const QAbstractScrollArea *>(w)
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
4171 const QAbstractScrollAreaPrivate *sap = sa->d_func(); -
4172 rule.drawBackground(p, opt->rect, sap->contentsOffset()); -
4173 if (rule.hasBorder()) {
partially evaluated: rule.hasBorder()
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
4174 QRect brect = rule.borderRect(opt->rect); -
4175 if (styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents, opt, w)) {
partially evaluated: styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents, opt, w)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
4176 QRect r = brect.adjusted(0, 0, sa->verticalScrollBar()->isVisible() ? -sa->verticalScrollBar()->width() : 0, -
4177 sa->horizontalScrollBar()->isVisible() ? -sa->horizontalScrollBar()->height() : 0); -
4178 brect = QStyle::visualRect(opt->direction, brect, r); -
4179 }
never executed: }
0
4180 rule.drawBorder(p, brect); -
4181 }
executed: }
Execution Count:2
2
4182 break;
executed: break;
Execution Count:2
2
4183 } -
4184 -
4185 -
4186 case PE_PanelMenu:
code before this statement never executed: case PE_PanelMenu:
0
4187 case PE_PanelStatusBar: -
4188 if(rule.hasDrawable()) {
never evaluated: rule.hasDrawable()
0
4189 rule.drawRule(p, opt->rect); -
4190 return;
never executed: return;
0
4191 } -
4192 break;
never executed: break;
0
4193 -
4194 case PE_FrameMenu: -
4195 if (rule.hasDrawable()) {
never evaluated: rule.hasDrawable()
0
4196 -
4197 return;
never executed: return;
0
4198 } -
4199 break;
never executed: break;
0
4200 -
4201 case PE_PanelMenuBar: -
4202 if (rule.hasDrawable()) {
never evaluated: rule.hasDrawable()
0
4203 -
4204 return;
never executed: return;
0
4205 } -
4206 break;
never executed: break;
0
4207 -
4208 case PE_IndicatorToolBarSeparator: -
4209 case PE_IndicatorToolBarHandle: { -
4210 PseudoElement ps = pe == PE_IndicatorToolBarHandle ? PseudoElement_ToolBarHandle : PseudoElement_ToolBarSeparator;
never evaluated: pe == PE_IndicatorToolBarHandle
0
4211 QRenderRule subRule = renderRule(w, opt, ps); -
4212 if (subRule.hasDrawable()) {
never evaluated: subRule.hasDrawable()
0
4213 subRule.drawRule(p, opt->rect); -
4214 return;
never executed: return;
0
4215 } -
4216 } -
4217 break;
never executed: break;
0
4218 -
4219 case PE_IndicatorMenuCheckMark: -
4220 pseudoElement = PseudoElement_MenuCheckMark; -
4221 break;
never executed: break;
0
4222 -
4223 case PE_IndicatorArrowLeft: -
4224 pseudoElement = PseudoElement_LeftArrow; -
4225 break;
never executed: break;
0
4226 -
4227 case PE_IndicatorArrowRight: -
4228 pseudoElement = PseudoElement_RightArrow; -
4229 break;
never executed: break;
0
4230 -
4231 case PE_IndicatorColumnViewArrow: -
4232 if (const QStyleOptionViewItem *viewOpt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) {
never evaluated: const QStyleOptionViewItem *viewOpt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)
0
4233 bool reverse = (viewOpt->direction == Qt::RightToLeft); -
4234 pseudoElement = reverse ? PseudoElement_LeftArrow : PseudoElement_RightArrow;
never evaluated: reverse
0
4235 } else {
never executed: }
0
4236 pseudoElement = PseudoElement_RightArrow; -
4237 }
never executed: }
0
4238 break;
never executed: break;
0
4239 -
4240 case PE_IndicatorBranch: -
4241 if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) {
partially evaluated: const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)
TRUEFALSE
yes
Evaluation Count:16
no
Evaluation Count:0
0-16
4242 QRenderRule subRule = renderRule(w, opt, PseudoElement_TreeViewBranch); -
4243 if (subRule.hasDrawable()) {
partially evaluated: subRule.hasDrawable()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16
0-16
4244 if ((vopt->state & QStyle::State_Selected) && vopt->showDecorationSelected)
never evaluated: (vopt->state & QStyle::State_Selected)
never evaluated: vopt->showDecorationSelected
0
4245 p->fillRect(vopt->rect, vopt->palette.highlight());
never executed: p->fillRect(vopt->rect, vopt->palette.highlight());
0
4246 else if (vopt->features & QStyleOptionViewItem::Alternate)
never evaluated: vopt->features & QStyleOptionViewItem::Alternate
0
4247 p->fillRect(vopt->rect, vopt->palette.alternateBase());
never executed: p->fillRect(vopt->rect, vopt->palette.alternateBase());
0
4248 subRule.drawRule(p, opt->rect); -
4249 } else {
never executed: }
0
4250 baseStyle()->drawPrimitive(pe, vopt, p, w); -
4251 }
executed: }
Execution Count:16
16
4252 } -
4253 return;
executed: return;
Execution Count:16
16
4254 -
4255 case PE_PanelTipLabel: -
4256 if (!rule.hasDrawable())
never evaluated: !rule.hasDrawable()
0
4257 break;
never executed: break;
0
4258 -
4259 if (const QStyleOptionFrame *frmOpt = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
never evaluated: const QStyleOptionFrame *frmOpt = qstyleoption_cast<const QStyleOptionFrame *>(opt)
0
4260 if (rule.hasNativeBorder()) {
never evaluated: rule.hasNativeBorder()
0
4261 rule.drawBackground(p, opt->rect); -
4262 QStyleOptionFrame optCopy(*frmOpt); -
4263 optCopy.rect = rule.borderRect(opt->rect); -
4264 optCopy.palette.setBrush(QPalette::Window, Qt::NoBrush); -
4265 baseStyle()->drawPrimitive(pe, &optCopy, p, w); -
4266 } else {
never executed: }
0
4267 rule.drawRule(p, opt->rect); -
4268 }
never executed: }
0
4269 } -
4270 return;
never executed: return;
0
4271 -
4272 case PE_FrameGroupBox: -
4273 if (rule.hasNativeBorder())
never evaluated: rule.hasNativeBorder()
0
4274 break;
never executed: break;
0
4275 rule.drawBorder(p, opt->rect); -
4276 return;
never executed: return;
0
4277 -
4278 -
4279 case PE_FrameTabWidget: -
4280 if (const QStyleOptionTabWidgetFrame *frm = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)) {
never evaluated: const QStyleOptionTabWidgetFrame *frm = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)
0
4281 QRenderRule subRule = renderRule(w, opt, PseudoElement_TabWidgetPane); -
4282 if (subRule.hasNativeBorder()) {
never evaluated: subRule.hasNativeBorder()
0
4283 subRule.drawBackground(p, opt->rect); -
4284 QStyleOptionTabWidgetFrameV2 frmCopy(*frm); -
4285 subRule.configurePalette(&frmCopy.palette, QPalette::WindowText, QPalette::Window); -
4286 baseStyle()->drawPrimitive(pe, &frmCopy, p, w); -
4287 } else {
never executed: }
0
4288 subRule.drawRule(p, opt->rect); -
4289 }
never executed: }
0
4290 return;
never executed: return;
0
4291 } -
4292 break;
never executed: break;
0
4293 -
4294 -
4295 case PE_IndicatorProgressChunk: -
4296 pseudoElement = PseudoElement_ProgressBarChunk; -
4297 break;
never executed: break;
0
4298 -
4299 case PE_IndicatorTabTear: -
4300 pseudoElement = PseudoElement_TabBarTear; -
4301 break;
never executed: break;
0
4302 -
4303 case PE_FrameFocusRect: -
4304 if (!rule.hasNativeOutline()) {
never evaluated: !rule.hasNativeOutline()
0
4305 rule.drawOutline(p, opt->rect); -
4306 return;
never executed: return;
0
4307 } -
4308 break;
never executed: break;
0
4309 -
4310 case PE_IndicatorDockWidgetResizeHandle: -
4311 pseudoElement = PseudoElement_DockWidgetSeparator; -
4312 break;
never executed: break;
0
4313 -
4314 case PE_PanelItemViewItem: -
4315 pseudoElement = PseudoElement_ViewItem; -
4316 break;
never executed: break;
0
4317 -
4318 case PE_PanelScrollAreaCorner: -
4319 pseudoElement = PseudoElement_ScrollAreaCorner; -
4320 break;
executed: break;
Execution Count:288
288
4321 -
4322 case PE_IndicatorSpinDown: -
4323 case PE_IndicatorSpinMinus: -
4324 pseudoElement = PseudoElement_SpinBoxDownArrow; -
4325 break;
never executed: break;
0
4326 -
4327 case PE_IndicatorSpinUp: -
4328 case PE_IndicatorSpinPlus: -
4329 pseudoElement = PseudoElement_SpinBoxUpArrow; -
4330 break;
never executed: break;
0
4331 -
4332 case PE_IndicatorTabClose: -
4333 if (w)
never evaluated: w
0
4334 w = w->parentWidget();
never executed: w = w->parentWidget();
0
4335 pseudoElement = PseudoElement_TabBarTabCloseButton; -
4336 -
4337 -
4338 default: -
4339 break;
executed: break;
Execution Count:32
32
4340 } -
4341 -
4342 if (pseudoElement != PseudoElement_None) {
evaluated: pseudoElement != PseudoElement_None
TRUEFALSE
yes
Evaluation Count:288
yes
Evaluation Count:36
36-288
4343 QRenderRule subRule = renderRule(w, opt, pseudoElement); -
4344 if (subRule.hasDrawable()) {
partially evaluated: subRule.hasDrawable()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:288
0-288
4345 subRule.drawRule(p, rect); -
4346 } else {
never executed: }
0
4347 baseStyle()->drawPrimitive(pe, opt, p, w); -
4348 }
executed: }
Execution Count:288
288
4349 } else { -
4350 baseStyle()->drawPrimitive(pe, opt, p, w); -
4351 }
executed: }
Execution Count:36
36
4352} -
4353 -
4354QPixmap QStyleSheetStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap& pixmap, -
4355 const QStyleOption *option) const -
4356{ -
4357 return baseStyle()->generatedIconPixmap(iconMode, pixmap, option);
never executed: return baseStyle()->generatedIconPixmap(iconMode, pixmap, option);
0
4358} -
4359 -
4360QStyle::SubControl QStyleSheetStyle::hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, -
4361 const QPoint &pt, const QWidget *w) const -
4362{ -
4363 if (globalStyleSheetStyle != 0 && globalStyleSheetStyle != this) { return baseStyle()->hitTestComplexControl(cc, opt, pt, w); } QStyleSheetStyleRecursionGuard recursion_guard(this);
never evaluated: globalStyleSheetStyle != 0
never evaluated: globalStyleSheetStyle != this
never executed: return baseStyle()->hitTestComplexControl(cc, opt, pt, w);
0
4364 switch (cc) { -
4365 case CC_TitleBar: -
4366 if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)) {
never evaluated: const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)
0
4367 QRenderRule rule = renderRule(w, opt, PseudoElement_TitleBar); -
4368 if (rule.hasDrawable() || rule.hasBox() || rule.hasBorder()) {
never evaluated: rule.hasDrawable()
never evaluated: rule.hasBox()
never evaluated: rule.hasBorder()
0
4369 QHash<QStyle::SubControl, QRect> layout = titleBarLayout(w, tb); -
4370 QRect r; -
4371 QStyle::SubControl sc = QStyle::SC_None; -
4372 uint ctrl = SC_TitleBarSysMenu; -
4373 while (ctrl <= SC_TitleBarLabel) {
never evaluated: ctrl <= SC_TitleBarLabel
0
4374 r = layout[QStyle::SubControl(ctrl)]; -
4375 if (r.isValid() && r.contains(pt)) {
never evaluated: r.isValid()
never evaluated: r.contains(pt)
0
4376 sc = QStyle::SubControl(ctrl); -
4377 break;
never executed: break;
0
4378 } -
4379 ctrl <<= 1; -
4380 }
never executed: }
0
4381 return sc;
never executed: return sc;
0
4382 } -
4383 }
never executed: }
0
4384 break;
never executed: break;
0
4385 -
4386 case CC_MdiControls: -
4387 if (hasStyleRule(w, PseudoElement_MdiCloseButton)
never evaluated: hasStyleRule(w, PseudoElement_MdiCloseButton)
0
4388 || hasStyleRule(w, PseudoElement_MdiNormalButton)
never evaluated: hasStyleRule(w, PseudoElement_MdiNormalButton)
0
4389 || hasStyleRule(w, PseudoElement_MdiMinButton))
never evaluated: hasStyleRule(w, PseudoElement_MdiMinButton)
0
4390 return QWindowsStyle::hitTestComplexControl(cc, opt, pt, w);
never executed: return QWindowsStyle::hitTestComplexControl(cc, opt, pt, w);
0
4391 break;
never executed: break;
0
4392 -
4393 case CC_ScrollBar: { -
4394 QRenderRule rule = renderRule(w, opt); -
4395 if (!rule.hasDrawable() && !rule.hasBox())
never evaluated: !rule.hasDrawable()
never evaluated: !rule.hasBox()
0
4396 break;
never executed: break;
0
4397 } -
4398 -
4399 case CC_SpinBox: -
4400 case CC_GroupBox: -
4401 case CC_ComboBox: -
4402 case CC_Slider: -
4403 case CC_ToolButton: -
4404 return QWindowsStyle::hitTestComplexControl(cc, opt, pt, w);
never executed: return QWindowsStyle::hitTestComplexControl(cc, opt, pt, w);
0
4405 default: -
4406 break;
never executed: break;
0
4407 } -
4408 -
4409 return baseStyle()->hitTestComplexControl(cc, opt, pt, w);
never executed: return baseStyle()->hitTestComplexControl(cc, opt, pt, w);
0
4410} -
4411 -
4412QRect QStyleSheetStyle::itemPixmapRect(const QRect &rect, int alignment, const QPixmap &pixmap) const -
4413{ -
4414 return baseStyle()->itemPixmapRect(rect, alignment, pixmap);
never executed: return baseStyle()->itemPixmapRect(rect, alignment, pixmap);
0
4415} -
4416 -
4417QRect QStyleSheetStyle::itemTextRect(const QFontMetrics &metrics, const QRect& rect, int alignment, -
4418 bool enabled, const QString& text) const -
4419{ -
4420 return baseStyle()->itemTextRect(metrics, rect, alignment, enabled, text);
never executed: return baseStyle()->itemTextRect(metrics, rect, alignment, enabled, text);
0
4421} -
4422 -
4423int QStyleSheetStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWidget *w) const -
4424{ -
4425 if (globalStyleSheetStyle != 0 && globalStyleSheetStyle != this) { return baseStyle()->pixelMetric(m, opt, w); } QStyleSheetStyleRecursionGuard recursion_guard(this);
partially evaluated: globalStyleSheetStyle != 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:13173
never evaluated: globalStyleSheetStyle != this
never executed: return baseStyle()->pixelMetric(m, opt, w);
0-13173
4426 -
4427 QRenderRule rule = renderRule(w, opt); -
4428 QRenderRule subRule; -
4429 -
4430 switch (m) { -
4431 case PM_MenuButtonIndicator: -
4432 -
4433 -
4434 if (qobject_cast<const QToolButton *>(w) && (rule.hasBox() || !rule.hasNativeBorder()))
never evaluated: qobject_cast<const QToolButton *>(w)
never evaluated: rule.hasBox()
never evaluated: !rule.hasNativeBorder()
0
4435 return 0;
never executed: return 0;
0
4436 -
4437 subRule = renderRule(w, opt, PseudoElement_PushButtonMenuIndicator); -
4438 if (subRule.hasContentsSize())
never evaluated: subRule.hasContentsSize()
0
4439 return subRule.size().width();
never executed: return subRule.size().width();
0
4440 break;
never executed: break;
0
4441 -
4442 case PM_ButtonShiftHorizontal: -
4443 case PM_ButtonShiftVertical: -
4444 case PM_ButtonMargin: -
4445 case PM_ButtonDefaultIndicator: -
4446 if (rule.hasBox())
never evaluated: rule.hasBox()
0
4447 return 0;
never executed: return 0;
0
4448 break;
never executed: break;
0
4449 -
4450 case PM_DefaultFrameWidth: -
4451 if (!rule.hasNativeBorder())
partially evaluated: !rule.hasNativeBorder()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:214
0-214
4452 return rule.border()->borders[LeftEdge];
never executed: return rule.border()->borders[LeftEdge];
0
4453 break;
executed: break;
Execution Count:214
214
4454 -
4455 case PM_ExclusiveIndicatorWidth: -
4456 case PM_IndicatorWidth: -
4457 case PM_ExclusiveIndicatorHeight: -
4458 case PM_IndicatorHeight: -
4459 subRule = renderRule(w, opt, PseudoElement_Indicator); -
4460 if (subRule.hasContentsSize()) {
never evaluated: subRule.hasContentsSize()
0
4461 return (m == PM_ExclusiveIndicatorWidth) || (m == PM_IndicatorWidth) 0
4462 ? subRule.size().width() : subRule.size().height();
never executed: return (m == PM_ExclusiveIndicatorWidth) || (m == PM_IndicatorWidth) ? subRule.size().width() : subRule.size().height();
0
4463 } -
4464 break;
never executed: break;
0
4465 -
4466 case PM_DockWidgetFrameWidth: -
4467 case PM_ToolTipLabelFrameWidth: -
4468 if (!rule.hasDrawable())
never evaluated: !rule.hasDrawable()
0
4469 break;
never executed: break;
0
4470 -
4471 return (rule.border() ? rule.border()->borders[LeftEdge] : 0) 0
4472 + (rule.hasBox() ? rule.box()->margins[LeftEdge] + rule.box()->paddings[LeftEdge]: 0);
never executed: return (rule.border() ? rule.border()->borders[LeftEdge] : 0) + (rule.hasBox() ? rule.box()->margins[LeftEdge] + rule.box()->paddings[LeftEdge]: 0);
0
4473 -
4474 case PM_ToolBarFrameWidth: -
4475 if (rule.hasBorder() || rule.hasBox())
never evaluated: rule.hasBorder()
never evaluated: rule.hasBox()
0
4476 return (rule.border() ? rule.border()->borders[LeftEdge] : 0) 0
4477 + (rule.hasBox() ? rule.box()->paddings[LeftEdge]: 0);
never executed: return (rule.border() ? rule.border()->borders[LeftEdge] : 0) + (rule.hasBox() ? rule.box()->paddings[LeftEdge]: 0);
0
4478 break;
never executed: break;
0
4479 -
4480 case PM_MenuPanelWidth: -
4481 case PM_MenuBarPanelWidth: -
4482 if (rule.hasBorder() || rule.hasBox())
never evaluated: rule.hasBorder()
never evaluated: rule.hasBox()
0
4483 return (rule.border() ? rule.border()->borders[LeftEdge] : 0) 0
4484 + (rule.hasBox() ? rule.box()->margins[LeftEdge]: 0);
never executed: return (rule.border() ? rule.border()->borders[LeftEdge] : 0) + (rule.hasBox() ? rule.box()->margins[LeftEdge]: 0);
0
4485 break;
never executed: break;
0
4486 -
4487 -
4488 case PM_MenuHMargin: -
4489 case PM_MenuBarHMargin: -
4490 if (rule.hasBox())
never evaluated: rule.hasBox()
0
4491 return rule.box()->paddings[LeftEdge];
never executed: return rule.box()->paddings[LeftEdge];
0
4492 break;
never executed: break;
0
4493 -
4494 case PM_MenuVMargin: -
4495 case PM_MenuBarVMargin: -
4496 if (rule.hasBox())
never evaluated: rule.hasBox()
0
4497 return rule.box()->paddings[TopEdge];
never executed: return rule.box()->paddings[TopEdge];
0
4498 break;
never executed: break;
0
4499 -
4500 case PM_DockWidgetTitleBarButtonMargin: -
4501 case PM_ToolBarItemMargin: -
4502 if (rule.hasBox())
never evaluated: rule.hasBox()
0
4503 return rule.box()->margins[TopEdge];
never executed: return rule.box()->margins[TopEdge];
0
4504 break;
never executed: break;
0
4505 -
4506 case PM_ToolBarItemSpacing: -
4507 case PM_MenuBarItemSpacing: -
4508 if (rule.hasBox() && rule.box()->spacing != -1)
never evaluated: rule.hasBox()
never evaluated: rule.box()->spacing != -1
0
4509 return rule.box()->spacing;
never executed: return rule.box()->spacing;
0
4510 break;
never executed: break;
0
4511 -
4512 case PM_MenuTearoffHeight: -
4513 case PM_MenuScrollerHeight: { -
4514 PseudoElement ps = m == PM_MenuTearoffHeight ? PseudoElement_MenuTearoff : PseudoElement_MenuScroller;
never evaluated: m == PM_MenuTearoffHeight
0
4515 subRule = renderRule(w, opt, ps); -
4516 if (subRule.hasContentsSize())
never evaluated: subRule.hasContentsSize()
0
4517 return subRule.size().height();
never executed: return subRule.size().height();
0
4518 break;
never executed: break;
0
4519 } -
4520 -
4521 case PM_ToolBarExtensionExtent: -
4522 break;
never executed: break;
0
4523 -
4524 case PM_SplitterWidth: -
4525 case PM_ToolBarSeparatorExtent: -
4526 case PM_ToolBarHandleExtent: { -
4527 PseudoElement ps; -
4528 if (m == PM_ToolBarHandleExtent) ps = PseudoElement_ToolBarHandle;
never evaluated: m == PM_ToolBarHandleExtent
never executed: ps = PseudoElement_ToolBarHandle;
0
4529 else if (m == PM_SplitterWidth) ps = PseudoElement_SplitterHandle;
never evaluated: m == PM_SplitterWidth
never executed: ps = PseudoElement_SplitterHandle;
0
4530 else ps = PseudoElement_ToolBarSeparator;
never executed: ps = PseudoElement_ToolBarSeparator;
0
4531 subRule = renderRule(w, opt, ps); -
4532 if (subRule.hasContentsSize()) {
never evaluated: subRule.hasContentsSize()
0
4533 QSize sz = subRule.size(); -
4534 return (opt && opt->state & QStyle::State_Horizontal) ? sz.width() : sz.height();
never executed: return (opt && opt->state & QStyle::State_Horizontal) ? sz.width() : sz.height();
0
4535 } -
4536 break;
never executed: break;
0
4537 } -
4538 -
4539 case PM_RadioButtonLabelSpacing: -
4540 if (rule.hasBox() && rule.box()->spacing != -1)
never evaluated: rule.hasBox()
never evaluated: rule.box()->spacing != -1
0
4541 return rule.box()->spacing;
never executed: return rule.box()->spacing;
0
4542 break;
never executed: break;
0
4543 case PM_CheckBoxLabelSpacing: -
4544 if (qobject_cast<const QCheckBox *>(w)) {
never evaluated: qobject_cast<const QCheckBox *>(w)
0
4545 if (rule.hasBox() && rule.box()->spacing != -1)
never evaluated: rule.hasBox()
never evaluated: rule.box()->spacing != -1
0
4546 return rule.box()->spacing;
never executed: return rule.box()->spacing;
0
4547 }
never executed: }
0
4548 -
4549 subRule = renderRule(w, opt, PseudoElement_GroupBoxTitle); -
4550 if (subRule.hasBox() && subRule.box()->spacing != -1)
never evaluated: subRule.hasBox()
never evaluated: subRule.box()->spacing != -1
0
4551 return subRule.box()->spacing;
never executed: return subRule.box()->spacing;
0
4552 break;
never executed: break;
0
4553 -
4554 -
4555 case PM_ScrollBarExtent: -
4556 if (rule.hasContentsSize()) {
partially evaluated: rule.hasContentsSize()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6608
0-6608
4557 QSize sz = rule.size(); -
4558 if (const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt))
never evaluated: const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt)
0
4559 return sb->orientation == Qt::Horizontal ? sz.height() : sz.width();
never executed: return sb->orientation == Qt::Horizontal ? sz.height() : sz.width();
0
4560 return sz.width() == -1 ? sz.height() : sz.width();
never executed: return sz.width() == -1 ? sz.height() : sz.width();
0
4561 } -
4562 break;
executed: break;
Execution Count:6608
6608
4563 -
4564 case PM_ScrollBarSliderMin: -
4565 if (hasStyleRule(w, PseudoElement_ScrollBarSlider)) {
partially evaluated: hasStyleRule(w, PseudoElement_ScrollBarSlider)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5072
0-5072
4566 subRule = renderRule(w, opt, PseudoElement_ScrollBarSlider); -
4567 QSize msz = subRule.minimumSize(); -
4568 if (const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt))
never evaluated: const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt)
0
4569 return sb->orientation == Qt::Horizontal ? msz.width() : msz.height();
never executed: return sb->orientation == Qt::Horizontal ? msz.width() : msz.height();
0
4570 return msz.width() == -1 ? msz.height() : msz.width();
never executed: return msz.width() == -1 ? msz.height() : msz.width();
0
4571 } -
4572 break;
executed: break;
Execution Count:5072
5072
4573 -
4574 case PM_ScrollView_ScrollBarSpacing: -
4575 if(!rule.hasNativeBorder() || rule.hasBox())
never evaluated: !rule.hasNativeBorder()
never evaluated: rule.hasBox()
0
4576 return 0;
never executed: return 0;
0
4577 break;
never executed: break;
0
4578 -
4579 -
4580 case PM_ProgressBarChunkWidth: -
4581 subRule = renderRule(w, opt, PseudoElement_ProgressBarChunk); -
4582 if (subRule.hasContentsSize()) {
never evaluated: subRule.hasContentsSize()
0
4583 QSize sz = subRule.size(); -
4584 return (opt->state & QStyle::State_Horizontal) 0
4585 ? sz.width() : sz.height();
never executed: return (opt->state & QStyle::State_Horizontal) ? sz.width() : sz.height();
0
4586 } -
4587 break;
never executed: break;
0
4588 -
4589 -
4590 case PM_TabBarTabHSpace: -
4591 case PM_TabBarTabVSpace: -
4592 subRule = renderRule(w, opt, PseudoElement_TabBarTab); -
4593 if (subRule.hasBox() || subRule.hasBorder())
never evaluated: subRule.hasBox()
never evaluated: subRule.hasBorder()
0
4594 return 0;
never executed: return 0;
0
4595 break;
never executed: break;
0
4596 -
4597 case PM_TabBarScrollButtonWidth: { -
4598 subRule = renderRule(w, opt, PseudoElement_TabBarScroller); -
4599 if (subRule.hasContentsSize()) {
never evaluated: subRule.hasContentsSize()
0
4600 QSize sz = subRule.size(); -
4601 return sz.width() != -1 ? sz.width() : sz.height();
never executed: return sz.width() != -1 ? sz.width() : sz.height();
0
4602 } -
4603 } -
4604 break;
never executed: break;
0
4605 -
4606 case PM_TabBarTabShiftHorizontal: -
4607 case PM_TabBarTabShiftVertical: -
4608 subRule = renderRule(w, opt, PseudoElement_TabBarTab); -
4609 if (subRule.hasBox())
never evaluated: subRule.hasBox()
0
4610 return 0;
never executed: return 0;
0
4611 break;
never executed: break;
0
4612 -
4613 case PM_TabBarBaseOverlap: { -
4614 const QWidget *tabWidget = qobject_cast<const QTabWidget *>(w) ? w : w->parentWidget();
never evaluated: qobject_cast<const QTabWidget *>(w)
0
4615 if (hasStyleRule(tabWidget, PseudoElement_TabWidgetPane)) {
never evaluated: hasStyleRule(tabWidget, PseudoElement_TabWidgetPane)
0
4616 return 0;
never executed: return 0;
0
4617 } -
4618 break;
never executed: break;
0
4619 } -
4620 -
4621 -
4622 case PM_SliderThickness: -
4623 case PM_SliderLength: -
4624 if (rule.hasContentsSize()) {
never evaluated: rule.hasContentsSize()
0
4625 bool horizontal = opt->state & QStyle::State_Horizontal; -
4626 if (m == PM_SliderThickness) {
never evaluated: m == PM_SliderThickness
0
4627 QSize sz = rule.size(); -
4628 return horizontal ? sz.height() : sz.width();
never executed: return horizontal ? sz.height() : sz.width();
0
4629 } else { -
4630 QSize msz = rule.minimumContentsSize(); -
4631 return horizontal ? msz.width() : msz.height();
never executed: return horizontal ? msz.width() : msz.height();
0
4632 } -
4633 } -
4634 break;
never executed: break;
0
4635 -
4636 case PM_SliderControlThickness: { -
4637 QRenderRule subRule = renderRule(w, opt, PseudoElement_SliderHandle); -
4638 if (!subRule.hasContentsSize())
never evaluated: !subRule.hasContentsSize()
0
4639 break;
never executed: break;
0
4640 QSize size = subRule.size(); -
4641 return (opt->state & QStyle::State_Horizontal) ? size.height() : size.width();
never executed: return (opt->state & QStyle::State_Horizontal) ? size.height() : size.width();
0
4642 } -
4643 -
4644 case PM_ToolBarIconSize: -
4645 case PM_ListViewIconSize: -
4646 case PM_IconViewIconSize: -
4647 case PM_TabBarIconSize: -
4648 case PM_MessageBoxIconSize: -
4649 case PM_ButtonIconSize: -
4650 case PM_SmallIconSize: -
4651 if (rule.hasStyleHint(QLatin1String("icon-size"))) {
partially evaluated: rule.hasStyleHint(QLatin1String("icon-size"))
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:34
0-34
4652 return rule.styleHint(QLatin1String("icon-size")).toSize().width();
never executed: return rule.styleHint(QLatin1String("icon-size")).toSize().width();
0
4653 } -
4654 break;
executed: break;
Execution Count:34
34
4655 -
4656 case PM_DockWidgetTitleMargin: { -
4657 QRenderRule subRule = renderRule(w, opt, PseudoElement_DockWidgetTitle); -
4658 if (!subRule.hasBox())
never evaluated: !subRule.hasBox()
0
4659 break;
never executed: break;
0
4660 return (subRule.border() ? subRule.border()->borders[TopEdge] : 0) 0
4661 + (subRule.hasBox() ? subRule.box()->margins[TopEdge] + subRule.box()->paddings[TopEdge]: 0);
never executed: return (subRule.border() ? subRule.border()->borders[TopEdge] : 0) + (subRule.hasBox() ? subRule.box()->margins[TopEdge] + subRule.box()->paddings[TopEdge]: 0);
0
4662 } -
4663 -
4664 case PM_DockWidgetSeparatorExtent: { -
4665 QRenderRule subRule = renderRule(w, opt, PseudoElement_DockWidgetSeparator); -
4666 if (!subRule.hasContentsSize())
partially evaluated: !subRule.hasContentsSize()
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
4667 break;
executed: break;
Execution Count:1
1
4668 QSize sz = subRule.size(); -
4669 return qMax(sz.width(), sz.height());
never executed: return qMax(sz.width(), sz.height());
0
4670 } -
4671 -
4672 case PM_TitleBarHeight: { -
4673 QRenderRule subRule = renderRule(w, opt, PseudoElement_TitleBar); -
4674 if (subRule.hasContentsSize())
never evaluated: subRule.hasContentsSize()
0
4675 return subRule.size().height();
never executed: return subRule.size().height();
0
4676 else if (subRule.hasBox() || subRule.hasBorder()) {
never evaluated: subRule.hasBox()
never evaluated: subRule.hasBorder()
0
4677 QFontMetrics fm = opt ? opt->fontMetrics : w->fontMetrics();
never evaluated: opt
0
4678 return subRule.size(QSize(0, fm.height())).height();
never executed: return subRule.size(QSize(0, fm.height())).height();
0
4679 } -
4680 break;
never executed: break;
0
4681 } -
4682 -
4683 case PM_MdiSubWindowFrameWidth: -
4684 if (rule.hasBox() || rule.hasBorder()) {
never evaluated: rule.hasBox()
never evaluated: rule.hasBorder()
0
4685 return (rule.border() ? rule.border()->borders[LeftEdge] : 0) 0
4686 + (rule.hasBox() ? rule.box()->paddings[LeftEdge]+rule.box()->margins[LeftEdge]: 0);
never executed: return (rule.border() ? rule.border()->borders[LeftEdge] : 0) + (rule.hasBox() ? rule.box()->paddings[LeftEdge]+rule.box()->margins[LeftEdge]: 0);
0
4687 } -
4688 break;
never executed: break;
0
4689 -
4690 case PM_MdiSubWindowMinimizedWidth: { -
4691 QRenderRule subRule = renderRule(w, PseudoElement_None, PseudoClass_Minimized); -
4692 int width = subRule.size().width(); -
4693 if (width != -1)
never evaluated: width != -1
0
4694 return width;
never executed: return width;
0
4695 break;
never executed: break;
0
4696 } -
4697 default: -
4698 break;
executed: break;
Execution Count:1244
1244
4699 } -
4700 -
4701 return baseStyle()->pixelMetric(m, opt, w);
executed: return baseStyle()->pixelMetric(m, opt, w);
Execution Count:13173
13173
4702} -
4703 -
4704QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, -
4705 const QSize &csz, const QWidget *w) const -
4706{ -
4707 if (globalStyleSheetStyle != 0 && globalStyleSheetStyle != this) { return baseStyle()->sizeFromContents(ct, opt, csz, w); } QStyleSheetStyleRecursionGuard recursion_guard(this);
never executed: return baseStyle()->sizeFromContents(ct, opt, csz, w);
partially evaluated: globalStyleSheetStyle != 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5091
never evaluated: globalStyleSheetStyle != this
0-5091
4708 -
4709 QRenderRule rule = renderRule(w, opt); -
4710 QSize sz = rule.adjustSize(csz); -
4711 -
4712 switch (ct) { -
4713 case CT_SpinBox: -
4714 if (rule.hasBox() || !rule.hasNativeBorder())
never evaluated: rule.hasBox()
never evaluated: !rule.hasNativeBorder()
0
4715 return csz;
never executed: return csz;
0
4716 return rule.baseStyleCanDraw() ? baseStyle()->sizeFromContents(ct, opt, sz, w) 0
4717 : QWindowsStyle::sizeFromContents(ct, opt, sz, w);
never executed: return rule.baseStyleCanDraw() ? baseStyle()->sizeFromContents(ct, opt, sz, w) : QWindowsStyle::sizeFromContents(ct, opt, sz, w);
0
4718 case CT_ToolButton: -
4719 if (rule.hasBox() || !rule.hasNativeBorder() || !rule.baseStyleCanDraw())
never evaluated: rule.hasBox()
never evaluated: !rule.hasNativeBorder()
never evaluated: !rule.baseStyleCanDraw()
0
4720 sz += QSize(3, 3);
never executed: sz += QSize(3, 3);
0
4721 -
4722 case CT_ComboBox:
code before this statement never executed: case CT_ComboBox:
0
4723 case CT_PushButton: -
4724 if (rule.hasBox() || !rule.hasNativeBorder()) {
never evaluated: rule.hasBox()
never evaluated: !rule.hasNativeBorder()
0
4725 if(ct == CT_ComboBox) {
never evaluated: ct == CT_ComboBox
0
4726 -
4727 QRenderRule subRule = renderRule(w, opt, PseudoElement_ComboBoxDropDown); -
4728 QRect comboRect = positionRect(w, rule, subRule, PseudoElement_ComboBoxDropDown, opt->rect, opt->direction); -
4729 -
4730 sz += QSize(comboRect.width() + 2, 0); -
4731 }
never executed: }
0
4732 return rule.boxSize(sz);
never executed: return rule.boxSize(sz);
0
4733 } -
4734 sz = rule.baseStyleCanDraw() ? baseStyle()->sizeFromContents(ct, opt, sz, w)
never evaluated: rule.baseStyleCanDraw()
0
4735 : QWindowsStyle::sizeFromContents(ct, opt, sz, w); -
4736 return rule.boxSize(sz, Margin);
never executed: return rule.boxSize(sz, Margin);
0
4737 -
4738 case CT_HeaderSection: { -
4739 if (const QStyleOptionHeader *hdr = qstyleoption_cast<const QStyleOptionHeader *>(opt)) {
partially evaluated: const QStyleOptionHeader *hdr = qstyleoption_cast<const QStyleOptionHeader *>(opt)
TRUEFALSE
yes
Evaluation Count:7
no
Evaluation Count:0
0-7
4740 QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection); -
4741 if (subRule.hasGeometry() || subRule.hasBox() || !subRule.hasNativeBorder()) {
partially evaluated: subRule.hasGeometry()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
partially evaluated: subRule.hasBox()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
partially evaluated: !subRule.hasNativeBorder()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
0-7
4742 sz = subRule.adjustSize(csz); -
4743 if (!subRule.hasGeometry()) {
never evaluated: !subRule.hasGeometry()
0
4744 QSize nativeContentsSize; -
4745 bool nullIcon = hdr->icon.isNull(); -
4746 int iconSize = nullIcon ? 0 : pixelMetric(QStyle::PM_SmallIconSize, hdr, w);
never evaluated: nullIcon
0
4747 QSize txt = hdr->fontMetrics.size(0, hdr->text); -
4748 nativeContentsSize.setHeight(qMax(iconSize, txt.height())); -
4749 nativeContentsSize.setWidth(iconSize + txt.width()); -
4750 sz = sz.expandedTo(nativeContentsSize); -
4751 }
never executed: }
0
4752 return subRule.size(sz);
never executed: return subRule.size(sz);
0
4753 } -
4754 return subRule.baseStyleCanDraw() ? baseStyle()->sizeFromContents(ct, opt, sz, w) 7
4755 : QWindowsStyle::sizeFromContents(ct, opt, sz, w);
executed: return subRule.baseStyleCanDraw() ? baseStyle()->sizeFromContents(ct, opt, sz, w) : QWindowsStyle::sizeFromContents(ct, opt, sz, w);
Execution Count:7
7
4756 } -
4757 } -
4758 break;
never executed: break;
0
4759 case CT_GroupBox: -
4760 case CT_LineEdit: -
4761 -
4762 -
4763 if (QAbstractSpinBox *spinBox = qobject_cast<QAbstractSpinBox *>(w ? w->parentWidget() : 0)) {
partially evaluated: QAbstractSpinBox *spinBox = qobject_cast<QAbstractSpinBox *>(w ? w->parentWidget() : 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
4764 QRenderRule rule = renderRule(spinBox, opt); -
4765 if (rule.hasBox() || !rule.hasNativeBorder())
never evaluated: rule.hasBox()
never evaluated: !rule.hasNativeBorder()
0
4766 return csz;
never executed: return csz;
0
4767 return rule.baseStyleCanDraw() ? baseStyle()->sizeFromContents(ct, opt, sz, w) 0
4768 : QWindowsStyle::sizeFromContents(ct, opt, sz, w);
never executed: return rule.baseStyleCanDraw() ? baseStyle()->sizeFromContents(ct, opt, sz, w) : QWindowsStyle::sizeFromContents(ct, opt, sz, w);
0
4769 } -
4770 -
4771 if (rule.hasBox() || !rule.hasNativeBorder()) {
partially evaluated: rule.hasBox()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
partially evaluated: !rule.hasNativeBorder()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
4772 return rule.boxSize(sz);
never executed: return rule.boxSize(sz);
0
4773 } -
4774 break;
executed: break;
Execution Count:2
2
4775 -
4776 case CT_CheckBox: -
4777 case CT_RadioButton: -
4778 if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
never evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)
0
4779 if (rule.hasBox() || rule.hasBorder() || hasStyleRule(w, PseudoElement_Indicator)) {
never evaluated: rule.hasBox()
never evaluated: rule.hasBorder()
never evaluated: hasStyleRule(w, PseudoElement_Indicator)
0
4780 bool isRadio = (ct == CT_RadioButton); -
4781 int iw = pixelMetric(isRadio ? PM_ExclusiveIndicatorWidth -
4782 : PM_IndicatorWidth, btn, w); -
4783 int ih = pixelMetric(isRadio ? PM_ExclusiveIndicatorHeight -
4784 : PM_IndicatorHeight, btn, w); -
4785 -
4786 int spacing = pixelMetric(isRadio ? PM_RadioButtonLabelSpacing -
4787 : PM_CheckBoxLabelSpacing, btn, w); -
4788 sz.setWidth(sz.width() + iw + spacing); -
4789 sz.setHeight(qMax(sz.height(), ih)); -
4790 return rule.boxSize(sz);
never executed: return rule.boxSize(sz);
0
4791 } -
4792 }
never executed: }
0
4793 break;
never executed: break;
0
4794 -
4795 case CT_Menu: -
4796 case CT_MenuBar: -
4797 case CT_ScrollBar: -
4798 if (rule.hasBox() || rule.hasBorder())
partially evaluated: rule.hasBox()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5072
evaluated: rule.hasBorder()
TRUEFALSE
yes
Evaluation Count:64
yes
Evaluation Count:5008
0-5072
4799 return sz;
executed: return sz;
Execution Count:64
64
4800 break;
executed: break;
Execution Count:5008
5008
4801 -
4802 case CT_MenuItem: -
4803 if (const QStyleOptionMenuItem *mi = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
never evaluated: const QStyleOptionMenuItem *mi = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)
0
4804 PseudoElement pe = (mi->menuItemType == QStyleOptionMenuItem::Separator)
never evaluated: (mi->menuItemType == QStyleOptionMenuItem::Separator)
0
4805 ? PseudoElement_MenuSeparator : PseudoElement_Item; -
4806 QRenderRule subRule = renderRule(w, opt, pe); -
4807 if ((pe == PseudoElement_MenuSeparator) && subRule.hasContentsSize()) {
never evaluated: (pe == PseudoElement_MenuSeparator)
never evaluated: subRule.hasContentsSize()
0
4808 return QSize(sz.width(), subRule.size().height());
never executed: return QSize(sz.width(), subRule.size().height());
0
4809 } else if ((pe == PseudoElement_Item) && (subRule.hasBox() || subRule.hasBorder())) {
never evaluated: (pe == PseudoElement_Item)
never evaluated: subRule.hasBox()
never evaluated: subRule.hasBorder()
0
4810 int width = csz.width(); -
4811 if (mi->text.contains(QLatin1Char('\t')))
never evaluated: mi->text.contains(QLatin1Char('\t'))
0
4812 width += 12;
never executed: width += 12;
0
4813 return subRule.boxSize(subRule.adjustSize(QSize(width, csz.height())));
never executed: return subRule.boxSize(subRule.adjustSize(QSize(width, csz.height())));
0
4814 } -
4815 } -
4816 break;
never executed: break;
0
4817 -
4818 case CT_Splitter: -
4819 case CT_MenuBarItem: { -
4820 PseudoElement pe = (ct == CT_Splitter) ? PseudoElement_SplitterHandle : PseudoElement_Item;
never evaluated: (ct == CT_Splitter)
0
4821 QRenderRule subRule = renderRule(w, opt, pe); -
4822 if (subRule.hasBox() || subRule.hasBorder())
never evaluated: subRule.hasBox()
never evaluated: subRule.hasBorder()
0
4823 return subRule.boxSize(sz);
never executed: return subRule.boxSize(sz);
0
4824 break;
never executed: break;
0
4825 } -
4826 -
4827 case CT_ProgressBar: -
4828 case CT_SizeGrip: -
4829 return (rule.hasContentsSize()) 0
4830 ? rule.size(sz) 0
4831 : rule.boxSize(baseStyle()->sizeFromContents(ct, opt, sz, w));
never executed: return (rule.hasContentsSize()) ? rule.size(sz) : rule.boxSize(baseStyle()->sizeFromContents(ct, opt, sz, w));
0
4832 break;
dead code: break;
-
4833 -
4834 case CT_Slider: -
4835 if (rule.hasBorder() || rule.hasBox() || rule.hasGeometry())
never evaluated: rule.hasBorder()
never evaluated: rule.hasBox()
never evaluated: rule.hasGeometry()
0
4836 return rule.boxSize(sz);
never executed: return rule.boxSize(sz);
0
4837 break;
never executed: break;
0
4838 -
4839 -
4840 case CT_TabBarTab: { -
4841 QRenderRule subRule = renderRule(w, opt, PseudoElement_TabBarTab); -
4842 if (subRule.hasBox() || !subRule.hasNativeBorder()) {
never evaluated: subRule.hasBox()
never evaluated: !subRule.hasNativeBorder()
0
4843 int spaceForIcon = 0; -
4844 bool vertical = false; -
4845 if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
never evaluated: const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)
0
4846 if (!tab->icon.isNull())
never evaluated: !tab->icon.isNull()
0
4847 spaceForIcon = 6 + 4 + 2 ;
never executed: spaceForIcon = 6 + 4 + 2 ;
0
4848 vertical = verticalTabs(tab->shape); -
4849 }
never executed: }
0
4850 sz = csz + QSize(vertical ? 0 : spaceForIcon, vertical ? spaceForIcon : 0); -
4851 return subRule.boxSize(subRule.adjustSize(sz));
never executed: return subRule.boxSize(subRule.adjustSize(sz));
0
4852 } -
4853 -
4854 -
4855 -
4856 -
4857 -
4858 -
4859 -
4860 sz = subRule.adjustSize(csz); -
4861 break;
never executed: break;
0
4862 } -
4863 -
4864 -
4865 case CT_MdiControls: -
4866 if (const QStyleOptionComplex *ccOpt = qstyleoption_cast<const QStyleOptionComplex *>(opt)) {
never evaluated: const QStyleOptionComplex *ccOpt = qstyleoption_cast<const QStyleOptionComplex *>(opt)
0
4867 if (!hasStyleRule(w, PseudoElement_MdiCloseButton)
never evaluated: !hasStyleRule(w, PseudoElement_MdiCloseButton)
0
4868 && !hasStyleRule(w, PseudoElement_MdiNormalButton)
never evaluated: !hasStyleRule(w, PseudoElement_MdiNormalButton)
0
4869 && !hasStyleRule(w, PseudoElement_MdiMinButton))
never evaluated: !hasStyleRule(w, PseudoElement_MdiMinButton)
0
4870 break;
never executed: break;
0
4871 -
4872 QList<QVariant> layout = rule.styleHint(QLatin1String("button-layout")).toList(); -
4873 if (layout.isEmpty())
never evaluated: layout.isEmpty()
0
4874 layout = subControlLayout(QLatin1String("mNX"));
never executed: layout = subControlLayout(QLatin1String("mNX"));
0
4875 -
4876 int width = 0, height = 0; -
4877 for (int i = 0; i < layout.count(); i++) {
never evaluated: i < layout.count()
0
4878 int layoutButton = layout[i].toInt(); -
4879 if (layoutButton < PseudoElement_MdiCloseButton
never evaluated: layoutButton < PseudoElement_MdiCloseButton
0
4880 || layoutButton > PseudoElement_MdiNormalButton)
never evaluated: layoutButton > PseudoElement_MdiNormalButton
0
4881 continue;
never executed: continue;
0
4882 QStyle::SubControl sc = knownPseudoElements[layoutButton].subControl; -
4883 if (!(ccOpt->subControls & sc))
never evaluated: !(ccOpt->subControls & sc)
0
4884 continue;
never executed: continue;
0
4885 QRenderRule subRule = renderRule(w, opt, layoutButton); -
4886 QSize sz = subRule.size(); -
4887 width += sz.width(); -
4888 height = qMax(height, sz.height()); -
4889 }
never executed: }
0
4890 -
4891 return QSize(width, height);
never executed: return QSize(width, height);
0
4892 } -
4893 break;
never executed: break;
0
4894 -
4895 -
4896 case CT_ItemViewItem: { -
4897 QRenderRule subRule = renderRule(w, opt, PseudoElement_ViewItem); -
4898 sz = baseStyle()->sizeFromContents(ct, opt, csz, w); -
4899 sz = subRule.adjustSize(sz); -
4900 if (subRule.hasBox() || subRule.hasBorder())
partially evaluated: subRule.hasBox()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
partially evaluated: subRule.hasBorder()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
0-10
4901 sz = subRule.boxSize(sz);
never executed: sz = subRule.boxSize(sz);
0
4902 return sz;
executed: return sz;
Execution Count:10
10
4903 } -
4904 -
4905 -
4906 default: -
4907 break;
never executed: break;
0
4908 } -
4909 -
4910 return baseStyle()->sizeFromContents(ct, opt, sz, w);
executed: return baseStyle()->sizeFromContents(ct, opt, sz, w);
Execution Count:5010
5010
4911} -
4912 -
4913 -
4914 -
4915 -
4916static QLatin1String propertyNameForStandardPixmap(QStyle::StandardPixmap sp) -
4917{ -
4918 switch (sp) { -
4919 case QStyle::SP_TitleBarMenuButton: return QLatin1String("titlebar-menu-icon");
never executed: return QLatin1String("titlebar-menu-icon");
0
4920 case QStyle::SP_TitleBarMinButton: return QLatin1String("titlebar-minimize-icon");
never executed: return QLatin1String("titlebar-minimize-icon");
0
4921 case QStyle::SP_TitleBarMaxButton: return QLatin1String("titlebar-maximize-icon");
never executed: return QLatin1String("titlebar-maximize-icon");
0
4922 case QStyle::SP_TitleBarCloseButton: return QLatin1String("titlebar-close-icon");
never executed: return QLatin1String("titlebar-close-icon");
0
4923 case QStyle::SP_TitleBarNormalButton: return QLatin1String("titlebar-normal-icon");
never executed: return QLatin1String("titlebar-normal-icon");
0
4924 case QStyle::SP_TitleBarShadeButton: return QLatin1String("titlebar-shade-icon");
never executed: return QLatin1String("titlebar-shade-icon");
0
4925 case QStyle::SP_TitleBarUnshadeButton: return QLatin1String("titlebar-unshade-icon");
never executed: return QLatin1String("titlebar-unshade-icon");
0
4926 case QStyle::SP_TitleBarContextHelpButton: return QLatin1String("titlebar-contexthelp-icon");
never executed: return QLatin1String("titlebar-contexthelp-icon");
0
4927 case QStyle::SP_DockWidgetCloseButton: return QLatin1String("dockwidget-close-icon");
never executed: return QLatin1String("dockwidget-close-icon");
0
4928 case QStyle::SP_MessageBoxInformation: return QLatin1String("messagebox-information-icon");
never executed: return QLatin1String("messagebox-information-icon");
0
4929 case QStyle::SP_MessageBoxWarning: return QLatin1String("messagebox-warning-icon");
never executed: return QLatin1String("messagebox-warning-icon");
0
4930 case QStyle::SP_MessageBoxCritical: return QLatin1String("messagebox-critical-icon");
never executed: return QLatin1String("messagebox-critical-icon");
0
4931 case QStyle::SP_MessageBoxQuestion: return QLatin1String("messagebox-question-icon");
never executed: return QLatin1String("messagebox-question-icon");
0
4932 case QStyle::SP_DesktopIcon: return QLatin1String("desktop-icon");
never executed: return QLatin1String("desktop-icon");
0
4933 case QStyle::SP_TrashIcon: return QLatin1String("trash-icon");
never executed: return QLatin1String("trash-icon");
0
4934 case QStyle::SP_ComputerIcon: return QLatin1String("computer-icon");
never executed: return QLatin1String("computer-icon");
0
4935 case QStyle::SP_DriveFDIcon: return QLatin1String("floppy-icon");
never executed: return QLatin1String("floppy-icon");
0
4936 case QStyle::SP_DriveHDIcon: return QLatin1String("harddisk-icon");
never executed: return QLatin1String("harddisk-icon");
0
4937 case QStyle::SP_DriveCDIcon: return QLatin1String("cd-icon");
never executed: return QLatin1String("cd-icon");
0
4938 case QStyle::SP_DriveDVDIcon: return QLatin1String("dvd-icon");
never executed: return QLatin1String("dvd-icon");
0
4939 case QStyle::SP_DriveNetIcon: return QLatin1String("network-icon");
never executed: return QLatin1String("network-icon");
0
4940 case QStyle::SP_DirOpenIcon: return QLatin1String("directory-open-icon");
never executed: return QLatin1String("directory-open-icon");
0
4941 case QStyle::SP_DirClosedIcon: return QLatin1String("directory-closed-icon");
never executed: return QLatin1String("directory-closed-icon");
0
4942 case QStyle::SP_DirLinkIcon: return QLatin1String("directory-link-icon");
never executed: return QLatin1String("directory-link-icon");
0
4943 case QStyle::SP_FileIcon: return QLatin1String("file-icon");
never executed: return QLatin1String("file-icon");
0
4944 case QStyle::SP_FileLinkIcon: return QLatin1String("file-link-icon");
never executed: return QLatin1String("file-link-icon");
0
4945 case QStyle::SP_FileDialogStart: return QLatin1String("filedialog-start-icon");
never executed: return QLatin1String("filedialog-start-icon");
0
4946 case QStyle::SP_FileDialogEnd: return QLatin1String("filedialog-end-icon");
never executed: return QLatin1String("filedialog-end-icon");
0
4947 case QStyle::SP_FileDialogToParent: return QLatin1String("filedialog-parent-directory-icon");
never executed: return QLatin1String("filedialog-parent-directory-icon");
0
4948 case QStyle::SP_FileDialogNewFolder: return QLatin1String("filedialog-new-directory-icon");
never executed: return QLatin1String("filedialog-new-directory-icon");
0
4949 case QStyle::SP_FileDialogDetailedView: return QLatin1String("filedialog-detailedview-icon");
never executed: return QLatin1String("filedialog-detailedview-icon");
0
4950 case QStyle::SP_FileDialogInfoView: return QLatin1String("filedialog-infoview-icon");
never executed: return QLatin1String("filedialog-infoview-icon");
0
4951 case QStyle::SP_FileDialogContentsView: return QLatin1String("filedialog-contentsview-icon");
never executed: return QLatin1String("filedialog-contentsview-icon");
0
4952 case QStyle::SP_FileDialogListView: return QLatin1String("filedialog-listview-icon");
never executed: return QLatin1String("filedialog-listview-icon");
0
4953 case QStyle::SP_FileDialogBack: return QLatin1String("filedialog-backward-icon");
never executed: return QLatin1String("filedialog-backward-icon");
0
4954 case QStyle::SP_DirIcon: return QLatin1String("directory-icon");
never executed: return QLatin1String("directory-icon");
0
4955 case QStyle::SP_DialogOkButton: return QLatin1String("dialog-ok-icon");
never executed: return QLatin1String("dialog-ok-icon");
0
4956 case QStyle::SP_DialogCancelButton: return QLatin1String("dialog-cancel-icon");
never executed: return QLatin1String("dialog-cancel-icon");
0
4957 case QStyle::SP_DialogHelpButton: return QLatin1String("dialog-help-icon");
never executed: return QLatin1String("dialog-help-icon");
0
4958 case QStyle::SP_DialogOpenButton: return QLatin1String("dialog-open-icon");
never executed: return QLatin1String("dialog-open-icon");
0
4959 case QStyle::SP_DialogSaveButton: return QLatin1String("dialog-save-icon");
never executed: return QLatin1String("dialog-save-icon");
0
4960 case QStyle::SP_DialogCloseButton: return QLatin1String("dialog-close-icon");
never executed: return QLatin1String("dialog-close-icon");
0
4961 case QStyle::SP_DialogApplyButton: return QLatin1String("dialog-apply-icon");
never executed: return QLatin1String("dialog-apply-icon");
0
4962 case QStyle::SP_DialogResetButton: return QLatin1String("dialog-reset-icon");
never executed: return QLatin1String("dialog-reset-icon");
0
4963 case QStyle::SP_DialogDiscardButton: return QLatin1String("discard-icon");
never executed: return QLatin1String("discard-icon");
0
4964 case QStyle::SP_DialogYesButton: return QLatin1String("dialog-yes-icon");
never executed: return QLatin1String("dialog-yes-icon");
0
4965 case QStyle::SP_DialogNoButton: return QLatin1String("dialog-no-icon");
never executed: return QLatin1String("dialog-no-icon");
0
4966 case QStyle::SP_ArrowUp: return QLatin1String("uparrow-icon");
never executed: return QLatin1String("uparrow-icon");
0
4967 case QStyle::SP_ArrowDown: return QLatin1String("downarrow-icon");
never executed: return QLatin1String("downarrow-icon");
0
4968 case QStyle::SP_ArrowLeft: return QLatin1String("leftarrow-icon");
never executed: return QLatin1String("leftarrow-icon");
0
4969 case QStyle::SP_ArrowRight: return QLatin1String("rightarrow-icon");
never executed: return QLatin1String("rightarrow-icon");
0
4970 case QStyle::SP_ArrowBack: return QLatin1String("backward-icon");
never executed: return QLatin1String("backward-icon");
0
4971 case QStyle::SP_ArrowForward: return QLatin1String("forward-icon");
never executed: return QLatin1String("forward-icon");
0
4972 case QStyle::SP_DirHomeIcon: return QLatin1String("home-icon");
never executed: return QLatin1String("home-icon");
0
4973 default: return QLatin1String("");
executed: return QLatin1String("");
Execution Count:1
1
4974 } -
4975}
never executed: }
0
4976 -
4977QIcon QStyleSheetStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption *opt, -
4978 const QWidget *w) const -
4979{ -
4980 if (globalStyleSheetStyle != 0 && globalStyleSheetStyle != this) { return baseStyle()->standardIcon(standardIcon, opt, w); } QStyleSheetStyleRecursionGuard recursion_guard(this);
never executed: return baseStyle()->standardIcon(standardIcon, opt, w);
partially evaluated: globalStyleSheetStyle != 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
never evaluated: globalStyleSheetStyle != this
0-1
4981 QString s = propertyNameForStandardPixmap(standardIcon); -
4982 if (!s.isEmpty()) {
partially evaluated: !s.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
4983 QRenderRule rule = renderRule(w, opt); -
4984 if (rule.hasStyleHint(s))
never evaluated: rule.hasStyleHint(s)
0
4985 return qvariant_cast<QIcon>(rule.styleHint(s));
never executed: return qvariant_cast<QIcon>(rule.styleHint(s));
0
4986 }
never executed: }
0
4987 return baseStyle()->standardIcon(standardIcon, opt, w);
executed: return baseStyle()->standardIcon(standardIcon, opt, w);
Execution Count:1
1
4988} -
4989 -
4990QPalette QStyleSheetStyle::standardPalette() const -
4991{ -
4992 return baseStyle()->standardPalette();
never executed: return baseStyle()->standardPalette();
0
4993} -
4994 -
4995QPixmap QStyleSheetStyle::standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, -
4996 const QWidget *w) const -
4997{ -
4998 if (globalStyleSheetStyle != 0 && globalStyleSheetStyle != this) { return baseStyle()->standardPixmap(standardPixmap, opt, w); } QStyleSheetStyleRecursionGuard recursion_guard(this);
never executed: return baseStyle()->standardPixmap(standardPixmap, opt, w);
never evaluated: globalStyleSheetStyle != 0
never evaluated: globalStyleSheetStyle != this
0
4999 QString s = propertyNameForStandardPixmap(standardPixmap); -
5000 if (!s.isEmpty()) {
never evaluated: !s.isEmpty()
0
5001 QRenderRule rule = renderRule(w, opt); -
5002 if (rule.hasStyleHint(s)) {
never evaluated: rule.hasStyleHint(s)
0
5003 QIcon icon = qvariant_cast<QIcon>(rule.styleHint(s)); -
5004 return icon.pixmap(16, 16);
never executed: return icon.pixmap(16, 16);
0
5005 } -
5006 }
never executed: }
0
5007 return baseStyle()->standardPixmap(standardPixmap, opt, w);
never executed: return baseStyle()->standardPixmap(standardPixmap, opt, w);
0
5008} -
5009 -
5010int QStyleSheetStyle::layoutSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, -
5011 Qt::Orientation orientation, const QStyleOption *option, -
5012 const QWidget *widget) const -
5013{ -
5014 return baseStyle()->layoutSpacing(control1, control2, orientation, option, widget);
never executed: return baseStyle()->layoutSpacing(control1, control2, orientation, option, widget);
0
5015} -
5016 -
5017int QStyleSheetStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w, -
5018 QStyleHintReturn *shret) const -
5019{ -
5020 if (globalStyleSheetStyle != 0 && globalStyleSheetStyle != this) { return baseStyle()->styleHint(sh, opt, w, shret); } QStyleSheetStyleRecursionGuard recursion_guard(this);
never executed: return baseStyle()->styleHint(sh, opt, w, shret);
evaluated: globalStyleSheetStyle != 0
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:23716
partially evaluated: globalStyleSheetStyle != this
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-23716
5021 -
5022 -
5023 if (sh == SH_Widget_ShareActivation)
evaluated: sh == SH_Widget_ShareActivation
TRUEFALSE
yes
Evaluation Count:13956
yes
Evaluation Count:9762
9762-13956
5024 return baseStyle()->styleHint(sh, opt, w, shret);
executed: return baseStyle()->styleHint(sh, opt, w, shret);
Execution Count:13956
13956
5025 -
5026 QRenderRule rule = renderRule(w, opt); -
5027 QString s; -
5028 switch (sh) { -
5029 case SH_LineEdit_PasswordCharacter: s = QLatin1String("lineedit-password-character"); break;
executed: break;
Execution Count:3
3
5030 case SH_DitherDisabledText: s = QLatin1String("dither-disabled-text"); break;
never executed: break;
0
5031 case SH_EtchDisabledText: s = QLatin1String("etch-disabled-text"); break;
never executed: break;
0
5032 case SH_ItemView_ActivateItemOnSingleClick: s = QLatin1String("activate-on-singleclick"); break;
never executed: break;
0
5033 case SH_ItemView_ShowDecorationSelected: s = QLatin1String("show-decoration-selected"); break;
executed: break;
Execution Count:33
33
5034 case SH_Table_GridLineColor: s = QLatin1String("gridline-color"); break;
executed: break;
Execution Count:2
2
5035 case SH_DialogButtonLayout: s = QLatin1String("button-layout"); break;
never executed: break;
0
5036 case SH_ToolTipLabel_Opacity: s = QLatin1String("opacity"); break;
never executed: break;
0
5037 case SH_ComboBox_Popup: s = QLatin1String("combobox-popup"); break;
never executed: break;
0
5038 case SH_ComboBox_ListMouseTracking: s = QLatin1String("combobox-list-mousetracking"); break;
never executed: break;
0
5039 case SH_MenuBar_AltKeyNavigation: s = QLatin1String("menubar-altkey-navigation"); break;
executed: break;
Execution Count:1
1
5040 case SH_Menu_Scrollable: s = QLatin1String("menu-scrollable"); break;
executed: break;
Execution Count:1
1
5041 case SH_DrawMenuBarSeparator: s = QLatin1String("menubar-separator"); break;
never executed: break;
0
5042 case SH_MenuBar_MouseTracking: s = QLatin1String("mouse-tracking"); break;
executed: break;
Execution Count:1
1
5043 case SH_SpinBox_ClickAutoRepeatRate: s = QLatin1String("spinbox-click-autorepeat-rate"); break;
executed: break;
Execution Count:1
1
5044 case SH_SpinControls_DisableOnBounds: s = QLatin1String("spincontrol-disable-on-bounds"); break;
executed: break;
Execution Count:2
2
5045 case SH_MessageBox_TextInteractionFlags: s = QLatin1String("messagebox-text-interaction-flags"); break;
never executed: break;
0
5046 case SH_ToolButton_PopupDelay: s = QLatin1String("toolbutton-popup-delay"); break;
executed: break;
Execution Count:21
21
5047 case SH_ToolBox_SelectedPageTitleBold: -
5048 if (renderRule(w, opt, PseudoElement_ToolBoxTab).hasFont)
never evaluated: renderRule(w, opt, PseudoElement_ToolBoxTab).hasFont
0
5049 return 0;
never executed: return 0;
0
5050 break;
never executed: break;
0
5051 case SH_GroupBox_TextLabelColor: -
5052 if (rule.hasPalette() && rule.palette()->foreground.style() != Qt::NoBrush)
never evaluated: rule.hasPalette()
never evaluated: rule.palette()->foreground.style() != Qt::NoBrush
0
5053 return rule.palette()->foreground.color().rgba();
never executed: return rule.palette()->foreground.color().rgba();
0
5054 break;
never executed: break;
0
5055 case SH_ScrollView_FrameOnlyAroundContents: s = QLatin1String("scrollview-frame-around-contents"); break;
executed: break;
Execution Count:1954
1954
5056 case SH_ScrollBar_ContextMenu: s = QLatin1String("scrollbar-contextmenu"); break;
never executed: break;
0
5057 case SH_ScrollBar_LeftClickAbsolutePosition: s = QLatin1String("scrollbar-leftclick-absolute-position"); break;
never executed: break;
0
5058 case SH_ScrollBar_MiddleClickAbsolutePosition: s = QLatin1String("scrollbar-middleclick-absolute-position"); break;
never executed: break;
0
5059 case SH_ScrollBar_RollBetweenButtons: s = QLatin1String("scrollbar-roll-between-buttons"); break;
never executed: break;
0
5060 case SH_ScrollBar_ScrollWhenPointerLeavesControl: s = QLatin1String("scrollbar-scroll-when-pointer-leaves-control"); break;
never executed: break;
0
5061 case SH_TabBar_Alignment: -
5062 -
5063 if (qobject_cast<const QTabWidget *>(w)) {
never evaluated: qobject_cast<const QTabWidget *>(w)
0
5064 rule = renderRule(w, opt, PseudoElement_TabWidgetTabBar); -
5065 if (rule.hasPosition())
never evaluated: rule.hasPosition()
0
5066 return rule.position()->position;
never executed: return rule.position()->position;
0
5067 }
never executed: }
0
5068 -
5069 s = QLatin1String("alignment"); -
5070 break;
never executed: break;
0
5071 -
5072 case SH_TabBar_CloseButtonPosition: -
5073 rule = renderRule(w, opt, PseudoElement_TabBarTabCloseButton); -
5074 if (rule.hasPosition()) {
never evaluated: rule.hasPosition()
0
5075 Qt::Alignment align = rule.position()->position; -
5076 if (align & Qt::AlignLeft || align & Qt::AlignTop)
never evaluated: align & Qt::AlignLeft
never evaluated: align & Qt::AlignTop
0
5077 return QTabBar::LeftSide;
never executed: return QTabBar::LeftSide;
0
5078 if (align & Qt::AlignRight || align & Qt::AlignBottom)
never evaluated: align & Qt::AlignRight
never evaluated: align & Qt::AlignBottom
0
5079 return QTabBar::RightSide;
never executed: return QTabBar::RightSide;
0
5080 }
never executed: }
0
5081 break;
never executed: break;
0
5082 -
5083 case SH_TabBar_ElideMode: s = QLatin1String("tabbar-elide-mode"); break;
executed: break;
Execution Count:5
5
5084 case SH_TabBar_PreferNoArrows: s = QLatin1String("tabbar-prefer-no-arrows"); break;
executed: break;
Execution Count:7
7
5085 case SH_ComboBox_PopupFrameStyle: -
5086 -
5087 if (qobject_cast<const QComboBox *>(w)) {
never evaluated: qobject_cast<const QComboBox *>(w)
0
5088 QAbstractItemView *view = w->findChild<QAbstractItemView *>(); -
5089 if (view) {
never evaluated: view
0
5090 view->ensurePolished(); -
5091 QRenderRule subRule = renderRule(view, PseudoElement_None); -
5092 if (subRule.hasBox() || !subRule.hasNativeBorder())
never evaluated: subRule.hasBox()
never evaluated: !subRule.hasNativeBorder()
0
5093 return QFrame::NoFrame;
never executed: return QFrame::NoFrame;
0
5094 }
never executed: }
0
5095 }
never executed: }
0
5096 -
5097 break;
never executed: break;
0
5098 case SH_DialogButtonBox_ButtonsHaveIcons: s = QLatin1String("dialogbuttonbox-buttons-have-icons"); break;
never executed: break;
0
5099 case SH_Workspace_FillSpaceOnMaximize: s = QLatin1String("mdi-fill-space-on-maximize"); break;
never executed: break;
0
5100 case SH_TitleBar_NoBorder: -
5101 if (rule.hasBorder())
never evaluated: rule.hasBorder()
0
5102 return !rule.border()->borders[LeftEdge];
never executed: return !rule.border()->borders[LeftEdge];
0
5103 break;
never executed: break;
0
5104 case SH_TitleBar_AutoRaise: { -
5105 QRenderRule subRule = renderRule(w, opt, PseudoElement_TitleBar); -
5106 if (subRule.hasDrawable())
never evaluated: subRule.hasDrawable()
0
5107 return 1;
never executed: return 1;
0
5108 break;
never executed: break;
0
5109 } -
5110 case SH_ItemView_ArrowKeysNavigateIntoChildren: s = QLatin1String("arrow-keys-navigate-into-children"); break;
never executed: break;
0
5111 case SH_ItemView_PaintAlternatingRowColorsForEmptyArea: s = QLatin1String("paint-alternating-row-colors-for-empty-area"); break;
never executed: break;
0
5112 default: break;
executed: break;
Execution Count:7731
7731
5113 } -
5114 if (!s.isEmpty() && rule.hasStyleHint(s)) {
evaluated: !s.isEmpty()
TRUEFALSE
yes
Evaluation Count:2031
yes
Evaluation Count:7731
partially evaluated: rule.hasStyleHint(s)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2031
0-7731
5115 return rule.styleHint(s).toInt();
never executed: return rule.styleHint(s).toInt();
0
5116 } -
5117 -
5118 return baseStyle()->styleHint(sh, opt, w, shret);
executed: return baseStyle()->styleHint(sh, opt, w, shret);
Execution Count:9762
9762
5119} -
5120 -
5121QRect QStyleSheetStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, -
5122 const QWidget *w) const -
5123{ -
5124 if (globalStyleSheetStyle != 0 && globalStyleSheetStyle != this) { return baseStyle()->subControlRect(cc, opt, sc, w); } QStyleSheetStyleRecursionGuard recursion_guard(this);
never executed: return baseStyle()->subControlRect(cc, opt, sc, w);
partially evaluated: globalStyleSheetStyle != 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
never evaluated: globalStyleSheetStyle != this
0-1
5125 -
5126 QRenderRule rule = renderRule(w, opt); -
5127 switch (cc) { -
5128 case CC_ComboBox: -
5129 if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
never evaluated: const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)
0
5130 if (rule.hasBox() || !rule.hasNativeBorder()) {
never evaluated: rule.hasBox()
never evaluated: !rule.hasNativeBorder()
0
5131 switch (sc) { -
5132 case SC_ComboBoxFrame: return rule.borderRect(opt->rect);
never executed: return rule.borderRect(opt->rect);
0
5133 case SC_ComboBoxEditField: -
5134 { -
5135 QRenderRule subRule = renderRule(w, opt, PseudoElement_ComboBoxDropDown); -
5136 QRect r = rule.contentsRect(opt->rect); -
5137 QRect r2 = positionRect(w, rule, subRule, PseudoElement_ComboBoxDropDown, -
5138 opt->rect, opt->direction); -
5139 if (subRule.hasPosition() && subRule.position()->position & Qt::AlignLeft) {
never evaluated: subRule.hasPosition()
never evaluated: subRule.position()->position & Qt::AlignLeft
0
5140 return visualRect(opt->direction, r, r.adjusted(r2.width(),0,0,0));
never executed: return visualRect(opt->direction, r, r.adjusted(r2.width(),0,0,0));
0
5141 } else { -
5142 return visualRect(opt->direction, r, r.adjusted(0,0,-r2.width(),0));
never executed: return visualRect(opt->direction, r, r.adjusted(0,0,-r2.width(),0));
0
5143 } -
5144 } -
5145 case SC_ComboBoxArrow: { -
5146 QRenderRule subRule = renderRule(w, opt, PseudoElement_ComboBoxDropDown); -
5147 return positionRect(w, rule, subRule, PseudoElement_ComboBoxDropDown, opt->rect, opt->direction);
never executed: return positionRect(w, rule, subRule, PseudoElement_ComboBoxDropDown, opt->rect, opt->direction);
0
5148 } -
5149 case SC_ComboBoxListBoxPopup: -
5150 default: -
5151 return baseStyle()->subControlRect(cc, opt, sc, w);
never executed: return baseStyle()->subControlRect(cc, opt, sc, w);
0
5152 } -
5153 }
never executed: }
0
5154 -
5155 QStyleOptionComboBox comboBox(*cb); -
5156 comboBox.rect = rule.borderRect(opt->rect); -
5157 return rule.baseStyleCanDraw() ? baseStyle()->subControlRect(cc, &comboBox, sc, w) 0
5158 : QWindowsStyle::subControlRect(cc, &comboBox, sc, w);
never executed: return rule.baseStyleCanDraw() ? baseStyle()->subControlRect(cc, &comboBox, sc, w) : QWindowsStyle::subControlRect(cc, &comboBox, sc, w);
0
5159 } -
5160 break;
never executed: break;
0
5161 -
5162 -
5163 case CC_SpinBox: -
5164 if (const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
partially evaluated: const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
5165 QRenderRule upRule = renderRule(w, opt, PseudoElement_SpinBoxUpButton); -
5166 QRenderRule downRule = renderRule(w, opt, PseudoElement_SpinBoxDownButton); -
5167 bool ruleMatch = rule.hasBox() || !rule.hasNativeBorder();
partially evaluated: rule.hasBox()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
partially evaluated: !rule.hasNativeBorder()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
5168 bool upRuleMatch = upRule.hasGeometry() || upRule.hasPosition();
partially evaluated: upRule.hasGeometry()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
partially evaluated: upRule.hasPosition()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
5169 bool downRuleMatch = downRule.hasGeometry() || upRule.hasPosition();
partially evaluated: downRule.hasGeometry()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
partially evaluated: upRule.hasPosition()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
5170 if (ruleMatch || upRuleMatch || downRuleMatch) {
partially evaluated: ruleMatch
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
partially evaluated: upRuleMatch
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
partially evaluated: downRuleMatch
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
5171 switch (sc) { -
5172 case SC_SpinBoxFrame: -
5173 return rule.borderRect(opt->rect);
never executed: return rule.borderRect(opt->rect);
0
5174 case SC_SpinBoxEditField: -
5175 { -
5176 QRect r = rule.contentsRect(opt->rect); -
5177 -
5178 Qt::Alignment upAlign, downAlign; -
5179 -
5180 upAlign = upRule.hasPosition() ? upRule.position()->position
never evaluated: upRule.hasPosition()
0
5181 : Qt::Alignment(Qt::AlignRight); -
5182 upAlign = resolveAlignment(opt->direction, upAlign); -
5183 -
5184 downAlign = downRule.hasPosition() ? downRule.position()->position
never evaluated: downRule.hasPosition()
0
5185 : Qt::Alignment(Qt::AlignRight); -
5186 downAlign = resolveAlignment(opt->direction, downAlign); -
5187 -
5188 int upSize = subControlRect(CC_SpinBox, opt, SC_SpinBoxUp, w).width(); -
5189 int downSize = subControlRect(CC_SpinBox, opt, SC_SpinBoxDown, w).width(); -
5190 int widestL = qMax((upAlign & Qt::AlignLeft) ? upSize : 0, -
5191 (downAlign & Qt::AlignLeft) ? downSize : 0); -
5192 int widestR = qMax((upAlign & Qt::AlignRight) ? upSize : 0, -
5193 (downAlign & Qt::AlignRight) ? downSize : 0); -
5194 r.setRight(r.right() - widestR); -
5195 r.setLeft(r.left() + widestL); -
5196 return r;
never executed: return r;
0
5197 } -
5198 case SC_SpinBoxDown: -
5199 if (downRuleMatch)
never evaluated: downRuleMatch
0
5200 return positionRect(w, rule, downRule, PseudoElement_SpinBoxDownButton, 0
5201 opt->rect, opt->direction);
never executed: return positionRect(w, rule, downRule, PseudoElement_SpinBoxDownButton, opt->rect, opt->direction);
0
5202 break;
never executed: break;
0
5203 case SC_SpinBoxUp: -
5204 if (upRuleMatch)
never evaluated: upRuleMatch
0
5205 return positionRect(w, rule, upRule, PseudoElement_SpinBoxUpButton, 0
5206 opt->rect, opt->direction);
never executed: return positionRect(w, rule, upRule, PseudoElement_SpinBoxUpButton, opt->rect, opt->direction);
0
5207 break;
never executed: break;
0
5208 default: -
5209 break;
never executed: break;
0
5210 } -
5211 -
5212 return baseStyle()->subControlRect(cc, opt, sc, w);
never executed: return baseStyle()->subControlRect(cc, opt, sc, w);
0
5213 } -
5214 -
5215 QStyleOptionSpinBox spinBox(*spin); -
5216 spinBox.rect = rule.borderRect(opt->rect); -
5217 return rule.baseStyleCanDraw() ? baseStyle()->subControlRect(cc, &spinBox, sc, w) 1
5218 : QWindowsStyle::subControlRect(cc, &spinBox, sc, w);
executed: return rule.baseStyleCanDraw() ? baseStyle()->subControlRect(cc, &spinBox, sc, w) : QWindowsStyle::subControlRect(cc, &spinBox, sc, w);
Execution Count:1
1
5219 } -
5220 break;
never executed: break;
0
5221 -
5222 -
5223 case CC_GroupBox: -
5224 if (const QStyleOptionGroupBox *gb = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)) {
never evaluated: const QStyleOptionGroupBox *gb = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)
0
5225 switch (sc) { -
5226 case SC_GroupBoxFrame: -
5227 case SC_GroupBoxContents: { -
5228 if (rule.hasBox() || !rule.hasNativeBorder()) {
never evaluated: rule.hasBox()
never evaluated: !rule.hasNativeBorder()
0
5229 return sc == SC_GroupBoxFrame ? rule.borderRect(opt->rect) 0
5230 : rule.contentsRect(opt->rect);
never executed: return sc == SC_GroupBoxFrame ? rule.borderRect(opt->rect) : rule.contentsRect(opt->rect);
0
5231 } -
5232 QStyleOptionGroupBox groupBox(*gb); -
5233 groupBox.rect = rule.borderRect(opt->rect); -
5234 return baseStyle()->subControlRect(cc, &groupBox, sc, w);
never executed: return baseStyle()->subControlRect(cc, &groupBox, sc, w);
0
5235 } -
5236 default: -
5237 case SC_GroupBoxLabel: -
5238 case SC_GroupBoxCheckBox: { -
5239 QRenderRule indRule = renderRule(w, opt, PseudoElement_GroupBoxIndicator); -
5240 QRenderRule labelRule = renderRule(w, opt, PseudoElement_GroupBoxTitle); -
5241 if (!labelRule.hasPosition() && !labelRule.hasGeometry() && !labelRule.hasBox()
never evaluated: !labelRule.hasPosition()
never evaluated: !labelRule.hasGeometry()
never evaluated: !labelRule.hasBox()
0
5242 && !labelRule.hasBorder() && !indRule.hasContentsSize()) {
never evaluated: !labelRule.hasBorder()
never evaluated: !indRule.hasContentsSize()
0
5243 QStyleOptionGroupBox groupBox(*gb); -
5244 groupBox.rect = rule.borderRect(opt->rect); -
5245 return baseStyle()->subControlRect(cc, &groupBox, sc, w);
never executed: return baseStyle()->subControlRect(cc, &groupBox, sc, w);
0
5246 } -
5247 int tw = opt->fontMetrics.width(gb->text); -
5248 int th = opt->fontMetrics.height(); -
5249 int spacing = pixelMetric(QStyle::PM_CheckBoxLabelSpacing, opt, w); -
5250 int iw = pixelMetric(QStyle::PM_IndicatorWidth, opt, w); -
5251 int ih = pixelMetric(QStyle::PM_IndicatorHeight, opt, w); -
5252 -
5253 if (gb->subControls & QStyle::SC_GroupBoxCheckBox) {
never evaluated: gb->subControls & QStyle::SC_GroupBoxCheckBox
0
5254 tw = tw + iw + spacing; -
5255 th = qMax(th, ih); -
5256 }
never executed: }
0
5257 if (!labelRule.hasGeometry()) {
never evaluated: !labelRule.hasGeometry()
0
5258 labelRule.geo = new QStyleSheetGeometryData(tw, th, tw, th, -1, -1); -
5259 } else {
never executed: }
0
5260 labelRule.geo->width = tw; -
5261 labelRule.geo->height = th; -
5262 }
never executed: }
0
5263 if (!labelRule.hasPosition()) {
never evaluated: !labelRule.hasPosition()
0
5264 labelRule.p = new QStyleSheetPositionData(0, 0, 0, 0, defaultOrigin(PseudoElement_GroupBoxTitle), -
5265 gb->textAlignment, PositionMode_Static); -
5266 }
never executed: }
0
5267 QRect r = positionRect(w, rule, labelRule, PseudoElement_GroupBoxTitle, -
5268 opt->rect, opt->direction); -
5269 if (gb->subControls & SC_GroupBoxCheckBox) {
never evaluated: gb->subControls & SC_GroupBoxCheckBox
0
5270 r = labelRule.contentsRect(r); -
5271 if (sc == SC_GroupBoxLabel) {
never evaluated: sc == SC_GroupBoxLabel
0
5272 r.setLeft(r.left() + iw + spacing); -
5273 r.setTop(r.center().y() - th/2); -
5274 } else {
never executed: }
0
5275 r = QRect(r.left(), r.center().y() - ih/2, iw, ih); -
5276 }
never executed: }
0
5277 return r;
never executed: return r;
0
5278 } else { -
5279 return labelRule.contentsRect(r);
never executed: return labelRule.contentsRect(r);
0
5280 } -
5281 } -
5282 } -
5283 }
never executed: }
0
5284 break;
never executed: break;
0
5285 -
5286 case CC_ToolButton: -
5287 if (const QStyleOptionToolButton *tb = qstyleoption_cast<const QStyleOptionToolButton *>(opt)) {
never evaluated: const QStyleOptionToolButton *tb = qstyleoption_cast<const QStyleOptionToolButton *>(opt)
0
5288 if (rule.hasBox() || !rule.hasNativeBorder()) {
never evaluated: rule.hasBox()
never evaluated: !rule.hasNativeBorder()
0
5289 switch (sc) { -
5290 case SC_ToolButton: return rule.borderRect(opt->rect);
never executed: return rule.borderRect(opt->rect);
0
5291 case SC_ToolButtonMenu: { -
5292 QRenderRule subRule = renderRule(w, opt, PseudoElement_ToolButtonMenu); -
5293 return positionRect(w, rule, subRule, PseudoElement_ToolButtonMenu, opt->rect, opt->direction);
never executed: return positionRect(w, rule, subRule, PseudoElement_ToolButtonMenu, opt->rect, opt->direction);
0
5294 } -
5295 default: -
5296 break;
never executed: break;
0
5297 } -
5298 }
never executed: }
0
5299 -
5300 QStyleOptionToolButton tool(*tb); -
5301 tool.rect = rule.borderRect(opt->rect); -
5302 return rule.baseStyleCanDraw() ? baseStyle()->subControlRect(cc, &tool, sc, w) 0
5303 : QWindowsStyle::subControlRect(cc, &tool, sc, w);
never executed: return rule.baseStyleCanDraw() ? baseStyle()->subControlRect(cc, &tool, sc, w) : QWindowsStyle::subControlRect(cc, &tool, sc, w);
0
5304 } -
5305 break;
never executed: break;
0
5306 -
5307 -
5308 case CC_ScrollBar: -
5309 if (const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
never evaluated: const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt)
0
5310 QStyleOptionSlider styleOptionSlider(*sb); -
5311 styleOptionSlider.rect = rule.borderRect(opt->rect); -
5312 if (rule.hasDrawable() || rule.hasBox()) {
never evaluated: rule.hasDrawable()
never evaluated: rule.hasBox()
0
5313 QRect grooveRect; -
5314 if (!rule.hasBox()) {
never evaluated: !rule.hasBox()
0
5315 grooveRect = rule.baseStyleCanDraw() ? baseStyle()->subControlRect(cc, sb, SC_ScrollBarGroove, w)
never evaluated: rule.baseStyleCanDraw()
0
5316 : QWindowsStyle::subControlRect(cc, sb, SC_ScrollBarGroove, w); -
5317 } else {
never executed: }
0
5318 grooveRect = rule.contentsRect(opt->rect); -
5319 }
never executed: }
0
5320 -
5321 PseudoElement pe = PseudoElement_None; -
5322 -
5323 switch (sc) { -
5324 case SC_ScrollBarGroove: -
5325 return grooveRect;
never executed: return grooveRect;
0
5326 case SC_ScrollBarAddPage: -
5327 case SC_ScrollBarSubPage: -
5328 case SC_ScrollBarSlider: { -
5329 QRect contentRect = grooveRect; -
5330 if (hasStyleRule(w, PseudoElement_ScrollBarSlider)) {
never evaluated: hasStyleRule(w, PseudoElement_ScrollBarSlider)
0
5331 QRenderRule sliderRule = renderRule(w, opt, PseudoElement_ScrollBarSlider); -
5332 Origin origin = sliderRule.hasPosition() ? sliderRule.position()->origin : defaultOrigin(PseudoElement_ScrollBarSlider);
never evaluated: sliderRule.hasPosition()
0
5333 contentRect = rule.originRect(opt->rect, origin); -
5334 }
never executed: }
0
5335 int maxlen = (styleOptionSlider.orientation == Qt::Horizontal) ? contentRect.width() : contentRect.height();
never evaluated: (styleOptionSlider.orientation == Qt::Horizontal)
0
5336 int sliderlen; -
5337 if (sb->maximum != sb->minimum) {
never evaluated: sb->maximum != sb->minimum
0
5338 uint range = sb->maximum - sb->minimum; -
5339 sliderlen = (qint64(sb->pageStep) * maxlen) / (range + sb->pageStep); -
5340 -
5341 int slidermin = pixelMetric(PM_ScrollBarSliderMin, sb, w); -
5342 if (sliderlen < slidermin || range > 2147483647 / 2)
never evaluated: sliderlen < slidermin
never evaluated: range > 2147483647 / 2
0
5343 sliderlen = slidermin;
never executed: sliderlen = slidermin;
0
5344 if (sliderlen > maxlen)
never evaluated: sliderlen > maxlen
0
5345 sliderlen = maxlen;
never executed: sliderlen = maxlen;
0
5346 } else {
never executed: }
0
5347 sliderlen = maxlen; -
5348 }
never executed: }
0
5349 -
5350 int sliderstart = (styleOptionSlider.orientation == Qt::Horizontal ? contentRect.left() : contentRect.top())
never evaluated: styleOptionSlider.orientation == Qt::Horizontal
0
5351 + sliderPositionFromValue(sb->minimum, sb->maximum, sb->sliderPosition, -
5352 maxlen - sliderlen, sb->upsideDown); -
5353 -
5354 QRect sr = (sb->orientation == Qt::Horizontal)
never evaluated: (sb->orientation == Qt::Horizontal)
0
5355 ? QRect(sliderstart, contentRect.top(), sliderlen, contentRect.height()) -
5356 : QRect(contentRect.left(), sliderstart, contentRect.width(), sliderlen); -
5357 if (sc == SC_ScrollBarSlider) {
never evaluated: sc == SC_ScrollBarSlider
0
5358 return sr;
never executed: return sr;
0
5359 } else if (sc == SC_ScrollBarSubPage) {
never evaluated: sc == SC_ScrollBarSubPage
0
5360 return QRect(contentRect.topLeft(), sb->orientation == Qt::Horizontal ? sr.bottomLeft() : sr.topRight());
never executed: return QRect(contentRect.topLeft(), sb->orientation == Qt::Horizontal ? sr.bottomLeft() : sr.topRight());
0
5361 } else { -
5362 return QRect(sb->orientation == Qt::Horizontal ? sr.topRight() : sr.bottomLeft(), contentRect.bottomRight());
never executed: return QRect(sb->orientation == Qt::Horizontal ? sr.topRight() : sr.bottomLeft(), contentRect.bottomRight());
0
5363 } -
5364 break;
dead code: break;
-
5365 } -
5366 case SC_ScrollBarAddLine: pe = PseudoElement_ScrollBarAddLine; break;
never executed: break;
0
5367 case SC_ScrollBarSubLine: pe = PseudoElement_ScrollBarSubLine; break;
never executed: break;
0
5368 case SC_ScrollBarFirst: pe = PseudoElement_ScrollBarFirst; break;
never executed: break;
0
5369 case SC_ScrollBarLast: pe = PseudoElement_ScrollBarLast; break;
never executed: break;
0
5370 default: break;
never executed: break;
0
5371 } -
5372 if (hasStyleRule(w,pe)) {
never evaluated: hasStyleRule(w,pe)
0
5373 QRenderRule subRule = renderRule(w, opt, pe); -
5374 if (subRule.hasPosition() || subRule.hasGeometry() || subRule.hasBox()) {
never evaluated: subRule.hasPosition()
never evaluated: subRule.hasGeometry()
never evaluated: subRule.hasBox()
0
5375 const QStyleSheetPositionData *pos = subRule.position(); -
5376 QRect originRect = grooveRect; -
5377 if (rule.hasBox()) {
never evaluated: rule.hasBox()
0
5378 Origin origin = (pos && pos->origin != Origin_Unknown) ? pos->origin : defaultOrigin(pe);
never evaluated: pos
never evaluated: pos->origin != Origin_Unknown
0
5379 originRect = rule.originRect(opt->rect, origin); -
5380 }
never executed: }
0
5381 return positionRect(w, subRule, pe, originRect, styleOptionSlider.direction);
never executed: return positionRect(w, subRule, pe, originRect, styleOptionSlider.direction);
0
5382 } -
5383 }
never executed: }
0
5384 }
never executed: }
0
5385 return rule.baseStyleCanDraw() ? baseStyle()->subControlRect(cc, &styleOptionSlider, sc, w) 0
5386 : QWindowsStyle::subControlRect(cc, &styleOptionSlider, sc, w);
never executed: return rule.baseStyleCanDraw() ? baseStyle()->subControlRect(cc, &styleOptionSlider, sc, w) : QWindowsStyle::subControlRect(cc, &styleOptionSlider, sc, w);
0
5387 } -
5388 break;
never executed: break;
0
5389 -
5390 -
5391 -
5392 case CC_Slider: -
5393 if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
never evaluated: const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)
0
5394 QRenderRule subRule = renderRule(w, opt, PseudoElement_SliderGroove); -
5395 if (!subRule.hasDrawable())
never evaluated: !subRule.hasDrawable()
0
5396 break;
never executed: break;
0
5397 subRule.img = 0; -
5398 QRect gr = positionRect(w, rule, subRule, PseudoElement_SliderGroove, opt->rect, opt->direction); -
5399 switch (sc) { -
5400 case SC_SliderGroove: -
5401 return gr;
never executed: return gr;
0
5402 case SC_SliderHandle: { -
5403 bool horizontal = slider->orientation & Qt::Horizontal; -
5404 QRect cr = subRule.contentsRect(gr); -
5405 QRenderRule subRule2 = renderRule(w, opt, PseudoElement_SliderHandle); -
5406 int len = horizontal ? subRule2.size().width() : subRule2.size().height();
never evaluated: horizontal
0
5407 subRule2.img = 0; -
5408 subRule2.geo = 0; -
5409 cr = positionRect(w, subRule2, PseudoElement_SliderHandle, cr, opt->direction); -
5410 int thickness = horizontal ? cr.height() : cr.width();
never evaluated: horizontal
0
5411 int sliderPos = sliderPositionFromValue(slider->minimum, slider->maximum, slider->sliderPosition, -
5412 (horizontal ? cr.width() : cr.height()) - len, slider->upsideDown); -
5413 cr = horizontal ? QRect(cr.x() + sliderPos, cr.y(), len, thickness)
never evaluated: horizontal
0
5414 : QRect(cr.x(), cr.y() + sliderPos, thickness, len); -
5415 return subRule2.borderRect(cr);
never executed: return subRule2.borderRect(cr);
0
5416 break; }
dead code: break;
-
5417 case SC_SliderTickmarks: -
5418 -
5419 default: -
5420 break;
never executed: break;
0
5421 } -
5422 }
never executed: }
0
5423 break;
never executed: break;
0
5424 -
5425 -
5426 case CC_MdiControls: -
5427 if (hasStyleRule(w, PseudoElement_MdiCloseButton)
never evaluated: hasStyleRule(w, PseudoElement_MdiCloseButton)
0
5428 || hasStyleRule(w, PseudoElement_MdiNormalButton)
never evaluated: hasStyleRule(w, PseudoElement_MdiNormalButton)
0
5429 || hasStyleRule(w, PseudoElement_MdiMinButton)) {
never evaluated: hasStyleRule(w, PseudoElement_MdiMinButton)
0
5430 QList<QVariant> layout = rule.styleHint(QLatin1String("button-layout")).toList(); -
5431 if (layout.isEmpty())
never evaluated: layout.isEmpty()
0
5432 layout = subControlLayout(QLatin1String("mNX"));
never executed: layout = subControlLayout(QLatin1String("mNX"));
0
5433 -
5434 int x = 0, width = 0; -
5435 QRenderRule subRule; -
5436 for (int i = 0; i < layout.count(); i++) {
never evaluated: i < layout.count()
0
5437 int layoutButton = layout[i].toInt(); -
5438 if (layoutButton < PseudoElement_MdiCloseButton
never evaluated: layoutButton < PseudoElement_MdiCloseButton
0
5439 || layoutButton > PseudoElement_MdiNormalButton)
never evaluated: layoutButton > PseudoElement_MdiNormalButton
0
5440 continue;
never executed: continue;
0
5441 QStyle::SubControl control = knownPseudoElements[layoutButton].subControl; -
5442 if (!(opt->subControls & control))
never evaluated: !(opt->subControls & control)
0
5443 continue;
never executed: continue;
0
5444 subRule = renderRule(w, opt, layoutButton); -
5445 width = subRule.size().width(); -
5446 if (sc == control)
never evaluated: sc == control
0
5447 break;
never executed: break;
0
5448 x += width; -
5449 }
never executed: }
0
5450 -
5451 return subRule.borderRect(QRect(x, opt->rect.top(), width, opt->rect.height()));
never executed: return subRule.borderRect(QRect(x, opt->rect.top(), width, opt->rect.height()));
0
5452 } -
5453 break;
never executed: break;
0
5454 -
5455 case CC_TitleBar: -
5456 if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)) {
never evaluated: const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)
0
5457 QRenderRule subRule = renderRule(w, opt, PseudoElement_TitleBar); -
5458 if (!subRule.hasDrawable() && !subRule.hasBox() && !subRule.hasBorder())
never evaluated: !subRule.hasDrawable()
never evaluated: !subRule.hasBox()
never evaluated: !subRule.hasBorder()
0
5459 break;
never executed: break;
0
5460 QHash<QStyle::SubControl, QRect> layoutRects = titleBarLayout(w, tb); -
5461 return layoutRects.value(sc);
never executed: return layoutRects.value(sc);
0
5462 } -
5463 break;
never executed: break;
0
5464 -
5465 default: -
5466 break;
never executed: break;
0
5467 } -
5468 -
5469 return baseStyle()->subControlRect(cc, opt, sc, w);
never executed: return baseStyle()->subControlRect(cc, opt, sc, w);
0
5470} -
5471 -
5472QRect QStyleSheetStyle::subElementRect(SubElement se, const QStyleOption *opt, const QWidget *w) const -
5473{ -
5474 if (globalStyleSheetStyle != 0 && globalStyleSheetStyle != this) { return baseStyle()->subElementRect(se, opt, w); } QStyleSheetStyleRecursionGuard recursion_guard(this);
never executed: return baseStyle()->subElementRect(se, opt, w);
evaluated: globalStyleSheetStyle != 0
TRUEFALSE
yes
Evaluation Count:389
yes
Evaluation Count:1604
partially evaluated: globalStyleSheetStyle != this
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:389
0-1604
5475 -
5476 QRenderRule rule = renderRule(w, opt); -
5477 -
5478 int pe = PseudoElement_None; -
5479 -
5480 -
5481 switch (se) { -
5482 case SE_PushButtonContents: -
5483 case SE_PushButtonFocusRect: -
5484 if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
never evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)
0
5485 QStyleOptionButton btnOpt(*btn); -
5486 if (rule.hasBox() || !rule.hasNativeBorder())
never evaluated: rule.hasBox()
never evaluated: !rule.hasNativeBorder()
0
5487 return visualRect(opt->direction, opt->rect, rule.contentsRect(opt->rect));
never executed: return visualRect(opt->direction, opt->rect, rule.contentsRect(opt->rect));
0
5488 return rule.baseStyleCanDraw() ? baseStyle()->subElementRect(se, &btnOpt, w) 0
5489 : QWindowsStyle::subElementRect(se, &btnOpt, w);
never executed: return rule.baseStyleCanDraw() ? baseStyle()->subElementRect(se, &btnOpt, w) : QWindowsStyle::subElementRect(se, &btnOpt, w);
0
5490 } -
5491 break;
never executed: break;
0
5492 -
5493 case SE_LineEditContents: -
5494 case SE_FrameContents: -
5495 case SE_ShapedFrameContents: -
5496 if (rule.hasBox() || !rule.hasNativeBorder()) {
partially evaluated: rule.hasBox()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1187
evaluated: !rule.hasNativeBorder()
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:1181
0-1187
5497 return visualRect(opt->direction, opt->rect, rule.contentsRect(opt->rect));
executed: return visualRect(opt->direction, opt->rect, rule.contentsRect(opt->rect));
Execution Count:6
6
5498 } -
5499 break;
executed: break;
Execution Count:1181
1181
5500 -
5501 case SE_CheckBoxIndicator: -
5502 case SE_RadioButtonIndicator: -
5503 if (rule.hasBox() || rule.hasBorder() || hasStyleRule(w, PseudoElement_Indicator)) {
never evaluated: rule.hasBox()
never evaluated: rule.hasBorder()
never evaluated: hasStyleRule(w, PseudoElement_Indicator)
0
5504 PseudoElement pe = se == SE_CheckBoxIndicator ? PseudoElement_Indicator : PseudoElement_ExclusiveIndicator;
never evaluated: se == SE_CheckBoxIndicator
0
5505 QRenderRule subRule = renderRule(w, opt, pe); -
5506 return positionRect(w, rule, subRule, pe, opt->rect, opt->direction);
never executed: return positionRect(w, rule, subRule, pe, opt->rect, opt->direction);
0
5507 } -
5508 break;
never executed: break;
0
5509 -
5510 case SE_CheckBoxContents: -
5511 case SE_RadioButtonContents: -
5512 if (rule.hasBox() || rule.hasBorder() || hasStyleRule(w, PseudoElement_Indicator)) {
never evaluated: rule.hasBox()
never evaluated: rule.hasBorder()
never evaluated: hasStyleRule(w, PseudoElement_Indicator)
0
5513 bool isRadio = se == SE_RadioButtonContents; -
5514 QRect ir = subElementRect(isRadio ? SE_RadioButtonIndicator : SE_CheckBoxIndicator, -
5515 opt, w); -
5516 ir = visualRect(opt->direction, opt->rect, ir); -
5517 int spacing = pixelMetric(isRadio ? PM_RadioButtonLabelSpacing : PM_CheckBoxLabelSpacing, 0, w); -
5518 QRect cr = rule.contentsRect(opt->rect); -
5519 ir.setRect(ir.left() + ir.width() + spacing, cr.y(), -
5520 cr.width() - ir.width() - spacing, cr.height()); -
5521 return visualRect(opt->direction, opt->rect, ir);
never executed: return visualRect(opt->direction, opt->rect, ir);
0
5522 } -
5523 break;
never executed: break;
0
5524 -
5525 case SE_ToolBoxTabContents: -
5526 if (w && hasStyleRule(w->parentWidget(), PseudoElement_ToolBoxTab)) {
never evaluated: w
never evaluated: hasStyleRule(w->parentWidget(), PseudoElement_ToolBoxTab)
0
5527 QRenderRule subRule = renderRule(w->parentWidget(), opt, PseudoElement_ToolBoxTab); -
5528 return visualRect(opt->direction, opt->rect, subRule.contentsRect(opt->rect));
never executed: return visualRect(opt->direction, opt->rect, subRule.contentsRect(opt->rect));
0
5529 } -
5530 break;
never executed: break;
0
5531 -
5532 case SE_RadioButtonFocusRect: -
5533 case SE_RadioButtonClickRect: -
5534 if (rule.hasBox() || rule.hasBorder() || hasStyleRule(w, PseudoElement_Indicator)) {
never evaluated: rule.hasBox()
never evaluated: rule.hasBorder()
never evaluated: hasStyleRule(w, PseudoElement_Indicator)
0
5535 return opt->rect;
never executed: return opt->rect;
0
5536 } -
5537 break;
never executed: break;
0
5538 -
5539 case SE_CheckBoxFocusRect: -
5540 case SE_CheckBoxClickRect: -
5541 return ParentStyle::subElementRect(se, opt, w);
never executed: return ParentStyle::subElementRect(se, opt, w);
0
5542 -
5543 -
5544 case SE_ViewItemCheckIndicator: -
5545 if (!qstyleoption_cast<const QStyleOptionViewItem *>(opt)) {
never evaluated: !qstyleoption_cast<const QStyleOptionViewItem *>(opt)
0
5546 return subElementRect(SE_CheckBoxIndicator, opt, w);
never executed: return subElementRect(SE_CheckBoxIndicator, opt, w);
0
5547 } -
5548 -
5549 case SE_ItemViewItemText:
code before this statement never executed: case SE_ItemViewItemText:
0
5550 case SE_ItemViewItemDecoration: -
5551 case SE_ItemViewItemFocusRect: -
5552 if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) {
never evaluated: const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)
0
5553 QRenderRule subRule = renderRule(w, opt, PseudoElement_ViewItem); -
5554 PseudoElement pe = PseudoElement_None; -
5555 if (se == SE_ItemViewItemText || se == SE_ItemViewItemFocusRect)
never evaluated: se == SE_ItemViewItemText
never evaluated: se == SE_ItemViewItemFocusRect
0
5556 pe = PseudoElement_ViewItemText;
never executed: pe = PseudoElement_ViewItemText;
0
5557 else if (se == SE_ItemViewItemDecoration && vopt->features & QStyleOptionViewItem::HasDecoration)
never evaluated: se == SE_ItemViewItemDecoration
never evaluated: vopt->features & QStyleOptionViewItem::HasDecoration
0
5558 pe = PseudoElement_ViewItemIcon;
never executed: pe = PseudoElement_ViewItemIcon;
0
5559 else if (se == SE_ItemViewItemCheckIndicator && vopt->features & QStyleOptionViewItem::HasCheckIndicator)
never evaluated: se == SE_ItemViewItemCheckIndicator
never evaluated: vopt->features & QStyleOptionViewItem::HasCheckIndicator
0
5560 pe = PseudoElement_ViewItemIndicator;
never executed: pe = PseudoElement_ViewItemIndicator;
0
5561 else -
5562 break;
never executed: break;
0
5563 if (subRule.hasGeometry() || subRule.hasBox() || !subRule.hasNativeBorder() || hasStyleRule(w, pe)) {
never evaluated: subRule.hasGeometry()
never evaluated: subRule.hasBox()
never evaluated: !subRule.hasNativeBorder()
never evaluated: hasStyleRule(w, pe)
0
5564 QRenderRule subRule2 = renderRule(w, opt, pe); -
5565 QStyleOptionViewItem optCopy(*vopt); -
5566 optCopy.rect = subRule.contentsRect(vopt->rect); -
5567 QRect rect = ParentStyle::subElementRect(se, &optCopy, w); -
5568 return positionRect(w, subRule2, pe, rect, opt->direction);
never executed: return positionRect(w, subRule2, pe, rect, opt->direction);
0
5569 } -
5570 }
never executed: }
0
5571 break;
never executed: break;
0
5572 -
5573 -
5574 case SE_HeaderArrow: { -
5575 QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewUpArrow); -
5576 if (subRule.hasPosition() || subRule.hasGeometry())
never evaluated: subRule.hasPosition()
never evaluated: subRule.hasGeometry()
0
5577 return positionRect(w, rule, subRule, PseudoElement_HeaderViewUpArrow, opt->rect, opt->direction);
never executed: return positionRect(w, rule, subRule, PseudoElement_HeaderViewUpArrow, opt->rect, opt->direction);
0
5578 } -
5579 break;
never executed: break;
0
5580 -
5581 case SE_HeaderLabel: { -
5582 QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection); -
5583 if (subRule.hasBox() || !subRule.hasNativeBorder())
never evaluated: subRule.hasBox()
never evaluated: !subRule.hasNativeBorder()
0
5584 return subRule.contentsRect(opt->rect);
never executed: return subRule.contentsRect(opt->rect);
0
5585 } -
5586 break;
never executed: break;
0
5587 -
5588 case SE_ProgressBarGroove: -
5589 case SE_ProgressBarContents: -
5590 case SE_ProgressBarLabel: -
5591 if (const QStyleOptionProgressBarV2 *pb = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt)) {
never evaluated: const QStyleOptionProgressBarV2 *pb = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt)
0
5592 if (rule.hasBox() || !rule.hasNativeBorder() || rule.hasPosition() || hasStyleRule(w, PseudoElement_ProgressBarChunk)) {
never evaluated: rule.hasBox()
never evaluated: !rule.hasNativeBorder()
never evaluated: rule.hasPosition()
never evaluated: hasStyleRule(w, PseudoElement_ProgressBarChunk)
0
5593 if (se == SE_ProgressBarGroove)
never evaluated: se == SE_ProgressBarGroove
0
5594 return rule.borderRect(pb->rect);
never executed: return rule.borderRect(pb->rect);
0
5595 else if (se == SE_ProgressBarContents)
never evaluated: se == SE_ProgressBarContents
0
5596 return rule.contentsRect(pb->rect);
never executed: return rule.contentsRect(pb->rect);
0
5597 -
5598 QSize sz = pb->fontMetrics.size(0, pb->text); -
5599 return QStyle::alignedRect(Qt::LeftToRight, rule.hasPosition() ? rule.position()->textAlignment : pb->textAlignment, 0
5600 sz, pb->rect);
never executed: return QStyle::alignedRect(Qt::LeftToRight, rule.hasPosition() ? rule.position()->textAlignment : pb->textAlignment, sz, pb->rect);
0
5601 } -
5602 }
never executed: }
0
5603 break;
never executed: break;
0
5604 -
5605 -
5606 case SE_TabWidgetLeftCorner: -
5607 pe = PseudoElement_TabWidgetLeftCorner; -
5608 -
5609 case SE_TabWidgetRightCorner:
code before this statement never executed: case SE_TabWidgetRightCorner:
0
5610 if (pe == PseudoElement_None)
never evaluated: pe == PseudoElement_None
0
5611 pe = PseudoElement_TabWidgetRightCorner;
never executed: pe = PseudoElement_TabWidgetRightCorner;
0
5612 -
5613 case SE_TabWidgetTabBar:
code before this statement never executed: case SE_TabWidgetTabBar:
0
5614 if (pe == PseudoElement_None)
never evaluated: pe == PseudoElement_None
0
5615 pe = PseudoElement_TabWidgetTabBar;
never executed: pe = PseudoElement_TabWidgetTabBar;
0
5616 -
5617 case SE_TabWidgetTabPane:
code before this statement never executed: case SE_TabWidgetTabPane:
0
5618 case SE_TabWidgetTabContents: -
5619 if (pe == PseudoElement_None)
never evaluated: pe == PseudoElement_None
0
5620 pe = PseudoElement_TabWidgetPane;
never executed: pe = PseudoElement_TabWidgetPane;
0
5621 -
5622 if (hasStyleRule(w, pe)) {
never evaluated: hasStyleRule(w, pe)
0
5623 QRect r = QWindowsStyle::subElementRect(pe == PseudoElement_TabWidgetPane ? SE_TabWidgetTabPane : se, opt, w); -
5624 QRenderRule subRule = renderRule(w, opt, pe); -
5625 r = positionRect(w, subRule, pe, r, opt->direction); -
5626 if (pe == PseudoElement_TabWidgetTabBar) {
never evaluated: pe == PseudoElement_TabWidgetTabBar
0
5627 qt_noop(); -
5628 r = opt->rect.intersected(r); -
5629 }
never executed: }
0
5630 if (se == SE_TabWidgetTabContents)
never evaluated: se == SE_TabWidgetTabContents
0
5631 r = subRule.contentsRect(r);
never executed: r = subRule.contentsRect(r);
0
5632 return r;
never executed: return r;
0
5633 } -
5634 break;
never executed: break;
0
5635 -
5636 case SE_TabBarTearIndicator: { -
5637 QRenderRule subRule = renderRule(w, opt, PseudoElement_TabBarTear); -
5638 if (subRule.hasContentsSize()) {
never evaluated: subRule.hasContentsSize()
0
5639 QRect r; -
5640 if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
never evaluated: const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)
0
5641 switch (tab->shape) { -
5642 case QTabBar::RoundedNorth: -
5643 case QTabBar::TriangularNorth: -
5644 case QTabBar::RoundedSouth: -
5645 case QTabBar::TriangularSouth: -
5646 r.setRect(tab->rect.left(), tab->rect.top(), subRule.size().width(), opt->rect.height()); -
5647 break;
never executed: break;
0
5648 case QTabBar::RoundedWest: -
5649 case QTabBar::TriangularWest: -
5650 case QTabBar::RoundedEast: -
5651 case QTabBar::TriangularEast: -
5652 r.setRect(tab->rect.left(), tab->rect.top(), opt->rect.width(), subRule.size().height()); -
5653 break;
never executed: break;
0
5654 default: -
5655 break;
never executed: break;
0
5656 } -
5657 r = visualRect(opt->direction, opt->rect, r); -
5658 }
never executed: }
0
5659 return r;
never executed: return r;
0
5660 } -
5661 break;
never executed: break;
0
5662 } -
5663 case SE_TabBarTabText: -
5664 case SE_TabBarTabLeftButton: -
5665 case SE_TabBarTabRightButton: { -
5666 QRenderRule subRule = renderRule(w, opt, PseudoElement_TabBarTab); -
5667 if (subRule.hasBox() || !subRule.hasNativeBorder()) {
never evaluated: subRule.hasBox()
never evaluated: !subRule.hasNativeBorder()
0
5668 return ParentStyle::subElementRect(se, opt, w);
never executed: return ParentStyle::subElementRect(se, opt, w);
0
5669 } -
5670 break;
never executed: break;
0
5671 } -
5672 -
5673 -
5674 case SE_DockWidgetCloseButton: -
5675 case SE_DockWidgetFloatButton: { -
5676 PseudoElement pe = (se == SE_DockWidgetCloseButton) ? PseudoElement_DockWidgetCloseButton : PseudoElement_DockWidgetFloatButton;
never evaluated: (se == SE_DockWidgetCloseButton)
0
5677 QRenderRule subRule2 = renderRule(w, opt, pe); -
5678 if (!subRule2.hasPosition())
never evaluated: !subRule2.hasPosition()
0
5679 break;
never executed: break;
0
5680 QRenderRule subRule = renderRule(w, opt, PseudoElement_DockWidgetTitle); -
5681 return positionRect(w, subRule, subRule2, pe, opt->rect, opt->direction);
never executed: return positionRect(w, subRule, subRule2, pe, opt->rect, opt->direction);
0
5682 } -
5683 -
5684 -
5685 case SE_ToolBarHandle: -
5686 if (hasStyleRule(w, PseudoElement_ToolBarHandle))
never evaluated: hasStyleRule(w, PseudoElement_ToolBarHandle)
0
5687 return ParentStyle::subElementRect(se, opt, w);
never executed: return ParentStyle::subElementRect(se, opt, w);
0
5688 break;
never executed: break;
0
5689 -
5690 -
5691 default: -
5692 break;
executed: break;
Execution Count:806
806
5693 } -
5694 -
5695 return baseStyle()->subElementRect(se, opt, w);
executed: return baseStyle()->subElementRect(se, opt, w);
Execution Count:1987
1987
5696} -
5697 -
5698bool QStyleSheetStyle::event(QEvent *e) -
5699{ -
5700 return (baseStyle()->event(e) && e->isAccepted()) || ParentStyle::event(e);
executed: return (baseStyle()->event(e) && e->isAccepted()) || ParentStyle::event(e);
Execution Count:777
777
5701} -
5702 -
5703void QStyleSheetStyle::updateStyleSheetFont(QWidget* w) const -
5704{ -
5705 QWidget *container = containerWidget(w); -
5706 QRenderRule rule = renderRule(container, PseudoElement_None, -
5707 PseudoClass_Active | PseudoClass_Enabled | extendedPseudoClass(container)); -
5708 QFont font = rule.font.resolve(w->font()); -
5709 -
5710 if ((!w->isWindow() || w->testAttribute(Qt::WA_WindowPropagation))
evaluated: !w->isWindow()
TRUEFALSE
yes
Evaluation Count:1959
yes
Evaluation Count:387
partially evaluated: w->testAttribute(Qt::WA_WindowPropagation)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:387
0-1959
5711 && isNaturalChild(w) && qobject_cast<QWidget *>(w->parent())) {
evaluated: isNaturalChild(w)
TRUEFALSE
yes
Evaluation Count:783
yes
Evaluation Count:1176
partially evaluated: qobject_cast<QWidget *>(w->parent())
TRUEFALSE
yes
Evaluation Count:783
no
Evaluation Count:0
0-1176
5712 -
5713 font = font.resolve(static_cast<QWidget *>(w->parent())->font()); -
5714 }
executed: }
Execution Count:783
783
5715 -
5716 if (w->data->fnt == font)
evaluated: w->data->fnt == font
TRUEFALSE
yes
Evaluation Count:2345
yes
Evaluation Count:1
1-2345
5717 return;
executed: return;
Execution Count:2345
2345
5718 -
5719 w->data->fnt = font; -
5720 -
5721 QEvent e(QEvent::FontChange); -
5722 QApplication::sendEvent(w, &e); -
5723}
executed: }
Execution Count:1
1
5724 -
5725void QStyleSheetStyle::saveWidgetFont(QWidget* w, const QFont& font) const -
5726{ -
5727 w->setProperty("_q_styleSheetWidgetFont", font); -
5728}
executed: }
Execution Count:1957
1957
5729 -
5730void QStyleSheetStyle::clearWidgetFont(QWidget* w) const -
5731{ -
5732 w->setProperty("_q_styleSheetWidgetFont", QVariant(QVariant::Invalid)); -
5733}
executed: }
Execution Count:2
2
5734 -
5735 -
5736 -
5737 -
5738 -
5739bool QStyleSheetStyle::styleSheetPalette(const QWidget* w, const QStyleOption* opt, QPalette* pal) -
5740{ -
5741 if (!w || !opt || !pal)
partially evaluated: !w
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
partially evaluated: !opt
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
partially evaluated: !pal
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
0-7
5742 return false;
never executed: return false;
0
5743 -
5744 if (globalStyleSheetStyle != 0 && globalStyleSheetStyle != this) { return false; } QStyleSheetStyleRecursionGuard recursion_guard(this);
never executed: return false;
partially evaluated: globalStyleSheetStyle != 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
never evaluated: globalStyleSheetStyle != this
0-7
5745 -
5746 w = containerWidget(w); -
5747 -
5748 QRenderRule rule = renderRule(w, PseudoElement_None, pseudoClass(opt->state) | extendedPseudoClass(w)); -
5749 if (!rule.hasPalette())
partially evaluated: !rule.hasPalette()
TRUEFALSE
yes
Evaluation Count:7
no
Evaluation Count:0
0-7
5750 return false;
executed: return false;
Execution Count:7
7
5751 -
5752 rule.configurePalette(pal, QPalette::NoRole, QPalette::NoRole); -
5753 return true;
never executed: return true;
0
5754} -
5755 -
5756Qt::Alignment QStyleSheetStyle::resolveAlignment(Qt::LayoutDirection layDir, Qt::Alignment src) -
5757{ -
5758 if (layDir == Qt::LeftToRight || src & Qt::AlignAbsolute)
never evaluated: layDir == Qt::LeftToRight
never evaluated: src & Qt::AlignAbsolute
0
5759 return src;
never executed: return src;
0
5760 -
5761 if (src & Qt::AlignLeft) {
never evaluated: src & Qt::AlignLeft
0
5762 src &= ~Qt::AlignLeft; -
5763 src |= Qt::AlignRight; -
5764 } else if (src & Qt::AlignRight) {
never executed: }
never evaluated: src & Qt::AlignRight
0
5765 src &= ~Qt::AlignRight; -
5766 src |= Qt::AlignLeft; -
5767 }
never executed: }
0
5768 src |= Qt::AlignAbsolute; -
5769 return src;
never executed: return src;
0
5770} -
5771 -
5772 -
5773 -
5774 -
5775 -
5776 -
5777 -
5778bool QStyleSheetStyle::isNaturalChild(const QObject *obj) -
5779{ -
5780 if (obj->objectName().startsWith(QLatin1String("qt_")))
evaluated: obj->objectName().startsWith(QLatin1String("qt_"))
TRUEFALSE
yes
Evaluation Count:783
yes
Evaluation Count:1176
783-1176
5781 return true;
executed: return true;
Execution Count:783
783
5782 -
5783 return false;
executed: return false;
Execution Count:1176
1176
5784} -
5785 -
5786 -
5787 -
5788 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial