styles/qstylesheetstyle.cpp

Source codeSwitch to Preprocessed file
LineSource CodeCoverage
1/**************************************************************************** -
2** -
3** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -
4** Contact: http://www.qt-project.org/legal -
5** -
6** This file is part of the QtGui module of the Qt Toolkit. -
7** -
8** $QT_BEGIN_LICENSE:LGPL$ -
9** Commercial License Usage -
10** Licensees holding valid commercial Qt licenses may use this file in -
11** accordance with the commercial license agreement provided with the -
12** Software or, alternatively, in accordance with the terms contained in -
13** a written agreement between you and Digia. For licensing terms and -
14** conditions see http://qt.digia.com/licensing. For further information -
15** use the contact form at http://qt.digia.com/contact-us. -
16** -
17** GNU Lesser General Public License Usage -
18** Alternatively, this file may be used under the terms of the GNU Lesser -
19** General Public License version 2.1 as published by the Free Software -
20** Foundation and appearing in the file LICENSE.LGPL included in the -
21** packaging of this file. Please review the following information to -
22** ensure the GNU Lesser General Public License version 2.1 requirements -
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -
24** -
25** In addition, as a special exception, Digia gives you certain additional -
26** rights. These rights are described in the Digia Qt LGPL Exception -
27** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -
28** -
29** GNU General Public License Usage -
30** Alternatively, this file may be used under the terms of the GNU -
31** General Public License version 3.0 as published by the Free Software -
32** Foundation and appearing in the file LICENSE.GPL included in the -
33** packaging of this file. Please review the following information to -
34** ensure the GNU General Public License version 3.0 requirements will be -
35** met: http://www.gnu.org/copyleft/gpl.html. -
36** -
37** -
38** $QT_END_LICENSE$ -
39** -
40****************************************************************************/ -
41 -
42#include <qglobal.h> -
43 -
44#ifndef QT_NO_STYLE_STYLESHEET -
45 -
46#include "qstylesheetstyle_p.h" -
47#include "private/qcssutil_p.h" -
48#include <qdebug.h> -
49#include <qapplication.h> -
50#include <qmenu.h> -
51#include <qmenubar.h> -
52#include <qpainter.h> -
53#include <qstyleoption.h> -
54#include <qlineedit.h> -
55#include <private/qwindowsstyle_p.h> -
56#include <qcombobox.h> -
57#include "private/qcssparser_p.h" -
58#include "private/qmath_p.h" -
59#include <qabstractscrollarea.h> -
60#include "private/qabstractscrollarea_p.h" -
61#include <qtooltip.h> -
62#include <qshareddata.h> -
63#include <qradiobutton.h> -
64#include <qtoolbutton.h> -
65#include <qscrollbar.h> -
66#include <qstring.h> -
67#include <qfile.h> -
68#include <qcheckbox.h> -
69#include <qstatusbar.h> -
70#include <qheaderview.h> -
71#include <private/qwindowsstyle_p_p.h> -
72#include <private/qstyleanimation_p.h> -
73#include <qtabbar.h> -
74#include <QMetaProperty> -
75#include <qmainwindow.h> -
76#include <qdockwidget.h> -
77#include <qmdisubwindow.h> -
78#include <qdialog.h> -
79#include <private/qwidget_p.h> -
80#include <QAbstractSpinBox> -
81#include <QLabel> -
82#include "qdrawutil.h" -
83 -
84#include <limits.h> -
85#include <QtWidgets/qtoolbar.h> -
86 -
87QT_BEGIN_NAMESPACE -
88 -
89using namespace QCss; -
90 -
91 -
92class QStyleSheetStylePrivate : public QWindowsStylePrivate -
93{ -
94 Q_DECLARE_PUBLIC(QStyleSheetStyle) -
95public: -
96 QStyleSheetStylePrivate() { } -
97}; -
98 -
99 -
100static QStyleSheetStyleCaches *styleSheetCaches = 0; -
101 -
102/* RECURSION_GUARD: -
103 * the QStyleSheetStyle is a proxy. If used with others proxy style, we may end up with something like: -
104 * QStyleSheetStyle -> ProxyStyle -> QStyleSheetStyle -> OriginalStyle -
105 * Recursion may happen if the style call the widget()->style() again. -
106 * Not to mention the performence penalty of having two lookup of rules. -
107 * -
108 * The first instance of QStyleSheetStyle will set globalStyleSheetStyle to itself. The second one -
109 * will notice the globalStyleSheetStyle is not istelf and call its base style directly. -
110 */ -
111static const QStyleSheetStyle *globalStyleSheetStyle = 0; -
112class QStyleSheetStyleRecursionGuard -
113{ -
114 public: -
115 QStyleSheetStyleRecursionGuard(const QStyleSheetStyle *that) -
116 : guarded(globalStyleSheetStyle == 0) -
117 { -
118 if (guarded) globalStyleSheetStyle = that;
executed: globalStyleSheetStyle = that;
Execution Count:127
partially evaluated: guarded
TRUEFALSE
yes
Evaluation Count:127
no
Evaluation Count:0
0-127
119 }
executed: }
Execution Count:127
127
120 ~QStyleSheetStyleRecursionGuard() { if (guarded) globalStyleSheetStyle = 0; }
executed: globalStyleSheetStyle = 0;
Execution Count:127
executed: }
Execution Count:127
partially evaluated: guarded
TRUEFALSE
yes
Evaluation Count:127
no
Evaluation Count:0
0-127
121 bool guarded; -
122}; -
123#define RECURSION_GUARD(RETURN) \ -
124 if (globalStyleSheetStyle != 0 && globalStyleSheetStyle != this) { RETURN; } \ -
125 QStyleSheetStyleRecursionGuard recursion_guard(this); -
126 -
127#define ceil(x) ((int)(x) + ((x) > 0 && (x) != (int)(x))) -
128 -
129enum PseudoElement { -
130 PseudoElement_None, -
131 PseudoElement_DownArrow, -
132 PseudoElement_UpArrow, -
133 PseudoElement_LeftArrow, -
134 PseudoElement_RightArrow, -
135 PseudoElement_Indicator, -
136 PseudoElement_ExclusiveIndicator, -
137 PseudoElement_PushButtonMenuIndicator, -
138 PseudoElement_ComboBoxDropDown, -
139 PseudoElement_ComboBoxArrow, -
140 PseudoElement_Item, -
141 PseudoElement_SpinBoxUpButton, -
142 PseudoElement_SpinBoxUpArrow, -
143 PseudoElement_SpinBoxDownButton, -
144 PseudoElement_SpinBoxDownArrow, -
145 PseudoElement_GroupBoxTitle, -
146 PseudoElement_GroupBoxIndicator, -
147 PseudoElement_ToolButtonMenu, -
148 PseudoElement_ToolButtonMenuArrow, -
149 PseudoElement_ToolButtonDownArrow, -
150 PseudoElement_ToolBoxTab, -
151 PseudoElement_ScrollBarSlider, -
152 PseudoElement_ScrollBarAddPage, -
153 PseudoElement_ScrollBarSubPage, -
154 PseudoElement_ScrollBarAddLine, -
155 PseudoElement_ScrollBarSubLine, -
156 PseudoElement_ScrollBarFirst, -
157 PseudoElement_ScrollBarLast, -
158 PseudoElement_ScrollBarUpArrow, -
159 PseudoElement_ScrollBarDownArrow, -
160 PseudoElement_ScrollBarLeftArrow, -
161 PseudoElement_ScrollBarRightArrow, -
162 PseudoElement_SplitterHandle, -
163 PseudoElement_ToolBarHandle, -
164 PseudoElement_ToolBarSeparator, -
165 PseudoElement_MenuScroller, -
166 PseudoElement_MenuTearoff, -
167 PseudoElement_MenuCheckMark, -
168 PseudoElement_MenuSeparator, -
169 PseudoElement_MenuIcon, -
170 PseudoElement_MenuRightArrow, -
171 PseudoElement_TreeViewBranch, -
172 PseudoElement_HeaderViewSection, -
173 PseudoElement_HeaderViewUpArrow, -
174 PseudoElement_HeaderViewDownArrow, -
175 PseudoElement_ProgressBarChunk, -
176 PseudoElement_TabBarTab, -
177 PseudoElement_TabBarScroller, -
178 PseudoElement_TabBarTear, -
179 PseudoElement_SliderGroove, -
180 PseudoElement_SliderHandle, -
181 PseudoElement_SliderAddPage, -
182 PseudoElement_SliderSubPage, -
183 PseudoElement_SliderTickmark, -
184 PseudoElement_TabWidgetPane, -
185 PseudoElement_TabWidgetTabBar, -
186 PseudoElement_TabWidgetLeftCorner, -
187 PseudoElement_TabWidgetRightCorner, -
188 PseudoElement_DockWidgetTitle, -
189 PseudoElement_DockWidgetCloseButton, -
190 PseudoElement_DockWidgetFloatButton, -
191 PseudoElement_DockWidgetSeparator, -
192 PseudoElement_MdiCloseButton, -
193 PseudoElement_MdiMinButton, -
194 PseudoElement_MdiNormalButton, -
195 PseudoElement_TitleBar, -
196 PseudoElement_TitleBarCloseButton, -
197 PseudoElement_TitleBarMinButton, -
198 PseudoElement_TitleBarMaxButton, -
199 PseudoElement_TitleBarShadeButton, -
200 PseudoElement_TitleBarUnshadeButton, -
201 PseudoElement_TitleBarNormalButton, -
202 PseudoElement_TitleBarContextHelpButton, -
203 PseudoElement_TitleBarSysMenu, -
204 PseudoElement_ViewItem, -
205 PseudoElement_ViewItemIcon, -
206 PseudoElement_ViewItemText, -
207 PseudoElement_ViewItemIndicator, -
208 PseudoElement_ScrollAreaCorner, -
209 PseudoElement_TabBarTabCloseButton, -
210 NumPseudoElements -
211}; -
212 -
213struct PseudoElementInfo { -
214 QStyle::SubControl subControl; -
215 const char *name; -
216}; -
217 -
218static const PseudoElementInfo knownPseudoElements[NumPseudoElements] = { -
219 { QStyle::SC_None, "" }, -
220 { QStyle::SC_None, "down-arrow" }, -
221 { QStyle::SC_None, "up-arrow" }, -
222 { QStyle::SC_None, "left-arrow" }, -
223 { QStyle::SC_None, "right-arrow" }, -
224 { QStyle::SC_None, "indicator" }, -
225 { QStyle::SC_None, "indicator" }, -
226 { QStyle::SC_None, "menu-indicator" }, -
227 { QStyle::SC_ComboBoxArrow, "drop-down" }, -
228 { QStyle::SC_ComboBoxArrow, "down-arrow" }, -
229 { QStyle::SC_None, "item" }, -
230 { QStyle::SC_SpinBoxUp, "up-button" }, -
231 { QStyle::SC_SpinBoxUp, "up-arrow" }, -
232 { QStyle::SC_SpinBoxDown, "down-button" }, -
233 { QStyle::SC_SpinBoxDown, "down-arrow" }, -
234 { QStyle::SC_GroupBoxLabel, "title" }, -
235 { QStyle::SC_GroupBoxCheckBox, "indicator" }, -
236 { QStyle::SC_ToolButtonMenu, "menu-button" }, -
237 { QStyle::SC_ToolButtonMenu, "menu-arrow" }, -
238 { QStyle::SC_None, "menu-indicator" }, -
239 { QStyle::SC_None, "tab" }, -
240 { QStyle::SC_ScrollBarSlider, "handle" }, -
241 { QStyle::SC_ScrollBarAddPage, "add-page" }, -
242 { QStyle::SC_ScrollBarSubPage, "sub-page" }, -
243 { QStyle::SC_ScrollBarAddLine, "add-line" }, -
244 { QStyle::SC_ScrollBarSubLine, "sub-line" }, -
245 { QStyle::SC_ScrollBarFirst, "first" }, -
246 { QStyle::SC_ScrollBarLast, "last" }, -
247 { QStyle::SC_ScrollBarSubLine, "up-arrow" }, -
248 { QStyle::SC_ScrollBarAddLine, "down-arrow" }, -
249 { QStyle::SC_ScrollBarSubLine, "left-arrow" }, -
250 { QStyle::SC_ScrollBarAddLine, "right-arrow" }, -
251 { QStyle::SC_None, "handle" }, -
252 { QStyle::SC_None, "handle" }, -
253 { QStyle::SC_None, "separator" }, -
254 { QStyle::SC_None, "scroller" }, -
255 { QStyle::SC_None, "tearoff" }, -
256 { QStyle::SC_None, "indicator" }, -
257 { QStyle::SC_None, "separator" }, -
258 { QStyle::SC_None, "icon" }, -
259 { QStyle::SC_None, "right-arrow" }, -
260 { QStyle::SC_None, "branch" }, -
261 { QStyle::SC_None, "section" }, -
262 { QStyle::SC_None, "down-arrow" }, -
263 { QStyle::SC_None, "up-arrow" }, -
264 { QStyle::SC_None, "chunk" }, -
265 { QStyle::SC_None, "tab" }, -
266 { QStyle::SC_None, "scroller" }, -
267 { QStyle::SC_None, "tear" }, -
268 { QStyle::SC_SliderGroove, "groove" }, -
269 { QStyle::SC_SliderHandle, "handle" }, -
270 { QStyle::SC_None, "add-page" }, -
271 { QStyle::SC_None, "sub-page"}, -
272 { QStyle::SC_SliderTickmarks, "tick-mark" }, -
273 { QStyle::SC_None, "pane" }, -
274 { QStyle::SC_None, "tab-bar" }, -
275 { QStyle::SC_None, "left-corner" }, -
276 { QStyle::SC_None, "right-corner" }, -
277 { QStyle::SC_None, "title" }, -
278 { QStyle::SC_None, "close-button" }, -
279 { QStyle::SC_None, "float-button" }, -
280 { QStyle::SC_None, "separator" }, -
281 { QStyle::SC_MdiCloseButton, "close-button" }, -
282 { QStyle::SC_MdiMinButton, "minimize-button" }, -
283 { QStyle::SC_MdiNormalButton, "normal-button" }, -
284 { QStyle::SC_TitleBarLabel, "title" }, -
285 { QStyle::SC_TitleBarCloseButton, "close-button" }, -
286 { QStyle::SC_TitleBarMinButton, "minimize-button" }, -
287 { QStyle::SC_TitleBarMaxButton, "maximize-button" }, -
288 { QStyle::SC_TitleBarShadeButton, "shade-button" }, -
289 { QStyle::SC_TitleBarUnshadeButton, "unshade-button" }, -
290 { QStyle::SC_TitleBarNormalButton, "normal-button" }, -
291 { QStyle::SC_TitleBarContextHelpButton, "contexthelp-button" }, -
292 { QStyle::SC_TitleBarSysMenu, "sys-menu" }, -
293 { QStyle::SC_None, "item" }, -
294 { QStyle::SC_None, "icon" }, -
295 { QStyle::SC_None, "text" }, -
296 { QStyle::SC_None, "indicator" }, -
297 { QStyle::SC_None, "corner" }, -
298 { QStyle::SC_None, "close-button" }, -
299}; -
300 -
301 -
302struct QStyleSheetBorderImageData : public QSharedData -
303{ -
304 QStyleSheetBorderImageData() -
305 : horizStretch(QCss::TileMode_Unknown), vertStretch(QCss::TileMode_Unknown) -
306 { -
307 for (int i = 0; i < 4; i++)
never evaluated: i < 4
0
308 cuts[i] = -1;
never executed: cuts[i] = -1;
0
309 }
never executed: }
0
310 int cuts[4]; -
311 QPixmap pixmap; -
312 QImage image; -
313 QCss::TileMode horizStretch, vertStretch; -
314}; -
315 -
316struct QStyleSheetBackgroundData : public QSharedData -
317{ -
318 QStyleSheetBackgroundData(const QBrush& b, const QPixmap& p, QCss::Repeat r, -
319 Qt::Alignment a, QCss::Origin o, Attachment t, QCss::Origin c) -
320 : brush(b), pixmap(p), repeat(r), position(a), origin(o), attachment(t), clip(c) { }
executed: }
Execution Count:36
36
321 -
322 bool isTransparent() const { -
323 if (brush.style() != Qt::NoBrush)
partially evaluated: brush.style() != Qt::NoBrush
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
324 return !brush.isOpaque();
executed: return !brush.isOpaque();
Execution Count:2
2
325 return pixmap.isNull() ? false : pixmap.hasAlpha();
never executed: return pixmap.isNull() ? false : pixmap.hasAlpha();
0
326 } -
327 QBrush brush; -
328 QPixmap pixmap; -
329 QCss::Repeat repeat; -
330 Qt::Alignment position; -
331 QCss::Origin origin; -
332 QCss::Attachment attachment; -
333 QCss::Origin clip; -
334}; -
335 -
336struct QStyleSheetBorderData : public QSharedData -
337{ -
338 QStyleSheetBorderData() : bi(0) -
339 { -
340 for (int i = 0; i < 4; i++) {
never evaluated: i < 4
0
341 borders[i] = 0;
never executed (the execution status of this line is deduced): borders[i] = 0;
-
342 styles[i] = QCss::BorderStyle_None;
never executed (the execution status of this line is deduced): styles[i] = QCss::BorderStyle_None;
-
343 }
never executed: }
0
344 }
never executed: }
0
345 -
346 QStyleSheetBorderData(int *b, QBrush *c, QCss::BorderStyle *s, QSize *r) : bi(0) -
347 { -
348 for (int i = 0; i < 4; i++) {
evaluated: i < 4
TRUEFALSE
yes
Evaluation Count:112
yes
Evaluation Count:28
28-112
349 borders[i] = b[i];
executed (the execution status of this line is deduced): borders[i] = b[i];
-
350 styles[i] = s[i];
executed (the execution status of this line is deduced): styles[i] = s[i];
-
351 colors[i] = c[i];
executed (the execution status of this line is deduced): colors[i] = c[i];
-
352 radii[i] = r[i];
executed (the execution status of this line is deduced): radii[i] = r[i];
-
353 }
executed: }
Execution Count:112
112
354 }
executed: }
Execution Count:28
28
355 -
356 int borders[4]; -
357 QBrush colors[4]; -
358 QCss::BorderStyle styles[4]; -
359 QSize radii[4]; // topleft, topright, bottomleft, bottomright -
360 -
361 const QStyleSheetBorderImageData *borderImage() const -
362 { return bi; }
never executed: return bi;
0
363 bool hasBorderImage() const { return bi!=0; }
executed: return bi!=0;
Execution Count:76
76
364 -
365 QSharedDataPointer<QStyleSheetBorderImageData> bi; -
366 -
367 bool isOpaque() const -
368 { -
369 for (int i = 0; i < 4; i++) {
evaluated: i < 4
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:2
2-8
370 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
371 continue;
executed: continue;
Execution Count:8
8
372 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
373 && styles[i] != BorderStyle_Solid)
never evaluated: styles[i] != BorderStyle_Solid
0
374 return false;
never executed: return false;
0
375 if (!colors[i].isOpaque())
never evaluated: !colors[i].isOpaque()
0
376 return false;
never executed: return false;
0
377 if (!radii[i].isEmpty())
never evaluated: !radii[i].isEmpty()
0
378 return false;
never executed: return false;
0
379 }
never executed: }
0
380 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
381 return false;
never executed: return false;
0
382 return true;
executed: return true;
Execution Count:2
2
383 } -
384}; -
385 -
386 -
387struct QStyleSheetOutlineData : public QStyleSheetBorderData -
388{ -
389 QStyleSheetOutlineData() -
390 { -
391 for (int i = 0; i < 4; i++) {
never evaluated: i < 4
0
392 offsets[i] = 0;
never executed (the execution status of this line is deduced): offsets[i] = 0;
-
393 }
never executed: }
0
394 }
never executed: }
0
395 -
396 QStyleSheetOutlineData(int *b, QBrush *c, QCss::BorderStyle *s, QSize *r, int *o) -
397 : QStyleSheetBorderData(b, c, s, r) -
398 { -
399 for (int i = 0; i < 4; i++) {
never evaluated: i < 4
0
400 offsets[i] = o[i];
never executed (the execution status of this line is deduced): offsets[i] = o[i];
-
401 }
never executed: }
0
402 }
never executed: }
0
403 -
404 int offsets[4]; -
405}; -
406 -
407struct QStyleSheetBoxData : public QSharedData -
408{ -
409 QStyleSheetBoxData(int *m, int *p, int s) : spacing(s) -
410 { -
411 for (int i = 0; i < 4; i++) {
never evaluated: i < 4
0
412 margins[i] = m[i];
never executed (the execution status of this line is deduced): margins[i] = m[i];
-
413 paddings[i] = p[i];
never executed (the execution status of this line is deduced): paddings[i] = p[i];
-
414 }
never executed: }
0
415 }
never executed: }
0
416 -
417 int margins[4]; -
418 int paddings[4]; -
419 -
420 int spacing; -
421}; -
422 -
423struct QStyleSheetPaletteData : public QSharedData -
424{ -
425 QStyleSheetPaletteData(const QBrush &fg, const QBrush &sfg, const QBrush &sbg, -
426 const QBrush &abg) -
427 : foreground(fg), selectionForeground(sfg), selectionBackground(sbg), -
428 alternateBackground(abg) { }
never executed: }
0
429 -
430 QBrush foreground; -
431 QBrush selectionForeground; -
432 QBrush selectionBackground; -
433 QBrush alternateBackground; -
434}; -
435 -
436struct QStyleSheetGeometryData : public QSharedData -
437{ -
438 QStyleSheetGeometryData(int w, int h, int minw, int minh, int maxw, int maxh) -
439 : minWidth(minw), minHeight(minh), width(w), height(h), maxWidth(maxw), maxHeight(maxh) { }
never executed: }
0
440 -
441 int minWidth, minHeight, width, height, maxWidth, maxHeight; -
442}; -
443 -
444struct QStyleSheetPositionData : public QSharedData -
445{ -
446 QStyleSheetPositionData(int l, int t, int r, int b, Origin o, Qt::Alignment p, QCss::PositionMode m, Qt::Alignment a = 0) -
447 : left(l), top(t), bottom(b), right(r), origin(o), position(p), mode(m), textAlignment(a) { }
never executed: }
0
448 -
449 int left, top, bottom, right; -
450 Origin origin; -
451 Qt::Alignment position; -
452 QCss::PositionMode mode; -
453 Qt::Alignment textAlignment; -
454}; -
455 -
456struct QStyleSheetImageData : public QSharedData -
457{ -
458 QStyleSheetImageData(const QIcon &i, Qt::Alignment a, const QSize &sz) -
459 : icon(i), alignment(a), size(sz) { }
never executed: }
0
460 -
461 QIcon icon; -
462 Qt::Alignment alignment; -
463 QSize size; -
464}; -
465 -
466class QRenderRule -
467{ -
468public: -
469 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:147
147
470 QRenderRule(const QVector<QCss::Declaration> &, const QObject *); -
471 ~QRenderRule() { } -
472 -
473 QRect borderRect(const QRect &r) const; -
474 QRect outlineRect(const QRect &r) const; -
475 QRect paddingRect(const QRect &r) const; -
476 QRect contentsRect(const QRect &r) const; -
477 -
478 enum { Margin = 1, Border = 2, Padding = 4, All=Margin|Border|Padding }; -
479 QRect boxRect(const QRect &r, int flags = All) const; -
480 QSize boxSize(const QSize &s, int flags = All) const; -
481 QRect originRect(const QRect &rect, Origin origin) const; -
482 -
483 QPainterPath borderClip(QRect rect); -
484 void drawBorder(QPainter *, const QRect&); -
485 void drawOutline(QPainter *, const QRect&); -
486 void drawBorderImage(QPainter *, const QRect&); -
487 void drawBackground(QPainter *, const QRect&, const QPoint& = QPoint(0, 0)); -
488 void drawBackgroundImage(QPainter *, const QRect&, QPoint = QPoint(0, 0)); -
489 void drawFrame(QPainter *, const QRect&); -
490 void drawImage(QPainter *p, const QRect &rect); -
491 void drawRule(QPainter *, const QRect&); -
492 void configurePalette(QPalette *, QPalette::ColorGroup, const QWidget *, bool); -
493 void configurePalette(QPalette *p, QPalette::ColorRole fr, QPalette::ColorRole br); -
494 -
495 const QStyleSheetPaletteData *palette() const { return pal; }
never executed: return pal;
0
496 const QStyleSheetBoxData *box() const { return b; }
never executed: return b;
0
497 const QStyleSheetBackgroundData *background() const { return bg; }
executed: return bg;
Execution Count:6
6
498 const QStyleSheetBorderData *border() const { return bd; }
executed: return bd;
Execution Count:30
30
499 const QStyleSheetOutlineData *outline() const { return ou; }
never executed: return ou;
0
500 const QStyleSheetGeometryData *geometry() const { return geo; }
executed: return geo;
Execution Count:3
3
501 const QStyleSheetPositionData *position() const { return p; }
never executed: return p;
0
502 -
503 bool hasPalette() const { return pal != 0; }
executed: return pal != 0;
Execution Count:13
13
504 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:8
8
505 bool hasGradientBackground() const { return bg && bg->brush.style() >= Qt::LinearGradientPattern
executed: return bg && bg->brush.style() >= Qt::LinearGradientPattern && bg->brush.style() <= Qt::ConicalGradientPattern;
Execution Count:2
2
506 && bg->brush.style() <= Qt::ConicalGradientPattern; }
executed: return bg && bg->brush.style() >= Qt::LinearGradientPattern && bg->brush.style() <= Qt::ConicalGradientPattern;
Execution Count:2
2
507 -
508 bool hasNativeBorder() const { -
509 return bd == 0
executed: return bd == 0 || (!bd->hasBorderImage() && bd->styles[0] == BorderStyle_Native);
Execution Count:22
22
510 || (!bd->hasBorderImage() && bd->styles[0] == BorderStyle_Native);
executed: return bd == 0 || (!bd->hasBorderImage() && bd->styles[0] == BorderStyle_Native);
Execution Count:22
22
511 } -
512 -
513 bool hasNativeOutline() const { -
514 return (ou == 0
never executed: return (ou == 0 || (!ou->hasBorderImage() && ou->styles[0] == BorderStyle_Native));
0
515 || (!ou->hasBorderImage() && ou->styles[0] == BorderStyle_Native));
never executed: return (ou == 0 || (!ou->hasBorderImage() && ou->styles[0] == BorderStyle_Native));
0
516 } -
517 -
518 bool baseStyleCanDraw() const { -
519 if (!hasBackground() || (background()->brush.style() == Qt::NoBrush && bg->pixmap.isNull()))
evaluated: !hasBackground()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:2
partially evaluated: background()->brush.style() == Qt::NoBrush
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
never evaluated: bg->pixmap.isNull()
0-2
520 return true;
executed: return true;
Execution Count:1
1
521 if (bg && !bg->pixmap.isNull())
partially evaluated: bg
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
partially evaluated: !bg->pixmap.isNull()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
522 return false;
never executed: return false;
0
523 if (hasGradientBackground())
partially evaluated: hasGradientBackground()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
524 return features & StyleFeature_BackgroundGradient;
never executed: return features & StyleFeature_BackgroundGradient;
0
525 return features & StyleFeature_BackgroundColor;
executed: return features & StyleFeature_BackgroundColor;
Execution Count:2
2
526 } -
527 -
528 bool hasBox() const { return b != 0; }
executed: return b != 0;
Execution Count:12
12
529 bool hasBorder() const { return bd != 0; }
executed: return bd != 0;
Execution Count:46
46
530 bool hasOutline() const { return ou != 0; }
never executed: return ou != 0;
0
531 bool hasPosition() const { return p != 0; }
executed: return p != 0;
Execution Count:2
2
532 bool hasGeometry() const { return geo != 0; }
executed: return geo != 0;
Execution Count:5
5
533 bool hasDrawable() const { return !hasNativeBorder() || hasBackground() || hasImage(); }
executed: return !hasNativeBorder() || hasBackground() || hasImage();
Execution Count:3
3
534 bool hasImage() const { return img != 0; }
executed: return img != 0;
Execution Count:1
1
535 -
536 QSize minimumContentsSize() const -
537 { return geo ? QSize(geo->minWidth, geo->minHeight) : QSize(0, 0); }
never executed: return geo ? QSize(geo->minWidth, geo->minHeight) : QSize(0, 0);
0
538 QSize minimumSize() const -
539 { return boxSize(minimumContentsSize()); }
never executed: return boxSize(minimumContentsSize());
0
540 -
541 QSize contentsSize() const -
542 { return geo ? QSize(geo->width, geo->height)
never executed: return geo ? QSize(geo->width, geo->height) : ((img && img->size.isValid()) ? img->size : QSize());
0
543 : ((img && img->size.isValid()) ? img->size : QSize()); }
never executed: return geo ? QSize(geo->width, geo->height) : ((img && img->size.isValid()) ? img->size : QSize());
0
544 QSize contentsSize(const QSize &sz) const -
545 { -
546 QSize csz = contentsSize();
never executed (the execution status of this line is deduced): QSize csz = contentsSize();
-
547 if (csz.width() == -1) csz.setWidth(sz.width());
never executed: csz.setWidth(sz.width());
never evaluated: csz.width() == -1
0
548 if (csz.height() == -1) csz.setHeight(sz.height());
never executed: csz.setHeight(sz.height());
never evaluated: csz.height() == -1
0
549 return csz;
never executed: return csz;
0
550 } -
551 bool hasContentsSize() const -
552 { 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:1
1
553 -
554 QSize size() const { return boxSize(contentsSize()); }
never executed: return boxSize(contentsSize());
0
555 QSize size(const QSize &sz) const { return boxSize(contentsSize(sz)); }
never executed: return boxSize(contentsSize(sz));
0
556 QSize adjustSize(const QSize &sz) -
557 { -
558 if (!geo)
partially evaluated: !geo
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
559 return sz;
executed: return sz;
Execution Count:2
2
560 QSize csz = contentsSize();
never executed (the execution status of this line is deduced): QSize csz = contentsSize();
-
561 if (csz.width() == -1) csz.setWidth(sz.width());
never executed: csz.setWidth(sz.width());
never evaluated: csz.width() == -1
0
562 if (csz.height() == -1) csz.setHeight(sz.height());
never executed: csz.setHeight(sz.height());
never evaluated: csz.height() == -1
0
563 if (geo->maxWidth != -1 && csz.width() > geo->maxWidth) csz.setWidth(geo->maxWidth);
never executed: csz.setWidth(geo->maxWidth);
never evaluated: geo->maxWidth != -1
never evaluated: csz.width() > geo->maxWidth
0
564 if (geo->maxHeight != -1 && csz.height() > geo->maxHeight) csz.setHeight(geo->maxHeight);
never executed: csz.setHeight(geo->maxHeight);
never evaluated: geo->maxHeight != -1
never evaluated: csz.height() > geo->maxHeight
0
565 csz=csz.expandedTo(QSize(geo->minWidth, geo->minHeight));
never executed (the execution status of this line is deduced): csz=csz.expandedTo(QSize(geo->minWidth, geo->minHeight));
-
566 return csz;
never executed: return csz;
0
567 } -
568 -
569 int features; -
570 QBrush defaultBackground; -
571 QFont font; -
572 bool hasFont; -
573 -
574 QHash<QString, QVariant> styleHints; -
575 bool hasStyleHint(const QString& sh) const { return styleHints.contains(sh); }
executed: return styleHints.contains(sh);
Execution Count:43
43
576 QVariant styleHint(const QString& sh) const { return styleHints.value(sh); }
never executed: return styleHints.value(sh);
0
577 -
578 void fixupBorder(int); -
579 -
580 QSharedDataPointer<QStyleSheetPaletteData> pal; -
581 QSharedDataPointer<QStyleSheetBoxData> b; -
582 QSharedDataPointer<QStyleSheetBackgroundData> bg; -
583 QSharedDataPointer<QStyleSheetBorderData> bd; -
584 QSharedDataPointer<QStyleSheetOutlineData> ou; -
585 QSharedDataPointer<QStyleSheetGeometryData> geo; -
586 QSharedDataPointer<QStyleSheetPositionData> p; -
587 QSharedDataPointer<QStyleSheetImageData> img; -
588 -
589 // Shouldn't be here -
590 void setClip(QPainter *p, const QRect &rect); -
591 void unsetClip(QPainter *); -
592 int clipset; -
593 QPainterPath clipPath; -
594}; -
595 -
596/////////////////////////////////////////////////////////////////////////////////////////// -
597static const char *knownStyleHints[] = { -
598 "activate-on-singleclick", -
599 "alignment", -
600 "arrow-keys-navigate-into-children", -
601 "backward-icon", -
602 "button-layout", -
603 "cd-icon", -
604 "combobox-list-mousetracking", -
605 "combobox-popup", -
606 "computer-icon", -
607 "desktop-icon", -
608 "dialog-apply-icon", -
609 "dialog-cancel-icon", -
610 "dialog-close-icon", -
611 "dialog-discard-icon", -
612 "dialog-help-icon", -
613 "dialog-no-icon", -
614 "dialog-ok-icon", -
615 "dialog-open-icon", -
616 "dialog-reset-icon", -
617 "dialog-save-icon", -
618 "dialog-yes-icon", -
619 "dialogbuttonbox-buttons-have-icons", -
620 "directory-closed-icon", -
621 "directory-icon", -
622 "directory-link-icon", -
623 "directory-open-icon", -
624 "dither-disable-text", -
625 "dockwidget-close-icon", -
626 "downarrow-icon", -
627 "dvd-icon", -
628 "etch-disabled-text", -
629 "file-icon", -
630 "file-link-icon", -
631 "filedialog-backward-icon", // unused -
632 "filedialog-contentsview-icon", -
633 "filedialog-detailedview-icon", -
634 "filedialog-end-icon", -
635 "filedialog-infoview-icon", -
636 "filedialog-listview-icon", -
637 "filedialog-new-directory-icon", -
638 "filedialog-parent-directory-icon", -
639 "filedialog-start-icon", -
640 "floppy-icon", -
641 "forward-icon", -
642 "gridline-color", -
643 "harddisk-icon", -
644 "home-icon", -
645 "icon-size", -
646 "leftarrow-icon", -
647 "lineedit-password-character", -
648 "mdi-fill-space-on-maximize", -
649 "menu-scrollable", -
650 "menubar-altkey-navigation", -
651 "menubar-separator", -
652 "messagebox-critical-icon", -
653 "messagebox-information-icon", -
654 "messagebox-question-icon", -
655 "messagebox-text-interaction-flags", -
656 "messagebox-warning-icon", -
657 "mouse-tracking", -
658 "network-icon", -
659 "opacity", -
660 "paint-alternating-row-colors-for-empty-area", -
661 "rightarrow-icon", -
662 "scrollbar-contextmenu", -
663 "scrollbar-leftclick-absolute-position", -
664 "scrollbar-middleclick-absolute-position", -
665 "scrollbar-roll-between-buttons", -
666 "scrollbar-scroll-when-pointer-leaves-control", -
667 "scrollview-frame-around-contents", -
668 "show-decoration-selected", -
669 "spinbox-click-autorepeat-rate", -
670 "spincontrol-disable-on-bounds", -
671 "tabbar-elide-mode", -
672 "tabbar-prefer-no-arrows", -
673 "titlebar-close-icon", -
674 "titlebar-contexthelp-icon", -
675 "titlebar-maximize-icon", -
676 "titlebar-menu-icon", -
677 "titlebar-minimize-icon", -
678 "titlebar-normal-icon", -
679 "titlebar-shade-icon", -
680 "titlebar-unshade-icon", -
681 "toolbutton-popup-delay", -
682 "trash-icon", -
683 "uparrow-icon" -
684}; -
685 -
686static const int numKnownStyleHints = sizeof(knownStyleHints)/sizeof(knownStyleHints[0]); -
687 -
688static QList<QVariant> subControlLayout(const QString& layout) -
689{ -
690 QList<QVariant> buttons;
never executed (the execution status of this line is deduced): QList<QVariant> buttons;
-
691 for (int i = 0; i < layout.count(); i++) {
never evaluated: i < layout.count()
0
692 int button = layout[i].toLatin1();
never executed (the execution status of this line is deduced): int button = layout[i].toLatin1();
-
693 switch (button) { -
694 case 'm': -
695 buttons.append(PseudoElement_MdiMinButton);
never executed (the execution status of this line is deduced): buttons.append(PseudoElement_MdiMinButton);
-
696 buttons.append(PseudoElement_TitleBarMinButton);
never executed (the execution status of this line is deduced): buttons.append(PseudoElement_TitleBarMinButton);
-
697 break;
never executed: break;
0
698 case 'M': -
699 buttons.append(PseudoElement_TitleBarMaxButton);
never executed (the execution status of this line is deduced): buttons.append(PseudoElement_TitleBarMaxButton);
-
700 break;
never executed: break;
0
701 case 'X': -
702 buttons.append(PseudoElement_MdiCloseButton);
never executed (the execution status of this line is deduced): buttons.append(PseudoElement_MdiCloseButton);
-
703 buttons.append(PseudoElement_TitleBarCloseButton);
never executed (the execution status of this line is deduced): buttons.append(PseudoElement_TitleBarCloseButton);
-
704 break;
never executed: break;
0
705 case 'N': -
706 buttons.append(PseudoElement_MdiNormalButton);
never executed (the execution status of this line is deduced): buttons.append(PseudoElement_MdiNormalButton);
-
707 buttons.append(PseudoElement_TitleBarNormalButton);
never executed (the execution status of this line is deduced): buttons.append(PseudoElement_TitleBarNormalButton);
-
708 break;
never executed: break;
0
709 case 'I': -
710 buttons.append(PseudoElement_TitleBarSysMenu);
never executed (the execution status of this line is deduced): buttons.append(PseudoElement_TitleBarSysMenu);
-
711 break;
never executed: break;
0
712 case 'T': -
713 buttons.append(PseudoElement_TitleBar);
never executed (the execution status of this line is deduced): buttons.append(PseudoElement_TitleBar);
-
714 break;
never executed: break;
0
715 case 'H': -
716 buttons.append(PseudoElement_TitleBarContextHelpButton);
never executed (the execution status of this line is deduced): buttons.append(PseudoElement_TitleBarContextHelpButton);
-
717 break;
never executed: break;
0
718 case 'S': -
719 buttons.append(PseudoElement_TitleBarShadeButton);
never executed (the execution status of this line is deduced): buttons.append(PseudoElement_TitleBarShadeButton);
-
720 break;
never executed: break;
0
721 default: -
722 buttons.append(button);
never executed (the execution status of this line is deduced): buttons.append(button);
-
723 break;
never executed: break;
0
724 } -
725 }
never executed: }
0
726 return buttons;
never executed: return buttons;
0
727} -
728 -
729namespace { -
730 struct ButtonInfo { -
731 QRenderRule rule; -
732 int element; -
733 int offset; -
734 int where; -
735 int width; -
736 }; -
737} -
738 -
739QHash<QStyle::SubControl, QRect> QStyleSheetStyle::titleBarLayout(const QWidget *w, const QStyleOptionTitleBar *tb) const -
740{ -
741 QHash<QStyle::SubControl, QRect> layoutRects;
never executed (the execution status of this line is deduced): QHash<QStyle::SubControl, QRect> layoutRects;
-
742 const bool isMinimized = tb->titleBarState & Qt::WindowMinimized;
never executed (the execution status of this line is deduced): const bool isMinimized = tb->titleBarState & Qt::WindowMinimized;
-
743 const bool isMaximized = tb->titleBarState & Qt::WindowMaximized;
never executed (the execution status of this line is deduced): const bool isMaximized = tb->titleBarState & Qt::WindowMaximized;
-
744 QRenderRule subRule = renderRule(w, tb);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, tb);
-
745 QRect cr = subRule.contentsRect(tb->rect);
never executed (the execution status of this line is deduced): QRect cr = subRule.contentsRect(tb->rect);
-
746 QList<QVariant> layout = subRule.styleHint(QLatin1String("button-layout")).toList();
never executed (the execution status of this line is deduced): QList<QVariant> layout = subRule.styleHint(QLatin1String("button-layout")).toList();
-
747 if (layout.isEmpty())
never evaluated: layout.isEmpty()
0
748 layout = subControlLayout(QLatin1String("I(T)HSmMX"));
never executed: layout = subControlLayout(QLatin1String("I(T)HSmMX"));
0
749 -
750 int offsets[3] = { 0, 0, 0 };
never executed (the execution status of this line is deduced): int offsets[3] = { 0, 0, 0 };
-
751 enum Where { Left, Right, Center, NoWhere } where = Left;
never executed (the execution status of this line is deduced): enum Where { Left, Right, Center, NoWhere } where = Left;
-
752 QList<ButtonInfo> infos;
never executed (the execution status of this line is deduced): QList<ButtonInfo> infos;
-
753 for (int i = 0; i < layout.count(); i++) {
never evaluated: i < layout.count()
0
754 ButtonInfo info;
never executed (the execution status of this line is deduced): ButtonInfo info;
-
755 info.element = layout[i].toInt();
never executed (the execution status of this line is deduced): info.element = layout[i].toInt();
-
756 if (info.element == '(') {
never evaluated: info.element == '('
0
757 where = Center;
never executed (the execution status of this line is deduced): where = Center;
-
758 } else if (info.element == ')') {
never executed: }
never evaluated: info.element == ')'
0
759 where = Right;
never executed (the execution status of this line is deduced): where = Right;
-
760 } else {
never executed: }
0
761 switch (info.element) { -
762 case PseudoElement_TitleBar: -
763 if (!(tb->titleBarFlags & (Qt::WindowTitleHint | Qt::WindowSystemMenuHint)))
never evaluated: !(tb->titleBarFlags & (Qt::WindowTitleHint | Qt::WindowSystemMenuHint))
0
764 continue;
never executed: continue;
0
765 break;
never executed: break;
0
766 case PseudoElement_TitleBarContextHelpButton: -
767 if (!(tb->titleBarFlags & Qt::WindowContextHelpButtonHint))
never evaluated: !(tb->titleBarFlags & Qt::WindowContextHelpButtonHint)
0
768 continue;
never executed: continue;
0
769 break;
never executed: break;
0
770 case PseudoElement_TitleBarMinButton: -
771 if (!(tb->titleBarFlags & Qt::WindowMinimizeButtonHint))
never evaluated: !(tb->titleBarFlags & Qt::WindowMinimizeButtonHint)
0
772 continue;
never executed: continue;
0
773 if (isMinimized)
never evaluated: isMinimized
0
774 info.element = PseudoElement_TitleBarNormalButton;
never executed: info.element = PseudoElement_TitleBarNormalButton;
0
775 break;
never executed: break;
0
776 case PseudoElement_TitleBarMaxButton: -
777 if (!(tb->titleBarFlags & Qt::WindowMaximizeButtonHint))
never evaluated: !(tb->titleBarFlags & Qt::WindowMaximizeButtonHint)
0
778 continue;
never executed: continue;
0
779 if (isMaximized)
never evaluated: isMaximized
0
780 info.element = PseudoElement_TitleBarNormalButton;
never executed: info.element = PseudoElement_TitleBarNormalButton;
0
781 break;
never executed: break;
0
782 case PseudoElement_TitleBarShadeButton: -
783 if (!(tb->titleBarFlags & Qt::WindowShadeButtonHint))
never evaluated: !(tb->titleBarFlags & Qt::WindowShadeButtonHint)
0
784 continue;
never executed: continue;
0
785 if (isMinimized)
never evaluated: isMinimized
0
786 info.element = PseudoElement_TitleBarUnshadeButton;
never executed: info.element = PseudoElement_TitleBarUnshadeButton;
0
787 break;
never executed: break;
0
788 case PseudoElement_TitleBarCloseButton: -
789 case PseudoElement_TitleBarSysMenu: -
790 if (!(tb->titleBarFlags & Qt::WindowSystemMenuHint))
never evaluated: !(tb->titleBarFlags & Qt::WindowSystemMenuHint)
0
791 continue;
never executed: continue;
0
792 break;
never executed: break;
0
793 default: -
794 continue;
never executed: continue;
0
795 } -
796 if (info.element == PseudoElement_TitleBar) {
never evaluated: info.element == PseudoElement_TitleBar
0
797 info.width = tb->fontMetrics.width(tb->text) + 6;
never executed (the execution status of this line is deduced): info.width = tb->fontMetrics.width(tb->text) + 6;
-
798 subRule.geo = new QStyleSheetGeometryData(info.width, tb->fontMetrics.height(), -1, -1, -1, -1);
never executed (the execution status of this line is deduced): subRule.geo = new QStyleSheetGeometryData(info.width, tb->fontMetrics.height(), -1, -1, -1, -1);
-
799 } else {
never executed: }
0
800 subRule = renderRule(w, tb, info.element);
never executed (the execution status of this line is deduced): subRule = renderRule(w, tb, info.element);
-
801 info.width = subRule.size().width();
never executed (the execution status of this line is deduced): info.width = subRule.size().width();
-
802 }
never executed: }
0
803 info.rule = subRule;
never executed (the execution status of this line is deduced): info.rule = subRule;
-
804 info.offset = offsets[where];
never executed (the execution status of this line is deduced): info.offset = offsets[where];
-
805 info.where = where;
never executed (the execution status of this line is deduced): info.where = where;
-
806 infos.append(info);
never executed (the execution status of this line is deduced): infos.append(info);
-
807 -
808 offsets[where] += info.width;
never executed (the execution status of this line is deduced): offsets[where] += info.width;
-
809 }
never executed: }
0
810 } -
811 -
812 for (int i = 0; i < infos.count(); i++) {
never evaluated: i < infos.count()
0
813 ButtonInfo info = infos[i];
never executed (the execution status of this line is deduced): ButtonInfo info = infos[i];
-
814 QRect lr = cr;
never executed (the execution status of this line is deduced): QRect lr = cr;
-
815 switch (info.where) { -
816 case Center: { -
817 lr.setLeft(cr.left() + offsets[Left]);
never executed (the execution status of this line is deduced): lr.setLeft(cr.left() + offsets[Left]);
-
818 lr.setRight(cr.right() - offsets[Right]);
never executed (the execution status of this line is deduced): lr.setRight(cr.right() - offsets[Right]);
-
819 QRect r(0, 0, offsets[Center], lr.height());
never executed (the execution status of this line is deduced): QRect r(0, 0, offsets[Center], lr.height());
-
820 r.moveCenter(lr.center());
never executed (the execution status of this line is deduced): r.moveCenter(lr.center());
-
821 r.setLeft(r.left()+info.offset);
never executed (the execution status of this line is deduced): r.setLeft(r.left()+info.offset);
-
822 r.setWidth(info.width);
never executed (the execution status of this line is deduced): r.setWidth(info.width);
-
823 lr = r;
never executed (the execution status of this line is deduced): lr = r;
-
824 break; }
never executed: break;
0
825 case Left: -
826 lr.translate(info.offset, 0);
never executed (the execution status of this line is deduced): lr.translate(info.offset, 0);
-
827 lr.setWidth(info.width);
never executed (the execution status of this line is deduced): lr.setWidth(info.width);
-
828 break;
never executed: break;
0
829 case Right: -
830 lr.moveLeft(cr.right() + 1 - offsets[Right] + info.offset);
never executed (the execution status of this line is deduced): lr.moveLeft(cr.right() + 1 - offsets[Right] + info.offset);
-
831 lr.setWidth(info.width);
never executed (the execution status of this line is deduced): lr.setWidth(info.width);
-
832 break;
never executed: break;
0
833 default: -
834 break;
never executed: break;
0
835 } -
836 QStyle::SubControl control = knownPseudoElements[info.element].subControl;
never executed (the execution status of this line is deduced): QStyle::SubControl control = knownPseudoElements[info.element].subControl;
-
837 layoutRects[control] = positionRect(w, info.rule, info.element, lr, tb->direction);
never executed (the execution status of this line is deduced): layoutRects[control] = positionRect(w, info.rule, info.element, lr, tb->direction);
-
838 }
never executed: }
0
839 -
840 return layoutRects;
never executed: return layoutRects;
0
841} -
842 -
843static QStyle::StandardPixmap subControlIcon(int pe) -
844{ -
845 switch (pe) { -
846 case PseudoElement_MdiCloseButton: return QStyle::SP_TitleBarCloseButton;
never executed: return QStyle::SP_TitleBarCloseButton;
0
847 case PseudoElement_MdiMinButton: return QStyle::SP_TitleBarMinButton;
never executed: return QStyle::SP_TitleBarMinButton;
0
848 case PseudoElement_MdiNormalButton: return QStyle::SP_TitleBarNormalButton;
never executed: return QStyle::SP_TitleBarNormalButton;
0
849 case PseudoElement_TitleBarCloseButton: return QStyle::SP_TitleBarCloseButton;
never executed: return QStyle::SP_TitleBarCloseButton;
0
850 case PseudoElement_TitleBarMinButton: return QStyle::SP_TitleBarMinButton;
never executed: return QStyle::SP_TitleBarMinButton;
0
851 case PseudoElement_TitleBarMaxButton: return QStyle::SP_TitleBarMaxButton;
never executed: return QStyle::SP_TitleBarMaxButton;
0
852 case PseudoElement_TitleBarShadeButton: return QStyle::SP_TitleBarShadeButton;
never executed: return QStyle::SP_TitleBarShadeButton;
0
853 case PseudoElement_TitleBarUnshadeButton: return QStyle::SP_TitleBarUnshadeButton;
never executed: return QStyle::SP_TitleBarUnshadeButton;
0
854 case PseudoElement_TitleBarNormalButton: return QStyle::SP_TitleBarNormalButton;
never executed: return QStyle::SP_TitleBarNormalButton;
0
855 case PseudoElement_TitleBarContextHelpButton: return QStyle::SP_TitleBarContextHelpButton;
never executed: return QStyle::SP_TitleBarContextHelpButton;
0
856 default: break;
never executed: break;
0
857 } -
858 return QStyle::SP_CustomBase;
never executed: return QStyle::SP_CustomBase;
0
859} -
860 -
861QRenderRule::QRenderRule(const QVector<Declaration> &declarations, const QObject *object) -
862: features(0), hasFont(false), pal(0), b(0), bg(0), bd(0), ou(0), geo(0), p(0), img(0), clipset(0) -
863{ -
864 QPalette palette = QApplication::palette(); // ###: ideally widget's palette
executed (the execution status of this line is deduced): QPalette palette = QApplication::palette();
-
865 ValueExtractor v(declarations, palette);
executed (the execution status of this line is deduced): ValueExtractor v(declarations, palette);
-
866 features = v.extractStyleFeatures();
executed (the execution status of this line is deduced): features = v.extractStyleFeatures();
-
867 -
868 int w = -1, h = -1, minw = -1, minh = -1, maxw = -1, maxh = -1;
executed (the execution status of this line is deduced): int w = -1, h = -1, minw = -1, minh = -1, maxw = -1, maxh = -1;
-
869 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:46
0-46
870 geo = new QStyleSheetGeometryData(w, h, minw, minh, maxw, maxh);
never executed: geo = new QStyleSheetGeometryData(w, h, minw, minh, maxw, maxh);
0
871 -
872 int left = 0, top = 0, right = 0, bottom = 0;
executed (the execution status of this line is deduced): int left = 0, top = 0, right = 0, bottom = 0;
-
873 Origin origin = Origin_Unknown;
executed (the execution status of this line is deduced): Origin origin = Origin_Unknown;
-
874 Qt::Alignment position = 0;
executed (the execution status of this line is deduced): Qt::Alignment position = 0;
-
875 QCss::PositionMode mode = PositionMode_Unknown;
executed (the execution status of this line is deduced): QCss::PositionMode mode = PositionMode_Unknown;
-
876 Qt::Alignment textAlignment = 0;
executed (the execution status of this line is deduced): Qt::Alignment textAlignment = 0;
-
877 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:46
0-46
878 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
879 -
880 int margins[4], paddings[4], spacing = -1;
executed (the execution status of this line is deduced): int margins[4], paddings[4], spacing = -1;
-
881 for (int i = 0; i < 4; i++)
evaluated: i < 4
TRUEFALSE
yes
Evaluation Count:184
yes
Evaluation Count:46
46-184
882 margins[i] = paddings[i] = 0;
executed: margins[i] = paddings[i] = 0;
Execution Count:184
184
883 if (v.extractBox(margins, paddings, &spacing))
partially evaluated: v.extractBox(margins, paddings, &spacing)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:46
0-46
884 b = new QStyleSheetBoxData(margins, paddings, spacing);
never executed: b = new QStyleSheetBoxData(margins, paddings, spacing);
0
885 -
886 int borders[4];
executed (the execution status of this line is deduced): int borders[4];
-
887 QBrush colors[4];
executed (the execution status of this line is deduced): QBrush colors[4];
-
888 QCss::BorderStyle styles[4];
executed (the execution status of this line is deduced): QCss::BorderStyle styles[4];
-
889 QSize radii[4];
executed (the execution status of this line is deduced): QSize radii[4];
-
890 for (int i = 0; i < 4; i++) {
evaluated: i < 4
TRUEFALSE
yes
Evaluation Count:184
yes
Evaluation Count:46
46-184
891 borders[i] = 0;
executed (the execution status of this line is deduced): borders[i] = 0;
-
892 styles[i] = BorderStyle_None;
executed (the execution status of this line is deduced): styles[i] = BorderStyle_None;
-
893 }
executed: }
Execution Count:184
184
894 if (v.extractBorder(borders, colors, styles, radii))
evaluated: v.extractBorder(borders, colors, styles, radii)
TRUEFALSE
yes
Evaluation Count:28
yes
Evaluation Count:18
18-28
895 bd = new QStyleSheetBorderData(borders, colors, styles, radii);
executed: bd = new QStyleSheetBorderData(borders, colors, styles, radii);
Execution Count:28
28
896 -
897 int offsets[4];
executed (the execution status of this line is deduced): int offsets[4];
-
898 for (int i = 0; i < 4; i++) {
evaluated: i < 4
TRUEFALSE
yes
Evaluation Count:184
yes
Evaluation Count:46
46-184
899 borders[i] = offsets[i] = 0;
executed (the execution status of this line is deduced): borders[i] = offsets[i] = 0;
-
900 styles[i] = BorderStyle_None;
executed (the execution status of this line is deduced): styles[i] = BorderStyle_None;
-
901 }
executed: }
Execution Count:184
184
902 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:46
0-46
903 ou = new QStyleSheetOutlineData(borders, colors, styles, radii, offsets);
never executed: ou = new QStyleSheetOutlineData(borders, colors, styles, radii, offsets);
0
904 -
905 QBrush brush;
executed (the execution status of this line is deduced): QBrush brush;
-
906 QString uri;
executed (the execution status of this line is deduced): QString uri;
-
907 Repeat repeat = Repeat_XY;
executed (the execution status of this line is deduced): Repeat repeat = Repeat_XY;
-
908 Qt::Alignment alignment = Qt::AlignTop | Qt::AlignLeft;
executed (the execution status of this line is deduced): Qt::Alignment alignment = Qt::AlignTop | Qt::AlignLeft;
-
909 Attachment attachment = Attachment_Scroll;
executed (the execution status of this line is deduced): Attachment attachment = Attachment_Scroll;
-
910 origin = Origin_Padding;
executed (the execution status of this line is deduced): origin = Origin_Padding;
-
911 Origin clip = Origin_Border;
executed (the execution status of this line is deduced): Origin clip = Origin_Border;
-
912 if (v.extractBackground(&brush, &uri, &repeat, &alignment, &origin, &attachment, &clip))
evaluated: v.extractBackground(&brush, &uri, &repeat, &alignment, &origin, &attachment, &clip)
TRUEFALSE
yes
Evaluation Count:36
yes
Evaluation Count:10
10-36
913 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:36
36
914 -
915 QBrush sfg, fg;
executed (the execution status of this line is deduced): QBrush sfg, fg;
-
916 QBrush sbg, abg;
executed (the execution status of this line is deduced): QBrush sbg, abg;
-
917 if (v.extractPalette(&fg, &sfg, &sbg, &abg))
partially evaluated: v.extractPalette(&fg, &sfg, &sbg, &abg)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:46
0-46
918 pal = new QStyleSheetPaletteData(fg, sfg, sbg, abg);
never executed: pal = new QStyleSheetPaletteData(fg, sfg, sbg, abg);
0
919 -
920 QIcon icon;
executed (the execution status of this line is deduced): QIcon icon;
-
921 alignment = Qt::AlignCenter;
executed (the execution status of this line is deduced): alignment = Qt::AlignCenter;
-
922 QSize size;
executed (the execution status of this line is deduced): QSize size;
-
923 if (v.extractImage(&icon, &alignment, &size))
partially evaluated: v.extractImage(&icon, &alignment, &size)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:46
0-46
924 img = new QStyleSheetImageData(icon, alignment, size);
never executed: img = new QStyleSheetImageData(icon, alignment, size);
0
925 -
926 int adj = -255;
executed (the execution status of this line is deduced): int adj = -255;
-
927 hasFont = v.extractFont(&font, &adj);
executed (the execution status of this line is deduced): hasFont = v.extractFont(&font, &adj);
-
928 -
929#ifndef QT_NO_TOOLTIP -
930 if (object && qstrcmp(object->metaObject()->className(), "QTipLabel") == 0)
partially evaluated: object
TRUEFALSE
yes
Evaluation Count:46
no
Evaluation Count:0
partially evaluated: qstrcmp(object->metaObject()->className(), "QTipLabel") == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:46
0-46
931 palette = QToolTip::palette();
never executed: palette = QToolTip::palette();
0
932#endif -
933 -
934 for (int i = 0; i < declarations.count(); i++) {
evaluated: i < declarations.count()
TRUEFALSE
yes
Evaluation Count:104
yes
Evaluation Count:46
46-104
935 const Declaration& decl = declarations.at(i);
executed (the execution status of this line is deduced): const Declaration& decl = declarations.at(i);
-
936 if (decl.d->propertyId == BorderImage) {
partially evaluated: decl.d->propertyId == BorderImage
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:104
0-104
937 QString uri;
never executed (the execution status of this line is deduced): QString uri;
-
938 QCss::TileMode horizStretch, vertStretch;
never executed (the execution status of this line is deduced): QCss::TileMode horizStretch, vertStretch;
-
939 int cuts[4];
never executed (the execution status of this line is deduced): int cuts[4];
-
940 -
941 decl.borderImageValue(&uri, cuts, &horizStretch, &vertStretch);
never executed (the execution status of this line is deduced): decl.borderImageValue(&uri, cuts, &horizStretch, &vertStretch);
-
942 if (uri.isEmpty() || uri == QLatin1String("none")) {
never evaluated: uri.isEmpty()
never evaluated: uri == QLatin1String("none")
0
943 if (bd && bd->bi)
never evaluated: bd
never evaluated: bd->bi
0
944 bd->bi->pixmap = QPixmap();
never executed: bd->bi->pixmap = QPixmap();
0
945 } else {
never executed: }
0
946 if (!bd)
never evaluated: !bd
0
947 bd = new QStyleSheetBorderData;
never executed: bd = new QStyleSheetBorderData;
0
948 if (!bd->bi)
never evaluated: !bd->bi
0
949 bd->bi = new QStyleSheetBorderImageData;
never executed: bd->bi = new QStyleSheetBorderImageData;
0
950 -
951 QStyleSheetBorderImageData *bi = bd->bi;
never executed (the execution status of this line is deduced): QStyleSheetBorderImageData *bi = bd->bi;
-
952 bi->pixmap = QPixmap(uri);
never executed (the execution status of this line is deduced): bi->pixmap = QPixmap(uri);
-
953 for (int i = 0; i < 4; i++)
never evaluated: i < 4
0
954 bi->cuts[i] = cuts[i];
never executed: bi->cuts[i] = cuts[i];
0
955 bi->horizStretch = horizStretch;
never executed (the execution status of this line is deduced): bi->horizStretch = horizStretch;
-
956 bi->vertStretch = vertStretch;
never executed (the execution status of this line is deduced): bi->vertStretch = vertStretch;
-
957 }
never executed: }
0
958 } else if (decl.d->propertyId == QtBackgroundRole) {
evaluated: decl.d->propertyId == QtBackgroundRole
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:96
8-96
959 if (bg && bg->brush.style() != Qt::NoBrush)
evaluated: bg
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:2
partially evaluated: bg->brush.style() != Qt::NoBrush
TRUEFALSE
yes
Evaluation Count:6
no
Evaluation Count:0
0-6
960 continue;
executed: continue;
Execution Count:6
6
961 int role = decl.d->values.at(0).variant.toInt();
executed (the execution status of this line is deduced): int role = decl.d->values.at(0).variant.toInt();
-
962 if (role >= Value_FirstColorRole && role <= Value_LastColorRole)
partially evaluated: role >= Value_FirstColorRole
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
partially evaluated: role <= Value_LastColorRole
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
963 defaultBackground = palette.color((QPalette::ColorRole)(role-Value_FirstColorRole));
executed: defaultBackground = palette.color((QPalette::ColorRole)(role-Value_FirstColorRole));
Execution Count:2
2
964 } else if (decl.d->property.startsWith(QLatin1String("qproperty-"), Qt::CaseInsensitive)) {
executed: }
Execution Count:2
partially evaluated: decl.d->property.startsWith(QLatin1String("qproperty-"), Qt::CaseInsensitive)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:96
0-96
965 // intentionally left blank... -
966 } else if (decl.d->propertyId == UnknownProperty) {
never executed: }
partially evaluated: decl.d->propertyId == UnknownProperty
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:96
0-96
967 bool knownStyleHint = false;
never executed (the execution status of this line is deduced): bool knownStyleHint = false;
-
968 for (int i = 0; i < numKnownStyleHints; i++) {
never evaluated: i < numKnownStyleHints
0
969 QLatin1String styleHint(knownStyleHints[i]);
never executed (the execution status of this line is deduced): QLatin1String styleHint(knownStyleHints[i]);
-
970 if (decl.d->property.compare(styleHint) == 0) {
never evaluated: decl.d->property.compare(styleHint) == 0
0
971 QString hintName = QString(styleHint);
never executed (the execution status of this line is deduced): QString hintName = QString(styleHint);
-
972 QVariant hintValue;
never executed (the execution status of this line is deduced): QVariant hintValue;
-
973 if (hintName.endsWith(QLatin1String("alignment"))) {
never evaluated: hintName.endsWith(QLatin1String("alignment"))
0
974 hintValue = (int) decl.alignmentValue();
never executed (the execution status of this line is deduced): hintValue = (int) decl.alignmentValue();
-
975 } else if (hintName.endsWith(QLatin1String("color"))) {
never executed: }
never evaluated: hintName.endsWith(QLatin1String("color"))
0
976 hintValue = (int) decl.colorValue().rgba();
never executed (the execution status of this line is deduced): hintValue = (int) decl.colorValue().rgba();
-
977 } else if (hintName.endsWith(QLatin1String("size"))) {
never executed: }
never evaluated: hintName.endsWith(QLatin1String("size"))
0
978 hintValue = decl.sizeValue();
never executed (the execution status of this line is deduced): hintValue = decl.sizeValue();
-
979 } else if (hintName.endsWith(QLatin1String("icon"))) {
never executed: }
never evaluated: hintName.endsWith(QLatin1String("icon"))
0
980 hintValue = decl.iconValue();
never executed (the execution status of this line is deduced): hintValue = decl.iconValue();
-
981 } else if (hintName == QLatin1String("button-layout")
never executed: }
never evaluated: hintName == QLatin1String("button-layout")
0
982 && 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
983 hintValue = subControlLayout(decl.d->values.at(0).variant.toString());
never executed (the execution status of this line is deduced): hintValue = subControlLayout(decl.d->values.at(0).variant.toString());
-
984 } else {
never executed: }
0
985 int integer;
never executed (the execution status of this line is deduced): int integer;
-
986 decl.intValue(&integer);
never executed (the execution status of this line is deduced): decl.intValue(&integer);
-
987 hintValue = integer;
never executed (the execution status of this line is deduced): hintValue = integer;
-
988 }
never executed: }
0
989 styleHints[decl.d->property] = hintValue;
never executed (the execution status of this line is deduced): styleHints[decl.d->property] = hintValue;
-
990 knownStyleHint = true;
never executed (the execution status of this line is deduced): knownStyleHint = true;
-
991 break;
never executed: break;
0
992 } -
993 }
never executed: }
0
994 if (!knownStyleHint)
never evaluated: !knownStyleHint
0
995 qDebug("Unknown property %s", qPrintable(decl.d->property));
never executed: QMessageLogger("styles/qstylesheetstyle.cpp", 995, __PRETTY_FUNCTION__).debug("Unknown property %s", QString(decl.d->property).toLocal8Bit().constData());
0
996 }
never executed: }
0
997 } -
998 -
999 if (const QWidget *widget = qobject_cast<const QWidget *>(object)) {
partially evaluated: const QWidget *widget = qobject_cast<const QWidget *>(object)
TRUEFALSE
yes
Evaluation Count:46
no
Evaluation Count:0
0-46
1000 QStyleSheetStyle *style = const_cast<QStyleSheetStyle *>(globalStyleSheetStyle);
executed (the execution status of this line is deduced): QStyleSheetStyle *style = const_cast<QStyleSheetStyle *>(globalStyleSheetStyle);
-
1001 if (!style)
partially evaluated: !style
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:46
0-46
1002 style = qobject_cast<QStyleSheetStyle *>(widget->style());
never executed: style = qobject_cast<QStyleSheetStyle *>(widget->style());
0
1003 if (style)
partially evaluated: style
TRUEFALSE
yes
Evaluation Count:46
no
Evaluation Count:0
0-46
1004 fixupBorder(style->nativeFrameWidth(widget));
executed: fixupBorder(style->nativeFrameWidth(widget));
Execution Count:46
46
1005 }
executed: }
Execution Count:46
46
1006 if (hasBorder() && border()->hasBorderImage())
evaluated: hasBorder()
TRUEFALSE
yes
Evaluation Count:28
yes
Evaluation Count:18
partially evaluated: border()->hasBorderImage()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:28
0-28
1007 defaultBackground = QBrush();
never executed: defaultBackground = QBrush();
0
1008}
executed: }
Execution Count:46
46
1009 -
1010QRect QRenderRule::borderRect(const QRect& r) const -
1011{ -
1012 if (!hasBox())
partially evaluated: !hasBox()
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
0-3
1013 return r;
executed: return r;
Execution Count:3
3
1014 const int* m = box()->margins;
never executed (the execution status of this line is deduced): const int* m = box()->margins;
-
1015 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
1016} -
1017 -
1018QRect QRenderRule::outlineRect(const QRect& r) const -
1019{ -
1020 QRect br = borderRect(r);
never executed (the execution status of this line is deduced): QRect br = borderRect(r);
-
1021 if (!hasOutline())
never evaluated: !hasOutline()
0
1022 return br;
never executed: return br;
0
1023 const int *b = outline()->borders;
never executed (the execution status of this line is deduced): const int *b = outline()->borders;
-
1024 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
1025} -
1026 -
1027QRect QRenderRule::paddingRect(const QRect& r) const -
1028{ -
1029 QRect br = borderRect(r);
never executed (the execution status of this line is deduced): QRect br = borderRect(r);
-
1030 if (!hasBorder())
never evaluated: !hasBorder()
0
1031 return br;
never executed: return br;
0
1032 const int *b = border()->borders;
never executed (the execution status of this line is deduced): const int *b = border()->borders;
-
1033 return br.adjusted(b[LeftEdge], b[TopEdge], -b[RightEdge], -b[BottomEdge]);
never executed: return br.adjusted(b[LeftEdge], b[TopEdge], -b[RightEdge], -b[BottomEdge]);
0
1034} -
1035 -
1036QRect QRenderRule::contentsRect(const QRect& r) const -
1037{ -
1038 QRect pr = paddingRect(r);
never executed (the execution status of this line is deduced): QRect pr = paddingRect(r);
-
1039 if (!hasBox())
never evaluated: !hasBox()
0
1040 return pr;
never executed: return pr;
0
1041 const int *p = box()->paddings;
never executed (the execution status of this line is deduced): const int *p = box()->paddings;
-
1042 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
1043} -
1044 -
1045QRect QRenderRule::boxRect(const QRect& cr, int flags) const -
1046{ -
1047 QRect r = cr;
never executed (the execution status of this line is deduced): QRect r = cr;
-
1048 if (hasBox()) {
never evaluated: hasBox()
0
1049 if (flags & Margin) {
never evaluated: flags & Margin
0
1050 const int *m = box()->margins;
never executed (the execution status of this line is deduced): const int *m = box()->margins;
-
1051 r.adjust(-m[LeftEdge], -m[TopEdge], m[RightEdge], m[BottomEdge]);
never executed (the execution status of this line is deduced): r.adjust(-m[LeftEdge], -m[TopEdge], m[RightEdge], m[BottomEdge]);
-
1052 }
never executed: }
0
1053 if (flags & Padding) {
never evaluated: flags & Padding
0
1054 const int *p = box()->paddings;
never executed (the execution status of this line is deduced): const int *p = box()->paddings;
-
1055 r.adjust(-p[LeftEdge], -p[TopEdge], p[RightEdge], p[BottomEdge]);
never executed (the execution status of this line is deduced): r.adjust(-p[LeftEdge], -p[TopEdge], p[RightEdge], p[BottomEdge]);
-
1056 }
never executed: }
0
1057 }
never executed: }
0
1058 if (hasBorder() && (flags & Border)) {
never evaluated: hasBorder()
never evaluated: (flags & Border)
0
1059 const int *b = border()->borders;
never executed (the execution status of this line is deduced): const int *b = border()->borders;
-
1060 r.adjust(-b[LeftEdge], -b[TopEdge], b[RightEdge], b[BottomEdge]);
never executed (the execution status of this line is deduced): r.adjust(-b[LeftEdge], -b[TopEdge], b[RightEdge], b[BottomEdge]);
-
1061 }
never executed: }
0
1062 return r;
never executed: return r;
0
1063} -
1064 -
1065QSize QRenderRule::boxSize(const QSize &cs, int flags) const -
1066{ -
1067 QSize bs = boxRect(QRect(QPoint(0, 0), cs), flags).size();
never executed (the execution status of this line is deduced): QSize bs = boxRect(QRect(QPoint(0, 0), cs), flags).size();
-
1068 if (cs.width() < 0) bs.setWidth(-1);
never executed: bs.setWidth(-1);
never evaluated: cs.width() < 0
0
1069 if (cs.height() < 0) bs.setHeight(-1);
never executed: bs.setHeight(-1);
never evaluated: cs.height() < 0
0
1070 return bs;
never executed: return bs;
0
1071} -
1072 -
1073void QRenderRule::fixupBorder(int nativeWidth) -
1074{ -
1075 if (bd == 0)
evaluated: bd == 0
TRUEFALSE
yes
Evaluation Count:18
yes
Evaluation Count:28
18-28
1076 return;
executed: return;
Execution Count:18
18
1077 -
1078 if (!bd->hasBorderImage() || bd->bi->pixmap.isNull()) {
partially evaluated: !bd->hasBorderImage()
TRUEFALSE
yes
Evaluation Count:28
no
Evaluation Count:0
never evaluated: bd->bi->pixmap.isNull()
0-28
1079 bd->bi = 0;
executed (the execution status of this line is deduced): bd->bi = 0;
-
1080 // ignore the color, border of edges that have none border-style -
1081 QBrush color = pal ? pal->foreground : QBrush();
partially evaluated: pal
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:28
0-28
1082 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:28
partially evaluated: bd->radii[1].isValid()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:28
0-28
1083 || bd->radii[2].isValid() || bd->radii[3].isValid();
partially evaluated: bd->radii[2].isValid()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:28
partially evaluated: bd->radii[3].isValid()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:28
0-28
1084 for (int i = 0; i < 4; i++) {
evaluated: i < 4
TRUEFALSE
yes
Evaluation Count:112
yes
Evaluation Count:28
28-112
1085 if ((bd->styles[i] == BorderStyle_Native) && hasRadius)
evaluated: (bd->styles[i] == BorderStyle_Native)
TRUEFALSE
yes
Evaluation Count:104
yes
Evaluation Count:8
partially evaluated: hasRadius
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:104
0-104
1086 bd->styles[i] = BorderStyle_None;
never executed: bd->styles[i] = BorderStyle_None;
0
1087 -
1088 switch (bd->styles[i]) { -
1089 case BorderStyle_None: -
1090 // border-style: none forces width to be 0 -
1091 bd->colors[i] = QBrush();
executed (the execution status of this line is deduced): bd->colors[i] = QBrush();
-
1092 bd->borders[i] = 0;
executed (the execution status of this line is deduced): bd->borders[i] = 0;
-
1093 break;
executed: break;
Execution Count:8
8
1094 case BorderStyle_Native: -
1095 if (bd->borders[i] == 0)
partially evaluated: bd->borders[i] == 0
TRUEFALSE
yes
Evaluation Count:104
no
Evaluation Count:0
0-104
1096 bd->borders[i] = nativeWidth;
executed: bd->borders[i] = nativeWidth;
Execution Count:104
104
1097 // intentional fall through -
1098 default:
code before this statement executed: default:
Execution Count:104
104
1099 if (!bd->colors[i].style() != Qt::NoBrush) // auto-acquire 'color'
evaluated: !bd->colors[i].style() != Qt::NoBrush
TRUEFALSE
yes
Evaluation Count:84
yes
Evaluation Count:20
20-84
1100 bd->colors[i] = color;
executed: bd->colors[i] = color;
Execution Count:84
84
1101 break;
executed: break;
Execution Count:104
104
1102 } -
1103 }
executed: }
Execution Count:112
112
1104 -
1105 return;
executed: return;
Execution Count:28
28
1106 } -
1107 -
1108 // inspect the border image -
1109 QStyleSheetBorderImageData *bi = bd->bi;
never executed (the execution status of this line is deduced): QStyleSheetBorderImageData *bi = bd->bi;
-
1110 if (bi->cuts[0] == -1) {
never evaluated: bi->cuts[0] == -1
0
1111 for (int i = 0; i < 4; i++) // assume, cut = border
never evaluated: i < 4
0
1112 bi->cuts[i] = int(border()->borders[i]);
never executed: bi->cuts[i] = int(border()->borders[i]);
0
1113 }
never executed: }
0
1114}
never executed: }
0
1115 -
1116void QRenderRule::drawBorderImage(QPainter *p, const QRect& rect) -
1117{ -
1118 setClip(p, rect);
never executed (the execution status of this line is deduced): setClip(p, rect);
-
1119 static const Qt::TileRule tileMode2TileRule[] = { -
1120 Qt::StretchTile, Qt::RoundTile, Qt::StretchTile, Qt::RepeatTile, Qt::StretchTile }; -
1121 -
1122 const QStyleSheetBorderImageData *borderImageData = border()->borderImage();
never executed (the execution status of this line is deduced): const QStyleSheetBorderImageData *borderImageData = border()->borderImage();
-
1123 const int *targetBorders = border()->borders;
never executed (the execution status of this line is deduced): const int *targetBorders = border()->borders;
-
1124 const int *sourceBorders = borderImageData->cuts;
never executed (the execution status of this line is deduced): const int *sourceBorders = borderImageData->cuts;
-
1125 QMargins sourceMargins(sourceBorders[LeftEdge], sourceBorders[TopEdge],
never executed (the execution status of this line is deduced): QMargins sourceMargins(sourceBorders[LeftEdge], sourceBorders[TopEdge],
-
1126 sourceBorders[RightEdge], sourceBorders[BottomEdge]);
never executed (the execution status of this line is deduced): sourceBorders[RightEdge], sourceBorders[BottomEdge]);
-
1127 QMargins targetMargins(targetBorders[LeftEdge], targetBorders[TopEdge],
never executed (the execution status of this line is deduced): QMargins targetMargins(targetBorders[LeftEdge], targetBorders[TopEdge],
-
1128 targetBorders[RightEdge], targetBorders[BottomEdge]);
never executed (the execution status of this line is deduced): targetBorders[RightEdge], targetBorders[BottomEdge]);
-
1129 -
1130 bool wasSmoothPixmapTransform = p->renderHints() & QPainter::SmoothPixmapTransform;
never executed (the execution status of this line is deduced): bool wasSmoothPixmapTransform = p->renderHints() & QPainter::SmoothPixmapTransform;
-
1131 p->setRenderHint(QPainter::SmoothPixmapTransform);
never executed (the execution status of this line is deduced): p->setRenderHint(QPainter::SmoothPixmapTransform);
-
1132 qDrawBorderPixmap(p, rect, targetMargins, borderImageData->pixmap,
never executed (the execution status of this line is deduced): qDrawBorderPixmap(p, rect, targetMargins, borderImageData->pixmap,
-
1133 QRect(QPoint(), borderImageData->pixmap.size()), sourceMargins,
never executed (the execution status of this line is deduced): QRect(QPoint(), borderImageData->pixmap.size()), sourceMargins,
-
1134 QTileRules(tileMode2TileRule[borderImageData->horizStretch], tileMode2TileRule[borderImageData->vertStretch]));
never executed (the execution status of this line is deduced): QTileRules(tileMode2TileRule[borderImageData->horizStretch], tileMode2TileRule[borderImageData->vertStretch]));
-
1135 p->setRenderHint(QPainter::SmoothPixmapTransform, wasSmoothPixmapTransform);
never executed (the execution status of this line is deduced): p->setRenderHint(QPainter::SmoothPixmapTransform, wasSmoothPixmapTransform);
-
1136 unsetClip(p);
never executed (the execution status of this line is deduced): unsetClip(p);
-
1137}
never executed: }
0
1138 -
1139QRect QRenderRule::originRect(const QRect &rect, Origin origin) const -
1140{ -
1141 switch (origin) { -
1142 case Origin_Padding: -
1143 return paddingRect(rect);
never executed: return paddingRect(rect);
0
1144 case Origin_Border: -
1145 return borderRect(rect);
never executed: return borderRect(rect);
0
1146 case Origin_Content: -
1147 return contentsRect(rect);
never executed: return contentsRect(rect);
0
1148 case Origin_Margin: -
1149 default: -
1150 return rect;
never executed: return rect;
0
1151 } -
1152}
never executed: }
0
1153 -
1154void QRenderRule::drawBackgroundImage(QPainter *p, const QRect &rect, QPoint off) -
1155{ -
1156 if (!hasBackground())
partially evaluated: !hasBackground()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1157 return;
never executed: return;
0
1158 -
1159 const QPixmap& bgp = background()->pixmap;
executed (the execution status of this line is deduced): const QPixmap& bgp = background()->pixmap;
-
1160 if (bgp.isNull())
partially evaluated: bgp.isNull()
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
1161 return;
executed: return;
Execution Count:2
2
1162 -
1163 setClip(p, borderRect(rect));
never executed (the execution status of this line is deduced): setClip(p, borderRect(rect));
-
1164 -
1165 if (background()->origin != background()->clip) {
never evaluated: background()->origin != background()->clip
0
1166 p->save();
never executed (the execution status of this line is deduced): p->save();
-
1167 p->setClipRect(originRect(rect, background()->clip), Qt::IntersectClip);
never executed (the execution status of this line is deduced): p->setClipRect(originRect(rect, background()->clip), Qt::IntersectClip);
-
1168 }
never executed: }
0
1169 -
1170 if (background()->attachment == Attachment_Fixed)
never evaluated: background()->attachment == Attachment_Fixed
0
1171 off = QPoint(0, 0);
never executed: off = QPoint(0, 0);
0
1172 -
1173 QRect r = originRect(rect, background()->origin);
never executed (the execution status of this line is deduced): QRect r = originRect(rect, background()->origin);
-
1174 QRect aligned = QStyle::alignedRect(Qt::LeftToRight, background()->position, bgp.size(), r);
never executed (the execution status of this line is deduced): QRect aligned = QStyle::alignedRect(Qt::LeftToRight, background()->position, bgp.size(), r);
-
1175 QRect inter = aligned.translated(-off).intersected(r);
never executed (the execution status of this line is deduced): QRect inter = aligned.translated(-off).intersected(r);
-
1176 -
1177 switch (background()->repeat) { -
1178 case Repeat_Y: -
1179 p->drawTiledPixmap(inter.x(), r.y(), inter.width(), r.height(), bgp,
never executed (the execution status of this line is deduced): p->drawTiledPixmap(inter.x(), r.y(), inter.width(), r.height(), bgp,
-
1180 inter.x() - aligned.x() + off.x(),
never executed (the execution status of this line is deduced): inter.x() - aligned.x() + off.x(),
-
1181 bgp.height() - int(aligned.y() - r.y()) % bgp.height() + off.y());
never executed (the execution status of this line is deduced): bgp.height() - int(aligned.y() - r.y()) % bgp.height() + off.y());
-
1182 break;
never executed: break;
0
1183 case Repeat_X: -
1184 p->drawTiledPixmap(r.x(), inter.y(), r.width(), inter.height(), bgp,
never executed (the execution status of this line is deduced): p->drawTiledPixmap(r.x(), inter.y(), r.width(), inter.height(), bgp,
-
1185 bgp.width() - int(aligned.x() - r.x())%bgp.width() + off.x(),
never executed (the execution status of this line is deduced): bgp.width() - int(aligned.x() - r.x())%bgp.width() + off.x(),
-
1186 inter.y() - aligned.y() + off.y());
never executed (the execution status of this line is deduced): inter.y() - aligned.y() + off.y());
-
1187 break;
never executed: break;
0
1188 case Repeat_XY: -
1189 p->drawTiledPixmap(r, bgp,
never executed (the execution status of this line is deduced): p->drawTiledPixmap(r, bgp,
-
1190 QPoint(bgp.width() - int(aligned.x() - r.x())% bgp.width() + off.x(),
never executed (the execution status of this line is deduced): QPoint(bgp.width() - int(aligned.x() - r.x())% bgp.width() + off.x(),
-
1191 bgp.height() - int(aligned.y() - r.y())%bgp.height() + off.y()));
never executed (the execution status of this line is deduced): bgp.height() - int(aligned.y() - r.y())%bgp.height() + off.y()));
-
1192 break;
never executed: break;
0
1193 case Repeat_None: -
1194 default: -
1195 p->drawPixmap(inter.x(), inter.y(), bgp, inter.x() - aligned.x() + off.x(),
never executed (the execution status of this line is deduced): p->drawPixmap(inter.x(), inter.y(), bgp, inter.x() - aligned.x() + off.x(),
-
1196 inter.y() - aligned.y() + off.y(), inter.width(), inter.height());
never executed (the execution status of this line is deduced): inter.y() - aligned.y() + off.y(), inter.width(), inter.height());
-
1197 break;
never executed: break;
0
1198 } -
1199 -
1200 -
1201 if (background()->origin != background()->clip)
never evaluated: background()->origin != background()->clip
0
1202 p->restore();
never executed: p->restore();
0
1203 -
1204 unsetClip(p);
never executed (the execution status of this line is deduced): unsetClip(p);
-
1205}
never executed: }
0
1206 -
1207void QRenderRule::drawOutline(QPainter *p, const QRect &rect) -
1208{ -
1209 if (!hasOutline())
never evaluated: !hasOutline()
0
1210 return;
never executed: return;
0
1211 -
1212 bool wasAntialiased = p->renderHints() & QPainter::Antialiasing;
never executed (the execution status of this line is deduced): bool wasAntialiased = p->renderHints() & QPainter::Antialiasing;
-
1213 p->setRenderHint(QPainter::Antialiasing);
never executed (the execution status of this line is deduced): p->setRenderHint(QPainter::Antialiasing);
-
1214 qDrawBorder(p, rect, ou->styles, ou->borders, ou->colors, ou->radii);
never executed (the execution status of this line is deduced): qDrawBorder(p, rect, ou->styles, ou->borders, ou->colors, ou->radii);
-
1215 p->setRenderHint(QPainter::Antialiasing, wasAntialiased);
never executed (the execution status of this line is deduced): p->setRenderHint(QPainter::Antialiasing, wasAntialiased);
-
1216}
never executed: }
0
1217 -
1218void QRenderRule::drawBorder(QPainter *p, const QRect& rect) -
1219{ -
1220 if (!hasBorder())
never evaluated: !hasBorder()
0
1221 return;
never executed: return;
0
1222 -
1223 if (border()->hasBorderImage()) {
never evaluated: border()->hasBorderImage()
0
1224 drawBorderImage(p, rect);
never executed (the execution status of this line is deduced): drawBorderImage(p, rect);
-
1225 return;
never executed: return;
0
1226 } -
1227 -
1228 bool wasAntialiased = p->renderHints() & QPainter::Antialiasing;
never executed (the execution status of this line is deduced): bool wasAntialiased = p->renderHints() & QPainter::Antialiasing;
-
1229 p->setRenderHint(QPainter::Antialiasing);
never executed (the execution status of this line is deduced): p->setRenderHint(QPainter::Antialiasing);
-
1230 qDrawBorder(p, rect, bd->styles, bd->borders, bd->colors, bd->radii);
never executed (the execution status of this line is deduced): qDrawBorder(p, rect, bd->styles, bd->borders, bd->colors, bd->radii);
-
1231 p->setRenderHint(QPainter::Antialiasing, wasAntialiased);
never executed (the execution status of this line is deduced): p->setRenderHint(QPainter::Antialiasing, wasAntialiased);
-
1232}
never executed: }
0
1233 -
1234QPainterPath QRenderRule::borderClip(QRect r) -
1235{ -
1236 if (!hasBorder())
never evaluated: !hasBorder()
0
1237 return QPainterPath();
never executed: return QPainterPath();
0
1238 -
1239 QSize tlr, trr, blr, brr;
never executed (the execution status of this line is deduced): QSize tlr, trr, blr, brr;
-
1240 qNormalizeRadii(r, bd->radii, &tlr, &trr, &blr, &brr);
never executed (the execution status of this line is deduced): qNormalizeRadii(r, bd->radii, &tlr, &trr, &blr, &brr);
-
1241 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
1242 return QPainterPath();
never executed: return QPainterPath();
0
1243 -
1244 const QRectF rect(r);
never executed (the execution status of this line is deduced): const QRectF rect(r);
-
1245 const int *borders = border()->borders;
never executed (the execution status of this line is deduced): const int *borders = border()->borders;
-
1246 QPainterPath path;
never executed (the execution status of this line is deduced): QPainterPath path;
-
1247 qreal curY = rect.y() + borders[TopEdge]/2.0;
never executed (the execution status of this line is deduced): qreal curY = rect.y() + borders[TopEdge]/2.0;
-
1248 path.moveTo(rect.x() + tlr.width(), curY);
never executed (the execution status of this line is deduced): path.moveTo(rect.x() + tlr.width(), curY);
-
1249 path.lineTo(rect.right() - trr.width(), curY);
never executed (the execution status of this line is deduced): path.lineTo(rect.right() - trr.width(), curY);
-
1250 qreal curX = rect.right() - borders[RightEdge]/2.0;
never executed (the execution status of this line is deduced): qreal curX = rect.right() - borders[RightEdge]/2.0;
-
1251 path.arcTo(curX - 2*trr.width() + borders[RightEdge], curY,
never executed (the execution status of this line is deduced): path.arcTo(curX - 2*trr.width() + borders[RightEdge], curY,
-
1252 trr.width()*2 - borders[RightEdge], trr.height()*2 - borders[TopEdge], 90, -90);
never executed (the execution status of this line is deduced): trr.width()*2 - borders[RightEdge], trr.height()*2 - borders[TopEdge], 90, -90);
-
1253 -
1254 path.lineTo(curX, rect.bottom() - brr.height());
never executed (the execution status of this line is deduced): path.lineTo(curX, rect.bottom() - brr.height());
-
1255 curY = rect.bottom() - borders[BottomEdge]/2.0;
never executed (the execution status of this line is deduced): curY = rect.bottom() - borders[BottomEdge]/2.0;
-
1256 path.arcTo(curX - 2*brr.width() + borders[RightEdge], curY - 2*brr.height() + borders[BottomEdge],
never executed (the execution status of this line is deduced): path.arcTo(curX - 2*brr.width() + borders[RightEdge], curY - 2*brr.height() + borders[BottomEdge],
-
1257 brr.width()*2 - borders[RightEdge], brr.height()*2 - borders[BottomEdge], 0, -90);
never executed (the execution status of this line is deduced): brr.width()*2 - borders[RightEdge], brr.height()*2 - borders[BottomEdge], 0, -90);
-
1258 -
1259 path.lineTo(rect.x() + blr.width(), curY);
never executed (the execution status of this line is deduced): path.lineTo(rect.x() + blr.width(), curY);
-
1260 curX = rect.left() + borders[LeftEdge]/2.0;
never executed (the execution status of this line is deduced): curX = rect.left() + borders[LeftEdge]/2.0;
-
1261 path.arcTo(curX, rect.bottom() - 2*blr.height() + borders[BottomEdge]/2,
never executed (the execution status of this line is deduced): path.arcTo(curX, rect.bottom() - 2*blr.height() + borders[BottomEdge]/2,
-
1262 blr.width()*2 - borders[LeftEdge], blr.height()*2 - borders[BottomEdge], 270, -90);
never executed (the execution status of this line is deduced): blr.width()*2 - borders[LeftEdge], blr.height()*2 - borders[BottomEdge], 270, -90);
-
1263 -
1264 path.lineTo(curX, rect.top() + tlr.height());
never executed (the execution status of this line is deduced): path.lineTo(curX, rect.top() + tlr.height());
-
1265 path.arcTo(curX, rect.top() + borders[TopEdge]/2,
never executed (the execution status of this line is deduced): path.arcTo(curX, rect.top() + borders[TopEdge]/2,
-
1266 tlr.width()*2 - borders[LeftEdge], tlr.height()*2 - borders[TopEdge], 180, -90);
never executed (the execution status of this line is deduced): tlr.width()*2 - borders[LeftEdge], tlr.height()*2 - borders[TopEdge], 180, -90);
-
1267 -
1268 path.closeSubpath();
never executed (the execution status of this line is deduced): path.closeSubpath();
-
1269 return path;
never executed: return path;
0
1270} -
1271 -
1272/*! \internal -
1273 Clip the painter to the border (in case we are using radius border) -
1274 */ -
1275void QRenderRule::setClip(QPainter *p, const QRect &rect) -
1276{ -
1277 if (clipset++)
never evaluated: clipset++
0
1278 return;
never executed: return;
0
1279 clipPath = borderClip(rect);
never executed (the execution status of this line is deduced): clipPath = borderClip(rect);
-
1280 if (!clipPath.isEmpty()) {
never evaluated: !clipPath.isEmpty()
0
1281 p->save();
never executed (the execution status of this line is deduced): p->save();
-
1282 p->setClipPath(clipPath, Qt::IntersectClip);
never executed (the execution status of this line is deduced): p->setClipPath(clipPath, Qt::IntersectClip);
-
1283 }
never executed: }
0
1284}
never executed: }
0
1285 -
1286void QRenderRule::unsetClip(QPainter *p) -
1287{ -
1288 if (--clipset)
never evaluated: --clipset
0
1289 return;
never executed: return;
0
1290 if (!clipPath.isEmpty())
never evaluated: !clipPath.isEmpty()
0
1291 p->restore();
never executed: p->restore();
0
1292}
never executed: }
0
1293 -
1294void QRenderRule::drawBackground(QPainter *p, const QRect& rect, const QPoint& off) -
1295{ -
1296 QBrush brush = hasBackground() ? background()->brush : QBrush();
never evaluated: hasBackground()
0
1297 if (brush.style() == Qt::NoBrush)
never evaluated: brush.style() == Qt::NoBrush
0
1298 brush = defaultBackground;
never executed: brush = defaultBackground;
0
1299 -
1300 if (brush.style() != Qt::NoBrush) {
never evaluated: brush.style() != Qt::NoBrush
0
1301 Origin origin = hasBackground() ? background()->clip : Origin_Border;
never evaluated: hasBackground()
0
1302 // ### fix for gradients -
1303 const QPainterPath &borderPath = borderClip(originRect(rect, origin));
never executed (the execution status of this line is deduced): const QPainterPath &borderPath = borderClip(originRect(rect, origin));
-
1304 if (!borderPath.isEmpty()) {
never evaluated: !borderPath.isEmpty()
0
1305 // Drawn intead of being used as clipping path for better visual quality -
1306 bool wasAntialiased = p->renderHints() & QPainter::Antialiasing;
never executed (the execution status of this line is deduced): bool wasAntialiased = p->renderHints() & QPainter::Antialiasing;
-
1307 p->setRenderHint(QPainter::Antialiasing);
never executed (the execution status of this line is deduced): p->setRenderHint(QPainter::Antialiasing);
-
1308 p->fillPath(borderPath, brush);
never executed (the execution status of this line is deduced): p->fillPath(borderPath, brush);
-
1309 p->setRenderHint(QPainter::Antialiasing, wasAntialiased);
never executed (the execution status of this line is deduced): p->setRenderHint(QPainter::Antialiasing, wasAntialiased);
-
1310 } else {
never executed: }
0
1311 p->fillRect(originRect(rect, origin), brush);
never executed (the execution status of this line is deduced): p->fillRect(originRect(rect, origin), brush);
-
1312 }
never executed: }
0
1313 } -
1314 -
1315 drawBackgroundImage(p, rect, off);
never executed (the execution status of this line is deduced): drawBackgroundImage(p, rect, off);
-
1316}
never executed: }
0
1317 -
1318void QRenderRule::drawFrame(QPainter *p, const QRect& rect) -
1319{ -
1320 drawBackground(p, rect);
never executed (the execution status of this line is deduced): drawBackground(p, rect);
-
1321 if (hasBorder())
never evaluated: hasBorder()
0
1322 drawBorder(p, borderRect(rect));
never executed: drawBorder(p, borderRect(rect));
0
1323}
never executed: }
0
1324 -
1325void QRenderRule::drawImage(QPainter *p, const QRect &rect) -
1326{ -
1327 if (!hasImage())
never evaluated: !hasImage()
0
1328 return;
never executed: return;
0
1329 img->icon.paint(p, rect, img->alignment);
never executed (the execution status of this line is deduced): img->icon.paint(p, rect, img->alignment);
-
1330}
never executed: }
0
1331 -
1332void QRenderRule::drawRule(QPainter *p, const QRect& rect) -
1333{ -
1334 drawFrame(p, rect);
never executed (the execution status of this line is deduced): drawFrame(p, rect);
-
1335 drawImage(p, contentsRect(rect));
never executed (the execution status of this line is deduced): drawImage(p, contentsRect(rect));
-
1336}
never executed: }
0
1337 -
1338// *shudder* , *horror*, *whoa* <-- what you might feel when you see the functions below -
1339void QRenderRule::configurePalette(QPalette *p, QPalette::ColorRole fr, QPalette::ColorRole br) -
1340{ -
1341 if (bg && bg->brush.style() != Qt::NoBrush) {
partially evaluated: bg
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
partially evaluated: bg->brush.style() != Qt::NoBrush
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
1342 if (br != QPalette::NoRole)
partially evaluated: br != QPalette::NoRole
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
1343 p->setBrush(br, bg->brush);
executed: p->setBrush(br, bg->brush);
Execution Count:2
2
1344 p->setBrush(QPalette::Window, bg->brush);
executed (the execution status of this line is deduced): p->setBrush(QPalette::Window, bg->brush);
-
1345 if (bg->brush.style() == Qt::SolidPattern) {
partially evaluated: bg->brush.style() == Qt::SolidPattern
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
1346 p->setBrush(QPalette::Light, bg->brush.color().lighter(115));
executed (the execution status of this line is deduced): p->setBrush(QPalette::Light, bg->brush.color().lighter(115));
-
1347 p->setBrush(QPalette::Midlight, bg->brush.color().lighter(107));
executed (the execution status of this line is deduced): p->setBrush(QPalette::Midlight, bg->brush.color().lighter(107));
-
1348 p->setBrush(QPalette::Dark, bg->brush.color().darker(150));
executed (the execution status of this line is deduced): p->setBrush(QPalette::Dark, bg->brush.color().darker(150));
-
1349 p->setBrush(QPalette::Shadow, bg->brush.color().darker(300));
executed (the execution status of this line is deduced): p->setBrush(QPalette::Shadow, bg->brush.color().darker(300));
-
1350 }
executed: }
Execution Count:2
2
1351 }
executed: }
Execution Count:2
2
1352 -
1353 if (!hasPalette())
partially evaluated: !hasPalette()
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
1354 return;
executed: return;
Execution Count:2
2
1355 -
1356 if (pal->foreground.style() != Qt::NoBrush) {
never evaluated: pal->foreground.style() != Qt::NoBrush
0
1357 if (fr != QPalette::NoRole)
never evaluated: fr != QPalette::NoRole
0
1358 p->setBrush(fr, pal->foreground);
never executed: p->setBrush(fr, pal->foreground);
0
1359 p->setBrush(QPalette::WindowText, pal->foreground);
never executed (the execution status of this line is deduced): p->setBrush(QPalette::WindowText, pal->foreground);
-
1360 p->setBrush(QPalette::Text, pal->foreground);
never executed (the execution status of this line is deduced): p->setBrush(QPalette::Text, pal->foreground);
-
1361 }
never executed: }
0
1362 if (pal->selectionBackground.style() != Qt::NoBrush)
never evaluated: pal->selectionBackground.style() != Qt::NoBrush
0
1363 p->setBrush(QPalette::Highlight, pal->selectionBackground);
never executed: p->setBrush(QPalette::Highlight, pal->selectionBackground);
0
1364 if (pal->selectionForeground.style() != Qt::NoBrush)
never evaluated: pal->selectionForeground.style() != Qt::NoBrush
0
1365 p->setBrush(QPalette::HighlightedText, pal->selectionForeground);
never executed: p->setBrush(QPalette::HighlightedText, pal->selectionForeground);
0
1366 if (pal->alternateBackground.style() != Qt::NoBrush)
never evaluated: pal->alternateBackground.style() != Qt::NoBrush
0
1367 p->setBrush(QPalette::AlternateBase, pal->alternateBackground);
never executed: p->setBrush(QPalette::AlternateBase, pal->alternateBackground);
0
1368}
never executed: }
0
1369 -
1370void QRenderRule::configurePalette(QPalette *p, QPalette::ColorGroup cg, const QWidget *w, bool embedded) -
1371{ -
1372 if (bg && bg->brush.style() != Qt::NoBrush) {
evaluated: bg
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:3
partially evaluated: bg->brush.style() != Qt::NoBrush
TRUEFALSE
yes
Evaluation Count:6
no
Evaluation Count:0
0-6
1373 p->setBrush(cg, QPalette::Base, bg->brush); // for windows, windowxp
executed (the execution status of this line is deduced): p->setBrush(cg, QPalette::Base, bg->brush);
-
1374 p->setBrush(cg, QPalette::Button, bg->brush); // for plastique
executed (the execution status of this line is deduced): p->setBrush(cg, QPalette::Button, bg->brush);
-
1375 p->setBrush(cg, w->backgroundRole(), bg->brush);
executed (the execution status of this line is deduced): p->setBrush(cg, w->backgroundRole(), bg->brush);
-
1376 p->setBrush(cg, QPalette::Window, bg->brush);
executed (the execution status of this line is deduced): p->setBrush(cg, QPalette::Window, bg->brush);
-
1377 }
executed: }
Execution Count:6
6
1378 -
1379 if (embedded) {
partially evaluated: embedded
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9
0-9
1380 /* For embedded widgets (ComboBox, SpinBox and ScrollArea) we want the embedded widget -
1381 * to be transparent when we have a transparent background or border image */ -
1382 if ((hasBackground() && background()->isTransparent())
never evaluated: hasBackground()
never evaluated: background()->isTransparent()
0
1383 || (hasBorder() && border()->hasBorderImage() && !border()->borderImage()->pixmap.isNull()))
never evaluated: hasBorder()
never evaluated: border()->hasBorderImage()
never evaluated: !border()->borderImage()->pixmap.isNull()
0
1384 p->setBrush(cg, w->backgroundRole(), Qt::NoBrush);
never executed: p->setBrush(cg, w->backgroundRole(), Qt::NoBrush);
0
1385 }
never executed: }
0
1386 -
1387 if (!hasPalette())
partially evaluated: !hasPalette()
TRUEFALSE
yes
Evaluation Count:9
no
Evaluation Count:0
0-9
1388 return;
executed: return;
Execution Count:9
9
1389 -
1390 if (pal->foreground.style() != Qt::NoBrush) {
never evaluated: pal->foreground.style() != Qt::NoBrush
0
1391 p->setBrush(cg, QPalette::ButtonText, pal->foreground);
never executed (the execution status of this line is deduced): p->setBrush(cg, QPalette::ButtonText, pal->foreground);
-
1392 p->setBrush(cg, w->foregroundRole(), pal->foreground);
never executed (the execution status of this line is deduced): p->setBrush(cg, w->foregroundRole(), pal->foreground);
-
1393 p->setBrush(cg, QPalette::WindowText, pal->foreground);
never executed (the execution status of this line is deduced): p->setBrush(cg, QPalette::WindowText, pal->foreground);
-
1394 p->setBrush(cg, QPalette::Text, pal->foreground);
never executed (the execution status of this line is deduced): p->setBrush(cg, QPalette::Text, pal->foreground);
-
1395 }
never executed: }
0
1396 if (pal->selectionBackground.style() != Qt::NoBrush)
never evaluated: pal->selectionBackground.style() != Qt::NoBrush
0
1397 p->setBrush(cg, QPalette::Highlight, pal->selectionBackground);
never executed: p->setBrush(cg, QPalette::Highlight, pal->selectionBackground);
0
1398 if (pal->selectionForeground.style() != Qt::NoBrush)
never evaluated: pal->selectionForeground.style() != Qt::NoBrush
0
1399 p->setBrush(cg, QPalette::HighlightedText, pal->selectionForeground);
never executed: p->setBrush(cg, QPalette::HighlightedText, pal->selectionForeground);
0
1400 if (pal->alternateBackground.style() != Qt::NoBrush)
never evaluated: pal->alternateBackground.style() != Qt::NoBrush
0
1401 p->setBrush(cg, QPalette::AlternateBase, pal->alternateBackground);
never executed: p->setBrush(cg, QPalette::AlternateBase, pal->alternateBackground);
0
1402}
never executed: }
0
1403 -
1404/////////////////////////////////////////////////////////////////////////////// -
1405// Style rules -
1406#define OBJECT_PTR(x) (static_cast<QObject *>(x.ptr)) -
1407 -
1408static inline QObject *parentObject(const QObject *obj) -
1409{ -
1410 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:69
never evaluated: qstrcmp(obj->metaObject()->className(), "QTipLabel") == 0
0-69
1411 QObject *p = qvariant_cast<QObject *>(obj->property("_q_stylesheet_parent"));
never executed (the execution status of this line is deduced): QObject *p = qvariant_cast<QObject *>(obj->property("_q_stylesheet_parent"));
-
1412 if (p)
never evaluated: p
0
1413 return p;
never executed: return p;
0
1414 }
never executed: }
0
1415 return obj->parent();
executed: return obj->parent();
Execution Count:69
69
1416} -
1417 -
1418class QStyleSheetStyleSelector : public StyleSelector -
1419{ -
1420public: -
1421 QStyleSheetStyleSelector() { } -
1422 -
1423 QStringList nodeNames(NodePtr node) const -
1424 { -
1425 if (isNullNode(node))
partially evaluated: isNullNode(node)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:71
0-71
1426 return QStringList();
never executed: return QStringList();
0
1427 const QMetaObject *metaObject = OBJECT_PTR(node)->metaObject();
executed (the execution status of this line is deduced): const QMetaObject *metaObject = (static_cast<QObject *>(node.ptr))->metaObject();
-
1428#ifndef QT_NO_TOOLTIP -
1429 if (qstrcmp(metaObject->className(), "QTipLabel") == 0)
partially evaluated: qstrcmp(metaObject->className(), "QTipLabel") == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:71
0-71
1430 return QStringList(QLatin1String("QToolTip"));
never executed: return QStringList(QLatin1String("QToolTip"));
0
1431#endif -
1432 QStringList result;
executed (the execution status of this line is deduced): QStringList result;
-
1433 do { -
1434 result += QString::fromLatin1(metaObject->className()).replace(QLatin1Char(':'), QLatin1Char('-'));
executed (the execution status of this line is deduced): result += QString::fromLatin1(metaObject->className()).replace(QLatin1Char(':'), QLatin1Char('-'));
-
1435 metaObject = metaObject->superClass();
executed (the execution status of this line is deduced): metaObject = metaObject->superClass();
-
1436 } while (metaObject != 0);
executed: }
Execution Count:254
evaluated: metaObject != 0
TRUEFALSE
yes
Evaluation Count:183
yes
Evaluation Count:71
71-254
1437 return result;
executed: return result;
Execution Count:71
71
1438 } -
1439 QString attribute(NodePtr node, const QString& name) const -
1440 { -
1441 if (isNullNode(node))
partially evaluated: isNullNode(node)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
0-6
1442 return QString();
never executed: return QString();
0
1443 -
1444 QHash<QString, QString> &cache = m_attributeCache[OBJECT_PTR(node)];
executed (the execution status of this line is deduced): QHash<QString, QString> &cache = m_attributeCache[(static_cast<QObject *>(node.ptr))];
-
1445 QHash<QString, QString>::const_iterator cacheIt = cache.constFind(name);
executed (the execution status of this line is deduced): QHash<QString, QString>::const_iterator cacheIt = cache.constFind(name);
-
1446 if (cacheIt != cache.constEnd())
partially evaluated: cacheIt != cache.constEnd()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
0-6
1447 return cacheIt.value();
never executed: return cacheIt.value();
0
1448 -
1449 QObject *obj = OBJECT_PTR(node);
executed (the execution status of this line is deduced): QObject *obj = (static_cast<QObject *>(node.ptr));
-
1450 QVariant value = obj->property(name.toLatin1());
executed (the execution status of this line is deduced): QVariant value = obj->property(name.toLatin1());
-
1451 if (!value.isValid()) {
evaluated: !value.isValid()
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:3
3
1452 if (name == QLatin1String("class")) {
partially evaluated: name == QLatin1String("class")
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
1453 QString className = QString::fromLatin1(obj->metaObject()->className());
never executed (the execution status of this line is deduced): QString className = QString::fromLatin1(obj->metaObject()->className());
-
1454 if (className.contains(QLatin1Char(':')))
never evaluated: className.contains(QLatin1Char(':'))
0
1455 className.replace(QLatin1Char(':'), QLatin1Char('-'));
never executed: className.replace(QLatin1Char(':'), QLatin1Char('-'));
0
1456 cache[name] = className;
never executed (the execution status of this line is deduced): cache[name] = className;
-
1457 return className;
never executed: return className;
0
1458 } else if (name == QLatin1String("style")) {
partially evaluated: name == QLatin1String("style")
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
1459 QWidget *w = qobject_cast<QWidget *>(obj);
never executed (the execution status of this line is deduced): QWidget *w = qobject_cast<QWidget *>(obj);
-
1460 QStyleSheetStyle *proxy = w ? qobject_cast<QStyleSheetStyle *>(w->style()) : 0;
never evaluated: w
0
1461 if (proxy) {
never evaluated: proxy
0
1462 QString styleName = QString::fromLatin1(proxy->baseStyle()->metaObject()->className());
never executed (the execution status of this line is deduced): QString styleName = QString::fromLatin1(proxy->baseStyle()->metaObject()->className());
-
1463 cache[name] = styleName;
never executed (the execution status of this line is deduced): cache[name] = styleName;
-
1464 return styleName;
never executed: return styleName;
0
1465 } -
1466 }
never executed: }
0
1467 } -
1468 QString valueStr;
executed (the execution status of this line is deduced): QString valueStr;
-
1469 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
1470 valueStr = value.toStringList().join(QLatin1Char(' '));
never executed: valueStr = value.toStringList().join(QLatin1Char(' '));
0
1471 else -
1472 valueStr = value.toString();
executed: valueStr = value.toString();
Execution Count:6
6
1473 cache[name] = valueStr;
executed (the execution status of this line is deduced): cache[name] = valueStr;
-
1474 return valueStr;
executed: return valueStr;
Execution Count:6
6
1475 } -
1476 bool nodeNameEquals(NodePtr node, const QString& nodeName) const -
1477 { -
1478 if (isNullNode(node))
partially evaluated: isNullNode(node)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:63
0-63
1479 return false;
never executed: return false;
0
1480 const QMetaObject *metaObject = OBJECT_PTR(node)->metaObject();
executed (the execution status of this line is deduced): const QMetaObject *metaObject = (static_cast<QObject *>(node.ptr))->metaObject();
-
1481#ifndef QT_NO_TOOLTIP -
1482 if (qstrcmp(metaObject->className(), "QTipLabel") == 0)
partially evaluated: qstrcmp(metaObject->className(), "QTipLabel") == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:63
0-63
1483 return nodeName == QLatin1String("QToolTip");
never executed: return nodeName == QLatin1String("QToolTip");
0
1484#endif -
1485 do { -
1486 const ushort *uc = (const ushort *)nodeName.constData();
executed (the execution status of this line is deduced): const ushort *uc = (const ushort *)nodeName.constData();
-
1487 const ushort *e = uc + nodeName.length();
executed (the execution status of this line is deduced): const ushort *e = uc + nodeName.length();
-
1488 const uchar *c = (uchar *)metaObject->className();
executed (the execution status of this line is deduced): const uchar *c = (uchar *)metaObject->className();
-
1489 while (*c && uc != e && (*uc == *c || (*c == ':' && *uc == '-'))) {
evaluated: *c
TRUEFALSE
yes
Evaluation Count:649
yes
Evaluation Count:63
partially evaluated: uc != e
TRUEFALSE
yes
Evaluation Count:649
no
Evaluation Count:0
evaluated: *uc == *c
TRUEFALSE
yes
Evaluation Count:598
yes
Evaluation Count:51
partially evaluated: *c == ':'
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:51
never evaluated: *uc == '-'
0-649
1490 ++uc;
executed (the execution status of this line is deduced): ++uc;
-
1491 ++c;
executed (the execution status of this line is deduced): ++c;
-
1492 }
executed: }
Execution Count:598
598
1493 if (uc == e && !*c)
evaluated: uc == e
TRUEFALSE
yes
Evaluation Count:63
yes
Evaluation Count:51
partially evaluated: !*c
TRUEFALSE
yes
Evaluation Count:63
no
Evaluation Count:0
0-63
1494 return true;
executed: return true;
Execution Count:63
63
1495 metaObject = metaObject->superClass();
executed (the execution status of this line is deduced): metaObject = metaObject->superClass();
-
1496 } while (metaObject != 0);
executed: }
Execution Count:51
partially evaluated: metaObject != 0
TRUEFALSE
yes
Evaluation Count:51
no
Evaluation Count:0
0-51
1497 return false;
never executed: return false;
0
1498 } -
1499 bool hasAttributes(NodePtr) const -
1500 { return true; }
executed: return true;
Execution Count:6
6
1501 QStringList nodeIds(NodePtr node) const -
1502 { return isNullNode(node) ? QStringList() : QStringList(OBJECT_PTR(node)->objectName()); }
never executed: return isNullNode(node) ? QStringList() : QStringList((static_cast<QObject *>(node.ptr))->objectName());
0
1503 bool isNullNode(NodePtr node) const -
1504 { return node.ptr == 0; }
executed: return node.ptr == 0;
Execution Count:140
140
1505 NodePtr parentNode(NodePtr node) const -
1506 { NodePtr n; n.ptr = isNullNode(node) ? 0 : parentObject(OBJECT_PTR(node)); return n; }
never executed: return n;
never evaluated: isNullNode(node)
0
1507 NodePtr previousSiblingNode(NodePtr) const -
1508 { NodePtr n; n.ptr = 0; return n; }
never executed: return n;
0
1509 NodePtr duplicateNode(NodePtr node) const -
1510 { return node; }
executed: return node;
Execution Count:4
4
1511 void freeNode(NodePtr) const -
1512 { } -
1513 -
1514private: -
1515 mutable QHash<const QObject *, QHash<QString, QString> > m_attributeCache; -
1516}; -
1517 -
1518QVector<QCss::StyleRule> QStyleSheetStyle::styleRules(const QObject *obj) const -
1519{ -
1520 QHash<const QObject *, QVector<StyleRule> >::const_iterator cacheIt = styleSheetCaches->styleRulesCache.constFind(obj);
executed (the execution status of this line is deduced): QHash<const QObject *, QVector<StyleRule> >::const_iterator cacheIt = styleSheetCaches->styleRulesCache.constFind(obj);
-
1521 if (cacheIt != styleSheetCaches->styleRulesCache.constEnd())
evaluated: cacheIt != styleSheetCaches->styleRulesCache.constEnd()
TRUEFALSE
yes
Evaluation Count:47
yes
Evaluation Count:40
40-47
1522 return cacheIt.value();
executed: return cacheIt.value();
Execution Count:47
47
1523 -
1524 if (!initObject(obj)) {
partially evaluated: !initObject(obj)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:40
0-40
1525 return QVector<StyleRule>();
never executed: return QVector<StyleRule>();
0
1526 } -
1527 -
1528 QStyleSheetStyleSelector styleSelector;
executed (the execution status of this line is deduced): QStyleSheetStyleSelector styleSelector;
-
1529 -
1530 StyleSheet defaultSs;
executed (the execution status of this line is deduced): StyleSheet defaultSs;
-
1531 QHash<const void *, StyleSheet>::const_iterator defaultCacheIt = styleSheetCaches->styleSheetCache.constFind(baseStyle());
executed (the execution status of this line is deduced): QHash<const void *, StyleSheet>::const_iterator defaultCacheIt = styleSheetCaches->styleSheetCache.constFind(baseStyle());
-
1532 if (defaultCacheIt == styleSheetCaches->styleSheetCache.constEnd()) {
evaluated: defaultCacheIt == styleSheetCaches->styleSheetCache.constEnd()
TRUEFALSE
yes
Evaluation Count:14
yes
Evaluation Count:26
14-26
1533 defaultSs = getDefaultStyleSheet();
executed (the execution status of this line is deduced): defaultSs = getDefaultStyleSheet();
-
1534 QStyle *bs = baseStyle();
executed (the execution status of this line is deduced): QStyle *bs = baseStyle();
-
1535 styleSheetCaches->styleSheetCache.insert(bs, defaultSs);
executed (the execution status of this line is deduced): styleSheetCaches->styleSheetCache.insert(bs, defaultSs);
-
1536 QObject::connect(bs, SIGNAL(destroyed(QObject*)), styleSheetCaches, SLOT(styleDestroyed(QObject*)), Qt::UniqueConnection);
executed (the execution status of this line is deduced): QObject::connect(bs, "2""destroyed(QObject*)", styleSheetCaches, "1""styleDestroyed(QObject*)", Qt::UniqueConnection);
-
1537 } else {
executed: }
Execution Count:14
14
1538 defaultSs = defaultCacheIt.value();
executed (the execution status of this line is deduced): defaultSs = defaultCacheIt.value();
-
1539 }
executed: }
Execution Count:26
26
1540 styleSelector.styleSheets += defaultSs;
executed (the execution status of this line is deduced): styleSelector.styleSheets += defaultSs;
-
1541 -
1542 if (!qApp->styleSheet().isEmpty()) {
evaluated: !(static_cast<QApplication *>(QCoreApplication::instance()))->styleSheet().isEmpty()
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:38
2-38
1543 StyleSheet appSs;
executed (the execution status of this line is deduced): StyleSheet appSs;
-
1544 QHash<const void *, StyleSheet>::const_iterator appCacheIt = styleSheetCaches->styleSheetCache.constFind(qApp);
executed (the execution status of this line is deduced): QHash<const void *, StyleSheet>::const_iterator appCacheIt = styleSheetCaches->styleSheetCache.constFind((static_cast<QApplication *>(QCoreApplication::instance())));
-
1545 if (appCacheIt == styleSheetCaches->styleSheetCache.constEnd()) {
partially evaluated: appCacheIt == styleSheetCaches->styleSheetCache.constEnd()
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
1546 QString ss = qApp->styleSheet();
executed (the execution status of this line is deduced): QString ss = (static_cast<QApplication *>(QCoreApplication::instance()))->styleSheet();
-
1547 if (ss.startsWith(QLatin1String("file:///")))
partially evaluated: ss.startsWith(QLatin1String("file:///"))
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1548 ss.remove(0, 8);
never executed: ss.remove(0, 8);
0
1549 parser.init(ss, qApp->styleSheet() != ss);
executed (the execution status of this line is deduced): parser.init(ss, (static_cast<QApplication *>(QCoreApplication::instance()))->styleSheet() != ss);
-
1550 if (!parser.parse(&appSs))
partially evaluated: !parser.parse(&appSs)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1551 qWarning("Could not parse application stylesheet");
never executed: QMessageLogger("styles/qstylesheetstyle.cpp", 1551, __PRETTY_FUNCTION__).warning("Could not parse application stylesheet");
0
1552 appSs.origin = StyleSheetOrigin_Inline;
executed (the execution status of this line is deduced): appSs.origin = StyleSheetOrigin_Inline;
-
1553 appSs.depth = 1;
executed (the execution status of this line is deduced): appSs.depth = 1;
-
1554 styleSheetCaches->styleSheetCache.insert(qApp, appSs);
executed (the execution status of this line is deduced): styleSheetCaches->styleSheetCache.insert((static_cast<QApplication *>(QCoreApplication::instance())), appSs);
-
1555 } else {
executed: }
Execution Count:2
2
1556 appSs = appCacheIt.value();
never executed (the execution status of this line is deduced): appSs = appCacheIt.value();
-
1557 }
never executed: }
0
1558 styleSelector.styleSheets += appSs;
executed (the execution status of this line is deduced): styleSelector.styleSheets += appSs;
-
1559 }
executed: }
Execution Count:2
2
1560 -
1561 QVector<QCss::StyleSheet> objectSs;
executed (the execution status of this line is deduced): QVector<QCss::StyleSheet> objectSs;
-
1562 for (const QObject *o = obj; o; o = parentObject(o)) {
evaluated: o
TRUEFALSE
yes
Evaluation Count:69
yes
Evaluation Count:40
40-69
1563 QString styleSheet = o->property("styleSheet").toString();
executed (the execution status of this line is deduced): QString styleSheet = o->property("styleSheet").toString();
-
1564 if (styleSheet.isEmpty())
evaluated: styleSheet.isEmpty()
TRUEFALSE
yes
Evaluation Count:31
yes
Evaluation Count:38
31-38
1565 continue;
executed: continue;
Execution Count:31
31
1566 StyleSheet ss;
executed (the execution status of this line is deduced): StyleSheet ss;
-
1567 QHash<const void *, StyleSheet>::const_iterator objCacheIt = styleSheetCaches->styleSheetCache.constFind(o);
executed (the execution status of this line is deduced): QHash<const void *, StyleSheet>::const_iterator objCacheIt = styleSheetCaches->styleSheetCache.constFind(o);
-
1568 if (objCacheIt == styleSheetCaches->styleSheetCache.constEnd()) {
evaluated: objCacheIt == styleSheetCaches->styleSheetCache.constEnd()
TRUEFALSE
yes
Evaluation Count:13
yes
Evaluation Count:25
13-25
1569 parser.init(styleSheet);
executed (the execution status of this line is deduced): parser.init(styleSheet);
-
1570 if (!parser.parse(&ss)) {
evaluated: !parser.parse(&ss)
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:11
2-11
1571 parser.init(QLatin1String("* {") + styleSheet + QLatin1Char('}'));
executed (the execution status of this line is deduced): parser.init(QLatin1String("* {") + styleSheet + QLatin1Char('}'));
-
1572 if (!parser.parse(&ss))
partially evaluated: !parser.parse(&ss)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1573 qWarning("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
1574 }
executed: }
Execution Count:2
2
1575 ss.origin = StyleSheetOrigin_Inline;
executed (the execution status of this line is deduced): ss.origin = StyleSheetOrigin_Inline;
-
1576 styleSheetCaches->styleSheetCache.insert(o, ss);
executed (the execution status of this line is deduced): styleSheetCaches->styleSheetCache.insert(o, ss);
-
1577 } else {
executed: }
Execution Count:13
13
1578 ss = objCacheIt.value();
executed (the execution status of this line is deduced): ss = objCacheIt.value();
-
1579 }
executed: }
Execution Count:25
25
1580 objectSs.append(ss);
executed (the execution status of this line is deduced): objectSs.append(ss);
-
1581 }
executed: }
Execution Count:38
38
1582 -
1583 for (int i = 0; i < objectSs.count(); i++)
evaluated: i < objectSs.count()
TRUEFALSE
yes
Evaluation Count:38
yes
Evaluation Count:40
38-40
1584 objectSs[i].depth = objectSs.count() - i + 2;
executed: objectSs[i].depth = objectSs.count() - i + 2;
Execution Count:38
38
1585 -
1586 styleSelector.styleSheets += objectSs;
executed (the execution status of this line is deduced): styleSelector.styleSheets += objectSs;
-
1587 -
1588 StyleSelector::NodePtr n;
executed (the execution status of this line is deduced): StyleSelector::NodePtr n;
-
1589 n.ptr = (void *)obj;
executed (the execution status of this line is deduced): n.ptr = (void *)obj;
-
1590 QVector<QCss::StyleRule> rules = styleSelector.styleRulesForNode(n);
executed (the execution status of this line is deduced): QVector<QCss::StyleRule> rules = styleSelector.styleRulesForNode(n);
-
1591 styleSheetCaches->styleRulesCache.insert(obj, rules);
executed (the execution status of this line is deduced): styleSheetCaches->styleRulesCache.insert(obj, rules);
-
1592 return rules;
executed: return rules;
Execution Count:40
40
1593} -
1594 -
1595///////////////////////////////////////////////////////////////////////////////////////// -
1596// Rendering rules -
1597static QVector<Declaration> declarations(const QVector<StyleRule> &styleRules, const QString &part, quint64 pseudoClass = PseudoClass_Unspecified) -
1598{ -
1599 QVector<Declaration> decls;
executed (the execution status of this line is deduced): QVector<Declaration> decls;
-
1600 for (int i = 0; i < styleRules.count(); i++) {
evaluated: i < styleRules.count()
TRUEFALSE
yes
Evaluation Count:83
yes
Evaluation Count:49
49-83
1601 const Selector& selector = styleRules.at(i).selectors.at(0);
executed (the execution status of this line is deduced): const Selector& selector = styleRules.at(i).selectors.at(0);
-
1602 // Rules with pseudo elements don't cascade. This is an intentional -
1603 // diversion for CSS -
1604 if (part.compare(selector.pseudoElement(), Qt::CaseInsensitive) != 0)
evaluated: part.compare(selector.pseudoElement(), Qt::CaseInsensitive) != 0
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:80
3-80
1605 continue;
executed: continue;
Execution Count:3
3
1606 quint64 negated = 0;
executed (the execution status of this line is deduced): quint64 negated = 0;
-
1607 quint64 cssClass = selector.pseudoClass(&negated);
executed (the execution status of this line is deduced): quint64 cssClass = selector.pseudoClass(&negated);
-
1608 if ((pseudoClass == PseudoClass_Any) || (cssClass == PseudoClass_Unspecified)
evaluated: (pseudoClass == PseudoClass_Any)
TRUEFALSE
yes
Evaluation Count:7
yes
Evaluation Count:73
evaluated: (cssClass == PseudoClass_Unspecified)
TRUEFALSE
yes
Evaluation Count:67
yes
Evaluation Count:6
6-73
1609 || ((((cssClass & pseudoClass) == cssClass)) && ((negated & pseudoClass) == 0)))
partially evaluated: (((cssClass & pseudoClass) == cssClass))
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
never evaluated: ((negated & pseudoClass) == 0)
0-6
1610 decls += styleRules.at(i).declarations;
executed: decls += styleRules.at(i).declarations;
Execution Count:74
74
1611 }
executed: }
Execution Count:80
80
1612 return decls;
executed: return decls;
Execution Count:49
49
1613} -
1614 -
1615int QStyleSheetStyle::nativeFrameWidth(const QWidget *w) -
1616{ -
1617 QStyle *base = baseStyle();
executed (the execution status of this line is deduced): QStyle *base = baseStyle();
-
1618 -
1619#ifndef QT_NO_SPINBOX -
1620 if (qobject_cast<const QAbstractSpinBox *>(w))
evaluated: qobject_cast<const QAbstractSpinBox *>(w)
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:43
3-43
1621 return base->pixelMetric(QStyle::PM_SpinBoxFrameWidth, 0, w);
executed: return base->pixelMetric(QStyle::PM_SpinBoxFrameWidth, 0, w);
Execution Count:3
3
1622#endif -
1623 -
1624#ifndef QT_NO_COMBOBOX -
1625 if (qobject_cast<const QComboBox *>(w))
partially evaluated: qobject_cast<const QComboBox *>(w)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:43
0-43
1626 return base->pixelMetric(QStyle::PM_ComboBoxFrameWidth, 0, w);
never executed: return base->pixelMetric(QStyle::PM_ComboBoxFrameWidth, 0, w);
0
1627#endif -
1628 -
1629#ifndef QT_NO_MENU -
1630 if (qobject_cast<const QMenu *>(w))
evaluated: qobject_cast<const QMenu *>(w)
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:42
1-42
1631 return base->pixelMetric(QStyle::PM_MenuPanelWidth, 0, w);
executed: return base->pixelMetric(QStyle::PM_MenuPanelWidth, 0, w);
Execution Count:1
1
1632#endif -
1633 -
1634#ifndef QT_NO_MENUBAR -
1635 if (qobject_cast<const QMenuBar *>(w))
evaluated: qobject_cast<const QMenuBar *>(w)
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:41
1-41
1636 return base->pixelMetric(QStyle::PM_MenuBarPanelWidth, 0, w);
executed: return base->pixelMetric(QStyle::PM_MenuBarPanelWidth, 0, w);
Execution Count:1
1
1637#endif -
1638#ifndef QT_NO_FRAME -
1639 if (const QFrame *frame = qobject_cast<const QFrame *>(w)) {
partially evaluated: const QFrame *frame = qobject_cast<const QFrame *>(w)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:41
0-41
1640 if (frame->frameShape() == QFrame::NoFrame)
never evaluated: frame->frameShape() == QFrame::NoFrame
0
1641 return 0;
never executed: return 0;
0
1642 }
never executed: }
0
1643#endif -
1644 -
1645 if (qstrcmp(w->metaObject()->className(), "QTipLabel") == 0)
partially evaluated: qstrcmp(w->metaObject()->className(), "QTipLabel") == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:41
0-41
1646 return base->pixelMetric(QStyle::PM_ToolTipLabelFrameWidth, 0, w);
never executed: return base->pixelMetric(QStyle::PM_ToolTipLabelFrameWidth, 0, w);
0
1647 -
1648 return base->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, w);
executed: return base->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, w);
Execution Count:41
41
1649} -
1650 -
1651static quint64 pseudoClass(QStyle::State state) -
1652{ -
1653 quint64 pc = 0;
executed (the execution status of this line is deduced): quint64 pc = 0;
-
1654 if (state & QStyle::State_Enabled) {
evaluated: state & QStyle::State_Enabled
TRUEFALSE
yes
Evaluation Count:48
yes
Evaluation Count:45
45-48
1655 pc |= PseudoClass_Enabled;
executed (the execution status of this line is deduced): pc |= PseudoClass_Enabled;
-
1656 if (state & QStyle::State_MouseOver)
evaluated: state & QStyle::State_MouseOver
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:45
3-45
1657 pc |= PseudoClass_Hover;
executed: pc |= PseudoClass_Hover;
Execution Count:3
3
1658 } else {
executed: }
Execution Count:48
48
1659 pc |= PseudoClass_Disabled;
executed (the execution status of this line is deduced): pc |= PseudoClass_Disabled;
-
1660 }
executed: }
Execution Count:45
45
1661 if (state & QStyle::State_Active)
evaluated: state & QStyle::State_Active
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:90
3-90
1662 pc |= PseudoClass_Active;
executed: pc |= PseudoClass_Active;
Execution Count:3
3
1663 if (state & QStyle::State_Window)
evaluated: state & QStyle::State_Window
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:89
4-89
1664 pc |= PseudoClass_Window;
executed: pc |= PseudoClass_Window;
Execution Count:4
4
1665 if (state & QStyle::State_Sunken)
evaluated: state & QStyle::State_Sunken
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:91
2-91
1666 pc |= PseudoClass_Pressed;
executed: pc |= PseudoClass_Pressed;
Execution Count:2
2
1667 if (state & QStyle::State_HasFocus)
evaluated: state & QStyle::State_HasFocus
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:90
3-90
1668 pc |= PseudoClass_Focus;
executed: pc |= PseudoClass_Focus;
Execution Count:3
3
1669 if (state & QStyle::State_On)
evaluated: state & QStyle::State_On
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:92
1-92
1670 pc |= (PseudoClass_On | PseudoClass_Checked);
executed: pc |= (PseudoClass_On | PseudoClass_Checked);
Execution Count:1
1
1671 if (state & QStyle::State_Off)
evaluated: state & QStyle::State_Off
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:92
1-92
1672 pc |= (PseudoClass_Off | PseudoClass_Unchecked);
executed: pc |= (PseudoClass_Off | PseudoClass_Unchecked);
Execution Count:1
1
1673 if (state & QStyle::State_NoChange)
partially evaluated: state & QStyle::State_NoChange
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:93
0-93
1674 pc |= PseudoClass_Indeterminate;
never executed: pc |= PseudoClass_Indeterminate;
0
1675 if (state & QStyle::State_Selected)
partially evaluated: state & QStyle::State_Selected
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:93
0-93
1676 pc |= PseudoClass_Selected;
never executed: pc |= PseudoClass_Selected;
0
1677 if (state & QStyle::State_Horizontal)
partially evaluated: state & QStyle::State_Horizontal
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:93
0-93
1678 pc |= PseudoClass_Horizontal;
never executed: pc |= PseudoClass_Horizontal;
0
1679 else -
1680 pc |= PseudoClass_Vertical;
executed: pc |= PseudoClass_Vertical;
Execution Count:93
93
1681 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:3
yes
Evaluation Count:90
3-90
1682 pc |= PseudoClass_Open;
executed: pc |= PseudoClass_Open;
Execution Count:3
3
1683 else -
1684 pc |= PseudoClass_Closed;
executed: pc |= PseudoClass_Closed;
Execution Count:90
90
1685 if (state & QStyle::State_Children)
partially evaluated: state & QStyle::State_Children
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:93
0-93
1686 pc |= PseudoClass_Children;
never executed: pc |= PseudoClass_Children;
0
1687 if (state & QStyle::State_Sibling)
partially evaluated: state & QStyle::State_Sibling
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:93
0-93
1688 pc |= PseudoClass_Sibling;
never executed: pc |= PseudoClass_Sibling;
0
1689 if (state & QStyle::State_ReadOnly)
partially evaluated: state & QStyle::State_ReadOnly
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:93
0-93
1690 pc |= PseudoClass_ReadOnly;
never executed: pc |= PseudoClass_ReadOnly;
0
1691 if (state & QStyle::State_Item)
partially evaluated: state & QStyle::State_Item
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:93
0-93
1692 pc |= PseudoClass_Item;
never executed: pc |= PseudoClass_Item;
0
1693#ifdef QT_KEYPAD_NAVIGATION -
1694 if (state & QStyle::State_HasEditFocus) -
1695 pc |= PseudoClass_EditFocus; -
1696#endif -
1697 return pc;
executed: return pc;
Execution Count:93
93
1698} -
1699 -
1700static void qt_check_if_internal_object(const QObject **obj, int *element) -
1701{ -
1702#ifdef QT_NO_DOCKWIDGET -
1703 Q_UNUSED(obj); -
1704 Q_UNUSED(element); -
1705#else -
1706 if (*obj && qstrcmp((*obj)->metaObject()->className(), "QDockWidgetTitleButton") == 0) {
evaluated: *obj
TRUEFALSE
yes
Evaluation Count:106
yes
Evaluation Count:5
partially evaluated: qstrcmp((*obj)->metaObject()->className(), "QDockWidgetTitleButton") == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:106
0-106
1707 if ((*obj)->objectName() == QLatin1String("qt_dockwidget_closebutton")) {
never evaluated: (*obj)->objectName() == QLatin1String("qt_dockwidget_closebutton")
0
1708 *element = PseudoElement_DockWidgetCloseButton;
never executed (the execution status of this line is deduced): *element = PseudoElement_DockWidgetCloseButton;
-
1709 } else if ((*obj)->objectName() == QLatin1String("qt_dockwidget_floatbutton")) {
never executed: }
never evaluated: (*obj)->objectName() == QLatin1String("qt_dockwidget_floatbutton")
0
1710 *element = PseudoElement_DockWidgetFloatButton;
never executed (the execution status of this line is deduced): *element = PseudoElement_DockWidgetFloatButton;
-
1711 }
never executed: }
0
1712 *obj = (*obj)->parent();
never executed (the execution status of this line is deduced): *obj = (*obj)->parent();
-
1713 }
never executed: }
0
1714#endif -
1715}
executed: }
Execution Count:111
111
1716 -
1717QRenderRule QStyleSheetStyle::renderRule(const QObject *obj, int element, quint64 state) const -
1718{ -
1719 qt_check_if_internal_object(&obj, &element);
executed (the execution status of this line is deduced): qt_check_if_internal_object(&obj, &element);
-
1720 QHash<quint64, QRenderRule> &cache = styleSheetCaches->renderRulesCache[obj][element];
executed (the execution status of this line is deduced): QHash<quint64, QRenderRule> &cache = styleSheetCaches->renderRulesCache[obj][element];
-
1721 QHash<quint64, QRenderRule>::const_iterator cacheIt = cache.constFind(state);
executed (the execution status of this line is deduced): QHash<quint64, QRenderRule>::const_iterator cacheIt = cache.constFind(state);
-
1722 if (cacheIt != cache.constEnd())
evaluated: cacheIt != cache.constEnd()
TRUEFALSE
yes
Evaluation Count:23
yes
Evaluation Count:88
23-88
1723 return cacheIt.value();
executed: return cacheIt.value();
Execution Count:23
23
1724 -
1725 if (!initObject(obj))
evaluated: !initObject(obj)
TRUEFALSE
yes
Evaluation Count:7
yes
Evaluation Count:81
7-81
1726 return QRenderRule();
executed: return QRenderRule();
Execution Count:7
7
1727 -
1728 quint64 stateMask = 0;
executed (the execution status of this line is deduced): quint64 stateMask = 0;
-
1729 const QVector<StyleRule> rules = styleRules(obj);
executed (the execution status of this line is deduced): const QVector<StyleRule> rules = styleRules(obj);
-
1730 for (int i = 0; i < rules.count(); i++) {
evaluated: i < rules.count()
TRUEFALSE
yes
Evaluation Count:153
yes
Evaluation Count:81
81-153
1731 const Selector& selector = rules.at(i).selectors.at(0);
executed (the execution status of this line is deduced): const Selector& selector = rules.at(i).selectors.at(0);
-
1732 quint64 negated = 0;
executed (the execution status of this line is deduced): quint64 negated = 0;
-
1733 stateMask |= selector.pseudoClass(&negated);
executed (the execution status of this line is deduced): stateMask |= selector.pseudoClass(&negated);
-
1734 stateMask |= negated;
executed (the execution status of this line is deduced): stateMask |= negated;
-
1735 }
executed: }
Execution Count:153
153
1736 -
1737 cacheIt = cache.constFind(state & stateMask);
executed (the execution status of this line is deduced): cacheIt = cache.constFind(state & stateMask);
-
1738 if (cacheIt != cache.constEnd()) {
evaluated: cacheIt != cache.constEnd()
TRUEFALSE
yes
Evaluation Count:35
yes
Evaluation Count:46
35-46
1739 const QRenderRule &newRule = cacheIt.value();
executed (the execution status of this line is deduced): const QRenderRule &newRule = cacheIt.value();
-
1740 cache[state] = newRule;
executed (the execution status of this line is deduced): cache[state] = newRule;
-
1741 return newRule;
executed: return newRule;
Execution Count:35
35
1742 } -
1743 -
1744 -
1745 const QString part = QLatin1String(knownPseudoElements[element].name);
executed (the execution status of this line is deduced): const QString part = QLatin1String(knownPseudoElements[element].name);
-
1746 QVector<Declaration> decls = declarations(rules, part, state);
executed (the execution status of this line is deduced): QVector<Declaration> decls = declarations(rules, part, state);
-
1747 QRenderRule newRule(decls, obj);
executed (the execution status of this line is deduced): QRenderRule newRule(decls, obj);
-
1748 cache[state] = newRule;
executed (the execution status of this line is deduced): cache[state] = newRule;
-
1749 if ((state & stateMask) != state)
partially evaluated: (state & stateMask) != state
TRUEFALSE
yes
Evaluation Count:46
no
Evaluation Count:0
0-46
1750 cache[state&stateMask] = newRule;
executed: cache[state&stateMask] = newRule;
Execution Count:46
46
1751 return newRule;
executed: return newRule;
Execution Count:46
46
1752} -
1753 -
1754QRenderRule QStyleSheetStyle::renderRule(const QObject *obj, const QStyleOption *opt, int pseudoElement) const -
1755{ -
1756 quint64 extraClass = 0;
executed (the execution status of this line is deduced): quint64 extraClass = 0;
-
1757 QStyle::State state = opt ? opt->state : QStyle::State(QStyle::State_None);
evaluated: opt
TRUEFALSE
yes
Evaluation Count:46
yes
Evaluation Count:45
45-46
1758 -
1759 if (const QStyleOptionComplex *complex = qstyleoption_cast<const QStyleOptionComplex *>(opt)) {
evaluated: const QStyleOptionComplex *complex = qstyleoption_cast<const QStyleOptionComplex *>(opt)
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:86
5-86
1760 if (pseudoElement != PseudoElement_None) {
evaluated: pseudoElement != PseudoElement_None
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:3
2-3
1761 // if not an active subcontrol, just pass enabled/disabled -
1762 QStyle::SubControl subControl = knownPseudoElements[pseudoElement].subControl;
executed (the execution status of this line is deduced): QStyle::SubControl subControl = knownPseudoElements[pseudoElement].subControl;
-
1763 -
1764 if (!(complex->activeSubControls & subControl))
partially evaluated: !(complex->activeSubControls & subControl)
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
1765 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
1766 }
executed: }
Execution Count:2
2
1767 -
1768 switch (pseudoElement) { -
1769 case PseudoElement_ComboBoxDropDown: -
1770 case PseudoElement_ComboBoxArrow: -
1771 state |= (complex->state & (QStyle::State_On|QStyle::State_ReadOnly));
never executed (the execution status of this line is deduced): state |= (complex->state & (QStyle::State_On|QStyle::State_ReadOnly));
-
1772 break;
never executed: break;
0
1773 case PseudoElement_SpinBoxUpButton: -
1774 case PseudoElement_SpinBoxDownButton: -
1775 case PseudoElement_SpinBoxUpArrow: -
1776 case PseudoElement_SpinBoxDownArrow: -
1777#ifndef QT_NO_SPINBOX -
1778 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
1779 bool on = false;
executed (the execution status of this line is deduced): bool on = false;
-
1780 bool up = pseudoElement == PseudoElement_SpinBoxUpButton
evaluated: pseudoElement == PseudoElement_SpinBoxUpButton
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1
1781 || pseudoElement == PseudoElement_SpinBoxUpArrow;
partially evaluated: pseudoElement == PseudoElement_SpinBoxUpArrow
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1782 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
1783 on = true;
executed: on = true;
Execution Count:1
1
1784 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
1785 on = true;
never executed: on = true;
0
1786 state |= (on ? QStyle::State_On : QStyle::State_Off);
evaluated: on
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1
1787 }
executed: }
Execution Count:2
2
1788#endif // QT_NO_SPINBOX -
1789 break;
executed: break;
Execution Count:2
2
1790 case PseudoElement_GroupBoxTitle: -
1791 state |= (complex->state & (QStyle::State_MouseOver | QStyle::State_Sunken));
never executed (the execution status of this line is deduced): state |= (complex->state & (QStyle::State_MouseOver | QStyle::State_Sunken));
-
1792 break;
never executed: break;
0
1793 case PseudoElement_ToolButtonMenu: -
1794 case PseudoElement_ToolButtonMenuArrow: -
1795 case PseudoElement_ToolButtonDownArrow: -
1796 state |= complex->state & QStyle::State_MouseOver;
never executed (the execution status of this line is deduced): state |= complex->state & QStyle::State_MouseOver;
-
1797 if (complex->state & QStyle::State_Sunken ||
never evaluated: complex->state & QStyle::State_Sunken
0
1798 complex->activeSubControls & QStyle::SC_ToolButtonMenu)
never evaluated: complex->activeSubControls & QStyle::SC_ToolButtonMenu
0
1799 state |= QStyle::State_Sunken;
never executed: state |= QStyle::State_Sunken;
0
1800 break;
never executed: break;
0
1801 case PseudoElement_SliderGroove: -
1802 state |= complex->state & QStyle::State_MouseOver;
never executed (the execution status of this line is deduced): state |= complex->state & QStyle::State_MouseOver;
-
1803 break;
never executed: break;
0
1804 default: -
1805 break;
executed: break;
Execution Count:3
3
1806 } -
1807 -
1808 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:5
0-5
1809 // QStyle::State_On is set when the popup is being shown -
1810 // Propagate EditField Pressed state -
1811 if (pseudoElement == PseudoElement_None
never evaluated: pseudoElement == PseudoElement_None
0
1812 && (complex->activeSubControls & QStyle::SC_ComboBoxEditField)
never evaluated: (complex->activeSubControls & QStyle::SC_ComboBoxEditField)
0
1813 && (!(state & QStyle::State_MouseOver))) {
never evaluated: (!(state & QStyle::State_MouseOver))
0
1814 state |= QStyle::State_Sunken;
never executed (the execution status of this line is deduced): state |= QStyle::State_Sunken;
-
1815 }
never executed: }
0
1816 -
1817 if (!combo->frame)
never evaluated: !combo->frame
0
1818 extraClass |= PseudoClass_Frameless;
never executed: extraClass |= PseudoClass_Frameless;
0
1819 if (!combo->editable)
never evaluated: !combo->editable
0
1820 extraClass |= PseudoClass_ReadOnly;
never executed: extraClass |= PseudoClass_ReadOnly;
0
1821 else -
1822 extraClass |= PseudoClass_Editable;
never executed: extraClass |= PseudoClass_Editable;
0
1823#ifndef QT_NO_SPINBOX -
1824 } else if (const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
partially evaluated: const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)
TRUEFALSE
yes
Evaluation Count:5
no
Evaluation Count:0
0-5
1825 if (!spin->frame)
partially evaluated: !spin->frame
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5
0-5
1826 extraClass |= PseudoClass_Frameless;
never executed: extraClass |= PseudoClass_Frameless;
0
1827#endif // QT_NO_SPINBOX -
1828 } else if (const QStyleOptionGroupBox *gb = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)) {
executed: }
Execution Count:5
never evaluated: const QStyleOptionGroupBox *gb = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)
0-5
1829 if (gb->features & QStyleOptionFrameV2::Flat)
never evaluated: gb->features & QStyleOptionFrameV2::Flat
0
1830 extraClass |= PseudoClass_Flat;
never executed: extraClass |= PseudoClass_Flat;
0
1831 if (gb->lineWidth == 0)
never evaluated: gb->lineWidth == 0
0
1832 extraClass |= PseudoClass_Frameless;
never executed: extraClass |= PseudoClass_Frameless;
0
1833 } else if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)) {
never executed: }
never evaluated: const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)
0
1834 if (tb->titleBarState & Qt::WindowMinimized) {
never evaluated: tb->titleBarState & Qt::WindowMinimized
0
1835 extraClass |= PseudoClass_Minimized;
never executed (the execution status of this line is deduced): extraClass |= PseudoClass_Minimized;
-
1836 }
never executed: }
0
1837 else if (tb->titleBarState & Qt::WindowMaximized)
never evaluated: tb->titleBarState & Qt::WindowMaximized
0
1838 extraClass |= PseudoClass_Maximized;
never executed: extraClass |= PseudoClass_Maximized;
0
1839 } -
1840 } else { -
1841 // handle simple style options -
1842 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:86
0-86
1843 if (mi->menuItemType == QStyleOptionMenuItem::DefaultItem)
never evaluated: mi->menuItemType == QStyleOptionMenuItem::DefaultItem
0
1844 extraClass |= PseudoClass_Default;
never executed: extraClass |= PseudoClass_Default;
0
1845 if (mi->checkType == QStyleOptionMenuItem::Exclusive)
never evaluated: mi->checkType == QStyleOptionMenuItem::Exclusive
0
1846 extraClass |= PseudoClass_Exclusive;
never executed: extraClass |= PseudoClass_Exclusive;
0
1847 else if (mi->checkType == QStyleOptionMenuItem::NonExclusive)
never evaluated: mi->checkType == QStyleOptionMenuItem::NonExclusive
0
1848 extraClass |= PseudoClass_NonExclusive;
never executed: extraClass |= PseudoClass_NonExclusive;
0
1849 if (mi->checkType != QStyleOptionMenuItem::NotCheckable)
never evaluated: mi->checkType != QStyleOptionMenuItem::NotCheckable
0
1850 extraClass |= (mi->checked) ? (PseudoClass_On|PseudoClass_Checked)
never executed: extraClass |= (mi->checked) ? (PseudoClass_On|PseudoClass_Checked) : (PseudoClass_Off|PseudoClass_Unchecked);
never evaluated: (mi->checked)
0
1851 : (PseudoClass_Off|PseudoClass_Unchecked);
never executed: extraClass |= (mi->checked) ? (PseudoClass_On|PseudoClass_Checked) : (PseudoClass_Off|PseudoClass_Unchecked);
0
1852 } else if (const QStyleOptionHeader *hdr = qstyleoption_cast<const QStyleOptionHeader *>(opt)) {
never executed: }
partially evaluated: const QStyleOptionHeader *hdr = qstyleoption_cast<const QStyleOptionHeader *>(opt)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:86
0-86
1853 if (hdr->position == QStyleOptionHeader::OnlyOneSection)
never evaluated: hdr->position == QStyleOptionHeader::OnlyOneSection
0
1854 extraClass |= PseudoClass_OnlyOne;
never executed: extraClass |= PseudoClass_OnlyOne;
0
1855 else if (hdr->position == QStyleOptionHeader::Beginning)
never evaluated: hdr->position == QStyleOptionHeader::Beginning
0
1856 extraClass |= PseudoClass_First;
never executed: extraClass |= PseudoClass_First;
0
1857 else if (hdr->position == QStyleOptionHeader::End)
never evaluated: hdr->position == QStyleOptionHeader::End
0
1858 extraClass |= PseudoClass_Last;
never executed: extraClass |= PseudoClass_Last;
0
1859 else if (hdr->position == QStyleOptionHeader::Middle)
never evaluated: hdr->position == QStyleOptionHeader::Middle
0
1860 extraClass |= PseudoClass_Middle;
never executed: extraClass |= PseudoClass_Middle;
0
1861 -
1862 if (hdr->selectedPosition == QStyleOptionHeader::NextAndPreviousAreSelected)
never evaluated: hdr->selectedPosition == QStyleOptionHeader::NextAndPreviousAreSelected
0
1863 extraClass |= (PseudoClass_NextSelected | PseudoClass_PreviousSelected);
never executed: extraClass |= (PseudoClass_NextSelected | PseudoClass_PreviousSelected);
0
1864 else if (hdr->selectedPosition == QStyleOptionHeader::NextIsSelected)
never evaluated: hdr->selectedPosition == QStyleOptionHeader::NextIsSelected
0
1865 extraClass |= PseudoClass_NextSelected;
never executed: extraClass |= PseudoClass_NextSelected;
0
1866 else if (hdr->selectedPosition == QStyleOptionHeader::PreviousIsSelected)
never evaluated: hdr->selectedPosition == QStyleOptionHeader::PreviousIsSelected
0
1867 extraClass |= PseudoClass_PreviousSelected;
never executed: extraClass |= PseudoClass_PreviousSelected;
0
1868#ifndef QT_NO_TABWIDGET -
1869 } 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:86
0-86
1870 switch (tab->shape) { -
1871 case QTabBar::RoundedNorth: -
1872 case QTabBar::TriangularNorth: -
1873 extraClass |= PseudoClass_Top;
never executed (the execution status of this line is deduced): extraClass |= PseudoClass_Top;
-
1874 break;
never executed: break;
0
1875 case QTabBar::RoundedSouth: -
1876 case QTabBar::TriangularSouth: -
1877 extraClass |= PseudoClass_Bottom;
never executed (the execution status of this line is deduced): extraClass |= PseudoClass_Bottom;
-
1878 break;
never executed: break;
0
1879 case QTabBar::RoundedEast: -
1880 case QTabBar::TriangularEast: -
1881 extraClass |= PseudoClass_Left;
never executed (the execution status of this line is deduced): extraClass |= PseudoClass_Left;
-
1882 break;
never executed: break;
0
1883 case QTabBar::RoundedWest: -
1884 case QTabBar::TriangularWest: -
1885 extraClass |= PseudoClass_Right;
never executed (the execution status of this line is deduced): extraClass |= PseudoClass_Right;
-
1886 break;
never executed: break;
0
1887 default: -
1888 break;
never executed: break;
0
1889 } -
1890#endif -
1891#ifndef QT_NO_TABBAR -
1892 } else if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
never executed: }
partially evaluated: const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:86
0-86
1893 if (tab->position == QStyleOptionTab::OnlyOneTab)
never evaluated: tab->position == QStyleOptionTab::OnlyOneTab
0
1894 extraClass |= PseudoClass_OnlyOne;
never executed: extraClass |= PseudoClass_OnlyOne;
0
1895 else if (tab->position == QStyleOptionTab::Beginning)
never evaluated: tab->position == QStyleOptionTab::Beginning
0
1896 extraClass |= PseudoClass_First;
never executed: extraClass |= PseudoClass_First;
0
1897 else if (tab->position == QStyleOptionTab::End)
never evaluated: tab->position == QStyleOptionTab::End
0
1898 extraClass |= PseudoClass_Last;
never executed: extraClass |= PseudoClass_Last;
0
1899 else if (tab->position == QStyleOptionTab::Middle)
never evaluated: tab->position == QStyleOptionTab::Middle
0
1900 extraClass |= PseudoClass_Middle;
never executed: extraClass |= PseudoClass_Middle;
0
1901 -
1902 if (tab->selectedPosition == QStyleOptionTab::NextIsSelected)
never evaluated: tab->selectedPosition == QStyleOptionTab::NextIsSelected
0
1903 extraClass |= PseudoClass_NextSelected;
never executed: extraClass |= PseudoClass_NextSelected;
0
1904 else if (tab->selectedPosition == QStyleOptionTab::PreviousIsSelected)
never evaluated: tab->selectedPosition == QStyleOptionTab::PreviousIsSelected
0
1905 extraClass |= PseudoClass_PreviousSelected;
never executed: extraClass |= PseudoClass_PreviousSelected;
0
1906 -
1907 switch (tab->shape) { -
1908 case QTabBar::RoundedNorth: -
1909 case QTabBar::TriangularNorth: -
1910 extraClass |= PseudoClass_Top;
never executed (the execution status of this line is deduced): extraClass |= PseudoClass_Top;
-
1911 break;
never executed: break;
0
1912 case QTabBar::RoundedSouth: -
1913 case QTabBar::TriangularSouth: -
1914 extraClass |= PseudoClass_Bottom;
never executed (the execution status of this line is deduced): extraClass |= PseudoClass_Bottom;
-
1915 break;
never executed: break;
0
1916 case QTabBar::RoundedEast: -
1917 case QTabBar::TriangularEast: -
1918 extraClass |= PseudoClass_Left;
never executed (the execution status of this line is deduced): extraClass |= PseudoClass_Left;
-
1919 break;
never executed: break;
0
1920 case QTabBar::RoundedWest: -
1921 case QTabBar::TriangularWest: -
1922 extraClass |= PseudoClass_Right;
never executed (the execution status of this line is deduced): extraClass |= PseudoClass_Right;
-
1923 break;
never executed: break;
0
1924 default: -
1925 break;
never executed: break;
0
1926 } -
1927#endif // QT_NO_TABBAR -
1928 } else if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
never executed: }
partially evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:86
0-86
1929 if (btn->features & QStyleOptionButton::Flat)
never evaluated: btn->features & QStyleOptionButton::Flat
0
1930 extraClass |= PseudoClass_Flat;
never executed: extraClass |= PseudoClass_Flat;
0
1931 if (btn->features & QStyleOptionButton::DefaultButton)
never evaluated: btn->features & QStyleOptionButton::DefaultButton
0
1932 extraClass |= PseudoClass_Default;
never executed: extraClass |= PseudoClass_Default;
0
1933 } else if (const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
never executed: }
evaluated: const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(opt)
TRUEFALSE
yes
Evaluation Count:19
yes
Evaluation Count:67
0-67
1934 if (frm->lineWidth == 0)
evaluated: frm->lineWidth == 0
TRUEFALSE
yes
Evaluation Count:9
yes
Evaluation Count:10
9-10
1935 extraClass |= PseudoClass_Frameless;
executed: extraClass |= PseudoClass_Frameless;
Execution Count:9
9
1936 if (const QStyleOptionFrameV2 *frame2 = qstyleoption_cast<const QStyleOptionFrameV2 *>(opt)) {
partially evaluated: const QStyleOptionFrameV2 *frame2 = qstyleoption_cast<const QStyleOptionFrameV2 *>(opt)
TRUEFALSE
yes
Evaluation Count:19
no
Evaluation Count:0
0-19
1937 if (frame2->features & QStyleOptionFrameV2::Flat)
partially evaluated: frame2->features & QStyleOptionFrameV2::Flat
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:19
0-19
1938 extraClass |= PseudoClass_Flat;
never executed: extraClass |= PseudoClass_Flat;
0
1939 }
executed: }
Execution Count:19
19
1940 }
executed: }
Execution Count:19
19
1941#ifndef QT_NO_TOOLBAR -
1942 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:67
0-67
1943 if (tb->toolBarArea == Qt::LeftToolBarArea)
never evaluated: tb->toolBarArea == Qt::LeftToolBarArea
0
1944 extraClass |= PseudoClass_Left;
never executed: extraClass |= PseudoClass_Left;
0
1945 else if (tb->toolBarArea == Qt::RightToolBarArea)
never evaluated: tb->toolBarArea == Qt::RightToolBarArea
0
1946 extraClass |= PseudoClass_Right;
never executed: extraClass |= PseudoClass_Right;
0
1947 else if (tb->toolBarArea == Qt::TopToolBarArea)
never evaluated: tb->toolBarArea == Qt::TopToolBarArea
0
1948 extraClass |= PseudoClass_Top;
never executed: extraClass |= PseudoClass_Top;
0
1949 else if (tb->toolBarArea == Qt::BottomToolBarArea)
never evaluated: tb->toolBarArea == Qt::BottomToolBarArea
0
1950 extraClass |= PseudoClass_Bottom;
never executed: extraClass |= PseudoClass_Bottom;
0
1951 -
1952 if (tb->positionWithinLine == QStyleOptionToolBar::Beginning)
never evaluated: tb->positionWithinLine == QStyleOptionToolBar::Beginning
0
1953 extraClass |= PseudoClass_First;
never executed: extraClass |= PseudoClass_First;
0
1954 else if (tb->positionWithinLine == QStyleOptionToolBar::Middle)
never evaluated: tb->positionWithinLine == QStyleOptionToolBar::Middle
0
1955 extraClass |= PseudoClass_Middle;
never executed: extraClass |= PseudoClass_Middle;
0
1956 else if (tb->positionWithinLine == QStyleOptionToolBar::End)
never evaluated: tb->positionWithinLine == QStyleOptionToolBar::End
0
1957 extraClass |= PseudoClass_Last;
never executed: extraClass |= PseudoClass_Last;
0
1958 else if (tb->positionWithinLine == QStyleOptionToolBar::OnlyOne)
never evaluated: tb->positionWithinLine == QStyleOptionToolBar::OnlyOne
0
1959 extraClass |= PseudoClass_OnlyOne;
never executed: extraClass |= PseudoClass_OnlyOne;
0
1960 } -
1961#endif // QT_NO_TOOLBAR -
1962#ifndef QT_NO_TOOLBOX -
1963 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:67
0-67
1964 if (tab->position == QStyleOptionToolBoxV2::OnlyOneTab)
never evaluated: tab->position == QStyleOptionToolBoxV2::OnlyOneTab
0
1965 extraClass |= PseudoClass_OnlyOne;
never executed: extraClass |= PseudoClass_OnlyOne;
0
1966 else if (tab->position == QStyleOptionToolBoxV2::Beginning)
never evaluated: tab->position == QStyleOptionToolBoxV2::Beginning
0
1967 extraClass |= PseudoClass_First;
never executed: extraClass |= PseudoClass_First;
0
1968 else if (tab->position == QStyleOptionToolBoxV2::End)
never evaluated: tab->position == QStyleOptionToolBoxV2::End
0
1969 extraClass |= PseudoClass_Last;
never executed: extraClass |= PseudoClass_Last;
0
1970 else if (tab->position == QStyleOptionToolBoxV2::Middle)
never evaluated: tab->position == QStyleOptionToolBoxV2::Middle
0
1971 extraClass |= PseudoClass_Middle;
never executed: extraClass |= PseudoClass_Middle;
0
1972 -
1973 if (tab->selectedPosition == QStyleOptionToolBoxV2::NextIsSelected)
never evaluated: tab->selectedPosition == QStyleOptionToolBoxV2::NextIsSelected
0
1974 extraClass |= PseudoClass_NextSelected;
never executed: extraClass |= PseudoClass_NextSelected;
0
1975 else if (tab->selectedPosition == QStyleOptionToolBoxV2::PreviousIsSelected)
never evaluated: tab->selectedPosition == QStyleOptionToolBoxV2::PreviousIsSelected
0
1976 extraClass |= PseudoClass_PreviousSelected;
never executed: extraClass |= PseudoClass_PreviousSelected;
0
1977 } -
1978#endif // QT_NO_TOOLBOX -
1979#ifndef QT_NO_DOCKWIDGET -
1980 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:67
0-67
1981 if (dw->verticalTitleBar)
never evaluated: dw->verticalTitleBar
0
1982 extraClass |= PseudoClass_Vertical;
never executed: extraClass |= PseudoClass_Vertical;
0
1983 else -
1984 extraClass |= PseudoClass_Horizontal;
never executed: extraClass |= PseudoClass_Horizontal;
0
1985 if (dw->closable)
never evaluated: dw->closable
0
1986 extraClass |= PseudoClass_Closable;
never executed: extraClass |= PseudoClass_Closable;
0
1987 if (dw->floatable)
never evaluated: dw->floatable
0
1988 extraClass |= PseudoClass_Floatable;
never executed: extraClass |= PseudoClass_Floatable;
0
1989 if (dw->movable)
never evaluated: dw->movable
0
1990 extraClass |= PseudoClass_Movable;
never executed: extraClass |= PseudoClass_Movable;
0
1991 }
never executed: }
0
1992#endif // QT_NO_DOCKWIDGET -
1993#ifndef QT_NO_ITEMVIEWS -
1994 else if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) {
partially evaluated: const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:67
0-67
1995 if (vopt->features & QStyleOptionViewItem::Alternate)
never evaluated: vopt->features & QStyleOptionViewItem::Alternate
0
1996 extraClass |= PseudoClass_Alternate;
never executed: extraClass |= PseudoClass_Alternate;
0
1997 if (vopt->viewItemPosition == QStyleOptionViewItem::OnlyOne)
never evaluated: vopt->viewItemPosition == QStyleOptionViewItem::OnlyOne
0
1998 extraClass |= PseudoClass_OnlyOne;
never executed: extraClass |= PseudoClass_OnlyOne;
0
1999 else if (vopt->viewItemPosition == QStyleOptionViewItem::Beginning)
never evaluated: vopt->viewItemPosition == QStyleOptionViewItem::Beginning
0
2000 extraClass |= PseudoClass_First;
never executed: extraClass |= PseudoClass_First;
0
2001 else if (vopt->viewItemPosition == QStyleOptionViewItem::End)
never evaluated: vopt->viewItemPosition == QStyleOptionViewItem::End
0
2002 extraClass |= PseudoClass_Last;
never executed: extraClass |= PseudoClass_Last;
0
2003 else if (vopt->viewItemPosition == QStyleOptionViewItem::Middle)
never evaluated: vopt->viewItemPosition == QStyleOptionViewItem::Middle
0
2004 extraClass |= PseudoClass_Middle;
never executed: extraClass |= PseudoClass_Middle;
0
2005 -
2006 } -
2007#endif -
2008#ifndef QT_NO_LINEEDIT -
2009 // LineEdit sets Sunken flag to indicate Sunken frame (argh) -
2010 if (const QLineEdit *lineEdit = qobject_cast<const QLineEdit *>(obj)) {
evaluated: const QLineEdit *lineEdit = qobject_cast<const QLineEdit *>(obj)
TRUEFALSE
yes
Evaluation Count:19
yes
Evaluation Count:67
19-67
2011 state &= ~QStyle::State_Sunken;
executed (the execution status of this line is deduced): state &= ~QStyle::State_Sunken;
-
2012 if (lineEdit->hasFrame()) {
partially evaluated: lineEdit->hasFrame()
TRUEFALSE
yes
Evaluation Count:19
no
Evaluation Count:0
0-19
2013 extraClass &= ~PseudoClass_Frameless;
executed (the execution status of this line is deduced): extraClass &= ~PseudoClass_Frameless;
-
2014 } else {
executed: }
Execution Count:19
19
2015 extraClass |= PseudoClass_Frameless;
never executed (the execution status of this line is deduced): extraClass |= PseudoClass_Frameless;
-
2016 }
never executed: }
0
2017 } else -
2018#endif -
2019 if (const QFrame *frm = qobject_cast<const QFrame *>(obj)) {
partially evaluated: const QFrame *frm = qobject_cast<const QFrame *>(obj)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:67
0-67
2020 if (frm->lineWidth() == 0)
never evaluated: frm->lineWidth() == 0
0
2021 extraClass |= PseudoClass_Frameless;
never executed: extraClass |= PseudoClass_Frameless;
0
2022 }
never executed: }
0
2023 } -
2024 -
2025 return renderRule(obj, pseudoElement, pseudoClass(state) | extraClass);
executed: return renderRule(obj, pseudoElement, pseudoClass(state) | extraClass);
Execution Count:91
91
2026} -
2027 -
2028bool QStyleSheetStyle::hasStyleRule(const QObject *obj, int part) const -
2029{ -
2030 QHash<int, bool> &cache = styleSheetCaches->hasStyleRuleCache[obj];
never executed (the execution status of this line is deduced): QHash<int, bool> &cache = styleSheetCaches->hasStyleRuleCache[obj];
-
2031 QHash<int, bool>::const_iterator cacheIt = cache.constFind(part);
never executed (the execution status of this line is deduced): QHash<int, bool>::const_iterator cacheIt = cache.constFind(part);
-
2032 if (cacheIt != cache.constEnd())
never evaluated: cacheIt != cache.constEnd()
0
2033 return cacheIt.value();
never executed: return cacheIt.value();
0
2034 -
2035 if (!initObject(obj))
never evaluated: !initObject(obj)
0
2036 return false;
never executed: return false;
0
2037 -
2038 -
2039 const QVector<StyleRule> &rules = styleRules(obj);
never executed (the execution status of this line is deduced): const QVector<StyleRule> &rules = styleRules(obj);
-
2040 if (part == PseudoElement_None) {
never evaluated: part == PseudoElement_None
0
2041 bool result = obj && !rules.isEmpty();
never evaluated: obj
never evaluated: !rules.isEmpty()
0
2042 cache[part] = result;
never executed (the execution status of this line is deduced): cache[part] = result;
-
2043 return result;
never executed: return result;
0
2044 } -
2045 -
2046 QString pseudoElement = QLatin1String(knownPseudoElements[part].name);
never executed (the execution status of this line is deduced): QString pseudoElement = QLatin1String(knownPseudoElements[part].name);
-
2047 QVector<Declaration> declarations;
never executed (the execution status of this line is deduced): QVector<Declaration> declarations;
-
2048 for (int i = 0; i < rules.count(); i++) {
never evaluated: i < rules.count()
0
2049 const Selector& selector = rules.at(i).selectors.at(0);
never executed (the execution status of this line is deduced): const Selector& selector = rules.at(i).selectors.at(0);
-
2050 if (pseudoElement.compare(selector.pseudoElement(), Qt::CaseInsensitive) == 0) {
never evaluated: pseudoElement.compare(selector.pseudoElement(), Qt::CaseInsensitive) == 0
0
2051 cache[part] = true;
never executed (the execution status of this line is deduced): cache[part] = true;
-
2052 return true;
never executed: return true;
0
2053 } -
2054 }
never executed: }
0
2055 -
2056 cache[part] = false;
never executed (the execution status of this line is deduced): cache[part] = false;
-
2057 return false;
never executed: return false;
0
2058} -
2059 -
2060static Origin defaultOrigin(int pe) -
2061{ -
2062 switch (pe) { -
2063 case PseudoElement_ScrollBarAddPage: -
2064 case PseudoElement_ScrollBarSubPage: -
2065 case PseudoElement_ScrollBarAddLine: -
2066 case PseudoElement_ScrollBarSubLine: -
2067 case PseudoElement_ScrollBarFirst: -
2068 case PseudoElement_ScrollBarLast: -
2069 case PseudoElement_GroupBoxTitle: -
2070 case PseudoElement_GroupBoxIndicator: // never used -
2071 case PseudoElement_ToolButtonMenu: -
2072 case PseudoElement_SliderAddPage: -
2073 case PseudoElement_SliderSubPage: -
2074 return Origin_Border;
never executed: return Origin_Border;
0
2075 -
2076 case PseudoElement_SpinBoxUpButton: -
2077 case PseudoElement_SpinBoxDownButton: -
2078 case PseudoElement_PushButtonMenuIndicator: -
2079 case PseudoElement_ComboBoxDropDown: -
2080 case PseudoElement_ToolButtonDownArrow: -
2081 case PseudoElement_MenuCheckMark: -
2082 case PseudoElement_MenuIcon: -
2083 case PseudoElement_MenuRightArrow: -
2084 return Origin_Padding;
never executed: return Origin_Padding;
0
2085 -
2086 case PseudoElement_Indicator: -
2087 case PseudoElement_ExclusiveIndicator: -
2088 case PseudoElement_ComboBoxArrow: -
2089 case PseudoElement_ScrollBarSlider: -
2090 case PseudoElement_ScrollBarUpArrow: -
2091 case PseudoElement_ScrollBarDownArrow: -
2092 case PseudoElement_ScrollBarLeftArrow: -
2093 case PseudoElement_ScrollBarRightArrow: -
2094 case PseudoElement_SpinBoxUpArrow: -
2095 case PseudoElement_SpinBoxDownArrow: -
2096 case PseudoElement_ToolButtonMenuArrow: -
2097 case PseudoElement_HeaderViewUpArrow: -
2098 case PseudoElement_HeaderViewDownArrow: -
2099 case PseudoElement_SliderGroove: -
2100 case PseudoElement_SliderHandle: -
2101 return Origin_Content;
never executed: return Origin_Content;
0
2102 -
2103 default: -
2104 return Origin_Margin;
never executed: return Origin_Margin;
0
2105 } -
2106}
never executed: }
0
2107 -
2108static Qt::Alignment defaultPosition(int pe) -
2109{ -
2110 switch (pe) { -
2111 case PseudoElement_Indicator: -
2112 case PseudoElement_ExclusiveIndicator: -
2113 case PseudoElement_MenuCheckMark: -
2114 case PseudoElement_MenuIcon: -
2115 return Qt::AlignLeft | Qt::AlignVCenter;
never executed: return Qt::AlignLeft | Qt::AlignVCenter;
0
2116 -
2117 case PseudoElement_ScrollBarAddLine: -
2118 case PseudoElement_ScrollBarLast: -
2119 case PseudoElement_SpinBoxDownButton: -
2120 case PseudoElement_PushButtonMenuIndicator: -
2121 case PseudoElement_ToolButtonDownArrow: -
2122 return Qt::AlignRight | Qt::AlignBottom;
never executed: return Qt::AlignRight | Qt::AlignBottom;
0
2123 -
2124 case PseudoElement_ScrollBarSubLine: -
2125 case PseudoElement_ScrollBarFirst: -
2126 case PseudoElement_SpinBoxUpButton: -
2127 case PseudoElement_ComboBoxDropDown: -
2128 case PseudoElement_ToolButtonMenu: -
2129 case PseudoElement_DockWidgetCloseButton: -
2130 case PseudoElement_DockWidgetFloatButton: -
2131 return Qt::AlignRight | Qt::AlignTop;
never executed: return Qt::AlignRight | Qt::AlignTop;
0
2132 -
2133 case PseudoElement_ScrollBarUpArrow: -
2134 case PseudoElement_ScrollBarDownArrow: -
2135 case PseudoElement_ScrollBarLeftArrow: -
2136 case PseudoElement_ScrollBarRightArrow: -
2137 case PseudoElement_SpinBoxUpArrow: -
2138 case PseudoElement_SpinBoxDownArrow: -
2139 case PseudoElement_ComboBoxArrow: -
2140 case PseudoElement_DownArrow: -
2141 case PseudoElement_ToolButtonMenuArrow: -
2142 case PseudoElement_SliderGroove: -
2143 return Qt::AlignCenter;
never executed: return Qt::AlignCenter;
0
2144 -
2145 case PseudoElement_GroupBoxTitle: -
2146 case PseudoElement_GroupBoxIndicator: // never used -
2147 return Qt::AlignLeft | Qt::AlignTop;
never executed: return Qt::AlignLeft | Qt::AlignTop;
0
2148 -
2149 case PseudoElement_HeaderViewUpArrow: -
2150 case PseudoElement_HeaderViewDownArrow: -
2151 case PseudoElement_MenuRightArrow: -
2152 return Qt::AlignRight | Qt::AlignVCenter;
never executed: return Qt::AlignRight | Qt::AlignVCenter;
0
2153 -
2154 default: -
2155 return 0;
never executed: return 0;
0
2156 } -
2157}
never executed: }
0
2158 -
2159QSize QStyleSheetStyle::defaultSize(const QWidget *w, QSize sz, const QRect& rect, int pe) const -
2160{ -
2161 QStyle *base = baseStyle();
never executed (the execution status of this line is deduced): QStyle *base = baseStyle();
-
2162 -
2163 switch (pe) { -
2164 case PseudoElement_Indicator: -
2165 case PseudoElement_MenuCheckMark: -
2166 if (sz.width() == -1)
never evaluated: sz.width() == -1
0
2167 sz.setWidth(base->pixelMetric(PM_IndicatorWidth, 0, w));
never executed: sz.setWidth(base->pixelMetric(PM_IndicatorWidth, 0, w));
0
2168 if (sz.height() == -1)
never evaluated: sz.height() == -1
0
2169 sz.setHeight(base->pixelMetric(PM_IndicatorHeight, 0, w));
never executed: sz.setHeight(base->pixelMetric(PM_IndicatorHeight, 0, w));
0
2170 break;
never executed: break;
0
2171 -
2172 case PseudoElement_ExclusiveIndicator: -
2173 case PseudoElement_GroupBoxIndicator: -
2174 if (sz.width() == -1)
never evaluated: sz.width() == -1
0
2175 sz.setWidth(base->pixelMetric(PM_ExclusiveIndicatorWidth, 0, w));
never executed: sz.setWidth(base->pixelMetric(PM_ExclusiveIndicatorWidth, 0, w));
0
2176 if (sz.height() == -1)
never evaluated: sz.height() == -1
0
2177 sz.setHeight(base->pixelMetric(PM_ExclusiveIndicatorHeight, 0, w));
never executed: sz.setHeight(base->pixelMetric(PM_ExclusiveIndicatorHeight, 0, w));
0
2178 break;
never executed: break;
0
2179 -
2180 case PseudoElement_PushButtonMenuIndicator: { -
2181 int pm = base->pixelMetric(PM_MenuButtonIndicator, 0, w);
never executed (the execution status of this line is deduced): int pm = base->pixelMetric(PM_MenuButtonIndicator, 0, w);
-
2182 if (sz.width() == -1)
never evaluated: sz.width() == -1
0
2183 sz.setWidth(pm);
never executed: sz.setWidth(pm);
0
2184 if (sz.height() == -1)
never evaluated: sz.height() == -1
0
2185 sz.setHeight(pm);
never executed: sz.setHeight(pm);
0
2186 } -
2187 break;
never executed: break;
0
2188 -
2189 case PseudoElement_ComboBoxDropDown: -
2190 if (sz.width() == -1)
never evaluated: sz.width() == -1
0
2191 sz.setWidth(16);
never executed: sz.setWidth(16);
0
2192 break;
never executed: break;
0
2193 -
2194 case PseudoElement_ComboBoxArrow: -
2195 case PseudoElement_DownArrow: -
2196 case PseudoElement_ToolButtonMenuArrow: -
2197 case PseudoElement_ToolButtonDownArrow: -
2198 case PseudoElement_MenuRightArrow: -
2199 if (sz.width() == -1)
never evaluated: sz.width() == -1
0
2200 sz.setWidth(13);
never executed: sz.setWidth(13);
0
2201 if (sz.height() == -1)
never evaluated: sz.height() == -1
0
2202 sz.setHeight(13);
never executed: sz.setHeight(13);
0
2203 break;
never executed: break;
0
2204 -
2205 case PseudoElement_SpinBoxUpButton: -
2206 case PseudoElement_SpinBoxDownButton: -
2207 if (sz.width() == -1)
never evaluated: sz.width() == -1
0
2208 sz.setWidth(16);
never executed: sz.setWidth(16);
0
2209 if (sz.height() == -1)
never evaluated: sz.height() == -1
0
2210 sz.setHeight(rect.height()/2);
never executed: sz.setHeight(rect.height()/2);
0
2211 break;
never executed: break;
0
2212 -
2213 case PseudoElement_ToolButtonMenu: -
2214 if (sz.width() == -1)
never evaluated: sz.width() == -1
0
2215 sz.setWidth(base->pixelMetric(PM_MenuButtonIndicator, 0, w));
never executed: sz.setWidth(base->pixelMetric(PM_MenuButtonIndicator, 0, w));
0
2216 break;
never executed: break;
0
2217 -
2218 case PseudoElement_HeaderViewUpArrow: -
2219 case PseudoElement_HeaderViewDownArrow: { -
2220 int pm = base->pixelMetric(PM_HeaderMargin, 0, w);
never executed (the execution status of this line is deduced): int pm = base->pixelMetric(PM_HeaderMargin, 0, w);
-
2221 if (sz.width() == -1)
never evaluated: sz.width() == -1
0
2222 sz.setWidth(pm);
never executed: sz.setWidth(pm);
0
2223 if (sz.height() == 1)
never evaluated: sz.height() == 1
0
2224 sz.setHeight(pm);
never executed: sz.setHeight(pm);
0
2225 break;
never executed: break;
0
2226 } -
2227 -
2228 case PseudoElement_ScrollBarFirst: -
2229 case PseudoElement_ScrollBarLast: -
2230 case PseudoElement_ScrollBarAddLine: -
2231 case PseudoElement_ScrollBarSubLine: -
2232 case PseudoElement_ScrollBarSlider: { -
2233 int pm = pixelMetric(QStyle::PM_ScrollBarExtent, 0, w);
never executed (the execution status of this line is deduced): int pm = pixelMetric(QStyle::PM_ScrollBarExtent, 0, w);
-
2234 if (sz.width() == -1)
never evaluated: sz.width() == -1
0
2235 sz.setWidth(pm);
never executed: sz.setWidth(pm);
0
2236 if (sz.height() == -1)
never evaluated: sz.height() == -1
0
2237 sz.setHeight(pm);
never executed: sz.setHeight(pm);
0
2238 break;
never executed: break;
0
2239 } -
2240 -
2241 case PseudoElement_DockWidgetCloseButton: -
2242 case PseudoElement_DockWidgetFloatButton: { -
2243 int iconSize = pixelMetric(PM_SmallIconSize, 0, w);
never executed (the execution status of this line is deduced): int iconSize = pixelMetric(PM_SmallIconSize, 0, w);
-
2244 return QSize(iconSize, iconSize);
never executed: return QSize(iconSize, iconSize);
0
2245 } -
2246 -
2247 default: -
2248 break;
never executed: break;
0
2249 } -
2250 -
2251 // expand to rectangle -
2252 if (sz.height() == -1)
never evaluated: sz.height() == -1
0
2253 sz.setHeight(rect.height());
never executed: sz.setHeight(rect.height());
0
2254 if (sz.width() == -1)
never evaluated: sz.width() == -1
0
2255 sz.setWidth(rect.width());
never executed: sz.setWidth(rect.width());
0
2256 -
2257 return sz;
never executed: return sz;
0
2258} -
2259 -
2260static PositionMode defaultPositionMode(int pe) -
2261{ -
2262 switch (pe) { -
2263 case PseudoElement_ScrollBarFirst: -
2264 case PseudoElement_ScrollBarLast: -
2265 case PseudoElement_ScrollBarAddLine: -
2266 case PseudoElement_ScrollBarSubLine: -
2267 case PseudoElement_ScrollBarAddPage: -
2268 case PseudoElement_ScrollBarSubPage: -
2269 case PseudoElement_ScrollBarSlider: -
2270 case PseudoElement_SliderGroove: -
2271 case PseudoElement_SliderHandle: -
2272 case PseudoElement_TabWidgetPane: -
2273 return PositionMode_Absolute;
never executed: return PositionMode_Absolute;
0
2274 default: -
2275 return PositionMode_Static;
never executed: return PositionMode_Static;
0
2276 } -
2277}
never executed: }
0
2278 -
2279QRect QStyleSheetStyle::positionRect(const QWidget *w, const QRenderRule &rule2, int pe, -
2280 const QRect &originRect, Qt::LayoutDirection dir) const -
2281{ -
2282 const QStyleSheetPositionData *p = rule2.position();
never executed (the execution status of this line is deduced): const QStyleSheetPositionData *p = rule2.position();
-
2283 PositionMode mode = (p && p->mode != PositionMode_Unknown) ? p->mode : defaultPositionMode(pe);
never evaluated: p
never evaluated: p->mode != PositionMode_Unknown
0
2284 Qt::Alignment position = (p && p->position != 0) ? p->position : defaultPosition(pe);
never evaluated: p
never evaluated: p->position != 0
0
2285 QRect r;
never executed (the execution status of this line is deduced): QRect r;
-
2286 -
2287 if (mode != PositionMode_Absolute) {
never evaluated: mode != PositionMode_Absolute
0
2288 QSize sz = defaultSize(w, rule2.size(), originRect, pe);
never executed (the execution status of this line is deduced): QSize sz = defaultSize(w, rule2.size(), originRect, pe);
-
2289 sz = sz.expandedTo(rule2.minimumContentsSize());
never executed (the execution status of this line is deduced): sz = sz.expandedTo(rule2.minimumContentsSize());
-
2290 r = QStyle::alignedRect(dir, position, sz, originRect);
never executed (the execution status of this line is deduced): r = QStyle::alignedRect(dir, position, sz, originRect);
-
2291 if (p) {
never evaluated: p
0
2292 int left = p->left ? p->left : -p->right;
never evaluated: p->left
0
2293 int top = p->top ? p->top : -p->bottom;
never evaluated: p->top
0
2294 r.translate(dir == Qt::LeftToRight ? left : -left, top);
never executed (the execution status of this line is deduced): r.translate(dir == Qt::LeftToRight ? left : -left, top);
-
2295 }
never executed: }
0
2296 } else {
never executed: }
0
2297 r = p ? originRect.adjusted(dir == Qt::LeftToRight ? p->left : p->right, p->top,
never evaluated: p
0
2298 dir == Qt::LeftToRight ? -p->right : -p->left, -p->bottom)
never executed (the execution status of this line is deduced): dir == Qt::LeftToRight ? -p->right : -p->left, -p->bottom)
-
2299 : originRect;
never executed (the execution status of this line is deduced): : originRect;
-
2300 if (rule2.hasContentsSize()) {
never evaluated: rule2.hasContentsSize()
0
2301 QSize sz = rule2.size().expandedTo(rule2.minimumContentsSize());
never executed (the execution status of this line is deduced): QSize sz = rule2.size().expandedTo(rule2.minimumContentsSize());
-
2302 if (sz.width() == -1) sz.setWidth(r.width());
never executed: sz.setWidth(r.width());
never evaluated: sz.width() == -1
0
2303 if (sz.height() == -1) sz.setHeight(r.height());
never executed: sz.setHeight(r.height());
never evaluated: sz.height() == -1
0
2304 r = QStyle::alignedRect(dir, position, sz, r);
never executed (the execution status of this line is deduced): r = QStyle::alignedRect(dir, position, sz, r);
-
2305 }
never executed: }
0
2306 }
never executed: }
0
2307 return r;
never executed: return r;
0
2308} -
2309 -
2310QRect QStyleSheetStyle::positionRect(const QWidget *w, const QRenderRule& rule1, const QRenderRule& rule2, int pe, -
2311 const QRect& rect, Qt::LayoutDirection dir) const -
2312{ -
2313 const QStyleSheetPositionData *p = rule2.position();
never executed (the execution status of this line is deduced): const QStyleSheetPositionData *p = rule2.position();
-
2314 Origin origin = (p && p->origin != Origin_Unknown) ? p->origin : defaultOrigin(pe);
never evaluated: p
never evaluated: p->origin != Origin_Unknown
0
2315 QRect originRect = rule1.originRect(rect, origin);
never executed (the execution status of this line is deduced): QRect originRect = rule1.originRect(rect, origin);
-
2316 return positionRect(w, rule2, pe, originRect, dir);
never executed: return positionRect(w, rule2, pe, originRect, dir);
0
2317} -
2318 -
2319 -
2320/** \internal -
2321 For widget that have an embedded widget (such as combobox) return that embedded widget. -
2322 otherwise return the widget itself -
2323 */ -
2324static QWidget *embeddedWidget(QWidget *w) -
2325{ -
2326#ifndef QT_NO_COMBOBOX -
2327 if (QComboBox *cmb = qobject_cast<QComboBox *>(w)) {
partially evaluated: QComboBox *cmb = qobject_cast<QComboBox *>(w)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
0-6
2328 if (cmb->isEditable())
never evaluated: cmb->isEditable()
0
2329 return cmb->lineEdit();
never executed: return cmb->lineEdit();
0
2330 else -
2331 return cmb;
never executed: return cmb;
0
2332 } -
2333#endif -
2334 -
2335#ifndef QT_NO_SPINBOX -
2336 if (QAbstractSpinBox *sb = qobject_cast<QAbstractSpinBox *>(w))
partially evaluated: QAbstractSpinBox *sb = qobject_cast<QAbstractSpinBox *>(w)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
0-6
2337 return sb->findChild<QLineEdit *>();
never executed: return sb->findChild<QLineEdit *>();
0
2338#endif -
2339 -
2340#ifndef QT_NO_SCROLLAREA -
2341 if (QAbstractScrollArea *sa = qobject_cast<QAbstractScrollArea *>(w))
partially evaluated: QAbstractScrollArea *sa = qobject_cast<QAbstractScrollArea *>(w)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
0-6
2342 return sa->viewport();
never executed: return sa->viewport();
0
2343#endif -
2344 -
2345 return w;
executed: return w;
Execution Count:6
6
2346} -
2347 -
2348/** \internal -
2349 in case w is an embedded widget, return the container widget -
2350 (i.e, the widget for which the rules actualy apply) -
2351 (exemple, if w is a lineedit embedded in a combobox, return the combobox) -
2352 -
2353 if w is not embedded, return w itself -
2354*/ -
2355static QWidget *containerWidget(const QWidget *w) -
2356{ -
2357#ifndef QT_NO_LINEEDIT -
2358 if (qobject_cast<const QLineEdit *>(w)) {
evaluated: qobject_cast<const QLineEdit *>(w)
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:26
6-26
2359 //if the QLineEdit is an embeddedWidget, we need the rule of the real widget -
2360#ifndef QT_NO_COMBOBOX -
2361 if (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
2362 return w->parentWidget();
never executed: return w->parentWidget();
0
2363#endif -
2364#ifndef QT_NO_SPINBOX -
2365 if (qobject_cast<const QAbstractSpinBox *>(w->parentWidget()))
evaluated: qobject_cast<const QAbstractSpinBox *>(w->parentWidget())
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:4
2-4
2366 return w->parentWidget();
executed: return w->parentWidget();
Execution Count:2
2
2367#endif -
2368 }
executed: }
Execution Count:4
4
2369#endif // QT_NO_LINEEDIT -
2370 -
2371#ifndef QT_NO_SCROLLAREA -
2372 if (const QAbstractScrollArea *sa = qobject_cast<const QAbstractScrollArea *>(w->parentWidget())) {
partially evaluated: const QAbstractScrollArea *sa = qobject_cast<const QAbstractScrollArea *>(w->parentWidget())
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:30
0-30
2373 if (sa->viewport() == w)
never evaluated: sa->viewport() == w
0
2374 return w->parentWidget();
never executed: return w->parentWidget();
0
2375 }
never executed: }
0
2376#endif -
2377 -
2378 return const_cast<QWidget *>(w);
executed: return const_cast<QWidget *>(w);
Execution Count:30
30
2379} -
2380 -
2381/** \internal -
2382 returns true if the widget can NOT be styled directly -
2383 */ -
2384static bool unstylable(const QWidget *w) -
2385{ -
2386 if (w->windowType() == Qt::Desktop)
partially evaluated: w->windowType() == Qt::Desktop
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:40
0-40
2387 return true;
never executed: return true;
0
2388 -
2389 if (!w->styleSheet().isEmpty())
evaluated: !w->styleSheet().isEmpty()
TRUEFALSE
yes
Evaluation Count:13
yes
Evaluation Count:27
13-27
2390 return false;
executed: return false;
Execution Count:13
13
2391 -
2392 if (containerWidget(w) != w)
evaluated: containerWidget(w) != w
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:25
2-25
2393 return true;
executed: return true;
Execution Count:2
2
2394 -
2395#ifndef QT_NO_FRAME -
2396 // detect QComboBoxPrivateContainer -
2397 else if (qobject_cast<const QFrame *>(w)) {
partially evaluated: qobject_cast<const QFrame *>(w)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:25
0-25
2398 if (0
never evaluated: 0
0
2399#ifndef QT_NO_COMBOBOX
never executed (the execution status of this line is deduced):
-
2400 || qobject_cast<const QComboBox *>(w->parentWidget())
never evaluated: qobject_cast<const QComboBox *>(w->parentWidget())
0
2401#endif -
2402 ) -
2403 return true;
never executed: return true;
0
2404 }
never executed: }
0
2405#endif -
2406 return false;
executed: return false;
Execution Count:25
25
2407} -
2408 -
2409static quint64 extendedPseudoClass(const QWidget *w) -
2410{ -
2411 quint64 pc = w->isWindow() ? quint64(PseudoClass_Window) : 0;
evaluated: w->isWindow()
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:12
5-12
2412 if (const QAbstractSlider *slider = qobject_cast<const QAbstractSlider *>(w)) {
partially evaluated: const QAbstractSlider *slider = qobject_cast<const QAbstractSlider *>(w)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:17
0-17
2413 pc |= ((slider->orientation() == Qt::Vertical) ? PseudoClass_Vertical : PseudoClass_Horizontal);
never evaluated: (slider->orientation() == Qt::Vertical)
0
2414 } else
never executed: }
0
2415#ifndef QT_NO_COMBOBOX -
2416 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:17
0-17
2417 if (combo->isEditable())
never evaluated: combo->isEditable()
0
2418 pc |= (combo->isEditable() ? PseudoClass_Editable : PseudoClass_ReadOnly);
never executed: pc |= (combo->isEditable() ? PseudoClass_Editable : PseudoClass_ReadOnly);
never evaluated: combo->isEditable()
0
2419 } else
never executed: }
0
2420#endif -
2421#ifndef QT_NO_LINEEDIT -
2422 if (const QLineEdit *edit = qobject_cast<const QLineEdit *>(w)) {
evaluated: const QLineEdit *edit = qobject_cast<const QLineEdit *>(w)
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:5
5-12
2423 pc |= (edit->isReadOnly() ? PseudoClass_ReadOnly : PseudoClass_Editable);
partially evaluated: edit->isReadOnly()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12
0-12
2424 } else
executed: }
Execution Count:12
12
2425#endif -
2426 { } // required for the above ifdef'ery to work
executed: }
Execution Count:5
5
2427 return pc;
executed: return pc;
Execution Count:17
17
2428} -
2429 -
2430// sets up the geometry of the widget. We set a dynamic property when -
2431// we modify the min/max size of the widget. The min/max size is restored -
2432// to their original value when a new stylesheet that does not contain -
2433// the CSS properties is set and when the widget has this dynamic property set. -
2434// This way we don't trample on users who had setup a min/max size in code and -
2435// don't use stylesheets at all. -
2436void QStyleSheetStyle::setGeometry(QWidget *w) -
2437{ -
2438 QRenderRule rule = renderRule(w, PseudoElement_None, PseudoClass_Enabled | extendedPseudoClass(w));
executed (the execution status of this line is deduced): QRenderRule rule = renderRule(w, PseudoElement_None, PseudoClass_Enabled | extendedPseudoClass(w));
-
2439 const QStyleSheetGeometryData *geo = rule.geometry();
executed (the execution status of this line is deduced): const QStyleSheetGeometryData *geo = rule.geometry();
-
2440 if (w->property("_q_stylesheet_minw").toBool()
partially evaluated: w->property("_q_stylesheet_minw").toBool()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
2441 && ((!rule.hasGeometry() || geo->minWidth == -1))) {
never evaluated: !rule.hasGeometry()
never evaluated: geo->minWidth == -1
0
2442 w->setMinimumWidth(0);
never executed (the execution status of this line is deduced): w->setMinimumWidth(0);
-
2443 w->setProperty("_q_stylesheet_minw", QVariant());
never executed (the execution status of this line is deduced): w->setProperty("_q_stylesheet_minw", QVariant());
-
2444 }
never executed: }
0
2445 if (w->property("_q_stylesheet_minh").toBool()
partially evaluated: w->property("_q_stylesheet_minh").toBool()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
2446 && ((!rule.hasGeometry() || geo->minHeight == -1))) {
never evaluated: !rule.hasGeometry()
never evaluated: geo->minHeight == -1
0
2447 w->setMinimumHeight(0);
never executed (the execution status of this line is deduced): w->setMinimumHeight(0);
-
2448 w->setProperty("_q_stylesheet_minh", QVariant());
never executed (the execution status of this line is deduced): w->setProperty("_q_stylesheet_minh", QVariant());
-
2449 }
never executed: }
0
2450 if (w->property("_q_stylesheet_maxw").toBool()
partially evaluated: w->property("_q_stylesheet_maxw").toBool()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
2451 && ((!rule.hasGeometry() || geo->maxWidth == -1))) {
never evaluated: !rule.hasGeometry()
never evaluated: geo->maxWidth == -1
0
2452 w->setMaximumWidth(QWIDGETSIZE_MAX);
never executed (the execution status of this line is deduced): w->setMaximumWidth(((1<<24)-1));
-
2453 w->setProperty("_q_stylesheet_maxw", QVariant());
never executed (the execution status of this line is deduced): w->setProperty("_q_stylesheet_maxw", QVariant());
-
2454 }
never executed: }
0
2455 if (w->property("_q_stylesheet_maxh").toBool()
partially evaluated: w->property("_q_stylesheet_maxh").toBool()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
2456 && ((!rule.hasGeometry() || geo->maxHeight == -1))) {
never evaluated: !rule.hasGeometry()
never evaluated: geo->maxHeight == -1
0
2457 w->setMaximumHeight(QWIDGETSIZE_MAX);
never executed (the execution status of this line is deduced): w->setMaximumHeight(((1<<24)-1));
-
2458 w->setProperty("_q_stylesheet_maxh", QVariant());
never executed (the execution status of this line is deduced): w->setProperty("_q_stylesheet_maxh", QVariant());
-
2459 }
never executed: }
0
2460 -
2461 -
2462 if (rule.hasGeometry()) {
partially evaluated: rule.hasGeometry()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
2463 if (geo->minWidth != -1) {
never evaluated: geo->minWidth != -1
0
2464 w->setProperty("_q_stylesheet_minw", true);
never executed (the execution status of this line is deduced): w->setProperty("_q_stylesheet_minw", true);
-
2465 w->setMinimumWidth(rule.boxSize(QSize(qMax(geo->width, geo->minWidth), 0)).width());
never executed (the execution status of this line is deduced): w->setMinimumWidth(rule.boxSize(QSize(qMax(geo->width, geo->minWidth), 0)).width());
-
2466 }
never executed: }
0
2467 if (geo->minHeight != -1) {
never evaluated: geo->minHeight != -1
0
2468 w->setProperty("_q_stylesheet_minh", true);
never executed (the execution status of this line is deduced): w->setProperty("_q_stylesheet_minh", true);
-
2469 w->setMinimumHeight(rule.boxSize(QSize(0, qMax(geo->height, geo->minHeight))).height());
never executed (the execution status of this line is deduced): w->setMinimumHeight(rule.boxSize(QSize(0, qMax(geo->height, geo->minHeight))).height());
-
2470 }
never executed: }
0
2471 if (geo->maxWidth != -1) {
never evaluated: geo->maxWidth != -1
0
2472 w->setProperty("_q_stylesheet_maxw", true);
never executed (the execution status of this line is deduced): w->setProperty("_q_stylesheet_maxw", true);
-
2473 w->setMaximumWidth(rule.boxSize(QSize(qMin(geo->width == -1 ? QWIDGETSIZE_MAX : geo->width,
never executed (the execution status of this line is deduced): w->setMaximumWidth(rule.boxSize(QSize(qMin(geo->width == -1 ? ((1<<24)-1) : geo->width,
-
2474 geo->maxWidth == -1 ? QWIDGETSIZE_MAX : geo->maxWidth), 0)).width());
never executed (the execution status of this line is deduced): geo->maxWidth == -1 ? ((1<<24)-1) : geo->maxWidth), 0)).width());
-
2475 }
never executed: }
0
2476 if (geo->maxHeight != -1) {
never evaluated: geo->maxHeight != -1
0
2477 w->setProperty("_q_stylesheet_maxh", true);
never executed (the execution status of this line is deduced): w->setProperty("_q_stylesheet_maxh", true);
-
2478 w->setMaximumHeight(rule.boxSize(QSize(0, qMin(geo->height == -1 ? QWIDGETSIZE_MAX : geo->height,
never executed (the execution status of this line is deduced): w->setMaximumHeight(rule.boxSize(QSize(0, qMin(geo->height == -1 ? ((1<<24)-1) : geo->height,
-
2479 geo->maxHeight == -1 ? QWIDGETSIZE_MAX : geo->maxHeight))).height());
never executed (the execution status of this line is deduced): geo->maxHeight == -1 ? ((1<<24)-1) : geo->maxHeight))).height());
-
2480 }
never executed: }
0
2481 }
never executed: }
0
2482}
executed: }
Execution Count:3
3
2483 -
2484void QStyleSheetStyle::setProperties(QWidget *w) -
2485{ -
2486 // The final occurrence of each property is authoritative. -
2487 // Set value for each property in the order of property final occurrence -
2488 // since properties interact. -
2489 -
2490 const QVector<Declaration> decls = declarations(styleRules(w), QString());
executed (the execution status of this line is deduced): const QVector<Declaration> decls = declarations(styleRules(w), QString());
-
2491 QVector<int> finals; // indices in reverse order of each property's final occurrence
executed (the execution status of this line is deduced): QVector<int> finals;
-
2492 -
2493 { -
2494 // scan decls for final occurrence of each "qproperty" -
2495 QSet<const QString> propertySet;
executed (the execution status of this line is deduced): QSet<const QString> propertySet;
-
2496 for (int i = decls.count() - 1; i >= 0; --i) {
evaluated: i >= 0
TRUEFALSE
yes
Evaluation Count:9
yes
Evaluation Count:3
3-9
2497 const QString property = decls.at(i).d->property;
executed (the execution status of this line is deduced): const QString property = decls.at(i).d->property;
-
2498 if (!property.startsWith(QStringLiteral("qproperty-"), Qt::CaseInsensitive))
partially evaluated: !property.startsWith(QString::fromUtf8("" "qproperty-" "", sizeof("qproperty-") - 1), Qt::CaseInsensitive)
TRUEFALSE
yes
Evaluation Count:9
no
Evaluation Count:0
0-9
2499 continue;
executed: continue;
Execution Count:9
9
2500 if (!propertySet.contains(property)) {
never evaluated: !propertySet.contains(property)
0
2501 propertySet.insert(property);
never executed (the execution status of this line is deduced): propertySet.insert(property);
-
2502 finals.append(i);
never executed (the execution status of this line is deduced): finals.append(i);
-
2503 }
never executed: }
0
2504 }
never executed: }
0
2505 } -
2506 -
2507 for (int i = finals.count() - 1; i >= 0; --i) {
partially evaluated: i >= 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
2508 const Declaration &decl = decls.at(finals[i]);
never executed (the execution status of this line is deduced): const Declaration &decl = decls.at(finals[i]);
-
2509 QString property = decl.d->property;
never executed (the execution status of this line is deduced): QString property = decl.d->property;
-
2510 property.remove(0, 10); // strip "qproperty-"
never executed (the execution status of this line is deduced): property.remove(0, 10);
-
2511 -
2512 const QMetaObject *metaObject = w->metaObject();
never executed (the execution status of this line is deduced): const QMetaObject *metaObject = w->metaObject();
-
2513 int index = metaObject->indexOfProperty(property.toLatin1());
never executed (the execution status of this line is deduced): int index = metaObject->indexOfProperty(property.toLatin1());
-
2514 if (index == -1) {
never evaluated: index == -1
0
2515 qWarning() << w << " does not have a property named " << property;
never executed (the execution status of this line is deduced): QMessageLogger("styles/qstylesheetstyle.cpp", 2515, __PRETTY_FUNCTION__).warning() << w << " does not have a property named " << property;
-
2516 continue;
never executed: continue;
0
2517 } -
2518 const QMetaProperty metaProperty = metaObject->property(index);
never executed (the execution status of this line is deduced): const QMetaProperty metaProperty = metaObject->property(index);
-
2519 if (!metaProperty.isWritable() || !metaProperty.isDesignable()) {
never evaluated: !metaProperty.isWritable()
never evaluated: !metaProperty.isDesignable()
0
2520 qWarning() << w << " cannot design property named " << property;
never executed (the execution status of this line is deduced): QMessageLogger("styles/qstylesheetstyle.cpp", 2520, __PRETTY_FUNCTION__).warning() << w << " cannot design property named " << property;
-
2521 continue;
never executed: continue;
0
2522 } -
2523 -
2524 QVariant v;
never executed (the execution status of this line is deduced): QVariant v;
-
2525 const QVariant value = w->property(property.toLatin1());
never executed (the execution status of this line is deduced): const QVariant value = w->property(property.toLatin1());
-
2526 switch (value.type()) { -
2527 case QVariant::Icon: v = decl.iconValue(); break;
never executed: break;
0
2528 case QVariant::Image: v = QImage(decl.uriValue()); break;
never executed: break;
0
2529 case QVariant::Pixmap: v = QPixmap(decl.uriValue()); break;
never executed: break;
0
2530 case QVariant::Rect: v = decl.rectValue(); break;
never executed: break;
0
2531 case QVariant::Size: v = decl.sizeValue(); break;
never executed: break;
0
2532 case QVariant::Color: v = decl.colorValue(); break;
never executed: break;
0
2533 case QVariant::Brush: v = decl.brushValue(); break;
never executed: break;
0
2534#ifndef QT_NO_SHORTCUT -
2535 case QVariant::KeySequence: v = QKeySequence(decl.d->values.at(0).variant.toString()); break;
never executed: break;
0
2536#endif -
2537 default: v = decl.d->values.at(0).variant; break;
never executed: break;
0
2538 } -
2539 -
2540 w->setProperty(property.toLatin1(), v);
never executed (the execution status of this line is deduced): w->setProperty(property.toLatin1(), v);
-
2541 }
never executed: }
0
2542}
executed: }
Execution Count:3
3
2543 -
2544void QStyleSheetStyle::setPalette(QWidget *w) -
2545{ -
2546 struct RuleRoleMap {
executed (the execution status of this line is deduced): struct RuleRoleMap {
-
2547 int state;
executed (the execution status of this line is deduced): int state;
-
2548 QPalette::ColorGroup group;
executed (the execution status of this line is deduced): QPalette::ColorGroup group;
-
2549 } map[3] = {
executed (the execution status of this line is deduced): } map[3] = {
-
2550 { int(PseudoClass_Active | PseudoClass_Enabled), QPalette::Active },
executed (the execution status of this line is deduced): { int(PseudoClass_Active | PseudoClass_Enabled), QPalette::Active },
-
2551 { PseudoClass_Disabled, QPalette::Disabled },
executed (the execution status of this line is deduced): { PseudoClass_Disabled, QPalette::Disabled },
-
2552 { PseudoClass_Enabled, QPalette::Inactive }
executed (the execution status of this line is deduced): { PseudoClass_Enabled, QPalette::Inactive }
-
2553 };
executed (the execution status of this line is deduced): };
-
2554 -
2555 QPalette p = w->palette();
executed (the execution status of this line is deduced): QPalette p = w->palette();
-
2556 QWidget *ew = embeddedWidget(w);
executed (the execution status of this line is deduced): QWidget *ew = embeddedWidget(w);
-
2557 -
2558 for (int i = 0; i < 3; i++) {
evaluated: i < 3
TRUEFALSE
yes
Evaluation Count:9
yes
Evaluation Count:3
3-9
2559 QRenderRule rule = renderRule(w, PseudoElement_None, map[i].state | extendedPseudoClass(w));
executed (the execution status of this line is deduced): QRenderRule rule = renderRule(w, PseudoElement_None, map[i].state | extendedPseudoClass(w));
-
2560 if (i == 0) {
evaluated: i == 0
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:6
3-6
2561 if (!w->property("_q_styleSheetWidgetFont").isValid()) {
partially evaluated: !w->property("_q_styleSheetWidgetFont").isValid()
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
0-3
2562 saveWidgetFont(w, w->font());
executed (the execution status of this line is deduced): saveWidgetFont(w, w->font());
-
2563 }
executed: }
Execution Count:3
3
2564 updateStyleSheetFont(w);
executed (the execution status of this line is deduced): updateStyleSheetFont(w);
-
2565 if (ew != w)
partially evaluated: ew != w
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
2566 updateStyleSheetFont(ew);
never executed: updateStyleSheetFont(ew);
0
2567 }
executed: }
Execution Count:3
3
2568 -
2569 rule.configurePalette(&p, map[i].group, ew, ew != w);
executed (the execution status of this line is deduced): rule.configurePalette(&p, map[i].group, ew, ew != w);
-
2570 }
executed: }
Execution Count:9
9
2571 -
2572 styleSheetCaches->customPaletteWidgets.insert(w, w->palette());
executed (the execution status of this line is deduced): styleSheetCaches->customPaletteWidgets.insert(w, w->palette());
-
2573 w->setPalette(p);
executed (the execution status of this line is deduced): w->setPalette(p);
-
2574 if (ew != w)
partially evaluated: ew != w
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
2575 ew->setPalette(p);
never executed: ew->setPalette(p);
0
2576}
executed: }
Execution Count:3
3
2577 -
2578void QStyleSheetStyle::unsetPalette(QWidget *w) -
2579{ -
2580 if (styleSheetCaches->customPaletteWidgets.contains(w)) {
evaluated: styleSheetCaches->customPaletteWidgets.contains(w)
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:3
1-3
2581 QPalette p = styleSheetCaches->customPaletteWidgets.value(w);
executed (the execution status of this line is deduced): QPalette p = styleSheetCaches->customPaletteWidgets.value(w);
-
2582 w->setPalette(p);
executed (the execution status of this line is deduced): w->setPalette(p);
-
2583 QWidget *ew = embeddedWidget(w);
executed (the execution status of this line is deduced): QWidget *ew = embeddedWidget(w);
-
2584 if (ew != w)
partially evaluated: ew != w
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
2585 ew->setPalette(p);
never executed: ew->setPalette(p);
0
2586 styleSheetCaches->customPaletteWidgets.remove(w);
executed (the execution status of this line is deduced): styleSheetCaches->customPaletteWidgets.remove(w);
-
2587 }
executed: }
Execution Count:1
1
2588 QVariant oldFont = w->property("_q_styleSheetWidgetFont");
executed (the execution status of this line is deduced): QVariant oldFont = w->property("_q_styleSheetWidgetFont");
-
2589 if (oldFont.isValid()) {
evaluated: oldFont.isValid()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:3
1-3
2590 w->setFont(qvariant_cast<QFont>(oldFont));
executed (the execution status of this line is deduced): w->setFont(qvariant_cast<QFont>(oldFont));
-
2591 }
executed: }
Execution Count:1
1
2592 if (styleSheetCaches->autoFillDisabledWidgets.contains(w)) {
partially evaluated: styleSheetCaches->autoFillDisabledWidgets.contains(w)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4
0-4
2593 embeddedWidget(w)->setAutoFillBackground(true);
never executed (the execution status of this line is deduced): embeddedWidget(w)->setAutoFillBackground(true);
-
2594 styleSheetCaches->autoFillDisabledWidgets.remove(w);
never executed (the execution status of this line is deduced): styleSheetCaches->autoFillDisabledWidgets.remove(w);
-
2595 }
never executed: }
0
2596}
executed: }
Execution Count:4
4
2597 -
2598static void updateObjects(const QList<const QObject *>& objects) -
2599{ -
2600 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
2601 for (int i = 0; i < objects.size(); ++i) {
never evaluated: i < objects.size()
0
2602 const QObject *object = objects.at(i);
never executed (the execution status of this line is deduced): const QObject *object = objects.at(i);
-
2603 styleSheetCaches->styleRulesCache.remove(object);
never executed (the execution status of this line is deduced): styleSheetCaches->styleRulesCache.remove(object);
-
2604 styleSheetCaches->hasStyleRuleCache.remove(object);
never executed (the execution status of this line is deduced): styleSheetCaches->hasStyleRuleCache.remove(object);
-
2605 styleSheetCaches->renderRulesCache.remove(object);
never executed (the execution status of this line is deduced): styleSheetCaches->renderRulesCache.remove(object);
-
2606 }
never executed: }
0
2607 }
never executed: }
0
2608 for (int i = 0; i < objects.size(); ++i) {
never evaluated: i < objects.size()
0
2609 QObject *object = const_cast<QObject *>(objects.at(i));
never executed (the execution status of this line is deduced): QObject *object = const_cast<QObject *>(objects.at(i));
-
2610 if (object == 0)
never evaluated: object == 0
0
2611 continue;
never executed: continue;
0
2612 if (QWidget *widget = qobject_cast<QWidget *>(object))
never evaluated: QWidget *widget = qobject_cast<QWidget *>(object)
0
2613 widget->style()->polish(widget);
never executed: widget->style()->polish(widget);
0
2614 QEvent event(QEvent::StyleChange);
never executed (the execution status of this line is deduced): QEvent event(QEvent::StyleChange);
-
2615 QApplication::sendEvent(object, &event);
never executed (the execution status of this line is deduced): QApplication::sendEvent(object, &event);
-
2616 }
never executed: }
0
2617}
never executed: }
0
2618 -
2619///////////////////////////////////////////////////////////////////////////////////////// -
2620// The stylesheet style -
2621int QStyleSheetStyle::numinstances = 0; -
2622 -
2623QStyleSheetStyle::QStyleSheetStyle(QStyle *base) -
2624 : QWindowsStyle(*new QStyleSheetStylePrivate), base(base), refcount(1) -
2625{ -
2626 ++numinstances;
executed (the execution status of this line is deduced): ++numinstances;
-
2627 if (numinstances == 1) {
evaluated: numinstances == 1
TRUEFALSE
yes
Evaluation Count:14
yes
Evaluation Count:1
1-14
2628 styleSheetCaches = new QStyleSheetStyleCaches;
executed (the execution status of this line is deduced): styleSheetCaches = new QStyleSheetStyleCaches;
-
2629 }
executed: }
Execution Count:14
14
2630}
executed: }
Execution Count:15
15
2631 -
2632QStyleSheetStyle::~QStyleSheetStyle() -
2633{ -
2634 --numinstances;
executed (the execution status of this line is deduced): --numinstances;
-
2635 if (numinstances == 0) {
partially evaluated: numinstances == 0
TRUEFALSE
yes
Evaluation Count:13
no
Evaluation Count:0
0-13
2636 delete styleSheetCaches;
executed (the execution status of this line is deduced): delete styleSheetCaches;
-
2637 }
executed: }
Execution Count:13
13
2638}
executed: }
Execution Count:13
13
2639QStyle *QStyleSheetStyle::baseStyle() const -
2640{ -
2641 if (base)
evaluated: base
TRUEFALSE
yes
Evaluation Count:43
yes
Evaluation Count:275
43-275
2642 return base;
executed: return base;
Execution Count:43
43
2643 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:275
0-275
2644 return me->base;
never executed: return me->base;
0
2645 return QApplication::style();
executed: return QApplication::style();
Execution Count:275
275
2646} -
2647 -
2648void QStyleSheetStyleCaches::objectDestroyed(QObject *o) -
2649{ -
2650 styleRulesCache.remove(o);
executed (the execution status of this line is deduced): styleRulesCache.remove(o);
-
2651 hasStyleRuleCache.remove(o);
executed (the execution status of this line is deduced): hasStyleRuleCache.remove(o);
-
2652 renderRulesCache.remove(o);
executed (the execution status of this line is deduced): renderRulesCache.remove(o);
-
2653 customPaletteWidgets.remove((const QWidget *)o);
executed (the execution status of this line is deduced): customPaletteWidgets.remove((const QWidget *)o);
-
2654 styleSheetCache.remove(o);
executed (the execution status of this line is deduced): styleSheetCache.remove(o);
-
2655 autoFillDisabledWidgets.remove((const QWidget *)o);
executed (the execution status of this line is deduced): autoFillDisabledWidgets.remove((const QWidget *)o);
-
2656}
executed: }
Execution Count:35
35
2657 -
2658void QStyleSheetStyleCaches::styleDestroyed(QObject *o) -
2659{ -
2660 styleSheetCache.remove(o);
never executed (the execution status of this line is deduced): styleSheetCache.remove(o);
-
2661}
never executed: }
0
2662 -
2663/*! -
2664 * Make sure that the cache will be clean by connecting destroyed if needed. -
2665 * return false if the widget is not stylable; -
2666 */ -
2667bool QStyleSheetStyle::initObject(const QObject *obj) const -
2668{ -
2669 if (!obj)
evaluated: !obj
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:126
5-126
2670 return false;
executed: return false;
Execution Count:5
5
2671 if (const QWidget *w = qobject_cast<const QWidget*>(obj)) {
partially evaluated: const QWidget *w = qobject_cast<const QWidget*>(obj)
TRUEFALSE
yes
Evaluation Count:126
no
Evaluation Count:0
0-126
2672 if (w->testAttribute(Qt::WA_StyleSheet))
evaluated: w->testAttribute(Qt::WA_StyleSheet)
TRUEFALSE
yes
Evaluation Count:86
yes
Evaluation Count:40
40-86
2673 return true;
executed: return true;
Execution Count:86
86
2674 if (unstylable(w))
evaluated: unstylable(w)
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:38
2-38
2675 return false;
executed: return false;
Execution Count:2
2
2676 const_cast<QWidget *>(w)->setAttribute(Qt::WA_StyleSheet, true);
executed (the execution status of this line is deduced): const_cast<QWidget *>(w)->setAttribute(Qt::WA_StyleSheet, true);
-
2677 }
executed: }
Execution Count:38
38
2678 -
2679 QObject::connect(obj, SIGNAL(destroyed(QObject*)), styleSheetCaches, SLOT(objectDestroyed(QObject*)), Qt::UniqueConnection);
executed (the execution status of this line is deduced): QObject::connect(obj, "2""destroyed(QObject*)", styleSheetCaches, "1""objectDestroyed(QObject*)", Qt::UniqueConnection);
-
2680 return true;
executed: return true;
Execution Count:38
38
2681} -
2682 -
2683void QStyleSheetStyle::polish(QWidget *w) -
2684{ -
2685 baseStyle()->polish(w);
executed (the execution status of this line is deduced): baseStyle()->polish(w);
-
2686 RECURSION_GUARD(return)
never executed: return;
partially evaluated: globalStyleSheetStyle != 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
never evaluated: globalStyleSheetStyle != this
0-3
2687 -
2688 if (!initObject(w))
partially evaluated: !initObject(w)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
2689 return;
never executed: return;
0
2690 -
2691 if (styleSheetCaches->styleRulesCache.contains(w)) {
evaluated: styleSheetCaches->styleRulesCache.contains(w)
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:1
1-2
2692 // the widget accessed its style pointer before polish (or repolish) -
2693 // (exemple: the QAbstractSpinBox constructor ask for the stylehint) -
2694 styleSheetCaches->styleRulesCache.remove(w);
executed (the execution status of this line is deduced): styleSheetCaches->styleRulesCache.remove(w);
-
2695 styleSheetCaches->hasStyleRuleCache.remove(w);
executed (the execution status of this line is deduced): styleSheetCaches->hasStyleRuleCache.remove(w);
-
2696 styleSheetCaches->renderRulesCache.remove(w);
executed (the execution status of this line is deduced): styleSheetCaches->renderRulesCache.remove(w);
-
2697 }
executed: }
Execution Count:2
2
2698 setGeometry(w);
executed (the execution status of this line is deduced): setGeometry(w);
-
2699 setProperties(w);
executed (the execution status of this line is deduced): setProperties(w);
-
2700 unsetPalette(w);
executed (the execution status of this line is deduced): unsetPalette(w);
-
2701 setPalette(w);
executed (the execution status of this line is deduced): setPalette(w);
-
2702 -
2703 //set the WA_Hover attribute if one of the selector depends of the hover state -
2704 QVector<StyleRule> rules = styleRules(w);
executed (the execution status of this line is deduced): QVector<StyleRule> rules = styleRules(w);
-
2705 for (int i = 0; i < rules.count(); i++) {
evaluated: i < rules.count()
TRUEFALSE
yes
Evaluation Count:7
yes
Evaluation Count:3
3-7
2706 const Selector& selector = rules.at(i).selectors.at(0);
executed (the execution status of this line is deduced): const Selector& selector = rules.at(i).selectors.at(0);
-
2707 quint64 negated = 0;
executed (the execution status of this line is deduced): quint64 negated = 0;
-
2708 quint64 cssClass = selector.pseudoClass(&negated);
executed (the execution status of this line is deduced): quint64 cssClass = selector.pseudoClass(&negated);
-
2709 if ( cssClass & PseudoClass_Hover || negated & PseudoClass_Hover) {
partially evaluated: cssClass & PseudoClass_Hover
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
partially evaluated: negated & PseudoClass_Hover
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
0-7
2710 w->setAttribute(Qt::WA_Hover);
never executed (the execution status of this line is deduced): w->setAttribute(Qt::WA_Hover);
-
2711 embeddedWidget(w)->setAttribute(Qt::WA_Hover);
never executed (the execution status of this line is deduced): embeddedWidget(w)->setAttribute(Qt::WA_Hover);
-
2712 }
never executed: }
0
2713 }
executed: }
Execution Count:7
7
2714 -
2715 -
2716#ifndef QT_NO_SCROLLAREA -
2717 if (QAbstractScrollArea *sa = qobject_cast<QAbstractScrollArea *>(w)) {
partially evaluated: QAbstractScrollArea *sa = qobject_cast<QAbstractScrollArea *>(w)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
2718 QRenderRule rule = renderRule(sa, PseudoElement_None, PseudoClass_Enabled);
never executed (the execution status of this line is deduced): QRenderRule rule = renderRule(sa, PseudoElement_None, PseudoClass_Enabled);
-
2719 if ((rule.hasBorder() && rule.border()->hasBorderImage())
never evaluated: rule.hasBorder()
never evaluated: rule.border()->hasBorderImage()
0
2720 || (rule.hasBackground() && !rule.background()->pixmap.isNull())) {
never evaluated: rule.hasBackground()
never evaluated: !rule.background()->pixmap.isNull()
0
2721 QObject::connect(sa->horizontalScrollBar(), SIGNAL(valueChanged(int)),
never executed (the execution status of this line is deduced): QObject::connect(sa->horizontalScrollBar(), "2""valueChanged(int)",
-
2722 sa, SLOT(update()), Qt::UniqueConnection);
never executed (the execution status of this line is deduced): sa, "1""update()", Qt::UniqueConnection);
-
2723 QObject::connect(sa->verticalScrollBar(), SIGNAL(valueChanged(int)),
never executed (the execution status of this line is deduced): QObject::connect(sa->verticalScrollBar(), "2""valueChanged(int)",
-
2724 sa, SLOT(update()), Qt::UniqueConnection);
never executed (the execution status of this line is deduced): sa, "1""update()", Qt::UniqueConnection);
-
2725 }
never executed: }
0
2726 }
never executed: }
0
2727#endif -
2728 -
2729 QRenderRule rule = renderRule(w, PseudoElement_None, PseudoClass_Any);
executed (the execution status of this line is deduced): QRenderRule rule = renderRule(w, PseudoElement_None, PseudoClass_Any);
-
2730 if (rule.hasDrawable() || rule.hasBox()) {
evaluated: rule.hasDrawable()
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:1
partially evaluated: rule.hasBox()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-2
2731 if (w->metaObject() == &QWidget::staticMetaObject
partially evaluated: w->metaObject() == &QWidget::staticMetaObject
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
2732#ifndef QT_NO_ITEMVIEWS
executed (the execution status of this line is deduced):
-
2733 || qobject_cast<QHeaderView *>(w)
partially evaluated: qobject_cast<QHeaderView *>(w)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
2734#endif
executed (the execution status of this line is deduced):
-
2735#ifndef QT_NO_TABBAR
executed (the execution status of this line is deduced):
-
2736 || qobject_cast<QTabBar *>(w)
partially evaluated: qobject_cast<QTabBar *>(w)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
2737#endif
executed (the execution status of this line is deduced):
-
2738#ifndef QT_NO_FRAME
executed (the execution status of this line is deduced):
-
2739 || qobject_cast<QFrame *>(w)
partially evaluated: qobject_cast<QFrame *>(w)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
2740#endif
executed (the execution status of this line is deduced):
-
2741#ifndef QT_NO_MAINWINDOW
executed (the execution status of this line is deduced):
-
2742 || qobject_cast<QMainWindow *>(w)
partially evaluated: qobject_cast<QMainWindow *>(w)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
2743#endif
executed (the execution status of this line is deduced):
-
2744#ifndef QT_NO_MDIAREA
executed (the execution status of this line is deduced):
-
2745 || qobject_cast<QMdiSubWindow *>(w)
partially evaluated: qobject_cast<QMdiSubWindow *>(w)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
2746#endif
executed (the execution status of this line is deduced):
-
2747#ifndef QT_NO_MENUBAR
executed (the execution status of this line is deduced):
-
2748 || qobject_cast<QMenuBar *>(w)
partially evaluated: qobject_cast<QMenuBar *>(w)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
2749#endif
executed (the execution status of this line is deduced):
-
2750 || qobject_cast<QDialog *>(w)) {
partially evaluated: qobject_cast<QDialog *>(w)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
2751 w->setAttribute(Qt::WA_StyledBackground, true);
never executed (the execution status of this line is deduced): w->setAttribute(Qt::WA_StyledBackground, true);
-
2752 }
never executed: }
0
2753 QWidget *ew = embeddedWidget(w);
executed (the execution status of this line is deduced): QWidget *ew = embeddedWidget(w);
-
2754 if (ew->autoFillBackground()) {
partially evaluated: ew->autoFillBackground()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
2755 ew->setAutoFillBackground(false);
never executed (the execution status of this line is deduced): ew->setAutoFillBackground(false);
-
2756 styleSheetCaches->autoFillDisabledWidgets.insert(w);
never executed (the execution status of this line is deduced): styleSheetCaches->autoFillDisabledWidgets.insert(w);
-
2757 if (ew != w) { //eg. viewport of a scrollarea
never evaluated: ew != w
0
2758 //(in order to draw the background anyway in case we don't.) -
2759 ew->setAttribute(Qt::WA_StyledBackground, true);
never executed (the execution status of this line is deduced): ew->setAttribute(Qt::WA_StyledBackground, true);
-
2760 }
never executed: }
0
2761 }
never executed: }
0
2762 if (!rule.hasBackground() || rule.background()->isTransparent() || rule.hasBox()
partially evaluated: !rule.hasBackground()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
partially evaluated: rule.background()->isTransparent()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
partially evaluated: rule.hasBox()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
2763 || (!rule.hasNativeBorder() && !rule.border()->isOpaque()))
partially evaluated: !rule.hasNativeBorder()
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
partially evaluated: !rule.border()->isOpaque()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
2764 w->setAttribute(Qt::WA_OpaquePaintEvent, false);
never executed: w->setAttribute(Qt::WA_OpaquePaintEvent, false);
0
2765 }
executed: }
Execution Count:2
2
2766}
executed: }
Execution Count:3
3
2767 -
2768void QStyleSheetStyle::polish(QApplication *app) -
2769{ -
2770 baseStyle()->polish(app);
executed (the execution status of this line is deduced): baseStyle()->polish(app);
-
2771}
executed: }
Execution Count:2
2
2772 -
2773void QStyleSheetStyle::polish(QPalette &pal) -
2774{ -
2775 baseStyle()->polish(pal);
executed (the execution status of this line is deduced): baseStyle()->polish(pal);
-
2776}
executed: }
Execution Count:2
2
2777 -
2778void QStyleSheetStyle::repolish(QWidget *w) -
2779{ -
2780 QList<const QObject *> children = w->findChildren<const QObject *>(QString());
never executed (the execution status of this line is deduced): QList<const QObject *> children = w->findChildren<const QObject *>(QString());
-
2781 children.append(w);
never executed (the execution status of this line is deduced): children.append(w);
-
2782 styleSheetCaches->styleSheetCache.remove(w);
never executed (the execution status of this line is deduced): styleSheetCaches->styleSheetCache.remove(w);
-
2783 updateObjects(children);
never executed (the execution status of this line is deduced): updateObjects(children);
-
2784}
never executed: }
0
2785 -
2786void QStyleSheetStyle::repolish(QApplication *app) -
2787{ -
2788 Q_UNUSED(app);
never executed (the execution status of this line is deduced): (void)app;;
-
2789 const QList<const QObject*> allObjects = styleSheetCaches->styleRulesCache.keys();
never executed (the execution status of this line is deduced): const QList<const QObject*> allObjects = styleSheetCaches->styleRulesCache.keys();
-
2790 styleSheetCaches->styleSheetCache.remove(qApp);
never executed (the execution status of this line is deduced): styleSheetCaches->styleSheetCache.remove((static_cast<QApplication *>(QCoreApplication::instance())));
-
2791 styleSheetCaches->styleRulesCache.clear();
never executed (the execution status of this line is deduced): styleSheetCaches->styleRulesCache.clear();
-
2792 styleSheetCaches->hasStyleRuleCache.clear();
never executed (the execution status of this line is deduced): styleSheetCaches->hasStyleRuleCache.clear();
-
2793 styleSheetCaches->renderRulesCache.clear();
never executed (the execution status of this line is deduced): styleSheetCaches->renderRulesCache.clear();
-
2794 updateObjects(allObjects);
never executed (the execution status of this line is deduced): updateObjects(allObjects);
-
2795}
never executed: }
0
2796 -
2797void QStyleSheetStyle::unpolish(QWidget *w) -
2798{ -
2799 if (!w || !w->testAttribute(Qt::WA_StyleSheet)) {
partially evaluated: !w
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
partially evaluated: !w->testAttribute(Qt::WA_StyleSheet)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
2800 baseStyle()->unpolish(w);
never executed (the execution status of this line is deduced): baseStyle()->unpolish(w);
-
2801 return;
never executed: return;
0
2802 } -
2803 -
2804 styleSheetCaches->styleRulesCache.remove(w);
executed (the execution status of this line is deduced): styleSheetCaches->styleRulesCache.remove(w);
-
2805 styleSheetCaches->hasStyleRuleCache.remove(w);
executed (the execution status of this line is deduced): styleSheetCaches->hasStyleRuleCache.remove(w);
-
2806 styleSheetCaches->renderRulesCache.remove(w);
executed (the execution status of this line is deduced): styleSheetCaches->renderRulesCache.remove(w);
-
2807 styleSheetCaches->styleSheetCache.remove(w);
executed (the execution status of this line is deduced): styleSheetCaches->styleSheetCache.remove(w);
-
2808 unsetPalette(w);
executed (the execution status of this line is deduced): unsetPalette(w);
-
2809 w->setProperty("_q_stylesheet_minw", QVariant());
executed (the execution status of this line is deduced): w->setProperty("_q_stylesheet_minw", QVariant());
-
2810 w->setProperty("_q_stylesheet_minh", QVariant());
executed (the execution status of this line is deduced): w->setProperty("_q_stylesheet_minh", QVariant());
-
2811 w->setProperty("_q_stylesheet_maxw", QVariant());
executed (the execution status of this line is deduced): w->setProperty("_q_stylesheet_maxw", QVariant());
-
2812 w->setProperty("_q_stylesheet_maxh", QVariant());
executed (the execution status of this line is deduced): w->setProperty("_q_stylesheet_maxh", QVariant());
-
2813 w->setAttribute(Qt::WA_StyleSheet, false);
executed (the execution status of this line is deduced): w->setAttribute(Qt::WA_StyleSheet, false);
-
2814 QObject::disconnect(w, 0, this, 0);
executed (the execution status of this line is deduced): QObject::disconnect(w, 0, this, 0);
-
2815#ifndef QT_NO_SCROLLAREA -
2816 if (QAbstractScrollArea *sa = qobject_cast<QAbstractScrollArea *>(w)) {
partially evaluated: QAbstractScrollArea *sa = qobject_cast<QAbstractScrollArea *>(w)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
2817 QObject::disconnect(sa->horizontalScrollBar(), SIGNAL(valueChanged(int)),
never executed (the execution status of this line is deduced): QObject::disconnect(sa->horizontalScrollBar(), "2""valueChanged(int)",
-
2818 sa, SLOT(update()));
never executed (the execution status of this line is deduced): sa, "1""update()");
-
2819 QObject::disconnect(sa->verticalScrollBar(), SIGNAL(valueChanged(int)),
never executed (the execution status of this line is deduced): QObject::disconnect(sa->verticalScrollBar(), "2""valueChanged(int)",
-
2820 sa, SLOT(update()));
never executed (the execution status of this line is deduced): sa, "1""update()");
-
2821 }
never executed: }
0
2822#endif -
2823 baseStyle()->unpolish(w);
executed (the execution status of this line is deduced): baseStyle()->unpolish(w);
-
2824}
executed: }
Execution Count:1
1
2825 -
2826void QStyleSheetStyle::unpolish(QApplication *app) -
2827{ -
2828 baseStyle()->unpolish(app);
executed (the execution status of this line is deduced): baseStyle()->unpolish(app);
-
2829 RECURSION_GUARD(return)
never executed: return;
partially evaluated: globalStyleSheetStyle != 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
never evaluated: globalStyleSheetStyle != this
0-1
2830 styleSheetCaches->styleRulesCache.clear();
executed (the execution status of this line is deduced): styleSheetCaches->styleRulesCache.clear();
-
2831 styleSheetCaches->hasStyleRuleCache.clear();
executed (the execution status of this line is deduced): styleSheetCaches->hasStyleRuleCache.clear();
-
2832 styleSheetCaches->renderRulesCache.clear();
executed (the execution status of this line is deduced): styleSheetCaches->renderRulesCache.clear();
-
2833 styleSheetCaches->styleSheetCache.remove(qApp);
executed (the execution status of this line is deduced): styleSheetCaches->styleSheetCache.remove((static_cast<QApplication *>(QCoreApplication::instance())));
-
2834}
executed: }
Execution Count:1
1
2835 -
2836#ifndef QT_NO_TABBAR -
2837inline static bool verticalTabs(QTabBar::Shape shape) -
2838{ -
2839 return shape == QTabBar::RoundedWest
never executed: return shape == QTabBar::RoundedWest || shape == QTabBar::RoundedEast || shape == QTabBar::TriangularWest || shape == QTabBar::TriangularEast;
0
2840 || shape == QTabBar::RoundedEast
never executed: return shape == QTabBar::RoundedWest || shape == QTabBar::RoundedEast || shape == QTabBar::TriangularWest || shape == QTabBar::TriangularEast;
0
2841 || shape == QTabBar::TriangularWest
never executed: return shape == QTabBar::RoundedWest || shape == QTabBar::RoundedEast || shape == QTabBar::TriangularWest || shape == QTabBar::TriangularEast;
0
2842 || shape == QTabBar::TriangularEast;
never executed: return shape == QTabBar::RoundedWest || shape == QTabBar::RoundedEast || shape == QTabBar::TriangularWest || shape == QTabBar::TriangularEast;
0
2843} -
2844#endif // QT_NO_TABBAR -
2845 -
2846void QStyleSheetStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, -
2847 const QWidget *w) const -
2848{ -
2849 RECURSION_GUARD(baseStyle()->drawComplexControl(cc, opt, p, w); return)
never executed: return;
never evaluated: globalStyleSheetStyle != 0
never evaluated: globalStyleSheetStyle != this
0
2850 -
2851 QRenderRule rule = renderRule(w, opt);
never executed (the execution status of this line is deduced): QRenderRule rule = renderRule(w, opt);
-
2852 -
2853 switch (cc) { -
2854 case CC_ComboBox: -
2855 if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
never evaluated: const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)
0
2856 QStyleOptionComboBox cmbOpt(*cmb);
never executed (the execution status of this line is deduced): QStyleOptionComboBox cmbOpt(*cmb);
-
2857 cmbOpt.rect = rule.borderRect(opt->rect);
never executed (the execution status of this line is deduced): cmbOpt.rect = rule.borderRect(opt->rect);
-
2858 if (rule.hasNativeBorder()) {
never evaluated: rule.hasNativeBorder()
0
2859 rule.drawBackgroundImage(p, cmbOpt.rect);
never executed (the execution status of this line is deduced): rule.drawBackgroundImage(p, cmbOpt.rect);
-
2860 rule.configurePalette(&cmbOpt.palette, QPalette::ButtonText, QPalette::Button);
never executed (the execution status of this line is deduced): rule.configurePalette(&cmbOpt.palette, QPalette::ButtonText, QPalette::Button);
-
2861 bool customDropDown = (opt->subControls & QStyle::SC_ComboBoxArrow)
never evaluated: (opt->subControls & QStyle::SC_ComboBoxArrow)
0
2862 && (hasStyleRule(w, PseudoElement_ComboBoxDropDown) || hasStyleRule(w, PseudoElement_ComboBoxArrow));
never evaluated: hasStyleRule(w, PseudoElement_ComboBoxDropDown)
never evaluated: hasStyleRule(w, PseudoElement_ComboBoxArrow)
0
2863 if (customDropDown)
never evaluated: customDropDown
0
2864 cmbOpt.subControls &= ~QStyle::SC_ComboBoxArrow;
never executed: cmbOpt.subControls &= ~QStyle::SC_ComboBoxArrow;
0
2865 if (rule.baseStyleCanDraw()) {
never evaluated: rule.baseStyleCanDraw()
0
2866 baseStyle()->drawComplexControl(cc, &cmbOpt, p, w);
never executed (the execution status of this line is deduced): baseStyle()->drawComplexControl(cc, &cmbOpt, p, w);
-
2867 } else {
never executed: }
0
2868 QWindowsStyle::drawComplexControl(cc, &cmbOpt, p, w);
never executed (the execution status of this line is deduced): QWindowsStyle::drawComplexControl(cc, &cmbOpt, p, w);
-
2869 }
never executed: }
0
2870 if (!customDropDown)
never evaluated: !customDropDown
0
2871 return;
never executed: return;
0
2872 } else {
never executed: }
0
2873 rule.drawRule(p, opt->rect);
never executed (the execution status of this line is deduced): rule.drawRule(p, opt->rect);
-
2874 }
never executed: }
0
2875 -
2876 if (opt->subControls & QStyle::SC_ComboBoxArrow) {
never evaluated: opt->subControls & QStyle::SC_ComboBoxArrow
0
2877 QRenderRule subRule = renderRule(w, opt, PseudoElement_ComboBoxDropDown);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_ComboBoxDropDown);
-
2878 if (subRule.hasDrawable()) {
never evaluated: subRule.hasDrawable()
0
2879 QRect r = subControlRect(CC_ComboBox, opt, SC_ComboBoxArrow, w);
never executed (the execution status of this line is deduced): QRect r = subControlRect(CC_ComboBox, opt, SC_ComboBoxArrow, w);
-
2880 subRule.drawRule(p, r);
never executed (the execution status of this line is deduced): subRule.drawRule(p, r);
-
2881 QRenderRule subRule2 = renderRule(w, opt, PseudoElement_ComboBoxArrow);
never executed (the execution status of this line is deduced): QRenderRule subRule2 = renderRule(w, opt, PseudoElement_ComboBoxArrow);
-
2882 r = positionRect(w, subRule, subRule2, PseudoElement_ComboBoxArrow, r, opt->direction);
never executed (the execution status of this line is deduced): r = positionRect(w, subRule, subRule2, PseudoElement_ComboBoxArrow, r, opt->direction);
-
2883 subRule2.drawRule(p, r);
never executed (the execution status of this line is deduced): subRule2.drawRule(p, r);
-
2884 } else {
never executed: }
0
2885 cmbOpt.subControls = QStyle::SC_ComboBoxArrow;
never executed (the execution status of this line is deduced): cmbOpt.subControls = QStyle::SC_ComboBoxArrow;
-
2886 QWindowsStyle::drawComplexControl(cc, &cmbOpt, p, w);
never executed (the execution status of this line is deduced): QWindowsStyle::drawComplexControl(cc, &cmbOpt, p, w);
-
2887 }
never executed: }
0
2888 } -
2889 -
2890 return;
never executed: return;
0
2891 } -
2892 break;
never executed: break;
0
2893 -
2894#ifndef QT_NO_SPINBOX -
2895 case CC_SpinBox: -
2896 if (const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
never evaluated: const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)
0
2897 QStyleOptionSpinBox spinOpt(*spin);
never executed (the execution status of this line is deduced): QStyleOptionSpinBox spinOpt(*spin);
-
2898 rule.configurePalette(&spinOpt.palette, QPalette::ButtonText, QPalette::Button);
never executed (the execution status of this line is deduced): rule.configurePalette(&spinOpt.palette, QPalette::ButtonText, QPalette::Button);
-
2899 rule.configurePalette(&spinOpt.palette, QPalette::Text, QPalette::Base);
never executed (the execution status of this line is deduced): rule.configurePalette(&spinOpt.palette, QPalette::Text, QPalette::Base);
-
2900 spinOpt.rect = rule.borderRect(opt->rect);
never executed (the execution status of this line is deduced): spinOpt.rect = rule.borderRect(opt->rect);
-
2901 bool customUp = true, customDown = true;
never executed (the execution status of this line is deduced): bool customUp = true, customDown = true;
-
2902 QRenderRule upRule = renderRule(w, opt, PseudoElement_SpinBoxUpButton);
never executed (the execution status of this line is deduced): QRenderRule upRule = renderRule(w, opt, PseudoElement_SpinBoxUpButton);
-
2903 QRenderRule downRule = renderRule(w, opt, PseudoElement_SpinBoxDownButton);
never executed (the execution status of this line is deduced): QRenderRule downRule = renderRule(w, opt, PseudoElement_SpinBoxDownButton);
-
2904 bool upRuleMatch = upRule.hasGeometry() || upRule.hasPosition();
never evaluated: upRule.hasGeometry()
never evaluated: upRule.hasPosition()
0
2905 bool downRuleMatch = downRule.hasGeometry() || downRule.hasPosition();
never evaluated: downRule.hasGeometry()
never evaluated: downRule.hasPosition()
0
2906 if (rule.hasNativeBorder() && !upRuleMatch && !downRuleMatch) {
never evaluated: rule.hasNativeBorder()
never evaluated: !upRuleMatch
never evaluated: !downRuleMatch
0
2907 rule.drawBackgroundImage(p, spinOpt.rect);
never executed (the execution status of this line is deduced): rule.drawBackgroundImage(p, spinOpt.rect);
-
2908 customUp = (opt->subControls & QStyle::SC_SpinBoxUp)
never evaluated: (opt->subControls & QStyle::SC_SpinBoxUp)
0
2909 && (hasStyleRule(w, PseudoElement_SpinBoxUpButton) || hasStyleRule(w, PseudoElement_UpArrow));
never evaluated: hasStyleRule(w, PseudoElement_SpinBoxUpButton)
never evaluated: hasStyleRule(w, PseudoElement_UpArrow)
0
2910 if (customUp)
never evaluated: customUp
0
2911 spinOpt.subControls &= ~QStyle::SC_SpinBoxUp;
never executed: spinOpt.subControls &= ~QStyle::SC_SpinBoxUp;
0
2912 customDown = (opt->subControls & QStyle::SC_SpinBoxDown)
never evaluated: (opt->subControls & QStyle::SC_SpinBoxDown)
0
2913 && (hasStyleRule(w, PseudoElement_SpinBoxDownButton) || hasStyleRule(w, PseudoElement_DownArrow));
never evaluated: hasStyleRule(w, PseudoElement_SpinBoxDownButton)
never evaluated: hasStyleRule(w, PseudoElement_DownArrow)
0
2914 if (customDown)
never evaluated: customDown
0
2915 spinOpt.subControls &= ~QStyle::SC_SpinBoxDown;
never executed: spinOpt.subControls &= ~QStyle::SC_SpinBoxDown;
0
2916 if (rule.baseStyleCanDraw()) {
never evaluated: rule.baseStyleCanDraw()
0
2917 baseStyle()->drawComplexControl(cc, &spinOpt, p, w);
never executed (the execution status of this line is deduced): baseStyle()->drawComplexControl(cc, &spinOpt, p, w);
-
2918 } else {
never executed: }
0
2919 QWindowsStyle::drawComplexControl(cc, &spinOpt, p, w);
never executed (the execution status of this line is deduced): QWindowsStyle::drawComplexControl(cc, &spinOpt, p, w);
-
2920 }
never executed: }
0
2921 if (!customUp && !customDown)
never evaluated: !customUp
never evaluated: !customDown
0
2922 return;
never executed: return;
0
2923 } else {
never executed: }
0
2924 rule.drawRule(p, opt->rect);
never executed (the execution status of this line is deduced): rule.drawRule(p, opt->rect);
-
2925 }
never executed: }
0
2926 -
2927 if ((opt->subControls & QStyle::SC_SpinBoxUp) && customUp) {
never evaluated: (opt->subControls & QStyle::SC_SpinBoxUp)
never evaluated: customUp
0
2928 QRenderRule subRule = renderRule(w, opt, PseudoElement_SpinBoxUpButton);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_SpinBoxUpButton);
-
2929 if (subRule.hasDrawable()) {
never evaluated: subRule.hasDrawable()
0
2930 QRect r = subControlRect(CC_SpinBox, opt, SC_SpinBoxUp, w);
never executed (the execution status of this line is deduced): QRect r = subControlRect(CC_SpinBox, opt, SC_SpinBoxUp, w);
-
2931 subRule.drawRule(p, r);
never executed (the execution status of this line is deduced): subRule.drawRule(p, r);
-
2932 QRenderRule subRule2 = renderRule(w, opt, PseudoElement_SpinBoxUpArrow);
never executed (the execution status of this line is deduced): QRenderRule subRule2 = renderRule(w, opt, PseudoElement_SpinBoxUpArrow);
-
2933 r = positionRect(w, subRule, subRule2, PseudoElement_SpinBoxUpArrow, r, opt->direction);
never executed (the execution status of this line is deduced): r = positionRect(w, subRule, subRule2, PseudoElement_SpinBoxUpArrow, r, opt->direction);
-
2934 subRule2.drawRule(p, r);
never executed (the execution status of this line is deduced): subRule2.drawRule(p, r);
-
2935 } else {
never executed: }
0
2936 spinOpt.subControls = QStyle::SC_SpinBoxUp;
never executed (the execution status of this line is deduced): spinOpt.subControls = QStyle::SC_SpinBoxUp;
-
2937 QWindowsStyle::drawComplexControl(cc, &spinOpt, p, w);
never executed (the execution status of this line is deduced): QWindowsStyle::drawComplexControl(cc, &spinOpt, p, w);
-
2938 }
never executed: }
0
2939 } -
2940 -
2941 if ((opt->subControls & QStyle::SC_SpinBoxDown) && customDown) {
never evaluated: (opt->subControls & QStyle::SC_SpinBoxDown)
never evaluated: customDown
0
2942 QRenderRule subRule = renderRule(w, opt, PseudoElement_SpinBoxDownButton);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_SpinBoxDownButton);
-
2943 if (subRule.hasDrawable()) {
never evaluated: subRule.hasDrawable()
0
2944 QRect r = subControlRect(CC_SpinBox, opt, SC_SpinBoxDown, w);
never executed (the execution status of this line is deduced): QRect r = subControlRect(CC_SpinBox, opt, SC_SpinBoxDown, w);
-
2945 subRule.drawRule(p, r);
never executed (the execution status of this line is deduced): subRule.drawRule(p, r);
-
2946 QRenderRule subRule2 = renderRule(w, opt, PseudoElement_SpinBoxDownArrow);
never executed (the execution status of this line is deduced): QRenderRule subRule2 = renderRule(w, opt, PseudoElement_SpinBoxDownArrow);
-
2947 r = positionRect(w, subRule, subRule2, PseudoElement_SpinBoxDownArrow, r, opt->direction);
never executed (the execution status of this line is deduced): r = positionRect(w, subRule, subRule2, PseudoElement_SpinBoxDownArrow, r, opt->direction);
-
2948 subRule2.drawRule(p, r);
never executed (the execution status of this line is deduced): subRule2.drawRule(p, r);
-
2949 } else {
never executed: }
0
2950 spinOpt.subControls = QStyle::SC_SpinBoxDown;
never executed (the execution status of this line is deduced): spinOpt.subControls = QStyle::SC_SpinBoxDown;
-
2951 QWindowsStyle::drawComplexControl(cc, &spinOpt, p, w);
never executed (the execution status of this line is deduced): QWindowsStyle::drawComplexControl(cc, &spinOpt, p, w);
-
2952 }
never executed: }
0
2953 } -
2954 return;
never executed: return;
0
2955 } -
2956 break;
never executed: break;
0
2957#endif // QT_NO_SPINBOX -
2958 -
2959 case CC_GroupBox: -
2960 if (const QStyleOptionGroupBox *gb = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)) {
never evaluated: const QStyleOptionGroupBox *gb = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)
0
2961 -
2962 QRect labelRect, checkBoxRect, titleRect, frameRect;
never executed (the execution status of this line is deduced): QRect labelRect, checkBoxRect, titleRect, frameRect;
-
2963 bool hasTitle = (gb->subControls & QStyle::SC_GroupBoxCheckBox) || !gb->text.isEmpty();
never evaluated: (gb->subControls & QStyle::SC_GroupBoxCheckBox)
never evaluated: !gb->text.isEmpty()
0
2964 -
2965 if (!rule.hasDrawable() && (!hasTitle || !hasStyleRule(w, PseudoElement_GroupBoxTitle))
never evaluated: !rule.hasDrawable()
never evaluated: !hasTitle
never evaluated: !hasStyleRule(w, PseudoElement_GroupBoxTitle)
0
2966 && !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
2967 // let the native style draw the combobox if there is no style for it. -
2968 break;
never executed: break;
0
2969 } -
2970 rule.drawBackground(p, opt->rect);
never executed (the execution status of this line is deduced): rule.drawBackground(p, opt->rect);
-
2971 -
2972 QRenderRule titleRule = renderRule(w, opt, PseudoElement_GroupBoxTitle);
never executed (the execution status of this line is deduced): QRenderRule titleRule = renderRule(w, opt, PseudoElement_GroupBoxTitle);
-
2973 bool clipSet = false;
never executed (the execution status of this line is deduced): bool clipSet = false;
-
2974 -
2975 if (hasTitle) {
never evaluated: hasTitle
0
2976 labelRect = subControlRect(CC_GroupBox, opt, SC_GroupBoxLabel, w);
never executed (the execution status of this line is deduced): labelRect = subControlRect(CC_GroupBox, opt, SC_GroupBoxLabel, w);
-
2977 //Some native style (such as mac) may return a too small rectangle (because they use smaller fonts), so we may need to expand it a little bit. -
2978 labelRect.setSize(labelRect.size().expandedTo(ParentStyle::subControlRect(CC_GroupBox, opt, SC_GroupBoxLabel, w).size()));
never executed (the execution status of this line is deduced): labelRect.setSize(labelRect.size().expandedTo(ParentStyle::subControlRect(CC_GroupBox, opt, SC_GroupBoxLabel, w).size()));
-
2979 if (gb->subControls & QStyle::SC_GroupBoxCheckBox) {
never evaluated: gb->subControls & QStyle::SC_GroupBoxCheckBox
0
2980 checkBoxRect = subControlRect(CC_GroupBox, opt, SC_GroupBoxCheckBox, w);
never executed (the execution status of this line is deduced): checkBoxRect = subControlRect(CC_GroupBox, opt, SC_GroupBoxCheckBox, w);
-
2981 titleRect = titleRule.boxRect(checkBoxRect.united(labelRect));
never executed (the execution status of this line is deduced): titleRect = titleRule.boxRect(checkBoxRect.united(labelRect));
-
2982 } else {
never executed: }
0
2983 titleRect = titleRule.boxRect(labelRect);
never executed (the execution status of this line is deduced): titleRect = titleRule.boxRect(labelRect);
-
2984 }
never executed: }
0
2985 if (!titleRule.hasBackground() || !titleRule.background()->isTransparent()) {
never evaluated: !titleRule.hasBackground()
never evaluated: !titleRule.background()->isTransparent()
0
2986 clipSet = true;
never executed (the execution status of this line is deduced): clipSet = true;
-
2987 p->save();
never executed (the execution status of this line is deduced): p->save();
-
2988 p->setClipRegion(QRegion(opt->rect) - titleRect);
never executed (the execution status of this line is deduced): p->setClipRegion(QRegion(opt->rect) - titleRect);
-
2989 }
never executed: }
0
2990 }
never executed: }
0
2991 -
2992 frameRect = subControlRect(CC_GroupBox, opt, SC_GroupBoxFrame, w);
never executed (the execution status of this line is deduced): frameRect = subControlRect(CC_GroupBox, opt, SC_GroupBoxFrame, w);
-
2993 QStyleOptionFrameV2 frame;
never executed (the execution status of this line is deduced): QStyleOptionFrameV2 frame;
-
2994 frame.QStyleOption::operator=(*gb);
never executed (the execution status of this line is deduced): frame.QStyleOption::operator=(*gb);
-
2995 frame.features = gb->features;
never executed (the execution status of this line is deduced): frame.features = gb->features;
-
2996 frame.lineWidth = gb->lineWidth;
never executed (the execution status of this line is deduced): frame.lineWidth = gb->lineWidth;
-
2997 frame.midLineWidth = gb->midLineWidth;
never executed (the execution status of this line is deduced): frame.midLineWidth = gb->midLineWidth;
-
2998 frame.rect = frameRect;
never executed (the execution status of this line is deduced): frame.rect = frameRect;
-
2999 drawPrimitive(PE_FrameGroupBox, &frame, p, w);
never executed (the execution status of this line is deduced): drawPrimitive(PE_FrameGroupBox, &frame, p, w);
-
3000 -
3001 if (clipSet)
never evaluated: clipSet
0
3002 p->restore();
never executed: p->restore();
0
3003 -
3004 // draw background and frame of the title -
3005 if (hasTitle)
never evaluated: hasTitle
0
3006 titleRule.drawRule(p, titleRect);
never executed: titleRule.drawRule(p, titleRect);
0
3007 -
3008 // draw the indicator -
3009 if (gb->subControls & QStyle::SC_GroupBoxCheckBox) {
never evaluated: gb->subControls & QStyle::SC_GroupBoxCheckBox
0
3010 QStyleOptionButton box;
never executed (the execution status of this line is deduced): QStyleOptionButton box;
-
3011 box.QStyleOption::operator=(*gb);
never executed (the execution status of this line is deduced): box.QStyleOption::operator=(*gb);
-
3012 box.rect = checkBoxRect;
never executed (the execution status of this line is deduced): box.rect = checkBoxRect;
-
3013 drawPrimitive(PE_IndicatorCheckBox, &box, p, w);
never executed (the execution status of this line is deduced): drawPrimitive(PE_IndicatorCheckBox, &box, p, w);
-
3014 }
never executed: }
0
3015 -
3016 // draw the text -
3017 if (!gb->text.isEmpty()) {
never evaluated: !gb->text.isEmpty()
0
3018 int alignment = int(Qt::AlignCenter | Qt::TextShowMnemonic);
never executed (the execution status of this line is deduced): int alignment = int(Qt::AlignCenter | Qt::TextShowMnemonic);
-
3019 if (!styleHint(QStyle::SH_UnderlineShortcut, opt, w)) {
never evaluated: !styleHint(QStyle::SH_UnderlineShortcut, opt, w)
0
3020 alignment |= Qt::TextHideMnemonic;
never executed (the execution status of this line is deduced): alignment |= Qt::TextHideMnemonic;
-
3021 }
never executed: }
0
3022 -
3023 QPalette pal = gb->palette;
never executed (the execution status of this line is deduced): QPalette pal = gb->palette;
-
3024 if (gb->textColor.isValid())
never evaluated: gb->textColor.isValid()
0
3025 pal.setColor(QPalette::WindowText, gb->textColor);
never executed: pal.setColor(QPalette::WindowText, gb->textColor);
0
3026 titleRule.configurePalette(&pal, QPalette::WindowText, QPalette::Window);
never executed (the execution status of this line is deduced): titleRule.configurePalette(&pal, QPalette::WindowText, QPalette::Window);
-
3027 drawItemText(p, labelRect, alignment, pal, gb->state & State_Enabled,
never executed (the execution status of this line is deduced): drawItemText(p, labelRect, alignment, pal, gb->state & State_Enabled,
-
3028 gb->text, QPalette::WindowText);
never executed (the execution status of this line is deduced): gb->text, QPalette::WindowText);
-
3029 -
3030 if (gb->state & State_HasFocus) {
never evaluated: gb->state & State_HasFocus
0
3031 QStyleOptionFocusRect fropt;
never executed (the execution status of this line is deduced): QStyleOptionFocusRect fropt;
-
3032 fropt.QStyleOption::operator=(*gb);
never executed (the execution status of this line is deduced): fropt.QStyleOption::operator=(*gb);
-
3033 fropt.rect = labelRect;
never executed (the execution status of this line is deduced): fropt.rect = labelRect;
-
3034 drawPrimitive(PE_FrameFocusRect, &fropt, p, w);
never executed (the execution status of this line is deduced): drawPrimitive(PE_FrameFocusRect, &fropt, p, w);
-
3035 }
never executed: }
0
3036 }
never executed: }
0
3037 -
3038 return;
never executed: return;
0
3039 } -
3040 break;
never executed: break;
0
3041 -
3042 case CC_ToolButton: -
3043 if (const QStyleOptionToolButton *tool = qstyleoption_cast<const QStyleOptionToolButton *>(opt)) {
never evaluated: const QStyleOptionToolButton *tool = qstyleoption_cast<const QStyleOptionToolButton *>(opt)
0
3044 QStyleOptionToolButton toolOpt(*tool);
never executed (the execution status of this line is deduced): QStyleOptionToolButton toolOpt(*tool);
-
3045 rule.configurePalette(&toolOpt.palette, QPalette::ButtonText, QPalette::Button);
never executed (the execution status of this line is deduced): rule.configurePalette(&toolOpt.palette, QPalette::ButtonText, QPalette::Button);
-
3046 toolOpt.font = rule.font.resolve(toolOpt.font);
never executed (the execution status of this line is deduced): toolOpt.font = rule.font.resolve(toolOpt.font);
-
3047 toolOpt.rect = rule.borderRect(opt->rect);
never executed (the execution status of this line is deduced): toolOpt.rect = rule.borderRect(opt->rect);
-
3048 bool customArrow = (tool->features & (QStyleOptionToolButton::HasMenu | QStyleOptionToolButton::MenuButtonPopup));
never executed (the execution status of this line is deduced): bool customArrow = (tool->features & (QStyleOptionToolButton::HasMenu | QStyleOptionToolButton::MenuButtonPopup));
-
3049 bool customDropDown = tool->features & QStyleOptionToolButton::MenuButtonPopup;
never executed (the execution status of this line is deduced): bool customDropDown = tool->features & QStyleOptionToolButton::MenuButtonPopup;
-
3050 if (rule.hasNativeBorder()) {
never evaluated: rule.hasNativeBorder()
0
3051 if (tool->subControls & SC_ToolButton) {
never evaluated: tool->subControls & SC_ToolButton
0
3052 //in some case (eg. the button is "auto raised") the style doesn't draw the background -
3053 //so we need to draw the background. -
3054 // use the same condition as in QCommonStyle -
3055 State bflags = tool->state & ~State_Sunken;
never executed (the execution status of this line is deduced): State bflags = tool->state & ~State_Sunken;
-
3056 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
3057 bflags &= ~State_Raised;
never executed: bflags &= ~State_Raised;
0
3058 if (tool->state & State_Sunken && tool->activeSubControls & SC_ToolButton)
never evaluated: tool->state & State_Sunken
never evaluated: tool->activeSubControls & SC_ToolButton
0
3059 bflags |= State_Sunken;
never executed: bflags |= State_Sunken;
0
3060 if (!(bflags & (State_Sunken | State_On | State_Raised)))
never evaluated: !(bflags & (State_Sunken | State_On | State_Raised))
0
3061 rule.drawBackground(p, toolOpt.rect);
never executed: rule.drawBackground(p, toolOpt.rect);
0
3062 }
never executed: }
0
3063 customArrow = customArrow && hasStyleRule(w, PseudoElement_ToolButtonDownArrow);
never evaluated: customArrow
never evaluated: hasStyleRule(w, PseudoElement_ToolButtonDownArrow)
0
3064 if (customArrow)
never evaluated: customArrow
0
3065 toolOpt.features &= ~QStyleOptionToolButton::HasMenu;
never executed: toolOpt.features &= ~QStyleOptionToolButton::HasMenu;
0
3066 customDropDown = customDropDown && hasStyleRule(w, PseudoElement_ToolButtonMenu);
never evaluated: customDropDown
never evaluated: hasStyleRule(w, PseudoElement_ToolButtonMenu)
0
3067 if (customDropDown)
never evaluated: customDropDown
0
3068 toolOpt.subControls &= ~QStyle::SC_ToolButtonMenu;
never executed: toolOpt.subControls &= ~QStyle::SC_ToolButtonMenu;
0
3069 -
3070 if (rule.baseStyleCanDraw() && !(tool->features & QStyleOptionToolButton::Arrow)) {
never evaluated: rule.baseStyleCanDraw()
never evaluated: !(tool->features & QStyleOptionToolButton::Arrow)
0
3071 baseStyle()->drawComplexControl(cc, &toolOpt, p, w);
never executed (the execution status of this line is deduced): baseStyle()->drawComplexControl(cc, &toolOpt, p, w);
-
3072 } else {
never executed: }
0
3073 QWindowsStyle::drawComplexControl(cc, &toolOpt, p, w);
never executed (the execution status of this line is deduced): QWindowsStyle::drawComplexControl(cc, &toolOpt, p, w);
-
3074 }
never executed: }
0
3075 -
3076 if (!customArrow && !customDropDown)
never evaluated: !customArrow
never evaluated: !customDropDown
0
3077 return;
never executed: return;
0
3078 } else {
never executed: }
0
3079 rule.drawRule(p, opt->rect);
never executed (the execution status of this line is deduced): rule.drawRule(p, opt->rect);
-
3080 toolOpt.rect = rule.contentsRect(opt->rect);
never executed (the execution status of this line is deduced): toolOpt.rect = rule.contentsRect(opt->rect);
-
3081 if (rule.hasFont)
never evaluated: rule.hasFont
0
3082 toolOpt.font = rule.font;
never executed: toolOpt.font = rule.font;
0
3083 drawControl(CE_ToolButtonLabel, &toolOpt, p, w);
never executed (the execution status of this line is deduced): drawControl(CE_ToolButtonLabel, &toolOpt, p, w);
-
3084 }
never executed: }
0
3085 -
3086 QRenderRule subRule = renderRule(w, opt, PseudoElement_ToolButtonMenu);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_ToolButtonMenu);
-
3087 QRect r = subControlRect(CC_ToolButton, opt, QStyle::SC_ToolButtonMenu, w);
never executed (the execution status of this line is deduced): QRect r = subControlRect(CC_ToolButton, opt, QStyle::SC_ToolButtonMenu, w);
-
3088 if (customDropDown) {
never evaluated: customDropDown
0
3089 if (opt->subControls & QStyle::SC_ToolButtonMenu) {
never evaluated: opt->subControls & QStyle::SC_ToolButtonMenu
0
3090 if (subRule.hasDrawable()) {
never evaluated: subRule.hasDrawable()
0
3091 subRule.drawRule(p, r);
never executed (the execution status of this line is deduced): subRule.drawRule(p, r);
-
3092 } else {
never executed: }
0
3093 toolOpt.rect = r;
never executed (the execution status of this line is deduced): toolOpt.rect = r;
-
3094 baseStyle()->drawPrimitive(PE_IndicatorButtonDropDown, &toolOpt, p, w);
never executed (the execution status of this line is deduced): baseStyle()->drawPrimitive(PE_IndicatorButtonDropDown, &toolOpt, p, w);
-
3095 }
never executed: }
0
3096 } -
3097 }
never executed: }
0
3098 -
3099 if (customArrow) {
never evaluated: customArrow
0
3100 QRenderRule subRule2 = customDropDown ? renderRule(w, opt, PseudoElement_ToolButtonMenuArrow)
never evaluated: customDropDown
0
3101 : renderRule(w, opt, PseudoElement_ToolButtonDownArrow);
never executed (the execution status of this line is deduced): : renderRule(w, opt, PseudoElement_ToolButtonDownArrow);
-
3102 QRect r2 = customDropDown
never evaluated: customDropDown
0
3103 ? positionRect(w, subRule, subRule2, PseudoElement_ToolButtonMenuArrow, r, opt->direction)
never executed (the execution status of this line is deduced): ? positionRect(w, subRule, subRule2, PseudoElement_ToolButtonMenuArrow, r, opt->direction)
-
3104 : positionRect(w, rule, subRule2, PseudoElement_ToolButtonDownArrow, opt->rect, opt->direction);
never executed (the execution status of this line is deduced): : positionRect(w, rule, subRule2, PseudoElement_ToolButtonDownArrow, opt->rect, opt->direction);
-
3105 if (subRule2.hasDrawable()) {
never evaluated: subRule2.hasDrawable()
0
3106 subRule2.drawRule(p, r2);
never executed (the execution status of this line is deduced): subRule2.drawRule(p, r2);
-
3107 } else {
never executed: }
0
3108 toolOpt.rect = r2;
never executed (the execution status of this line is deduced): toolOpt.rect = r2;
-
3109 baseStyle()->drawPrimitive(QStyle::PE_IndicatorArrowDown, &toolOpt, p, w);
never executed (the execution status of this line is deduced): baseStyle()->drawPrimitive(QStyle::PE_IndicatorArrowDown, &toolOpt, p, w);
-
3110 }
never executed: }
0
3111 } -
3112 -
3113 return;
never executed: return;
0
3114 } -
3115 break;
never executed: break;
0
3116 -
3117#ifndef QT_NO_SCROLLBAR -
3118 case CC_ScrollBar: -
3119 if (const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
never evaluated: const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt)
0
3120 QStyleOptionSlider sbOpt(*sb);
never executed (the execution status of this line is deduced): QStyleOptionSlider sbOpt(*sb);
-
3121 if (!rule.hasDrawable()) {
never evaluated: !rule.hasDrawable()
0
3122 sbOpt.rect = rule.borderRect(opt->rect);
never executed (the execution status of this line is deduced): sbOpt.rect = rule.borderRect(opt->rect);
-
3123 rule.drawBackgroundImage(p, opt->rect);
never executed (the execution status of this line is deduced): rule.drawBackgroundImage(p, opt->rect);
-
3124 baseStyle()->drawComplexControl(cc, &sbOpt, p, w);
never executed (the execution status of this line is deduced): baseStyle()->drawComplexControl(cc, &sbOpt, p, w);
-
3125 } else {
never executed: }
0
3126 rule.drawRule(p, opt->rect);
never executed (the execution status of this line is deduced): rule.drawRule(p, opt->rect);
-
3127 QWindowsStyle::drawComplexControl(cc, opt, p, w);
never executed (the execution status of this line is deduced): QWindowsStyle::drawComplexControl(cc, opt, p, w);
-
3128 }
never executed: }
0
3129 return;
never executed: return;
0
3130 } -
3131 break;
never executed: break;
0
3132#endif // QT_NO_SCROLLBAR -
3133 -
3134#ifndef QT_NO_SLIDER -
3135 case CC_Slider: -
3136 if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
never evaluated: const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)
0
3137 rule.drawRule(p, opt->rect);
never executed (the execution status of this line is deduced): rule.drawRule(p, opt->rect);
-
3138 -
3139 QRenderRule grooveSubRule = renderRule(w, opt, PseudoElement_SliderGroove);
never executed (the execution status of this line is deduced): QRenderRule grooveSubRule = renderRule(w, opt, PseudoElement_SliderGroove);
-
3140 QRenderRule handleSubRule = renderRule(w, opt, PseudoElement_SliderHandle);
never executed (the execution status of this line is deduced): QRenderRule handleSubRule = renderRule(w, opt, PseudoElement_SliderHandle);
-
3141 if (!grooveSubRule.hasDrawable()) {
never evaluated: !grooveSubRule.hasDrawable()
0
3142 QStyleOptionSlider slOpt(*slider);
never executed (the execution status of this line is deduced): QStyleOptionSlider slOpt(*slider);
-
3143 bool handleHasRule = handleSubRule.hasDrawable();
never executed (the execution status of this line is deduced): bool handleHasRule = handleSubRule.hasDrawable();
-
3144 // If the style specifies a different handler rule, draw the groove without the handler. -
3145 if (handleHasRule)
never evaluated: handleHasRule
0
3146 slOpt.subControls &= ~SC_SliderHandle;
never executed: slOpt.subControls &= ~SC_SliderHandle;
0
3147 baseStyle()->drawComplexControl(cc, &slOpt, p, w);
never executed (the execution status of this line is deduced): baseStyle()->drawComplexControl(cc, &slOpt, p, w);
-
3148 if (!handleHasRule)
never evaluated: !handleHasRule
0
3149 return;
never executed: return;
0
3150 }
never executed: }
0
3151 -
3152 QRect gr = subControlRect(cc, opt, SC_SliderGroove, w);
never executed (the execution status of this line is deduced): QRect gr = subControlRect(cc, opt, SC_SliderGroove, w);
-
3153 if (slider->subControls & SC_SliderGroove) {
never evaluated: slider->subControls & SC_SliderGroove
0
3154 grooveSubRule.drawRule(p, gr);
never executed (the execution status of this line is deduced): grooveSubRule.drawRule(p, gr);
-
3155 }
never executed: }
0
3156 -
3157 if (slider->subControls & SC_SliderHandle) {
never evaluated: slider->subControls & SC_SliderHandle
0
3158 QRect hr = subControlRect(cc, opt, SC_SliderHandle, w);
never executed (the execution status of this line is deduced): QRect hr = subControlRect(cc, opt, SC_SliderHandle, w);
-
3159 -
3160 QRenderRule subRule1 = renderRule(w, opt, PseudoElement_SliderSubPage);
never executed (the execution status of this line is deduced): QRenderRule subRule1 = renderRule(w, opt, PseudoElement_SliderSubPage);
-
3161 if (subRule1.hasDrawable()) {
never evaluated: subRule1.hasDrawable()
0
3162 QRect r(gr.topLeft(),
never executed (the execution status of this line is deduced): QRect r(gr.topLeft(),
-
3163 slider->orientation == Qt::Horizontal
never executed (the execution status of this line is deduced): slider->orientation == Qt::Horizontal
-
3164 ? QPoint(hr.x()+hr.width()/2, gr.y()+gr.height() - 1)
never executed (the execution status of this line is deduced): ? QPoint(hr.x()+hr.width()/2, gr.y()+gr.height() - 1)
-
3165 : QPoint(gr.x()+gr.width() - 1, hr.y()+hr.height()/2));
never executed (the execution status of this line is deduced): : QPoint(gr.x()+gr.width() - 1, hr.y()+hr.height()/2));
-
3166 subRule1.drawRule(p, r);
never executed (the execution status of this line is deduced): subRule1.drawRule(p, r);
-
3167 }
never executed: }
0
3168 -
3169 QRenderRule subRule2 = renderRule(w, opt, PseudoElement_SliderAddPage);
never executed (the execution status of this line is deduced): QRenderRule subRule2 = renderRule(w, opt, PseudoElement_SliderAddPage);
-
3170 if (subRule2.hasDrawable()) {
never evaluated: subRule2.hasDrawable()
0
3171 QRect r(slider->orientation == Qt::Horizontal
never executed (the execution status of this line is deduced): QRect r(slider->orientation == Qt::Horizontal
-
3172 ? QPoint(hr.x()+hr.width()/2+1, gr.y())
never executed (the execution status of this line is deduced): ? QPoint(hr.x()+hr.width()/2+1, gr.y())
-
3173 : QPoint(gr.x(), hr.y()+hr.height()/2+1),
never executed (the execution status of this line is deduced): : QPoint(gr.x(), hr.y()+hr.height()/2+1),
-
3174 gr.bottomRight());
never executed (the execution status of this line is deduced): gr.bottomRight());
-
3175 subRule2.drawRule(p, r);
never executed (the execution status of this line is deduced): subRule2.drawRule(p, r);
-
3176 }
never executed: }
0
3177 -
3178 handleSubRule.drawRule(p, handleSubRule.boxRect(hr, Margin));
never executed (the execution status of this line is deduced): handleSubRule.drawRule(p, handleSubRule.boxRect(hr, Margin));
-
3179 }
never executed: }
0
3180 -
3181 if (slider->subControls & SC_SliderTickmarks) {
never evaluated: slider->subControls & SC_SliderTickmarks
0
3182 // TODO... -
3183 }
never executed: }
0
3184 -
3185 return;
never executed: return;
0
3186 } -
3187 break;
never executed: break;
0
3188#endif // QT_NO_SLIDER -
3189 -
3190 case CC_MdiControls: -
3191 if (hasStyleRule(w, PseudoElement_MdiCloseButton)
never evaluated: hasStyleRule(w, PseudoElement_MdiCloseButton)
0
3192 || hasStyleRule(w, PseudoElement_MdiNormalButton)
never evaluated: hasStyleRule(w, PseudoElement_MdiNormalButton)
0
3193 || hasStyleRule(w, PseudoElement_MdiMinButton)) {
never evaluated: hasStyleRule(w, PseudoElement_MdiMinButton)
0
3194 QList<QVariant> layout = rule.styleHint(QLatin1String("button-layout")).toList();
never executed (the execution status of this line is deduced): QList<QVariant> layout = rule.styleHint(QLatin1String("button-layout")).toList();
-
3195 if (layout.isEmpty())
never evaluated: layout.isEmpty()
0
3196 layout = subControlLayout(QLatin1String("mNX"));
never executed: layout = subControlLayout(QLatin1String("mNX"));
0
3197 -
3198 QStyleOptionComplex optCopy(*opt);
never executed (the execution status of this line is deduced): QStyleOptionComplex optCopy(*opt);
-
3199 optCopy.subControls = 0;
never executed (the execution status of this line is deduced): optCopy.subControls = 0;
-
3200 for (int i = 0; i < layout.count(); i++) {
never evaluated: i < layout.count()
0
3201 int layoutButton = layout[i].toInt();
never executed (the execution status of this line is deduced): int layoutButton = layout[i].toInt();
-
3202 if (layoutButton < PseudoElement_MdiCloseButton
never evaluated: layoutButton < PseudoElement_MdiCloseButton
0
3203 || layoutButton > PseudoElement_MdiNormalButton)
never evaluated: layoutButton > PseudoElement_MdiNormalButton
0
3204 continue;
never executed: continue;
0
3205 QStyle::SubControl control = knownPseudoElements[layoutButton].subControl;
never executed (the execution status of this line is deduced): QStyle::SubControl control = knownPseudoElements[layoutButton].subControl;
-
3206 if (!(opt->subControls & control))
never evaluated: !(opt->subControls & control)
0
3207 continue;
never executed: continue;
0
3208 QRenderRule subRule = renderRule(w, opt, layoutButton);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, layoutButton);
-
3209 if (subRule.hasDrawable()) {
never evaluated: subRule.hasDrawable()
0
3210 QRect rect = subRule.boxRect(subControlRect(CC_MdiControls, opt, control, w), Margin);
never executed (the execution status of this line is deduced): QRect rect = subRule.boxRect(subControlRect(CC_MdiControls, opt, control, w), Margin);
-
3211 subRule.drawRule(p, rect);
never executed (the execution status of this line is deduced): subRule.drawRule(p, rect);
-
3212 QIcon icon = standardIcon(subControlIcon(layoutButton), opt);
never executed (the execution status of this line is deduced): QIcon icon = standardIcon(subControlIcon(layoutButton), opt);
-
3213 icon.paint(p, subRule.contentsRect(rect), Qt::AlignCenter);
never executed (the execution status of this line is deduced): icon.paint(p, subRule.contentsRect(rect), Qt::AlignCenter);
-
3214 } else {
never executed: }
0
3215 optCopy.subControls |= control;
never executed (the execution status of this line is deduced): optCopy.subControls |= control;
-
3216 }
never executed: }
0
3217 } -
3218 -
3219 if (optCopy.subControls)
never evaluated: optCopy.subControls
0
3220 baseStyle()->drawComplexControl(CC_MdiControls, &optCopy, p, w);
never executed: baseStyle()->drawComplexControl(CC_MdiControls, &optCopy, p, w);
0
3221 return;
never executed: return;
0
3222 } -
3223 break;
never executed: break;
0
3224 -
3225 case CC_TitleBar: -
3226 if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)) {
never evaluated: const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)
0
3227 QRenderRule subRule = renderRule(w, opt, PseudoElement_TitleBar);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_TitleBar);
-
3228 if (!subRule.hasDrawable() && !subRule.hasBox() && !subRule.hasBorder())
never evaluated: !subRule.hasDrawable()
never evaluated: !subRule.hasBox()
never evaluated: !subRule.hasBorder()
0
3229 break;
never executed: break;
0
3230 subRule.drawRule(p, opt->rect);
never executed (the execution status of this line is deduced): subRule.drawRule(p, opt->rect);
-
3231 QHash<QStyle::SubControl, QRect> layout = titleBarLayout(w, tb);
never executed (the execution status of this line is deduced): QHash<QStyle::SubControl, QRect> layout = titleBarLayout(w, tb);
-
3232 -
3233 QRect ir;
never executed (the execution status of this line is deduced): QRect ir;
-
3234 ir = layout[SC_TitleBarLabel];
never executed (the execution status of this line is deduced): ir = layout[SC_TitleBarLabel];
-
3235 if (ir.isValid()) {
never evaluated: ir.isValid()
0
3236 if (subRule.hasPalette())
never evaluated: subRule.hasPalette()
0
3237 p->setPen(subRule.palette()->foreground.color());
never executed: p->setPen(subRule.palette()->foreground.color());
0
3238 p->fillRect(ir, Qt::white);
never executed (the execution status of this line is deduced): p->fillRect(ir, Qt::white);
-
3239 p->drawText(ir.x(), ir.y(), ir.width(), ir.height(), Qt::AlignLeft | Qt::AlignVCenter | Qt::TextSingleLine, tb->text);
never executed (the execution status of this line is deduced): p->drawText(ir.x(), ir.y(), ir.width(), ir.height(), Qt::AlignLeft | Qt::AlignVCenter | Qt::TextSingleLine, tb->text);
-
3240 }
never executed: }
0
3241 -
3242 QPixmap pm;
never executed (the execution status of this line is deduced): QPixmap pm;
-
3243 -
3244 ir = layout[SC_TitleBarSysMenu];
never executed (the execution status of this line is deduced): ir = layout[SC_TitleBarSysMenu];
-
3245 if (ir.isValid()) {
never evaluated: ir.isValid()
0
3246 QRenderRule subSubRule = renderRule(w, opt, PseudoElement_TitleBarSysMenu);
never executed (the execution status of this line is deduced): QRenderRule subSubRule = renderRule(w, opt, PseudoElement_TitleBarSysMenu);
-
3247 subSubRule.drawRule(p, ir);
never executed (the execution status of this line is deduced): subSubRule.drawRule(p, ir);
-
3248 ir = subSubRule.contentsRect(ir);
never executed (the execution status of this line is deduced): ir = subSubRule.contentsRect(ir);
-
3249 if (!tb->icon.isNull()) {
never evaluated: !tb->icon.isNull()
0
3250 tb->icon.paint(p, ir);
never executed (the execution status of this line is deduced): tb->icon.paint(p, ir);
-
3251 } else {
never executed: }
0
3252 int iconSize = pixelMetric(PM_SmallIconSize, tb, w);
never executed (the execution status of this line is deduced): int iconSize = pixelMetric(PM_SmallIconSize, tb, w);
-
3253 pm = standardIcon(SP_TitleBarMenuButton, 0, w).pixmap(iconSize, iconSize);
never executed (the execution status of this line is deduced): pm = standardIcon(SP_TitleBarMenuButton, 0, w).pixmap(iconSize, iconSize);
-
3254 drawItemPixmap(p, ir, Qt::AlignCenter, pm);
never executed (the execution status of this line is deduced): drawItemPixmap(p, ir, Qt::AlignCenter, pm);
-
3255 }
never executed: }
0
3256 } -
3257 -
3258 ir = layout[SC_TitleBarCloseButton];
never executed (the execution status of this line is deduced): ir = layout[SC_TitleBarCloseButton];
-
3259 if (ir.isValid()) {
never evaluated: ir.isValid()
0
3260 QRenderRule subSubRule = renderRule(w, opt, PseudoElement_TitleBarCloseButton);
never executed (the execution status of this line is deduced): QRenderRule subSubRule = renderRule(w, opt, PseudoElement_TitleBarCloseButton);
-
3261 subSubRule.drawRule(p, ir);
never executed (the execution status of this line is deduced): subSubRule.drawRule(p, ir);
-
3262 -
3263 QSize sz = subSubRule.contentsRect(ir).size();
never executed (the execution status of this line is deduced): QSize sz = subSubRule.contentsRect(ir).size();
-
3264 if ((tb->titleBarFlags & Qt::WindowType_Mask) == Qt::Tool)
never evaluated: (tb->titleBarFlags & Qt::WindowType_Mask) == Qt::Tool
0
3265 pm = standardIcon(SP_DockWidgetCloseButton, 0, w).pixmap(sz);
never executed: pm = standardIcon(SP_DockWidgetCloseButton, 0, w).pixmap(sz);
0
3266 else -
3267 pm = standardIcon(SP_TitleBarCloseButton, 0, w).pixmap(sz);
never executed: pm = standardIcon(SP_TitleBarCloseButton, 0, w).pixmap(sz);
0
3268 drawItemPixmap(p, ir, Qt::AlignCenter, pm);
never executed (the execution status of this line is deduced): drawItemPixmap(p, ir, Qt::AlignCenter, pm);
-
3269 }
never executed: }
0
3270 -
3271 int pes[] = {
never executed (the execution status of this line is deduced): int pes[] = {
-
3272 PseudoElement_TitleBarMaxButton,
never executed (the execution status of this line is deduced): PseudoElement_TitleBarMaxButton,
-
3273 PseudoElement_TitleBarMinButton,
never executed (the execution status of this line is deduced): PseudoElement_TitleBarMinButton,
-
3274 PseudoElement_TitleBarNormalButton,
never executed (the execution status of this line is deduced): PseudoElement_TitleBarNormalButton,
-
3275 PseudoElement_TitleBarShadeButton,
never executed (the execution status of this line is deduced): PseudoElement_TitleBarShadeButton,
-
3276 PseudoElement_TitleBarUnshadeButton,
never executed (the execution status of this line is deduced): PseudoElement_TitleBarUnshadeButton,
-
3277 PseudoElement_TitleBarContextHelpButton
never executed (the execution status of this line is deduced): PseudoElement_TitleBarContextHelpButton
-
3278 };
never executed (the execution status of this line is deduced): };
-
3279 -
3280 for (unsigned int i = 0; i < sizeof(pes)/sizeof(int); i++) {
never evaluated: i < sizeof(pes)/sizeof(int)
0
3281 int pe = pes[i];
never executed (the execution status of this line is deduced): int pe = pes[i];
-
3282 QStyle::SubControl sc = knownPseudoElements[pe].subControl;
never executed (the execution status of this line is deduced): QStyle::SubControl sc = knownPseudoElements[pe].subControl;
-
3283 ir = layout[sc];
never executed (the execution status of this line is deduced): ir = layout[sc];
-
3284 if (!ir.isValid())
never evaluated: !ir.isValid()
0
3285 continue;
never executed: continue;
0
3286 QRenderRule subSubRule = renderRule(w, opt, pe);
never executed (the execution status of this line is deduced): QRenderRule subSubRule = renderRule(w, opt, pe);
-
3287 subSubRule.drawRule(p, ir);
never executed (the execution status of this line is deduced): subSubRule.drawRule(p, ir);
-
3288 pm = standardIcon(subControlIcon(pe), 0, w).pixmap(subSubRule.contentsRect(ir).size());
never executed (the execution status of this line is deduced): pm = standardIcon(subControlIcon(pe), 0, w).pixmap(subSubRule.contentsRect(ir).size());
-
3289 drawItemPixmap(p, ir, Qt::AlignCenter, pm);
never executed (the execution status of this line is deduced): drawItemPixmap(p, ir, Qt::AlignCenter, pm);
-
3290 }
never executed: }
0
3291 -
3292 return;
never executed: return;
0
3293 } -
3294 break;
never executed: break;
0
3295 -
3296 -
3297 default: -
3298 break;
never executed: break;
0
3299 } -
3300 -
3301 baseStyle()->drawComplexControl(cc, opt, p, w);
never executed (the execution status of this line is deduced): baseStyle()->drawComplexControl(cc, opt, p, w);
-
3302}
never executed: }
0
3303 -
3304void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter *p, -
3305 const QWidget *w) const -
3306{ -
3307 RECURSION_GUARD(baseStyle()->drawControl(ce, opt, p, w); return)
never executed: return;
never evaluated: globalStyleSheetStyle != 0
never evaluated: globalStyleSheetStyle != this
0
3308 -
3309 QRenderRule rule = renderRule(w, opt);
never executed (the execution status of this line is deduced): QRenderRule rule = renderRule(w, opt);
-
3310 int pe1 = PseudoElement_None, pe2 = PseudoElement_None;
never executed (the execution status of this line is deduced): int pe1 = PseudoElement_None, pe2 = PseudoElement_None;
-
3311 bool fallback = false;
never executed (the execution status of this line is deduced): bool fallback = false;
-
3312 -
3313 switch (ce) { -
3314 case CE_ToolButtonLabel: -
3315 if (const QStyleOptionToolButton *btn = qstyleoption_cast<const QStyleOptionToolButton *>(opt)) {
never evaluated: const QStyleOptionToolButton *btn = qstyleoption_cast<const QStyleOptionToolButton *>(opt)
0
3316 if (rule.hasBox() || btn->features & QStyleOptionToolButton::Arrow) {
never evaluated: rule.hasBox()
never evaluated: btn->features & QStyleOptionToolButton::Arrow
0
3317 QCommonStyle::drawControl(ce, opt, p, w);
never executed (the execution status of this line is deduced): QCommonStyle::drawControl(ce, opt, p, w);
-
3318 } else {
never executed: }
0
3319 QStyleOptionToolButton butOpt(*btn);
never executed (the execution status of this line is deduced): QStyleOptionToolButton butOpt(*btn);
-
3320 rule.configurePalette(&butOpt.palette, QPalette::ButtonText, QPalette::Button);
never executed (the execution status of this line is deduced): rule.configurePalette(&butOpt.palette, QPalette::ButtonText, QPalette::Button);
-
3321 baseStyle()->drawControl(ce, &butOpt, p, w);
never executed (the execution status of this line is deduced): baseStyle()->drawControl(ce, &butOpt, p, w);
-
3322 }
never executed: }
0
3323 return;
never executed: return;
0
3324 } -
3325 break;
never executed: break;
0
3326 -
3327 case CE_FocusFrame: -
3328 if (!rule.hasNativeBorder()) {
never evaluated: !rule.hasNativeBorder()
0
3329 rule.drawBorder(p, opt->rect);
never executed (the execution status of this line is deduced): rule.drawBorder(p, opt->rect);
-
3330 return;
never executed: return;
0
3331 } -
3332 break;
never executed: break;
0
3333 -
3334 case CE_PushButton: -
3335 if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
never evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)
0
3336 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
3337 ((btn->features & QStyleOptionButton::HasMenu) && hasStyleRule(w, PseudoElement_PushButtonMenuIndicator))) {
never evaluated: (btn->features & QStyleOptionButton::HasMenu)
never evaluated: hasStyleRule(w, PseudoElement_PushButtonMenuIndicator)
0
3338 ParentStyle::drawControl(ce, opt, p, w);
never executed (the execution status of this line is deduced): ParentStyle::drawControl(ce, opt, p, w);
-
3339 return;
never executed: return;
0
3340 } -
3341 }
never executed: }
0
3342 break;
never executed: break;
0
3343 case CE_PushButtonBevel: -
3344 if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
never evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)
0
3345 QStyleOptionButton btnOpt(*btn);
never executed (the execution status of this line is deduced): QStyleOptionButton btnOpt(*btn);
-
3346 btnOpt.rect = rule.borderRect(opt->rect);
never executed (the execution status of this line is deduced): btnOpt.rect = rule.borderRect(opt->rect);
-
3347 if (rule.hasNativeBorder()) {
never evaluated: rule.hasNativeBorder()
0
3348 rule.drawBackgroundImage(p, btnOpt.rect);
never executed (the execution status of this line is deduced): rule.drawBackgroundImage(p, btnOpt.rect);
-
3349 rule.configurePalette(&btnOpt.palette, QPalette::ButtonText, QPalette::Button);
never executed (the execution status of this line is deduced): rule.configurePalette(&btnOpt.palette, QPalette::ButtonText, QPalette::Button);
-
3350 bool customMenu = (btn->features & QStyleOptionButton::HasMenu
never evaluated: btn->features & QStyleOptionButton::HasMenu
0
3351 && hasStyleRule(w, PseudoElement_PushButtonMenuIndicator));
never evaluated: hasStyleRule(w, PseudoElement_PushButtonMenuIndicator)
0
3352 if (customMenu)
never evaluated: customMenu
0
3353 btnOpt.features &= ~QStyleOptionButton::HasMenu;
never executed: btnOpt.features &= ~QStyleOptionButton::HasMenu;
0
3354 if (rule.baseStyleCanDraw()) {
never evaluated: rule.baseStyleCanDraw()
0
3355 baseStyle()->drawControl(ce, &btnOpt, p, w);
never executed (the execution status of this line is deduced): baseStyle()->drawControl(ce, &btnOpt, p, w);
-
3356 } else {
never executed: }
0
3357 QWindowsStyle::drawControl(ce, &btnOpt, p, w);
never executed (the execution status of this line is deduced): QWindowsStyle::drawControl(ce, &btnOpt, p, w);
-
3358 }
never executed: }
0
3359 if (!customMenu)
never evaluated: !customMenu
0
3360 return;
never executed: return;
0
3361 } else {
never executed: }
0
3362 rule.drawRule(p, opt->rect);
never executed (the execution status of this line is deduced): rule.drawRule(p, opt->rect);
-
3363 }
never executed: }
0
3364 -
3365 if (btn->features & QStyleOptionButton::HasMenu) {
never evaluated: btn->features & QStyleOptionButton::HasMenu
0
3366 QRenderRule subRule = renderRule(w, opt, PseudoElement_PushButtonMenuIndicator);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_PushButtonMenuIndicator);
-
3367 QRect ir = positionRect(w, rule, subRule, PseudoElement_PushButtonMenuIndicator, opt->rect, opt->direction);
never executed (the execution status of this line is deduced): QRect ir = positionRect(w, rule, subRule, PseudoElement_PushButtonMenuIndicator, opt->rect, opt->direction);
-
3368 if (subRule.hasDrawable()) {
never evaluated: subRule.hasDrawable()
0
3369 subRule.drawRule(p, ir);
never executed (the execution status of this line is deduced): subRule.drawRule(p, ir);
-
3370 } else {
never executed: }
0
3371 btnOpt.rect = ir;
never executed (the execution status of this line is deduced): btnOpt.rect = ir;
-
3372 baseStyle()->drawPrimitive(PE_IndicatorArrowDown, &btnOpt, p, w);
never executed (the execution status of this line is deduced): baseStyle()->drawPrimitive(PE_IndicatorArrowDown, &btnOpt, p, w);
-
3373 }
never executed: }
0
3374 } -
3375 }
never executed: }
0
3376 return;
never executed: return;
0
3377 -
3378 case CE_PushButtonLabel: -
3379 if (const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
never evaluated: const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton *>(opt)
0
3380 QStyleOptionButton butOpt(*button);
never executed (the execution status of this line is deduced): QStyleOptionButton butOpt(*button);
-
3381 rule.configurePalette(&butOpt.palette, QPalette::ButtonText, QPalette::Button);
never executed (the execution status of this line is deduced): rule.configurePalette(&butOpt.palette, QPalette::ButtonText, QPalette::Button);
-
3382 if (rule.hasPosition() && rule.position()->textAlignment != 0) {
never evaluated: rule.hasPosition()
never evaluated: rule.position()->textAlignment != 0
0
3383 Qt::Alignment textAlignment = rule.position()->textAlignment;
never executed (the execution status of this line is deduced): Qt::Alignment textAlignment = rule.position()->textAlignment;
-
3384 QRect textRect = button->rect;
never executed (the execution status of this line is deduced): QRect textRect = button->rect;
-
3385 uint tf = Qt::TextShowMnemonic;
never executed (the execution status of this line is deduced): uint tf = Qt::TextShowMnemonic;
-
3386 const uint verticalAlignMask = Qt::AlignVCenter | Qt::AlignTop | Qt::AlignLeft;
never executed (the execution status of this line is deduced): const uint verticalAlignMask = Qt::AlignVCenter | Qt::AlignTop | Qt::AlignLeft;
-
3387 tf |= (textAlignment & verticalAlignMask) ? (textAlignment & verticalAlignMask) : Qt::AlignVCenter;
never evaluated: (textAlignment & verticalAlignMask)
0
3388 if (!styleHint(SH_UnderlineShortcut, button, w))
never evaluated: !styleHint(SH_UnderlineShortcut, button, w)
0
3389 tf |= Qt::TextHideMnemonic;
never executed: tf |= Qt::TextHideMnemonic;
0
3390 if (!button->icon.isNull()) {
never evaluated: !button->icon.isNull()
0
3391 //Group both icon and text -
3392 QRect iconRect;
never executed (the execution status of this line is deduced): QRect iconRect;
-
3393 QIcon::Mode mode = button->state & State_Enabled ? QIcon::Normal : QIcon::Disabled;
never evaluated: button->state & State_Enabled
0
3394 if (mode == QIcon::Normal && button->state & State_HasFocus)
never evaluated: mode == QIcon::Normal
never evaluated: button->state & State_HasFocus
0
3395 mode = QIcon::Active;
never executed: mode = QIcon::Active;
0
3396 QIcon::State state = QIcon::Off;
never executed (the execution status of this line is deduced): QIcon::State state = QIcon::Off;
-
3397 if (button->state & State_On)
never evaluated: button->state & State_On
0
3398 state = QIcon::On;
never executed: state = QIcon::On;
0
3399 -
3400 QPixmap pixmap = button->icon.pixmap(button->iconSize, mode, state);
never executed (the execution status of this line is deduced): QPixmap pixmap = button->icon.pixmap(button->iconSize, mode, state);
-
3401 int labelWidth = pixmap.width();
never executed (the execution status of this line is deduced): int labelWidth = pixmap.width();
-
3402 int labelHeight = pixmap.height();
never executed (the execution status of this line is deduced): int labelHeight = pixmap.height();
-
3403 int iconSpacing = 4;//### 4 is currently hardcoded in QPushButton::sizeHint()
never executed (the execution status of this line is deduced): int iconSpacing = 4;
-
3404 int textWidth = button->fontMetrics.boundingRect(opt->rect, tf, button->text).width();
never executed (the execution status of this line is deduced): int textWidth = button->fontMetrics.boundingRect(opt->rect, tf, button->text).width();
-
3405 if (!button->text.isEmpty())
never evaluated: !button->text.isEmpty()
0
3406 labelWidth += (textWidth + iconSpacing);
never executed: labelWidth += (textWidth + iconSpacing);
0
3407 -
3408 //Determine label alignment: -
3409 if (textAlignment & Qt::AlignLeft) { /*left*/
never evaluated: textAlignment & Qt::AlignLeft
0
3410 iconRect = QRect(textRect.x(), textRect.y() + (textRect.height() - labelHeight) / 2,
never executed (the execution status of this line is deduced): iconRect = QRect(textRect.x(), textRect.y() + (textRect.height() - labelHeight) / 2,
-
3411 pixmap.width(), pixmap.height());
never executed (the execution status of this line is deduced): pixmap.width(), pixmap.height());
-
3412 } else if (textAlignment & Qt::AlignHCenter) { /* center */
never executed: }
never evaluated: textAlignment & Qt::AlignHCenter
0
3413 iconRect = QRect(textRect.x() + (textRect.width() - labelWidth) / 2,
never executed (the execution status of this line is deduced): iconRect = QRect(textRect.x() + (textRect.width() - labelWidth) / 2,
-
3414 textRect.y() + (textRect.height() - labelHeight) / 2,
never executed (the execution status of this line is deduced): textRect.y() + (textRect.height() - labelHeight) / 2,
-
3415 pixmap.width(), pixmap.height());
never executed (the execution status of this line is deduced): pixmap.width(), pixmap.height());
-
3416 } else { /*right*/
never executed: }
0
3417 iconRect = QRect(textRect.x() + textRect.width() - labelWidth,
never executed (the execution status of this line is deduced): iconRect = QRect(textRect.x() + textRect.width() - labelWidth,
-
3418 textRect.y() + (textRect.height() - labelHeight) / 2,
never executed (the execution status of this line is deduced): textRect.y() + (textRect.height() - labelHeight) / 2,
-
3419 pixmap.width(), pixmap.height());
never executed (the execution status of this line is deduced): pixmap.width(), pixmap.height());
-
3420 }
never executed: }
0
3421 -
3422 iconRect = visualRect(button->direction, textRect, iconRect);
never executed (the execution status of this line is deduced): iconRect = visualRect(button->direction, textRect, iconRect);
-
3423 -
3424 tf |= Qt::AlignLeft; //left align, we adjust the text-rect instead
never executed (the execution status of this line is deduced): tf |= Qt::AlignLeft;
-
3425 -
3426 if (button->direction == Qt::RightToLeft)
never evaluated: button->direction == Qt::RightToLeft
0
3427 textRect.setRight(iconRect.left() - iconSpacing);
never executed: textRect.setRight(iconRect.left() - iconSpacing);
0
3428 else -
3429 textRect.setLeft(iconRect.left() + iconRect.width() + iconSpacing);
never executed: textRect.setLeft(iconRect.left() + iconRect.width() + iconSpacing);
0
3430 -
3431 if (button->state & (State_On | State_Sunken))
never evaluated: button->state & (State_On | State_Sunken)
0
3432 iconRect.translate(pixelMetric(PM_ButtonShiftHorizontal, opt, w),
never executed: iconRect.translate(pixelMetric(PM_ButtonShiftHorizontal, opt, w), pixelMetric(PM_ButtonShiftVertical, opt, w));
0
3433 pixelMetric(PM_ButtonShiftVertical, opt, w));
never executed: iconRect.translate(pixelMetric(PM_ButtonShiftHorizontal, opt, w), pixelMetric(PM_ButtonShiftVertical, opt, w));
0
3434 p->drawPixmap(iconRect, pixmap);
never executed (the execution status of this line is deduced): p->drawPixmap(iconRect, pixmap);
-
3435 } else {
never executed: }
0
3436 tf |= textAlignment;
never executed (the execution status of this line is deduced): tf |= textAlignment;
-
3437 }
never executed: }
0
3438 if (button->state & (State_On | State_Sunken))
never evaluated: button->state & (State_On | State_Sunken)
0
3439 textRect.translate(pixelMetric(PM_ButtonShiftHorizontal, opt, w),
never executed: textRect.translate(pixelMetric(PM_ButtonShiftHorizontal, opt, w), pixelMetric(PM_ButtonShiftVertical, opt, w));
0
3440 pixelMetric(PM_ButtonShiftVertical, opt, w));
never executed: textRect.translate(pixelMetric(PM_ButtonShiftHorizontal, opt, w), pixelMetric(PM_ButtonShiftVertical, opt, w));
0
3441 -
3442 if (button->features & QStyleOptionButton::HasMenu) {
never evaluated: button->features & QStyleOptionButton::HasMenu
0
3443 int indicatorSize = pixelMetric(PM_MenuButtonIndicator, button, w);
never executed (the execution status of this line is deduced): int indicatorSize = pixelMetric(PM_MenuButtonIndicator, button, w);
-
3444 if (button->direction == Qt::LeftToRight)
never evaluated: button->direction == Qt::LeftToRight
0
3445 textRect = textRect.adjusted(0, 0, -indicatorSize, 0);
never executed: textRect = textRect.adjusted(0, 0, -indicatorSize, 0);
0
3446 else -
3447 textRect = textRect.adjusted(indicatorSize, 0, 0, 0);
never executed: textRect = textRect.adjusted(indicatorSize, 0, 0, 0);
0
3448 } -
3449 drawItemText(p, textRect, tf, butOpt.palette, (button->state & State_Enabled),
never executed (the execution status of this line is deduced): drawItemText(p, textRect, tf, butOpt.palette, (button->state & State_Enabled),
-
3450 button->text, QPalette::ButtonText);
never executed (the execution status of this line is deduced): button->text, QPalette::ButtonText);
-
3451 } else {
never executed: }
0
3452 ParentStyle::drawControl(ce, &butOpt, p, w);
never executed (the execution status of this line is deduced): ParentStyle::drawControl(ce, &butOpt, p, w);
-
3453 }
never executed: }
0
3454 } -
3455 return;
never executed: return;
0
3456 -
3457 case CE_RadioButton: -
3458 case CE_CheckBox: -
3459 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
3460 rule.drawRule(p, opt->rect);
never executed (the execution status of this line is deduced): rule.drawRule(p, opt->rect);
-
3461 ParentStyle::drawControl(ce, opt, p, w);
never executed (the execution status of this line is deduced): ParentStyle::drawControl(ce, opt, p, w);
-
3462 return;
never executed: return;
0
3463 } else if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
never evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)
0
3464 QStyleOptionButton butOpt(*btn);
never executed (the execution status of this line is deduced): QStyleOptionButton butOpt(*btn);
-
3465 rule.configurePalette(&butOpt.palette, QPalette::ButtonText, QPalette::Button);
never executed (the execution status of this line is deduced): rule.configurePalette(&butOpt.palette, QPalette::ButtonText, QPalette::Button);
-
3466 baseStyle()->drawControl(ce, &butOpt, p, w);
never executed (the execution status of this line is deduced): baseStyle()->drawControl(ce, &butOpt, p, w);
-
3467 return;
never executed: return;
0
3468 } -
3469 break;
never executed: break;
0
3470 case CE_RadioButtonLabel: -
3471 case CE_CheckBoxLabel: -
3472 if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
never evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)
0
3473 QStyleOptionButton butOpt(*btn);
never executed (the execution status of this line is deduced): QStyleOptionButton butOpt(*btn);
-
3474 rule.configurePalette(&butOpt.palette, QPalette::ButtonText, QPalette::Button);
never executed (the execution status of this line is deduced): rule.configurePalette(&butOpt.palette, QPalette::ButtonText, QPalette::Button);
-
3475 ParentStyle::drawControl(ce, &butOpt, p, w);
never executed (the execution status of this line is deduced): ParentStyle::drawControl(ce, &butOpt, p, w);
-
3476 }
never executed: }
0
3477 return;
never executed: return;
0
3478 -
3479 case CE_Splitter: -
3480 pe1 = PseudoElement_SplitterHandle;
never executed (the execution status of this line is deduced): pe1 = PseudoElement_SplitterHandle;
-
3481 break;
never executed: break;
0
3482 -
3483 case CE_ToolBar: -
3484 if (rule.hasBackground()) {
never evaluated: rule.hasBackground()
0
3485 rule.drawBackground(p, opt->rect);
never executed (the execution status of this line is deduced): rule.drawBackground(p, opt->rect);
-
3486 }
never executed: }
0
3487 if (rule.hasBorder()) {
never evaluated: rule.hasBorder()
0
3488 rule.drawBorder(p, rule.borderRect(opt->rect));
never executed (the execution status of this line is deduced): rule.drawBorder(p, rule.borderRect(opt->rect));
-
3489 } else {
never executed: }
0
3490#ifndef QT_NO_TOOLBAR -
3491 if (const QStyleOptionToolBar *tb = qstyleoption_cast<const QStyleOptionToolBar *>(opt)) {
never evaluated: const QStyleOptionToolBar *tb = qstyleoption_cast<const QStyleOptionToolBar *>(opt)
0
3492 QStyleOptionToolBar newTb(*tb);
never executed (the execution status of this line is deduced): QStyleOptionToolBar newTb(*tb);
-
3493 newTb.rect = rule.borderRect(opt->rect);
never executed (the execution status of this line is deduced): newTb.rect = rule.borderRect(opt->rect);
-
3494 baseStyle()->drawControl(ce, &newTb, p, w);
never executed (the execution status of this line is deduced): baseStyle()->drawControl(ce, &newTb, p, w);
-
3495 }
never executed: }
0
3496#endif // QT_NO_TOOLBAR -
3497 }
never executed: }
0
3498 return;
never executed: return;
0
3499 -
3500 case CE_MenuEmptyArea: -
3501 case CE_MenuBarEmptyArea: -
3502 if (rule.hasDrawable()) {
never evaluated: rule.hasDrawable()
0
3503 // Drawn by PE_Widget -
3504 return;
never executed: return;
0
3505 } -
3506 break;
never executed: break;
0
3507 -
3508 case CE_MenuTearoff: -
3509 case CE_MenuScroller: -
3510 if (const QStyleOptionMenuItem *m = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
never evaluated: const QStyleOptionMenuItem *m = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)
0
3511 QStyleOptionMenuItem mi(*m);
never executed (the execution status of this line is deduced): QStyleOptionMenuItem mi(*m);
-
3512 int pe = ce == CE_MenuTearoff ? PseudoElement_MenuTearoff : PseudoElement_MenuScroller;
never evaluated: ce == CE_MenuTearoff
0
3513 QRenderRule subRule = renderRule(w, opt, pe);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, pe);
-
3514 mi.rect = subRule.contentsRect(opt->rect);
never executed (the execution status of this line is deduced): mi.rect = subRule.contentsRect(opt->rect);
-
3515 rule.configurePalette(&mi.palette, QPalette::ButtonText, QPalette::Button);
never executed (the execution status of this line is deduced): rule.configurePalette(&mi.palette, QPalette::ButtonText, QPalette::Button);
-
3516 subRule.configurePalette(&mi.palette, QPalette::ButtonText, QPalette::Button);
never executed (the execution status of this line is deduced): subRule.configurePalette(&mi.palette, QPalette::ButtonText, QPalette::Button);
-
3517 -
3518 if (subRule.hasDrawable()) {
never evaluated: subRule.hasDrawable()
0
3519 subRule.drawRule(p, opt->rect);
never executed (the execution status of this line is deduced): subRule.drawRule(p, opt->rect);
-
3520 } else {
never executed: }
0
3521 baseStyle()->drawControl(ce, &mi, p, w);
never executed (the execution status of this line is deduced): baseStyle()->drawControl(ce, &mi, p, w);
-
3522 }
never executed: }
0
3523 } -
3524 return;
never executed: return;
0
3525 -
3526 case CE_MenuItem: -
3527 if (const QStyleOptionMenuItem *m = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
never evaluated: const QStyleOptionMenuItem *m = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)
0
3528 QStyleOptionMenuItem mi(*m);
never executed (the execution status of this line is deduced): QStyleOptionMenuItem mi(*m);
-
3529 -
3530 int pseudo = (mi.menuItemType == QStyleOptionMenuItem::Separator) ? PseudoElement_MenuSeparator : PseudoElement_Item;
never evaluated: (mi.menuItemType == QStyleOptionMenuItem::Separator)
0
3531 QRenderRule subRule = renderRule(w, opt, pseudo);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, pseudo);
-
3532 mi.rect = subRule.contentsRect(opt->rect);
never executed (the execution status of this line is deduced): mi.rect = subRule.contentsRect(opt->rect);
-
3533 rule.configurePalette(&mi.palette, QPalette::ButtonText, QPalette::Button);
never executed (the execution status of this line is deduced): rule.configurePalette(&mi.palette, QPalette::ButtonText, QPalette::Button);
-
3534 rule.configurePalette(&mi.palette, QPalette::HighlightedText, QPalette::Highlight);
never executed (the execution status of this line is deduced): rule.configurePalette(&mi.palette, QPalette::HighlightedText, QPalette::Highlight);
-
3535 subRule.configurePalette(&mi.palette, QPalette::ButtonText, QPalette::Button);
never executed (the execution status of this line is deduced): subRule.configurePalette(&mi.palette, QPalette::ButtonText, QPalette::Button);
-
3536 subRule.configurePalette(&mi.palette, QPalette::HighlightedText, QPalette::Highlight);
never executed (the execution status of this line is deduced): subRule.configurePalette(&mi.palette, QPalette::HighlightedText, QPalette::Highlight);
-
3537 QFont oldFont = p->font();
never executed (the execution status of this line is deduced): QFont oldFont = p->font();
-
3538 if (subRule.hasFont)
never evaluated: subRule.hasFont
0
3539 p->setFont(subRule.font.resolve(p->font()));
never executed: p->setFont(subRule.font.resolve(p->font()));
0
3540 -
3541 // We fall back to drawing with the style sheet code whenever at least one of the -
3542 // items are styled in an incompatible way, such as having a background image. -
3543 QRenderRule allRules = renderRule(w, PseudoElement_Item, PseudoClass_Any);
never executed (the execution status of this line is deduced): QRenderRule allRules = renderRule(w, PseudoElement_Item, PseudoClass_Any);
-
3544 -
3545 if ((pseudo == PseudoElement_MenuSeparator) && subRule.hasDrawable()) {
never evaluated: (pseudo == PseudoElement_MenuSeparator)
never evaluated: subRule.hasDrawable()
0
3546 subRule.drawRule(p, opt->rect);
never executed (the execution status of this line is deduced): subRule.drawRule(p, opt->rect);
-
3547 } else if ((pseudo == PseudoElement_Item)
never executed: }
never evaluated: (pseudo == PseudoElement_Item)
0
3548 && (allRules.hasBox() || allRules.hasBorder()
never evaluated: allRules.hasBox()
never evaluated: allRules.hasBorder()
0
3549 || (allRules.background() && !allRules.background()->pixmap.isNull()))) {
never evaluated: allRules.background()
never evaluated: !allRules.background()->pixmap.isNull()
0
3550 subRule.drawRule(p, opt->rect);
never executed (the execution status of this line is deduced): subRule.drawRule(p, opt->rect);
-
3551 if (subRule.hasBackground()) {
never evaluated: subRule.hasBackground()
0
3552 mi.palette.setBrush(QPalette::Highlight, Qt::NoBrush);
never executed (the execution status of this line is deduced): mi.palette.setBrush(QPalette::Highlight, Qt::NoBrush);
-
3553 mi.palette.setBrush(QPalette::Button, Qt::NoBrush);
never executed (the execution status of this line is deduced): mi.palette.setBrush(QPalette::Button, Qt::NoBrush);
-
3554 } else {
never executed: }
0
3555 mi.palette.setBrush(QPalette::Highlight, mi.palette.brush(QPalette::Button));
never executed (the execution status of this line is deduced): mi.palette.setBrush(QPalette::Highlight, mi.palette.brush(QPalette::Button));
-
3556 }
never executed: }
0
3557 mi.palette.setBrush(QPalette::HighlightedText, mi.palette.brush(QPalette::ButtonText));
never executed (the execution status of this line is deduced): mi.palette.setBrush(QPalette::HighlightedText, mi.palette.brush(QPalette::ButtonText));
-
3558 -
3559 bool checkable = mi.checkType != QStyleOptionMenuItem::NotCheckable;
never executed (the execution status of this line is deduced): bool checkable = mi.checkType != QStyleOptionMenuItem::NotCheckable;
-
3560 bool checked = checkable ? mi.checked : false;
never evaluated: checkable
0
3561 -
3562 bool dis = !(opt->state & QStyle::State_Enabled),
never executed (the execution status of this line is deduced): bool dis = !(opt->state & QStyle::State_Enabled),
-
3563 act = opt->state & QStyle::State_Selected;
never executed (the execution status of this line is deduced): act = opt->state & QStyle::State_Selected;
-
3564 -
3565 if (!mi.icon.isNull()) {
never evaluated: !mi.icon.isNull()
0
3566 QIcon::Mode mode = dis ? QIcon::Disabled : QIcon::Normal;
never evaluated: dis
0
3567 if (act && !dis)
never evaluated: act
never evaluated: !dis
0
3568 mode = QIcon::Active;
never executed: mode = QIcon::Active;
0
3569 QPixmap pixmap;
never executed (the execution status of this line is deduced): QPixmap pixmap;
-
3570 if (checked)
never evaluated: checked
0
3571 pixmap = mi.icon.pixmap(pixelMetric(PM_SmallIconSize), mode, QIcon::On);
never executed: pixmap = mi.icon.pixmap(pixelMetric(PM_SmallIconSize), mode, QIcon::On);
0
3572 else -
3573 pixmap = mi.icon.pixmap(pixelMetric(PM_SmallIconSize), mode);
never executed: pixmap = mi.icon.pixmap(pixelMetric(PM_SmallIconSize), mode);
0
3574 int pixw = pixmap.width();
never executed (the execution status of this line is deduced): int pixw = pixmap.width();
-
3575 int pixh = pixmap.height();
never executed (the execution status of this line is deduced): int pixh = pixmap.height();
-
3576 QRenderRule iconRule = renderRule(w, opt, PseudoElement_MenuIcon);
never executed (the execution status of this line is deduced): QRenderRule iconRule = renderRule(w, opt, PseudoElement_MenuIcon);
-
3577 if (!iconRule.hasGeometry()) {
never evaluated: !iconRule.hasGeometry()
0
3578 iconRule.geo = new QStyleSheetGeometryData(pixw, pixh, pixw, pixh, -1, -1);
never executed (the execution status of this line is deduced): iconRule.geo = new QStyleSheetGeometryData(pixw, pixh, pixw, pixh, -1, -1);
-
3579 } else {
never executed: }
0
3580 iconRule.geo->width = pixw;
never executed (the execution status of this line is deduced): iconRule.geo->width = pixw;
-
3581 iconRule.geo->height = pixh;
never executed (the execution status of this line is deduced): iconRule.geo->height = pixh;
-
3582 }
never executed: }
0
3583 QRect iconRect = positionRect(w, subRule, iconRule, PseudoElement_MenuIcon, opt->rect, opt->direction);
never executed (the execution status of this line is deduced): QRect iconRect = positionRect(w, subRule, iconRule, PseudoElement_MenuIcon, opt->rect, opt->direction);
-
3584 iconRule.drawRule(p, iconRect);
never executed (the execution status of this line is deduced): iconRule.drawRule(p, iconRect);
-
3585 QRect pmr(0, 0, pixw, pixh);
never executed (the execution status of this line is deduced): QRect pmr(0, 0, pixw, pixh);
-
3586 pmr.moveCenter(iconRect.center());
never executed (the execution status of this line is deduced): pmr.moveCenter(iconRect.center());
-
3587 p->drawPixmap(pmr.topLeft(), pixmap);
never executed (the execution status of this line is deduced): p->drawPixmap(pmr.topLeft(), pixmap);
-
3588 } else if (checkable) {
never executed: }
never evaluated: checkable
0
3589 QRenderRule subSubRule = renderRule(w, opt, PseudoElement_MenuCheckMark);
never executed (the execution status of this line is deduced): QRenderRule subSubRule = renderRule(w, opt, PseudoElement_MenuCheckMark);
-
3590 if (subSubRule.hasDrawable() || checked) {
never evaluated: subSubRule.hasDrawable()
never evaluated: checked
0
3591 QStyleOptionMenuItem newMi = mi;
never executed (the execution status of this line is deduced): QStyleOptionMenuItem newMi = mi;
-
3592 newMi.rect = positionRect(w, subRule, subSubRule, PseudoElement_MenuCheckMark, opt->rect, opt->direction);
never executed (the execution status of this line is deduced): newMi.rect = positionRect(w, subRule, subSubRule, PseudoElement_MenuCheckMark, opt->rect, opt->direction);
-
3593 drawPrimitive(PE_IndicatorMenuCheckMark, &newMi, p, w);
never executed (the execution status of this line is deduced): drawPrimitive(PE_IndicatorMenuCheckMark, &newMi, p, w);
-
3594 }
never executed: }
0
3595 }
never executed: }
0
3596 -
3597 QRect textRect = subRule.contentsRect(opt->rect);
never executed (the execution status of this line is deduced): QRect textRect = subRule.contentsRect(opt->rect);
-
3598 textRect.setWidth(textRect.width() - mi.tabWidth);
never executed (the execution status of this line is deduced): textRect.setWidth(textRect.width() - mi.tabWidth);
-
3599 QString s = mi.text;
never executed (the execution status of this line is deduced): QString s = mi.text;
-
3600 p->setPen(mi.palette.buttonText().color());
never executed (the execution status of this line is deduced): p->setPen(mi.palette.buttonText().color());
-
3601 if (!s.isEmpty()) {
never evaluated: !s.isEmpty()
0
3602 int text_flags = Qt::AlignLeft | Qt::AlignVCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine;
never executed (the execution status of this line is deduced): int text_flags = Qt::AlignLeft | Qt::AlignVCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine;
-
3603 if (!styleHint(SH_UnderlineShortcut, &mi, w))
never evaluated: !styleHint(SH_UnderlineShortcut, &mi, w)
0
3604 text_flags |= Qt::TextHideMnemonic;
never executed: text_flags |= Qt::TextHideMnemonic;
0
3605 int t = s.indexOf(QLatin1Char('\t'));
never executed (the execution status of this line is deduced): int t = s.indexOf(QLatin1Char('\t'));
-
3606 if (t >= 0) {
never evaluated: t >= 0
0
3607 QRect vShortcutRect = visualRect(opt->direction, mi.rect,
never executed (the execution status of this line is deduced): QRect vShortcutRect = visualRect(opt->direction, mi.rect,
-
3608 QRect(textRect.topRight(), QPoint(mi.rect.right(), textRect.bottom())));
never executed (the execution status of this line is deduced): QRect(textRect.topRight(), QPoint(mi.rect.right(), textRect.bottom())));
-
3609 p->drawText(vShortcutRect, text_flags, s.mid(t + 1));
never executed (the execution status of this line is deduced): p->drawText(vShortcutRect, text_flags, s.mid(t + 1));
-
3610 s = s.left(t);
never executed (the execution status of this line is deduced): s = s.left(t);
-
3611 }
never executed: }
0
3612 p->drawText(textRect, text_flags, s.left(t));
never executed (the execution status of this line is deduced): p->drawText(textRect, text_flags, s.left(t));
-
3613 }
never executed: }
0
3614 -
3615 if (mi.menuItemType == QStyleOptionMenuItem::SubMenu) {// draw sub menu arrow
never evaluated: mi.menuItemType == QStyleOptionMenuItem::SubMenu
0
3616 PrimitiveElement arrow = (opt->direction == Qt::RightToLeft) ? PE_IndicatorArrowLeft : PE_IndicatorArrowRight;
never evaluated: (opt->direction == Qt::RightToLeft)
0
3617 QRenderRule subRule2 = renderRule(w, opt, PseudoElement_MenuRightArrow);
never executed (the execution status of this line is deduced): QRenderRule subRule2 = renderRule(w, opt, PseudoElement_MenuRightArrow);
-
3618 mi.rect = positionRect(w, subRule, subRule2, PseudoElement_MenuRightArrow, opt->rect, mi.direction);
never executed (the execution status of this line is deduced): mi.rect = positionRect(w, subRule, subRule2, PseudoElement_MenuRightArrow, opt->rect, mi.direction);
-
3619 drawPrimitive(arrow, &mi, p, w);
never executed (the execution status of this line is deduced): drawPrimitive(arrow, &mi, p, w);
-
3620 }
never executed: }
0
3621 } else if (hasStyleRule(w, PseudoElement_MenuCheckMark) || hasStyleRule(w, PseudoElement_MenuRightArrow)) {
never executed: }
never evaluated: hasStyleRule(w, PseudoElement_MenuCheckMark)
never evaluated: hasStyleRule(w, PseudoElement_MenuRightArrow)
0
3622 QWindowsStyle::drawControl(ce, &mi, p, w);
never executed (the execution status of this line is deduced): QWindowsStyle::drawControl(ce, &mi, p, w);
-
3623 if (mi.checkType != QStyleOptionMenuItem::NotCheckable && !mi.checked) {
never evaluated: mi.checkType != QStyleOptionMenuItem::NotCheckable
never evaluated: !mi.checked
0
3624 // We have a style defined, but QWindowsStyle won't draw anything if not checked. -
3625 // So we mimick what QWindowsStyle would do. -
3626 int checkcol = qMax<int>(mi.maxIconWidth, QWindowsStylePrivate::windowsCheckMarkWidth);
never executed (the execution status of this line is deduced): int checkcol = qMax<int>(mi.maxIconWidth, QWindowsStylePrivate::windowsCheckMarkWidth);
-
3627 QRect vCheckRect = visualRect(opt->direction, mi.rect, QRect(mi.rect.x(), mi.rect.y(), checkcol, mi.rect.height()));
never executed (the execution status of this line is deduced): QRect vCheckRect = visualRect(opt->direction, mi.rect, QRect(mi.rect.x(), mi.rect.y(), checkcol, mi.rect.height()));
-
3628 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
3629 qDrawShadePanel(p, vCheckRect, mi.palette, true, 1, &mi.palette.brush(QPalette::Button));
never executed (the execution status of this line is deduced): qDrawShadePanel(p, vCheckRect, mi.palette, true, 1, &mi.palette.brush(QPalette::Button));
-
3630 } else {
never executed: }
0
3631 QBrush fill(mi.palette.light().color(), Qt::Dense4Pattern);
never executed (the execution status of this line is deduced): QBrush fill(mi.palette.light().color(), Qt::Dense4Pattern);
-
3632 qDrawShadePanel(p, vCheckRect, mi.palette, true, 1, &fill);
never executed (the execution status of this line is deduced): qDrawShadePanel(p, vCheckRect, mi.palette, true, 1, &fill);
-
3633 }
never executed: }
0
3634 QRenderRule subSubRule = renderRule(w, opt, PseudoElement_MenuCheckMark);
never executed (the execution status of this line is deduced): QRenderRule subSubRule = renderRule(w, opt, PseudoElement_MenuCheckMark);
-
3635 if (subSubRule.hasDrawable()) {
never evaluated: subSubRule.hasDrawable()
0
3636 QStyleOptionMenuItem newMi(mi);
never executed (the execution status of this line is deduced): QStyleOptionMenuItem newMi(mi);
-
3637 newMi.rect = visualRect(opt->direction, mi.rect, QRect(mi.rect.x() + QWindowsStylePrivate::windowsItemFrame,
never executed (the execution status of this line is deduced): newMi.rect = visualRect(opt->direction, mi.rect, QRect(mi.rect.x() + QWindowsStylePrivate::windowsItemFrame,
-
3638 mi.rect.y() + QWindowsStylePrivate::windowsItemFrame,
never executed (the execution status of this line is deduced): mi.rect.y() + QWindowsStylePrivate::windowsItemFrame,
-
3639 checkcol - 2 * QWindowsStylePrivate::windowsItemFrame,
never executed (the execution status of this line is deduced): checkcol - 2 * QWindowsStylePrivate::windowsItemFrame,
-
3640 mi.rect.height() - 2 * QWindowsStylePrivate::windowsItemFrame));
never executed (the execution status of this line is deduced): mi.rect.height() - 2 * QWindowsStylePrivate::windowsItemFrame));
-
3641 drawPrimitive(PE_IndicatorMenuCheckMark, &newMi, p, w);
never executed (the execution status of this line is deduced): drawPrimitive(PE_IndicatorMenuCheckMark, &newMi, p, w);
-
3642 }
never executed: }
0
3643 }
never executed: }
0
3644 } else {
never executed: }
0
3645 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
3646 mi.palette.setColor(QPalette::Window, Qt::transparent);
never executed (the execution status of this line is deduced): mi.palette.setColor(QPalette::Window, Qt::transparent);
-
3647 mi.palette.setColor(QPalette::Button, Qt::transparent);
never executed (the execution status of this line is deduced): mi.palette.setColor(QPalette::Button, Qt::transparent);
-
3648 }
never executed: }
0
3649 if (rule.baseStyleCanDraw() && subRule.baseStyleCanDraw()) {
never evaluated: rule.baseStyleCanDraw()
never evaluated: subRule.baseStyleCanDraw()
0
3650 baseStyle()->drawControl(ce, &mi, p, w);
never executed (the execution status of this line is deduced): baseStyle()->drawControl(ce, &mi, p, w);
-
3651 } else {
never executed: }
0
3652 ParentStyle::drawControl(ce, &mi, p, w);
never executed (the execution status of this line is deduced): ParentStyle::drawControl(ce, &mi, p, w);
-
3653 }
never executed: }
0
3654 } -
3655 -
3656 if (subRule.hasFont)
never evaluated: subRule.hasFont
0
3657 p->setFont(oldFont);
never executed: p->setFont(oldFont);
0
3658 -
3659 return;
never executed: return;
0
3660 } -
3661 return;
never executed: return;
0
3662 -
3663 case CE_MenuBarItem: -
3664 if (const QStyleOptionMenuItem *m = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
never evaluated: const QStyleOptionMenuItem *m = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)
0
3665 QStyleOptionMenuItem mi(*m);
never executed (the execution status of this line is deduced): QStyleOptionMenuItem mi(*m);
-
3666 QRenderRule subRule = renderRule(w, opt, PseudoElement_Item);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_Item);
-
3667 mi.rect = subRule.contentsRect(opt->rect);
never executed (the execution status of this line is deduced): mi.rect = subRule.contentsRect(opt->rect);
-
3668 rule.configurePalette(&mi.palette, QPalette::ButtonText, QPalette::Button);
never executed (the execution status of this line is deduced): rule.configurePalette(&mi.palette, QPalette::ButtonText, QPalette::Button);
-
3669 subRule.configurePalette(&mi.palette, QPalette::ButtonText, QPalette::Button);
never executed (the execution status of this line is deduced): subRule.configurePalette(&mi.palette, QPalette::ButtonText, QPalette::Button);
-
3670 -
3671 if (subRule.hasDrawable()) {
never evaluated: subRule.hasDrawable()
0
3672 subRule.drawRule(p, opt->rect);
never executed (the execution status of this line is deduced): subRule.drawRule(p, opt->rect);
-
3673 QCommonStyle::drawControl(ce, &mi, p, w);
never executed (the execution status of this line is deduced): QCommonStyle::drawControl(ce, &mi, p, w);
-
3674 } else {
never executed: }
0
3675 if (rule.hasDrawable() && !(opt->state & QStyle::State_Selected)) {
never evaluated: rule.hasDrawable()
never evaluated: !(opt->state & QStyle::State_Selected)
0
3676 // So that the menu bar background is not hidden by the items -
3677 mi.palette.setColor(QPalette::Window, Qt::transparent);
never executed (the execution status of this line is deduced): mi.palette.setColor(QPalette::Window, Qt::transparent);
-
3678 mi.palette.setColor(QPalette::Button, Qt::transparent);
never executed (the execution status of this line is deduced): mi.palette.setColor(QPalette::Button, Qt::transparent);
-
3679 }
never executed: }
0
3680 baseStyle()->drawControl(ce, &mi, p, w);
never executed (the execution status of this line is deduced): baseStyle()->drawControl(ce, &mi, p, w);
-
3681 }
never executed: }
0
3682 } -
3683 return;
never executed: return;
0
3684 -
3685#ifndef QT_NO_COMBOBOX -
3686 case CE_ComboBoxLabel: -
3687 if (!rule.hasBox())
never evaluated: !rule.hasBox()
0
3688 break;
never executed: break;
0
3689 if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
never evaluated: const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)
0
3690 QRect editRect = subControlRect(CC_ComboBox, cb, SC_ComboBoxEditField, w);
never executed (the execution status of this line is deduced): QRect editRect = subControlRect(CC_ComboBox, cb, SC_ComboBoxEditField, w);
-
3691 p->save();
never executed (the execution status of this line is deduced): p->save();
-
3692 p->setClipRect(editRect);
never executed (the execution status of this line is deduced): p->setClipRect(editRect);
-
3693 if (!cb->currentIcon.isNull()) {
never evaluated: !cb->currentIcon.isNull()
0
3694 int spacing = rule.hasBox() ? rule.box()->spacing : -1;
never evaluated: rule.hasBox()
0
3695 if (spacing == -1)
never evaluated: spacing == -1
0
3696 spacing = 6;
never executed: spacing = 6;
0
3697 QIcon::Mode mode = cb->state & State_Enabled ? QIcon::Normal : QIcon::Disabled;
never evaluated: cb->state & State_Enabled
0
3698 QPixmap pixmap = cb->currentIcon.pixmap(cb->iconSize, mode);
never executed (the execution status of this line is deduced): QPixmap pixmap = cb->currentIcon.pixmap(cb->iconSize, mode);
-
3699 QRect iconRect(editRect);
never executed (the execution status of this line is deduced): QRect iconRect(editRect);
-
3700 iconRect.setWidth(cb->iconSize.width());
never executed (the execution status of this line is deduced): iconRect.setWidth(cb->iconSize.width());
-
3701 iconRect = alignedRect(cb->direction,
never executed (the execution status of this line is deduced): iconRect = alignedRect(cb->direction,
-
3702 Qt::AlignLeft | Qt::AlignVCenter,
never executed (the execution status of this line is deduced): Qt::AlignLeft | Qt::AlignVCenter,
-
3703 iconRect.size(), editRect);
never executed (the execution status of this line is deduced): iconRect.size(), editRect);
-
3704 drawItemPixmap(p, iconRect, Qt::AlignCenter, pixmap);
never executed (the execution status of this line is deduced): drawItemPixmap(p, iconRect, Qt::AlignCenter, pixmap);
-
3705 -
3706 if (cb->direction == Qt::RightToLeft)
never evaluated: cb->direction == Qt::RightToLeft
0
3707 editRect.translate(-spacing - cb->iconSize.width(), 0);
never executed: editRect.translate(-spacing - cb->iconSize.width(), 0);
0
3708 else -
3709 editRect.translate(cb->iconSize.width() + spacing, 0);
never executed: editRect.translate(cb->iconSize.width() + spacing, 0);
0
3710 } -
3711 if (!cb->currentText.isEmpty() && !cb->editable) {
never evaluated: !cb->currentText.isEmpty()
never evaluated: !cb->editable
0
3712 QPalette styledPalette(cb->palette);
never executed (the execution status of this line is deduced): QPalette styledPalette(cb->palette);
-
3713 rule.configurePalette(&styledPalette, QPalette::Text, QPalette::Base);
never executed (the execution status of this line is deduced): rule.configurePalette(&styledPalette, QPalette::Text, QPalette::Base);
-
3714 drawItemText(p, editRect.adjusted(0, 0, 0, 0), Qt::AlignLeft | Qt::AlignVCenter, styledPalette,
never executed (the execution status of this line is deduced): drawItemText(p, editRect.adjusted(0, 0, 0, 0), Qt::AlignLeft | Qt::AlignVCenter, styledPalette,
-
3715 cb->state & State_Enabled, cb->currentText, QPalette::Text);
never executed (the execution status of this line is deduced): cb->state & State_Enabled, cb->currentText, QPalette::Text);
-
3716 }
never executed: }
0
3717 p->restore();
never executed (the execution status of this line is deduced): p->restore();
-
3718 return;
never executed: return;
0
3719 } -
3720 break;
never executed: break;
0
3721#endif // QT_NO_COMBOBOX -
3722 -
3723 case CE_Header: -
3724 if (hasStyleRule(w, PseudoElement_HeaderViewUpArrow)
never evaluated: hasStyleRule(w, PseudoElement_HeaderViewUpArrow)
0
3725 || hasStyleRule(w, PseudoElement_HeaderViewDownArrow)) {
never evaluated: hasStyleRule(w, PseudoElement_HeaderViewDownArrow)
0
3726 ParentStyle::drawControl(ce, opt, p, w);
never executed (the execution status of this line is deduced): ParentStyle::drawControl(ce, opt, p, w);
-
3727 return;
never executed: return;
0
3728 } -
3729 if(hasStyleRule(w, PseudoElement_HeaderViewSection)) {
never evaluated: hasStyleRule(w, PseudoElement_HeaderViewSection)
0
3730 QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection);
-
3731 if (!subRule.hasNativeBorder() || !subRule.baseStyleCanDraw()
never evaluated: !subRule.hasNativeBorder()
never evaluated: !subRule.baseStyleCanDraw()
0
3732 || subRule.hasBackground() || subRule.hasPalette()) {
never evaluated: subRule.hasBackground()
never evaluated: subRule.hasPalette()
0
3733 ParentStyle::drawControl(ce, opt, p, w);
never executed (the execution status of this line is deduced): ParentStyle::drawControl(ce, opt, p, w);
-
3734 return;
never executed: return;
0
3735 } -
3736 }
never executed: }
0
3737 break;
never executed: break;
0
3738 case CE_HeaderSection: -
3739 if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt)) {
never evaluated: const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt)
0
3740 QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection);
-
3741 if (subRule.hasNativeBorder()) {
never evaluated: subRule.hasNativeBorder()
0
3742 QStyleOptionHeader hdr(*header);
never executed (the execution status of this line is deduced): QStyleOptionHeader hdr(*header);
-
3743 subRule.configurePalette(&hdr.palette, QPalette::ButtonText, QPalette::Button);
never executed (the execution status of this line is deduced): subRule.configurePalette(&hdr.palette, QPalette::ButtonText, QPalette::Button);
-
3744 -
3745 if (subRule.baseStyleCanDraw()) {
never evaluated: subRule.baseStyleCanDraw()
0
3746 baseStyle()->drawControl(CE_HeaderSection, &hdr, p, w);
never executed (the execution status of this line is deduced): baseStyle()->drawControl(CE_HeaderSection, &hdr, p, w);
-
3747 } else {
never executed: }
0
3748 QWindowsStyle::drawControl(CE_HeaderSection, &hdr, p, w);
never executed (the execution status of this line is deduced): QWindowsStyle::drawControl(CE_HeaderSection, &hdr, p, w);
-
3749 }
never executed: }
0
3750 } else { -
3751 subRule.drawRule(p, opt->rect);
never executed (the execution status of this line is deduced): subRule.drawRule(p, opt->rect);
-
3752 }
never executed: }
0
3753 return;
never executed: return;
0
3754 } -
3755 break;
never executed: break;
0
3756 -
3757 case CE_HeaderLabel: -
3758 if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt)) {
never evaluated: const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt)
0
3759 QStyleOptionHeader hdr(*header);
never executed (the execution status of this line is deduced): QStyleOptionHeader hdr(*header);
-
3760 QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection);
-
3761 subRule.configurePalette(&hdr.palette, QPalette::ButtonText, QPalette::Button);
never executed (the execution status of this line is deduced): subRule.configurePalette(&hdr.palette, QPalette::ButtonText, QPalette::Button);
-
3762 QFont oldFont = p->font();
never executed (the execution status of this line is deduced): QFont oldFont = p->font();
-
3763 if (subRule.hasFont)
never evaluated: subRule.hasFont
0
3764 p->setFont(subRule.font.resolve(p->font()));
never executed: p->setFont(subRule.font.resolve(p->font()));
0
3765 baseStyle()->drawControl(ce, &hdr, p, w);
never executed (the execution status of this line is deduced): baseStyle()->drawControl(ce, &hdr, p, w);
-
3766 if (subRule.hasFont)
never evaluated: subRule.hasFont
0
3767 p->setFont(oldFont);
never executed: p->setFont(oldFont);
0
3768 return;
never executed: return;
0
3769 } -
3770 break;
never executed: break;
0
3771 -
3772 case CE_HeaderEmptyArea: -
3773 if (rule.hasDrawable()) {
never evaluated: rule.hasDrawable()
0
3774 return;
never executed: return;
0
3775 } -
3776 break;
never executed: break;
0
3777 -
3778 case CE_ProgressBar: -
3779 QWindowsStyle::drawControl(ce, opt, p, w);
never executed (the execution status of this line is deduced): QWindowsStyle::drawControl(ce, opt, p, w);
-
3780 return;
never executed: return;
0
3781 -
3782 case CE_ProgressBarGroove: -
3783 if (!rule.hasNativeBorder()) {
never evaluated: !rule.hasNativeBorder()
0
3784 rule.drawRule(p, rule.boxRect(opt->rect, Margin));
never executed (the execution status of this line is deduced): rule.drawRule(p, rule.boxRect(opt->rect, Margin));
-
3785 return;
never executed: return;
0
3786 } -
3787 break;
never executed: break;
0
3788 -
3789 case CE_ProgressBarContents: { -
3790 QRenderRule subRule = renderRule(w, opt, PseudoElement_ProgressBarChunk);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_ProgressBarChunk);
-
3791 if (subRule.hasDrawable()) {
never evaluated: subRule.hasDrawable()
0
3792 if (const QStyleOptionProgressBarV2 *pb = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt)) {
never evaluated: const QStyleOptionProgressBarV2 *pb = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt)
0
3793 p->save();
never executed (the execution status of this line is deduced): p->save();
-
3794 p->setClipRect(pb->rect);
never executed (the execution status of this line is deduced): p->setClipRect(pb->rect);
-
3795 -
3796 qint64 minimum = qint64(pb->minimum);
never executed (the execution status of this line is deduced): qint64 minimum = qint64(pb->minimum);
-
3797 qint64 maximum = qint64(pb->maximum);
never executed (the execution status of this line is deduced): qint64 maximum = qint64(pb->maximum);
-
3798 qint64 progress = qint64(pb->progress);
never executed (the execution status of this line is deduced): qint64 progress = qint64(pb->progress);
-
3799 bool vertical = (pb->orientation == Qt::Vertical);
never executed (the execution status of this line is deduced): bool vertical = (pb->orientation == Qt::Vertical);
-
3800 bool inverted = pb->invertedAppearance;
never executed (the execution status of this line is deduced): bool inverted = pb->invertedAppearance;
-
3801 -
3802 QTransform m;
never executed (the execution status of this line is deduced): QTransform m;
-
3803 QRect rect = pb->rect;
never executed (the execution status of this line is deduced): QRect rect = pb->rect;
-
3804 if (vertical) {
never evaluated: vertical
0
3805 rect = QRect(rect.y(), rect.x(), rect.height(), rect.width());
never executed (the execution status of this line is deduced): rect = QRect(rect.y(), rect.x(), rect.height(), rect.width());
-
3806 m.rotate(90);
never executed (the execution status of this line is deduced): m.rotate(90);
-
3807 m.translate(0, -(rect.height() + rect.y()*2));
never executed (the execution status of this line is deduced): m.translate(0, -(rect.height() + rect.y()*2));
-
3808 }
never executed: }
0
3809 -
3810 bool reverse = ((!vertical && (pb->direction == Qt::RightToLeft)) || vertical);
never evaluated: !vertical
never evaluated: (pb->direction == Qt::RightToLeft)
never evaluated: vertical
0
3811 if (inverted)
never evaluated: inverted
0
3812 reverse = !reverse;
never executed: reverse = !reverse;
0
3813 const bool indeterminate = pb->minimum == pb->maximum;
never executed (the execution status of this line is deduced): const bool indeterminate = pb->minimum == pb->maximum;
-
3814 qreal fillRatio = indeterminate ? 0.50 : qreal(progress - minimum)/(maximum - minimum);
never evaluated: indeterminate
0
3815 int fillWidth = int(rect.width() * fillRatio);
never executed (the execution status of this line is deduced): int fillWidth = int(rect.width() * fillRatio);
-
3816 int chunkWidth = fillWidth;
never executed (the execution status of this line is deduced): int chunkWidth = fillWidth;
-
3817 if (subRule.hasContentsSize()) {
never evaluated: subRule.hasContentsSize()
0
3818 QSize sz = subRule.size();
never executed (the execution status of this line is deduced): QSize sz = subRule.size();
-
3819 chunkWidth = (opt->state & QStyle::State_Horizontal) ? sz.width() : sz.height();
never evaluated: (opt->state & QStyle::State_Horizontal)
0
3820 }
never executed: }
0
3821 -
3822 QRect r = rect;
never executed (the execution status of this line is deduced): QRect r = rect;
-
3823 Q_D(const QWindowsStyle);
never executed (the execution status of this line is deduced): const QWindowsStylePrivate * const d = d_func();
-
3824 if (pb->minimum == 0 && pb->maximum == 0) {
never evaluated: pb->minimum == 0
never evaluated: pb->maximum == 0
0
3825 int chunkCount = fillWidth/chunkWidth;
never executed (the execution status of this line is deduced): int chunkCount = fillWidth/chunkWidth;
-
3826 int offset = 0;
never executed (the execution status of this line is deduced): int offset = 0;
-
3827 if (QProgressStyleAnimation *animation = qobject_cast<QProgressStyleAnimation*>(d->animation(opt->styleObject)))
never evaluated: QProgressStyleAnimation *animation = qobject_cast<QProgressStyleAnimation*>(d->animation(opt->styleObject))
0
3828 offset = animation->animationStep() * 8 % rect.width();
never executed: offset = animation->animationStep() * 8 % rect.width();
0
3829 else -
3830 d->startAnimation(new QProgressStyleAnimation(d->animationFps, opt->styleObject));
never executed: d->startAnimation(new QProgressStyleAnimation(d->animationFps, opt->styleObject));
0
3831 int x = reverse ? r.left() + r.width() - offset - chunkWidth : r.x() + offset;
never evaluated: reverse
0
3832 while (chunkCount > 0) {
never evaluated: chunkCount > 0
0
3833 r.setRect(x, rect.y(), chunkWidth, rect.height());
never executed (the execution status of this line is deduced): r.setRect(x, rect.y(), chunkWidth, rect.height());
-
3834 r = m.mapRect(QRectF(r)).toRect();
never executed (the execution status of this line is deduced): r = m.mapRect(QRectF(r)).toRect();
-
3835 subRule.drawRule(p, r);
never executed (the execution status of this line is deduced): subRule.drawRule(p, r);
-
3836 x += reverse ? -chunkWidth : chunkWidth;
never evaluated: reverse
0
3837 if (reverse ? x < rect.left() : x > rect.right())
never evaluated: reverse
0
3838 break;
never executed: break;
0
3839 --chunkCount;
never executed (the execution status of this line is deduced): --chunkCount;
-
3840 }
never executed: }
0
3841 -
3842 r = rect;
never executed (the execution status of this line is deduced): r = rect;
-
3843 x = reverse ? r.right() - (r.left() - x - chunkWidth)
never evaluated: reverse
0
3844 : r.left() + (x - r.right() - chunkWidth);
never executed (the execution status of this line is deduced): : r.left() + (x - r.right() - chunkWidth);
-
3845 while (chunkCount > 0) {
never evaluated: chunkCount > 0
0
3846 r.setRect(x, rect.y(), chunkWidth, rect.height());
never executed (the execution status of this line is deduced): r.setRect(x, rect.y(), chunkWidth, rect.height());
-
3847 r = m.mapRect(QRectF(r)).toRect();
never executed (the execution status of this line is deduced): r = m.mapRect(QRectF(r)).toRect();
-
3848 subRule.drawRule(p, r);
never executed (the execution status of this line is deduced): subRule.drawRule(p, r);
-
3849 x += reverse ? -chunkWidth : chunkWidth;
never evaluated: reverse
0
3850 --chunkCount;
never executed (the execution status of this line is deduced): --chunkCount;
-
3851 };
never executed: }
0
3852 } else {
never executed: }
0
3853 int x = reverse ? r.left() + r.width() - chunkWidth : r.x();
never evaluated: reverse
0
3854 -
3855 for (int i = 0; i < ceil(qreal(fillWidth)/chunkWidth); ++i) {
never evaluated: i < ((int)(qreal(fillWidth)/chunkWidth) + ((qreal(fillWidth)/chunkWidth) > 0 && (qreal(fillWidth)/chunkWidth) != (int)(qreal(fillWidth)/chunkWidth)))
0
3856 r.setRect(x, rect.y(), chunkWidth, rect.height());
never executed (the execution status of this line is deduced): r.setRect(x, rect.y(), chunkWidth, rect.height());
-
3857 r = m.mapRect(QRectF(r)).toRect();
never executed (the execution status of this line is deduced): r = m.mapRect(QRectF(r)).toRect();
-
3858 subRule.drawRule(p, r);
never executed (the execution status of this line is deduced): subRule.drawRule(p, r);
-
3859 x += reverse ? -chunkWidth : chunkWidth;
never evaluated: reverse
0
3860 }
never executed: }
0
3861 -
3862 d->stopAnimation(opt->styleObject);
never executed (the execution status of this line is deduced): d->stopAnimation(opt->styleObject);
-
3863 }
never executed: }
0
3864 -
3865 p->restore();
never executed (the execution status of this line is deduced): p->restore();
-
3866 return;
never executed: return;
0
3867 } -
3868 }
never executed: }
0
3869 } -
3870 break;
never executed: break;
0
3871 -
3872 case CE_ProgressBarLabel: -
3873 if (const QStyleOptionProgressBarV2 *pb = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt)) {
never evaluated: const QStyleOptionProgressBarV2 *pb = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt)
0
3874 if (rule.hasBox() || rule.hasBorder() || hasStyleRule(w, PseudoElement_ProgressBarChunk)) {
never evaluated: rule.hasBox()
never evaluated: rule.hasBorder()
never evaluated: hasStyleRule(w, PseudoElement_ProgressBarChunk)
0
3875 drawItemText(p, pb->rect, pb->textAlignment | Qt::TextSingleLine, pb->palette,
never executed (the execution status of this line is deduced): drawItemText(p, pb->rect, pb->textAlignment | Qt::TextSingleLine, pb->palette,
-
3876 pb->state & State_Enabled, pb->text, QPalette::Text);
never executed (the execution status of this line is deduced): pb->state & State_Enabled, pb->text, QPalette::Text);
-
3877 } else {
never executed: }
0
3878 QStyleOptionProgressBarV2 pbCopy(*pb);
never executed (the execution status of this line is deduced): QStyleOptionProgressBarV2 pbCopy(*pb);
-
3879 rule.configurePalette(&pbCopy.palette, QPalette::HighlightedText, QPalette::Highlight);
never executed (the execution status of this line is deduced): rule.configurePalette(&pbCopy.palette, QPalette::HighlightedText, QPalette::Highlight);
-
3880 baseStyle()->drawControl(ce, &pbCopy, p, w);
never executed (the execution status of this line is deduced): baseStyle()->drawControl(ce, &pbCopy, p, w);
-
3881 }
never executed: }
0
3882 return;
never executed: return;
0
3883 } -
3884 break;
never executed: break;
0
3885 -
3886 case CE_SizeGrip: -
3887 if (const QStyleOptionSizeGrip *sgOpt = qstyleoption_cast<const QStyleOptionSizeGrip *>(opt)) {
never evaluated: const QStyleOptionSizeGrip *sgOpt = qstyleoption_cast<const QStyleOptionSizeGrip *>(opt)
0
3888 if (rule.hasDrawable()) {
never evaluated: rule.hasDrawable()
0
3889 rule.drawFrame(p, opt->rect);
never executed (the execution status of this line is deduced): rule.drawFrame(p, opt->rect);
-
3890 p->save();
never executed (the execution status of this line is deduced): p->save();
-
3891 switch (sgOpt->corner) { -
3892 case Qt::BottomRightCorner: break;
never executed: break;
0
3893 case Qt::BottomLeftCorner: p->rotate(90); break;
never executed: break;
0
3894 case Qt::TopLeftCorner: p->rotate(180); break;
never executed: break;
0
3895 case Qt::TopRightCorner: p->rotate(270); break;
never executed: break;
0
3896 default: break;
never executed: break;
0
3897 } -
3898 rule.drawImage(p, opt->rect);
never executed (the execution status of this line is deduced): rule.drawImage(p, opt->rect);
-
3899 p->restore();
never executed (the execution status of this line is deduced): p->restore();
-
3900 } else {
never executed: }
0
3901 QStyleOptionSizeGrip sg(*sgOpt);
never executed (the execution status of this line is deduced): QStyleOptionSizeGrip sg(*sgOpt);
-
3902 sg.rect = rule.contentsRect(opt->rect);
never executed (the execution status of this line is deduced): sg.rect = rule.contentsRect(opt->rect);
-
3903 baseStyle()->drawControl(CE_SizeGrip, &sg, p, w);
never executed (the execution status of this line is deduced): baseStyle()->drawControl(CE_SizeGrip, &sg, p, w);
-
3904 }
never executed: }
0
3905 return;
never executed: return;
0
3906 } -
3907 break;
never executed: break;
0
3908 -
3909 case CE_ToolBoxTab: -
3910 QWindowsStyle::drawControl(ce, opt, p, w);
never executed (the execution status of this line is deduced): QWindowsStyle::drawControl(ce, opt, p, w);
-
3911 return;
never executed: return;
0
3912 -
3913 case CE_ToolBoxTabShape: { -
3914 QRenderRule subRule = renderRule(w, opt, PseudoElement_ToolBoxTab);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_ToolBoxTab);
-
3915 if (subRule.hasDrawable()) {
never evaluated: subRule.hasDrawable()
0
3916 subRule.drawRule(p, opt->rect);
never executed (the execution status of this line is deduced): subRule.drawRule(p, opt->rect);
-
3917 return;
never executed: return;
0
3918 } -
3919 } -
3920 break;
never executed: break;
0
3921 -
3922 case CE_ToolBoxTabLabel: -
3923 if (const QStyleOptionToolBox *box = qstyleoption_cast<const QStyleOptionToolBox *>(opt)) {
never evaluated: const QStyleOptionToolBox *box = qstyleoption_cast<const QStyleOptionToolBox *>(opt)
0
3924 QStyleOptionToolBox boxCopy(*box);
never executed (the execution status of this line is deduced): QStyleOptionToolBox boxCopy(*box);
-
3925 QRenderRule subRule = renderRule(w, opt, PseudoElement_ToolBoxTab);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_ToolBoxTab);
-
3926 subRule.configurePalette(&boxCopy.palette, QPalette::ButtonText, QPalette::Button);
never executed (the execution status of this line is deduced): subRule.configurePalette(&boxCopy.palette, QPalette::ButtonText, QPalette::Button);
-
3927 QFont oldFont = p->font();
never executed (the execution status of this line is deduced): QFont oldFont = p->font();
-
3928 if (subRule.hasFont)
never evaluated: subRule.hasFont
0
3929 p->setFont(subRule.font);
never executed: p->setFont(subRule.font);
0
3930 boxCopy.rect = subRule.contentsRect(opt->rect);
never executed (the execution status of this line is deduced): boxCopy.rect = subRule.contentsRect(opt->rect);
-
3931 QWindowsStyle::drawControl(ce, &boxCopy, p , w);
never executed (the execution status of this line is deduced): QWindowsStyle::drawControl(ce, &boxCopy, p , w);
-
3932 if (subRule.hasFont)
never evaluated: subRule.hasFont
0
3933 p->setFont(oldFont);
never executed: p->setFont(oldFont);
0
3934 return;
never executed: return;
0
3935 } -
3936 break;
never executed: break;
0
3937 -
3938 case CE_ScrollBarAddPage: -
3939 pe1 = PseudoElement_ScrollBarAddPage;
never executed (the execution status of this line is deduced): pe1 = PseudoElement_ScrollBarAddPage;
-
3940 break;
never executed: break;
0
3941 -
3942 case CE_ScrollBarSubPage: -
3943 pe1 = PseudoElement_ScrollBarSubPage;
never executed (the execution status of this line is deduced): pe1 = PseudoElement_ScrollBarSubPage;
-
3944 break;
never executed: break;
0
3945 -
3946 case CE_ScrollBarAddLine: -
3947 pe1 = PseudoElement_ScrollBarAddLine;
never executed (the execution status of this line is deduced): pe1 = PseudoElement_ScrollBarAddLine;
-
3948 pe2 = (opt->state & QStyle::State_Horizontal) ? PseudoElement_ScrollBarRightArrow : PseudoElement_ScrollBarDownArrow;
never evaluated: (opt->state & QStyle::State_Horizontal)
0
3949 fallback = true;
never executed (the execution status of this line is deduced): fallback = true;
-
3950 break;
never executed: break;
0
3951 -
3952 case CE_ScrollBarSubLine: -
3953 pe1 = PseudoElement_ScrollBarSubLine;
never executed (the execution status of this line is deduced): pe1 = PseudoElement_ScrollBarSubLine;
-
3954 pe2 = (opt->state & QStyle::State_Horizontal) ? PseudoElement_ScrollBarLeftArrow : PseudoElement_ScrollBarUpArrow;
never evaluated: (opt->state & QStyle::State_Horizontal)
0
3955 fallback = true;
never executed (the execution status of this line is deduced): fallback = true;
-
3956 break;
never executed: break;
0
3957 -
3958 case CE_ScrollBarFirst: -
3959 pe1 = PseudoElement_ScrollBarFirst;
never executed (the execution status of this line is deduced): pe1 = PseudoElement_ScrollBarFirst;
-
3960 break;
never executed: break;
0
3961 -
3962 case CE_ScrollBarLast: -
3963 pe1 = PseudoElement_ScrollBarLast;
never executed (the execution status of this line is deduced): pe1 = PseudoElement_ScrollBarLast;
-
3964 break;
never executed: break;
0
3965 -
3966 case CE_ScrollBarSlider: -
3967 pe1 = PseudoElement_ScrollBarSlider;
never executed (the execution status of this line is deduced): pe1 = PseudoElement_ScrollBarSlider;
-
3968 fallback = true;
never executed (the execution status of this line is deduced): fallback = true;
-
3969 break;
never executed: break;
0
3970 -
3971#ifndef QT_NO_ITEMVIEWS -
3972 case CE_ItemViewItem: -
3973 if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) {
never evaluated: const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)
0
3974 QRenderRule subRule = renderRule(w, opt, PseudoElement_ViewItem);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_ViewItem);
-
3975 if (subRule.hasDrawable() || hasStyleRule(w, PseudoElement_Indicator)) {
never evaluated: subRule.hasDrawable()
never evaluated: hasStyleRule(w, PseudoElement_Indicator)
0
3976 QStyleOptionViewItem optCopy(*vopt);
never executed (the execution status of this line is deduced): QStyleOptionViewItem optCopy(*vopt);
-
3977 subRule.configurePalette(&optCopy.palette, vopt->state & QStyle::State_Selected ? QPalette::HighlightedText : QPalette::Text,
never executed (the execution status of this line is deduced): subRule.configurePalette(&optCopy.palette, vopt->state & QStyle::State_Selected ? QPalette::HighlightedText : QPalette::Text,
-
3978 vopt->state & QStyle::State_Selected ? QPalette::Highlight : QPalette::Base);
never executed (the execution status of this line is deduced): vopt->state & QStyle::State_Selected ? QPalette::Highlight : QPalette::Base);
-
3979 QWindowsStyle::drawControl(ce, &optCopy, p, w);
never executed (the execution status of this line is deduced): QWindowsStyle::drawControl(ce, &optCopy, p, w);
-
3980 } else {
never executed: }
0
3981 QStyleOptionViewItem voptCopy(*vopt);
never executed (the execution status of this line is deduced): QStyleOptionViewItem voptCopy(*vopt);
-
3982 subRule.configurePalette(&voptCopy.palette, QPalette::Text, QPalette::NoRole);
never executed (the execution status of this line is deduced): subRule.configurePalette(&voptCopy.palette, QPalette::Text, QPalette::NoRole);
-
3983 baseStyle()->drawControl(ce, &voptCopy, p, w);
never executed (the execution status of this line is deduced): baseStyle()->drawControl(ce, &voptCopy, p, w);
-
3984 }
never executed: }
0
3985 return;
never executed: return;
0
3986 } -
3987 break;
never executed: break;
0
3988#endif // QT_NO_ITEMVIEWS -
3989 -
3990#ifndef QT_NO_TABBAR -
3991 case CE_TabBarTab: -
3992 if (hasStyleRule(w, PseudoElement_TabBarTab)) {
never evaluated: hasStyleRule(w, PseudoElement_TabBarTab)
0
3993 QWindowsStyle::drawControl(ce, opt, p, w);
never executed (the execution status of this line is deduced): QWindowsStyle::drawControl(ce, opt, p, w);
-
3994 return;
never executed: return;
0
3995 } -
3996 break;
never executed: break;
0
3997 -
3998 case CE_TabBarTabLabel: -
3999 case CE_TabBarTabShape: -
4000 if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
never evaluated: const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)
0
4001 QStyleOptionTabV3 tabCopy(*tab);
never executed (the execution status of this line is deduced): QStyleOptionTabV3 tabCopy(*tab);
-
4002 QRenderRule subRule = renderRule(w, opt, PseudoElement_TabBarTab);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_TabBarTab);
-
4003 QRect r = positionRect(w, subRule, PseudoElement_TabBarTab, opt->rect, opt->direction);
never executed (the execution status of this line is deduced): QRect r = positionRect(w, subRule, PseudoElement_TabBarTab, opt->rect, opt->direction);
-
4004 if (ce == CE_TabBarTabShape && subRule.hasDrawable()) {
never evaluated: ce == CE_TabBarTabShape
never evaluated: subRule.hasDrawable()
0
4005 subRule.drawRule(p, r);
never executed (the execution status of this line is deduced): subRule.drawRule(p, r);
-
4006 return;
never executed: return;
0
4007 } -
4008 subRule.configurePalette(&tabCopy.palette, QPalette::WindowText, QPalette::Window);
never executed (the execution status of this line is deduced): subRule.configurePalette(&tabCopy.palette, QPalette::WindowText, QPalette::Window);
-
4009 QFont oldFont = p->font();
never executed (the execution status of this line is deduced): QFont oldFont = p->font();
-
4010 if (subRule.hasFont)
never evaluated: subRule.hasFont
0
4011 p->setFont(subRule.font);
never executed: p->setFont(subRule.font);
0
4012 if (subRule.hasBox() || !subRule.hasNativeBorder()) {
never evaluated: subRule.hasBox()
never evaluated: !subRule.hasNativeBorder()
0
4013 tabCopy.rect = ce == CE_TabBarTabShape ? subRule.borderRect(r)
never evaluated: ce == CE_TabBarTabShape
0
4014 : subRule.contentsRect(r);
never executed (the execution status of this line is deduced): : subRule.contentsRect(r);
-
4015 QWindowsStyle::drawControl(ce, &tabCopy, p, w);
never executed (the execution status of this line is deduced): QWindowsStyle::drawControl(ce, &tabCopy, p, w);
-
4016 } else {
never executed: }
0
4017 baseStyle()->drawControl(ce, &tabCopy, p, w);
never executed (the execution status of this line is deduced): baseStyle()->drawControl(ce, &tabCopy, p, w);
-
4018 }
never executed: }
0
4019 if (subRule.hasFont)
never evaluated: subRule.hasFont
0
4020 p->setFont(oldFont);
never executed: p->setFont(oldFont);
0
4021 -
4022 return;
never executed: return;
0
4023 } -
4024 break;
never executed: break;
0
4025#endif // QT_NO_TABBAR -
4026 -
4027 case CE_ColumnViewGrip: -
4028 if (rule.hasDrawable()) {
never evaluated: rule.hasDrawable()
0
4029 rule.drawRule(p, opt->rect);
never executed (the execution status of this line is deduced): rule.drawRule(p, opt->rect);
-
4030 return;
never executed: return;
0
4031 } -
4032 break;
never executed: break;
0
4033 -
4034 case CE_DockWidgetTitle: -
4035 if (const QStyleOptionDockWidgetV2 *dwOpt = qstyleoption_cast<const QStyleOptionDockWidgetV2 *>(opt)) {
never evaluated: const QStyleOptionDockWidgetV2 *dwOpt = qstyleoption_cast<const QStyleOptionDockWidgetV2 *>(opt)
0
4036 QRenderRule subRule = renderRule(w, opt, PseudoElement_DockWidgetTitle);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_DockWidgetTitle);
-
4037 if (!subRule.hasDrawable() && !subRule.hasPosition())
never evaluated: !subRule.hasDrawable()
never evaluated: !subRule.hasPosition()
0
4038 break;
never executed: break;
0
4039 if (subRule.hasDrawable()) {
never evaluated: subRule.hasDrawable()
0
4040 subRule.drawRule(p, opt->rect);
never executed (the execution status of this line is deduced): subRule.drawRule(p, opt->rect);
-
4041 } else {
never executed: }
0
4042 QStyleOptionDockWidgetV2 dwCopy(*dwOpt);
never executed (the execution status of this line is deduced): QStyleOptionDockWidgetV2 dwCopy(*dwOpt);
-
4043 dwCopy.title = QString();
never executed (the execution status of this line is deduced): dwCopy.title = QString();
-
4044 baseStyle()->drawControl(ce, &dwCopy, p, w);
never executed (the execution status of this line is deduced): baseStyle()->drawControl(ce, &dwCopy, p, w);
-
4045 }
never executed: }
0
4046 -
4047 if (!dwOpt->title.isEmpty()) {
never evaluated: !dwOpt->title.isEmpty()
0
4048 QRect r = opt->rect;
never executed (the execution status of this line is deduced): QRect r = opt->rect;
-
4049 if (dwOpt->verticalTitleBar) {
never evaluated: dwOpt->verticalTitleBar
0
4050 QSize s = r.size();
never executed (the execution status of this line is deduced): QSize s = r.size();
-
4051 s.transpose();
never executed (the execution status of this line is deduced): s.transpose();
-
4052 r.setSize(s);
never executed (the execution status of this line is deduced): r.setSize(s);
-
4053 -
4054 p->save();
never executed (the execution status of this line is deduced): p->save();
-
4055 p->translate(r.left(), r.top() + r.width());
never executed (the execution status of this line is deduced): p->translate(r.left(), r.top() + r.width());
-
4056 p->rotate(-90);
never executed (the execution status of this line is deduced): p->rotate(-90);
-
4057 p->translate(-r.left(), -r.top());
never executed (the execution status of this line is deduced): p->translate(-r.left(), -r.top());
-
4058 }
never executed: }
0
4059 -
4060 Qt::Alignment alignment = 0;
never executed (the execution status of this line is deduced): Qt::Alignment alignment = 0;
-
4061 if (subRule.hasPosition())
never evaluated: subRule.hasPosition()
0
4062 alignment = subRule.position()->textAlignment;
never executed: alignment = subRule.position()->textAlignment;
0
4063 if (alignment == 0)
never evaluated: alignment == 0
0
4064 alignment = Qt::AlignLeft;
never executed: alignment = Qt::AlignLeft;
0
4065 drawItemText(p, subRule.contentsRect(opt->rect),
never executed (the execution status of this line is deduced): drawItemText(p, subRule.contentsRect(opt->rect),
-
4066 alignment | Qt::TextShowMnemonic, dwOpt->palette,
never executed (the execution status of this line is deduced): alignment | Qt::TextShowMnemonic, dwOpt->palette,
-
4067 dwOpt->state & State_Enabled, dwOpt->title,
never executed (the execution status of this line is deduced): dwOpt->state & State_Enabled, dwOpt->title,
-
4068 QPalette::WindowText);
never executed (the execution status of this line is deduced): QPalette::WindowText);
-
4069 -
4070 if (dwOpt->verticalTitleBar)
never evaluated: dwOpt->verticalTitleBar
0
4071 p->restore();
never executed: p->restore();
0
4072 }
never executed: }
0
4073 -
4074 return;
never executed: return;
0
4075 } -
4076 break;
never executed: break;
0
4077 case CE_ShapedFrame: -
4078 if (const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
never evaluated: const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(opt)
0
4079 if (rule.hasNativeBorder()) {
never evaluated: rule.hasNativeBorder()
0
4080 QStyleOptionFrameV3 frmOpt(*frm);
never executed (the execution status of this line is deduced): QStyleOptionFrameV3 frmOpt(*frm);
-
4081 rule.configurePalette(&frmOpt.palette, QPalette::Text, QPalette::Base);
never executed (the execution status of this line is deduced): rule.configurePalette(&frmOpt.palette, QPalette::Text, QPalette::Base);
-
4082 frmOpt.rect = rule.borderRect(frmOpt.rect);
never executed (the execution status of this line is deduced): frmOpt.rect = rule.borderRect(frmOpt.rect);
-
4083 baseStyle()->drawControl(ce, &frmOpt, p, w);
never executed (the execution status of this line is deduced): baseStyle()->drawControl(ce, &frmOpt, p, w);
-
4084 }
never executed: }
0
4085 // else, borders are already drawn in PE_Widget -
4086 }
never executed: }
0
4087 return;
never executed: return;
0
4088 -
4089 -
4090 default: -
4091 break;
never executed: break;
0
4092 } -
4093 -
4094 if (pe1 != PseudoElement_None) {
never evaluated: pe1 != PseudoElement_None
0
4095 QRenderRule subRule = renderRule(w, opt, pe1);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, pe1);
-
4096 if (subRule.bg != 0 || subRule.hasDrawable()) {
never evaluated: subRule.bg != 0
never evaluated: subRule.hasDrawable()
0
4097 //We test subRule.bg directly because hasBackground() would return false for background:none. -
4098 //But we still don't want the default drawning in that case (example for QScrollBar::add-page) (task 198926) -
4099 subRule.drawRule(p, opt->rect);
never executed (the execution status of this line is deduced): subRule.drawRule(p, opt->rect);
-
4100 } else if (fallback) {
never executed: }
never evaluated: fallback
0
4101 QWindowsStyle::drawControl(ce, opt, p, w);
never executed (the execution status of this line is deduced): QWindowsStyle::drawControl(ce, opt, p, w);
-
4102 pe2 = PseudoElement_None;
never executed (the execution status of this line is deduced): pe2 = PseudoElement_None;
-
4103 } else {
never executed: }
0
4104 baseStyle()->drawControl(ce, opt, p, w);
never executed (the execution status of this line is deduced): baseStyle()->drawControl(ce, opt, p, w);
-
4105 }
never executed: }
0
4106 if (pe2 != PseudoElement_None) {
never evaluated: pe2 != PseudoElement_None
0
4107 QRenderRule subSubRule = renderRule(w, opt, pe2);
never executed (the execution status of this line is deduced): QRenderRule subSubRule = renderRule(w, opt, pe2);
-
4108 QRect r = positionRect(w, subRule, subSubRule, pe2, opt->rect, opt->direction);
never executed (the execution status of this line is deduced): QRect r = positionRect(w, subRule, subSubRule, pe2, opt->rect, opt->direction);
-
4109 subSubRule.drawRule(p, r);
never executed (the execution status of this line is deduced): subSubRule.drawRule(p, r);
-
4110 }
never executed: }
0
4111 return;
never executed: return;
0
4112 } -
4113 -
4114 baseStyle()->drawControl(ce, opt, p, w);
never executed (the execution status of this line is deduced): baseStyle()->drawControl(ce, opt, p, w);
-
4115}
never executed: }
0
4116 -
4117void QStyleSheetStyle::drawItemPixmap(QPainter *p, const QRect &rect, int alignment, const -
4118 QPixmap &pixmap) const -
4119{ -
4120 baseStyle()->drawItemPixmap(p, rect, alignment, pixmap);
never executed (the execution status of this line is deduced): baseStyle()->drawItemPixmap(p, rect, alignment, pixmap);
-
4121}
never executed: }
0
4122 -
4123void QStyleSheetStyle::drawItemText(QPainter *painter, const QRect& rect, int alignment, const QPalette &pal, -
4124 bool enabled, const QString& text, QPalette::ColorRole textRole) const -
4125{ -
4126 baseStyle()->drawItemText(painter, rect, alignment, pal, enabled, text, textRole);
never executed (the execution status of this line is deduced): baseStyle()->drawItemText(painter, rect, alignment, pal, enabled, text, textRole);
-
4127}
never executed: }
0
4128 -
4129void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, -
4130 const QWidget *w) const -
4131{ -
4132 RECURSION_GUARD(baseStyle()->drawPrimitive(pe, opt, p, w); return)
never executed: return;
partially evaluated: globalStyleSheetStyle != 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
never evaluated: globalStyleSheetStyle != this
0-2
4133 -
4134 int pseudoElement = PseudoElement_None;
executed (the execution status of this line is deduced): int pseudoElement = PseudoElement_None;
-
4135 QRenderRule rule = renderRule(w, opt);
executed (the execution status of this line is deduced): QRenderRule rule = renderRule(w, opt);
-
4136 QRect rect = opt->rect;
executed (the execution status of this line is deduced): QRect rect = opt->rect;
-
4137 -
4138 switch (pe) { -
4139 -
4140 case PE_FrameStatusBar: { -
4141 QRenderRule subRule = renderRule(w->parentWidget(), opt, PseudoElement_Item);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w->parentWidget(), opt, PseudoElement_Item);
-
4142 if (subRule.hasDrawable()) {
never evaluated: subRule.hasDrawable()
0
4143 subRule.drawRule(p, opt->rect);
never executed (the execution status of this line is deduced): subRule.drawRule(p, opt->rect);
-
4144 return;
never executed: return;
0
4145 } -
4146 break;
never executed: break;
0
4147 } -
4148 -
4149 case PE_IndicatorArrowDown: -
4150 pseudoElement = PseudoElement_DownArrow;
never executed (the execution status of this line is deduced): pseudoElement = PseudoElement_DownArrow;
-
4151 break;
never executed: break;
0
4152 -
4153 case PE_IndicatorArrowUp: -
4154 pseudoElement = PseudoElement_UpArrow;
never executed (the execution status of this line is deduced): pseudoElement = PseudoElement_UpArrow;
-
4155 break;
never executed: break;
0
4156 -
4157 case PE_IndicatorRadioButton: -
4158 pseudoElement = PseudoElement_ExclusiveIndicator;
never executed (the execution status of this line is deduced): pseudoElement = PseudoElement_ExclusiveIndicator;
-
4159 break;
never executed: break;
0
4160 -
4161 case PE_IndicatorViewItemCheck: -
4162 pseudoElement = PseudoElement_ViewItemIndicator;
never executed (the execution status of this line is deduced): pseudoElement = PseudoElement_ViewItemIndicator;
-
4163 break;
never executed: break;
0
4164 -
4165 case PE_IndicatorCheckBox: -
4166 pseudoElement = PseudoElement_Indicator;
never executed (the execution status of this line is deduced): pseudoElement = PseudoElement_Indicator;
-
4167 break;
never executed: break;
0
4168 -
4169 case PE_IndicatorHeaderArrow: -
4170 if (const QStyleOptionHeader *hdr = qstyleoption_cast<const QStyleOptionHeader *>(opt)) {
never evaluated: const QStyleOptionHeader *hdr = qstyleoption_cast<const QStyleOptionHeader *>(opt)
0
4171 pseudoElement = hdr->sortIndicator == QStyleOptionHeader::SortUp
never evaluated: hdr->sortIndicator == QStyleOptionHeader::SortUp
0
4172 ? PseudoElement_HeaderViewUpArrow
never executed (the execution status of this line is deduced): ? PseudoElement_HeaderViewUpArrow
-
4173 : PseudoElement_HeaderViewDownArrow;
never executed (the execution status of this line is deduced): : PseudoElement_HeaderViewDownArrow;
-
4174 }
never executed: }
0
4175 break;
never executed: break;
0
4176 -
4177 case PE_PanelButtonTool: -
4178 case PE_PanelButtonCommand: -
4179 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
4180 //the window style will draw the borders -
4181 ParentStyle::drawPrimitive(pe, opt, p, w);
never executed (the execution status of this line is deduced): ParentStyle::drawPrimitive(pe, opt, p, w);
-
4182 if (!rule.background()->pixmap.isNull() || rule.hasImage()) {
never evaluated: !rule.background()->pixmap.isNull()
never evaluated: rule.hasImage()
0
4183 rule.drawRule(p, rule.boxRect(opt->rect, QRenderRule::Margin).adjusted(1,1,-1,-1));
never executed (the execution status of this line is deduced): rule.drawRule(p, rule.boxRect(opt->rect, QRenderRule::Margin).adjusted(1,1,-1,-1));
-
4184 }
never executed: }
0
4185 return;
never executed: return;
0
4186 } -
4187 if (!rule.hasNativeBorder()) {
never evaluated: !rule.hasNativeBorder()
0
4188 rule.drawRule(p, rule.boxRect(opt->rect, QRenderRule::Margin));
never executed (the execution status of this line is deduced): rule.drawRule(p, rule.boxRect(opt->rect, QRenderRule::Margin));
-
4189 return;
never executed: return;
0
4190 } -
4191 break;
never executed: break;
0
4192 -
4193 case PE_IndicatorButtonDropDown: { -
4194 QRenderRule subRule = renderRule(w, opt, PseudoElement_ToolButtonMenu);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_ToolButtonMenu);
-
4195 if (!subRule.hasNativeBorder()) {
never evaluated: !subRule.hasNativeBorder()
0
4196 rule.drawBorder(p, opt->rect);
never executed (the execution status of this line is deduced): rule.drawBorder(p, opt->rect);
-
4197 return;
never executed: return;
0
4198 } -
4199 break;
never executed: break;
0
4200 } -
4201 -
4202 case PE_FrameDefaultButton: -
4203 if (rule.hasNativeBorder()) {
never evaluated: rule.hasNativeBorder()
0
4204 if (rule.baseStyleCanDraw())
never evaluated: rule.baseStyleCanDraw()
0
4205 break;
never executed: break;
0
4206 QWindowsStyle::drawPrimitive(pe, opt, p, w);
never executed (the execution status of this line is deduced): QWindowsStyle::drawPrimitive(pe, opt, p, w);
-
4207 }
never executed: }
0
4208 return;
never executed: return;
0
4209 -
4210 case PE_FrameWindow: -
4211 case PE_FrameDockWidget: -
4212 case PE_Frame: -
4213 if (const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
never evaluated: const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(opt)
0
4214 if (rule.hasNativeBorder()) {
never evaluated: rule.hasNativeBorder()
0
4215 QStyleOptionFrameV2 frmOpt(*frm);
never executed (the execution status of this line is deduced): QStyleOptionFrameV2 frmOpt(*frm);
-
4216 rule.configurePalette(&frmOpt.palette, QPalette::Text, QPalette::Base);
never executed (the execution status of this line is deduced): rule.configurePalette(&frmOpt.palette, QPalette::Text, QPalette::Base);
-
4217 if (!qstyleoption_cast<const QStyleOptionFrameV3 *>(opt)) //if it comes from CE_ShapedFrame, the margins are already sustracted
never evaluated: !qstyleoption_cast<const QStyleOptionFrameV3 *>(opt)
0
4218 frmOpt.rect = rule.borderRect(frmOpt.rect);
never executed: frmOpt.rect = rule.borderRect(frmOpt.rect);
0
4219 baseStyle()->drawPrimitive(pe, &frmOpt, p, w);
never executed (the execution status of this line is deduced): baseStyle()->drawPrimitive(pe, &frmOpt, p, w);
-
4220 } else {
never executed: }
0
4221 rule.drawBorder(p, rule.borderRect(opt->rect));
never executed (the execution status of this line is deduced): rule.drawBorder(p, rule.borderRect(opt->rect));
-
4222 }
never executed: }
0
4223 } -
4224 return;
never executed: return;
0
4225 -
4226 case PE_PanelLineEdit: -
4227 if (const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
partially evaluated: const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(opt)
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
4228#ifndef QT_NO_SPINBOX -
4229 if (w && qobject_cast<const QAbstractSpinBox *>(w->parentWidget())) {
partially evaluated: w
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
partially evaluated: qobject_cast<const QAbstractSpinBox *>(w->parentWidget())
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
4230 QRenderRule spinboxRule = renderRule(w->parentWidget(), opt);
never executed (the execution status of this line is deduced): QRenderRule spinboxRule = renderRule(w->parentWidget(), opt);
-
4231 if (!spinboxRule.hasNativeBorder() || !spinboxRule.baseStyleCanDraw())
never evaluated: !spinboxRule.hasNativeBorder()
never evaluated: !spinboxRule.baseStyleCanDraw()
0
4232 return;
never executed: return;
0
4233 rule = spinboxRule;
never executed (the execution status of this line is deduced): rule = spinboxRule;
-
4234 }
never executed: }
0
4235#endif -
4236 if (rule.hasNativeBorder()) {
partially evaluated: rule.hasNativeBorder()
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
4237 QStyleOptionFrame frmOpt(*frm);
executed (the execution status of this line is deduced): QStyleOptionFrame frmOpt(*frm);
-
4238 rule.configurePalette(&frmOpt.palette, QPalette::Text, QPalette::Base);
executed (the execution status of this line is deduced): rule.configurePalette(&frmOpt.palette, QPalette::Text, QPalette::Base);
-
4239 frmOpt.rect = rule.borderRect(frmOpt.rect);
executed (the execution status of this line is deduced): frmOpt.rect = rule.borderRect(frmOpt.rect);
-
4240 if (rule.baseStyleCanDraw()) {
partially evaluated: rule.baseStyleCanDraw()
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
4241 rule.drawBackgroundImage(p, opt->rect);
executed (the execution status of this line is deduced): rule.drawBackgroundImage(p, opt->rect);
-
4242 baseStyle()->drawPrimitive(pe, &frmOpt, p, w);
executed (the execution status of this line is deduced): baseStyle()->drawPrimitive(pe, &frmOpt, p, w);
-
4243 } else {
executed: }
Execution Count:2
2
4244 rule.drawBackground(p, opt->rect);
never executed (the execution status of this line is deduced): rule.drawBackground(p, opt->rect);
-
4245 if (frmOpt.lineWidth > 0)
never evaluated: frmOpt.lineWidth > 0
0
4246 baseStyle()->drawPrimitive(PE_FrameLineEdit, &frmOpt, p, w);
never executed: baseStyle()->drawPrimitive(PE_FrameLineEdit, &frmOpt, p, w);
0
4247 }
never executed: }
0
4248 } else { -
4249 rule.drawRule(p, opt->rect);
never executed (the execution status of this line is deduced): rule.drawRule(p, opt->rect);
-
4250 }
never executed: }
0
4251 } -
4252 return;
executed: return;
Execution Count:2
2
4253 -
4254 case PE_Widget: -
4255 if (w && !rule.hasDrawable()) {
never evaluated: w
never evaluated: !rule.hasDrawable()
0
4256 QWidget *container = containerWidget(w);
never executed (the execution status of this line is deduced): QWidget *container = containerWidget(w);
-
4257 if (styleSheetCaches->autoFillDisabledWidgets.contains(container)
never evaluated: styleSheetCaches->autoFillDisabledWidgets.contains(container)
0
4258 && (container == w || !renderRule(container, opt).hasBackground())) {
never evaluated: container == w
never evaluated: !renderRule(container, opt).hasBackground()
0
4259 //we do not have a background, but we disabled the autofillbackground anyway. so fill the background now. -
4260 // (this may happen if we have rules like :focus) -
4261 p->fillRect(opt->rect, opt->palette.brush(w->backgroundRole()));
never executed (the execution status of this line is deduced): p->fillRect(opt->rect, opt->palette.brush(w->backgroundRole()));
-
4262 }
never executed: }
0
4263 break;
never executed: break;
0
4264 } -
4265#ifndef QT_NO_SCROLLAREA -
4266 if (const QAbstractScrollArea *sa = qobject_cast<const QAbstractScrollArea *>(w)) {
never evaluated: const QAbstractScrollArea *sa = qobject_cast<const QAbstractScrollArea *>(w)
0
4267 const QAbstractScrollAreaPrivate *sap = sa->d_func();
never executed (the execution status of this line is deduced): const QAbstractScrollAreaPrivate *sap = sa->d_func();
-
4268 rule.drawBackground(p, opt->rect, sap->contentsOffset());
never executed (the execution status of this line is deduced): rule.drawBackground(p, opt->rect, sap->contentsOffset());
-
4269 if (rule.hasBorder()) {
never evaluated: rule.hasBorder()
0
4270 QRect brect = rule.borderRect(opt->rect);
never executed (the execution status of this line is deduced): QRect brect = rule.borderRect(opt->rect);
-
4271 if (styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents, opt, w)) {
never evaluated: styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents, opt, w)
0
4272 QRect r = brect.adjusted(0, 0, sa->verticalScrollBar()->isVisible() ? -sa->verticalScrollBar()->width() : 0,
never executed (the execution status of this line is deduced): QRect r = brect.adjusted(0, 0, sa->verticalScrollBar()->isVisible() ? -sa->verticalScrollBar()->width() : 0,
-
4273 sa->horizontalScrollBar()->isVisible() ? -sa->horizontalScrollBar()->height() : 0);
never executed (the execution status of this line is deduced): sa->horizontalScrollBar()->isVisible() ? -sa->horizontalScrollBar()->height() : 0);
-
4274 brect = QStyle::visualRect(opt->direction, brect, r);
never executed (the execution status of this line is deduced): brect = QStyle::visualRect(opt->direction, brect, r);
-
4275 }
never executed: }
0
4276 rule.drawBorder(p, brect);
never executed (the execution status of this line is deduced): rule.drawBorder(p, brect);
-
4277 }
never executed: }
0
4278 break;
never executed: break;
0
4279 } -
4280#endif -
4281 //fall tghought -
4282 case PE_PanelMenu:
code before this statement never executed: case PE_PanelMenu:
0
4283 case PE_PanelStatusBar: -
4284 if(rule.hasDrawable()) {
never evaluated: rule.hasDrawable()
0
4285 rule.drawRule(p, opt->rect);
never executed (the execution status of this line is deduced): rule.drawRule(p, opt->rect);
-
4286 return;
never executed: return;
0
4287 } -
4288 break;
never executed: break;
0
4289 -
4290 case PE_FrameMenu: -
4291 if (rule.hasDrawable()) {
never evaluated: rule.hasDrawable()
0
4292 // Drawn by PE_PanelMenu -
4293 return;
never executed: return;
0
4294 } -
4295 break;
never executed: break;
0
4296 -
4297 case PE_PanelMenuBar: -
4298 if (rule.hasDrawable()) {
never evaluated: rule.hasDrawable()
0
4299 // Drawn by PE_Widget -
4300 return;
never executed: return;
0
4301 } -
4302 break;
never executed: break;
0
4303 -
4304 case PE_IndicatorToolBarSeparator: -
4305 case PE_IndicatorToolBarHandle: { -
4306 PseudoElement ps = pe == PE_IndicatorToolBarHandle ? PseudoElement_ToolBarHandle : PseudoElement_ToolBarSeparator;
never evaluated: pe == PE_IndicatorToolBarHandle
0
4307 QRenderRule subRule = renderRule(w, opt, ps);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, ps);
-
4308 if (subRule.hasDrawable()) {
never evaluated: subRule.hasDrawable()
0
4309 subRule.drawRule(p, opt->rect);
never executed (the execution status of this line is deduced): subRule.drawRule(p, opt->rect);
-
4310 return;
never executed: return;
0
4311 } -
4312 } -
4313 break;
never executed: break;
0
4314 -
4315 case PE_IndicatorMenuCheckMark: -
4316 pseudoElement = PseudoElement_MenuCheckMark;
never executed (the execution status of this line is deduced): pseudoElement = PseudoElement_MenuCheckMark;
-
4317 break;
never executed: break;
0
4318 -
4319 case PE_IndicatorArrowLeft: -
4320 pseudoElement = PseudoElement_LeftArrow;
never executed (the execution status of this line is deduced): pseudoElement = PseudoElement_LeftArrow;
-
4321 break;
never executed: break;
0
4322 -
4323 case PE_IndicatorArrowRight: -
4324 pseudoElement = PseudoElement_RightArrow;
never executed (the execution status of this line is deduced): pseudoElement = PseudoElement_RightArrow;
-
4325 break;
never executed: break;
0
4326 -
4327 case PE_IndicatorColumnViewArrow: -
4328 if (const QStyleOptionViewItem *viewOpt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) {
never evaluated: const QStyleOptionViewItem *viewOpt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)
0
4329 bool reverse = (viewOpt->direction == Qt::RightToLeft);
never executed (the execution status of this line is deduced): bool reverse = (viewOpt->direction == Qt::RightToLeft);
-
4330 pseudoElement = reverse ? PseudoElement_LeftArrow : PseudoElement_RightArrow;
never evaluated: reverse
0
4331 } else {
never executed: }
0
4332 pseudoElement = PseudoElement_RightArrow;
never executed (the execution status of this line is deduced): pseudoElement = PseudoElement_RightArrow;
-
4333 }
never executed: }
0
4334 break;
never executed: break;
0
4335 -
4336 case PE_IndicatorBranch: -
4337 if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) {
never evaluated: const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)
0
4338 QRenderRule subRule = renderRule(w, opt, PseudoElement_TreeViewBranch);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_TreeViewBranch);
-
4339 if (subRule.hasDrawable()) {
never evaluated: subRule.hasDrawable()
0
4340 if ((vopt->state & QStyle::State_Selected) && vopt->showDecorationSelected)
never evaluated: (vopt->state & QStyle::State_Selected)
never evaluated: vopt->showDecorationSelected
0
4341 p->fillRect(vopt->rect, vopt->palette.highlight());
never executed: p->fillRect(vopt->rect, vopt->palette.highlight());
0
4342 else if (vopt->features & QStyleOptionViewItem::Alternate)
never evaluated: vopt->features & QStyleOptionViewItem::Alternate
0
4343 p->fillRect(vopt->rect, vopt->palette.alternateBase());
never executed: p->fillRect(vopt->rect, vopt->palette.alternateBase());
0
4344 subRule.drawRule(p, opt->rect);
never executed (the execution status of this line is deduced): subRule.drawRule(p, opt->rect);
-
4345 } else {
never executed: }
0
4346 baseStyle()->drawPrimitive(pe, vopt, p, w);
never executed (the execution status of this line is deduced): baseStyle()->drawPrimitive(pe, vopt, p, w);
-
4347 }
never executed: }
0
4348 } -
4349 return;
never executed: return;
0
4350 -
4351 case PE_PanelTipLabel: -
4352 if (!rule.hasDrawable())
never evaluated: !rule.hasDrawable()
0
4353 break;
never executed: break;
0
4354 -
4355 if (const QStyleOptionFrame *frmOpt = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
never evaluated: const QStyleOptionFrame *frmOpt = qstyleoption_cast<const QStyleOptionFrame *>(opt)
0
4356 if (rule.hasNativeBorder()) {
never evaluated: rule.hasNativeBorder()
0
4357 rule.drawBackground(p, opt->rect);
never executed (the execution status of this line is deduced): rule.drawBackground(p, opt->rect);
-
4358 QStyleOptionFrame optCopy(*frmOpt);
never executed (the execution status of this line is deduced): QStyleOptionFrame optCopy(*frmOpt);
-
4359 optCopy.rect = rule.borderRect(opt->rect);
never executed (the execution status of this line is deduced): optCopy.rect = rule.borderRect(opt->rect);
-
4360 optCopy.palette.setBrush(QPalette::Window, Qt::NoBrush); // oh dear
never executed (the execution status of this line is deduced): optCopy.palette.setBrush(QPalette::Window, Qt::NoBrush);
-
4361 baseStyle()->drawPrimitive(pe, &optCopy, p, w);
never executed (the execution status of this line is deduced): baseStyle()->drawPrimitive(pe, &optCopy, p, w);
-
4362 } else {
never executed: }
0
4363 rule.drawRule(p, opt->rect);
never executed (the execution status of this line is deduced): rule.drawRule(p, opt->rect);
-
4364 }
never executed: }
0
4365 } -
4366 return;
never executed: return;
0
4367 -
4368 case PE_FrameGroupBox: -
4369 if (rule.hasNativeBorder())
never evaluated: rule.hasNativeBorder()
0
4370 break;
never executed: break;
0
4371 rule.drawBorder(p, opt->rect);
never executed (the execution status of this line is deduced): rule.drawBorder(p, opt->rect);
-
4372 return;
never executed: return;
0
4373 -
4374#ifndef QT_NO_TABWIDGET -
4375 case PE_FrameTabWidget: -
4376 if (const QStyleOptionTabWidgetFrame *frm = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)) {
never evaluated: const QStyleOptionTabWidgetFrame *frm = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)
0
4377 QRenderRule subRule = renderRule(w, opt, PseudoElement_TabWidgetPane);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_TabWidgetPane);
-
4378 if (subRule.hasNativeBorder()) {
never evaluated: subRule.hasNativeBorder()
0
4379 subRule.drawBackground(p, opt->rect);
never executed (the execution status of this line is deduced): subRule.drawBackground(p, opt->rect);
-
4380 QStyleOptionTabWidgetFrameV2 frmCopy(*frm);
never executed (the execution status of this line is deduced): QStyleOptionTabWidgetFrameV2 frmCopy(*frm);
-
4381 subRule.configurePalette(&frmCopy.palette, QPalette::WindowText, QPalette::Window);
never executed (the execution status of this line is deduced): subRule.configurePalette(&frmCopy.palette, QPalette::WindowText, QPalette::Window);
-
4382 baseStyle()->drawPrimitive(pe, &frmCopy, p, w);
never executed (the execution status of this line is deduced): baseStyle()->drawPrimitive(pe, &frmCopy, p, w);
-
4383 } else {
never executed: }
0
4384 subRule.drawRule(p, opt->rect);
never executed (the execution status of this line is deduced): subRule.drawRule(p, opt->rect);
-
4385 }
never executed: }
0
4386 return;
never executed: return;
0
4387 } -
4388 break;
never executed: break;
0
4389#endif // QT_NO_TABWIDGET -
4390 -
4391 case PE_IndicatorProgressChunk: -
4392 pseudoElement = PseudoElement_ProgressBarChunk;
never executed (the execution status of this line is deduced): pseudoElement = PseudoElement_ProgressBarChunk;
-
4393 break;
never executed: break;
0
4394 -
4395 case PE_IndicatorTabTear: -
4396 pseudoElement = PseudoElement_TabBarTear;
never executed (the execution status of this line is deduced): pseudoElement = PseudoElement_TabBarTear;
-
4397 break;
never executed: break;
0
4398 -
4399 case PE_FrameFocusRect: -
4400 if (!rule.hasNativeOutline()) {
never evaluated: !rule.hasNativeOutline()
0
4401 rule.drawOutline(p, opt->rect);
never executed (the execution status of this line is deduced): rule.drawOutline(p, opt->rect);
-
4402 return;
never executed: return;
0
4403 } -
4404 break;
never executed: break;
0
4405 -
4406 case PE_IndicatorDockWidgetResizeHandle: -
4407 pseudoElement = PseudoElement_DockWidgetSeparator;
never executed (the execution status of this line is deduced): pseudoElement = PseudoElement_DockWidgetSeparator;
-
4408 break;
never executed: break;
0
4409 -
4410 case PE_PanelItemViewItem: -
4411 pseudoElement = PseudoElement_ViewItem;
never executed (the execution status of this line is deduced): pseudoElement = PseudoElement_ViewItem;
-
4412 break;
never executed: break;
0
4413 -
4414 case PE_PanelScrollAreaCorner: -
4415 pseudoElement = PseudoElement_ScrollAreaCorner;
never executed (the execution status of this line is deduced): pseudoElement = PseudoElement_ScrollAreaCorner;
-
4416 break;
never executed: break;
0
4417 -
4418 case PE_IndicatorSpinDown: -
4419 case PE_IndicatorSpinMinus: -
4420 pseudoElement = PseudoElement_SpinBoxDownArrow;
never executed (the execution status of this line is deduced): pseudoElement = PseudoElement_SpinBoxDownArrow;
-
4421 break;
never executed: break;
0
4422 -
4423 case PE_IndicatorSpinUp: -
4424 case PE_IndicatorSpinPlus: -
4425 pseudoElement = PseudoElement_SpinBoxUpArrow;
never executed (the execution status of this line is deduced): pseudoElement = PseudoElement_SpinBoxUpArrow;
-
4426 break;
never executed: break;
0
4427#ifndef QT_NO_TABBAR -
4428 case PE_IndicatorTabClose: -
4429 if (w)
never evaluated: w
0
4430 w = w->parentWidget(); //match on the QTabBar instead of the CloseButton
never executed: w = w->parentWidget();
0
4431 pseudoElement = PseudoElement_TabBarTabCloseButton;
never executed (the execution status of this line is deduced): pseudoElement = PseudoElement_TabBarTabCloseButton;
-
4432#endif -
4433 -
4434 default: -
4435 break;
never executed: break;
0
4436 } -
4437 -
4438 if (pseudoElement != PseudoElement_None) {
never evaluated: pseudoElement != PseudoElement_None
0
4439 QRenderRule subRule = renderRule(w, opt, pseudoElement);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, pseudoElement);
-
4440 if (subRule.hasDrawable()) {
never evaluated: subRule.hasDrawable()
0
4441 subRule.drawRule(p, rect);
never executed (the execution status of this line is deduced): subRule.drawRule(p, rect);
-
4442 } else {
never executed: }
0
4443 baseStyle()->drawPrimitive(pe, opt, p, w);
never executed (the execution status of this line is deduced): baseStyle()->drawPrimitive(pe, opt, p, w);
-
4444 }
never executed: }
0
4445 } else { -
4446 baseStyle()->drawPrimitive(pe, opt, p, w);
never executed (the execution status of this line is deduced): baseStyle()->drawPrimitive(pe, opt, p, w);
-
4447 }
never executed: }
0
4448} -
4449 -
4450QPixmap QStyleSheetStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap& pixmap, -
4451 const QStyleOption *option) const -
4452{ -
4453 return baseStyle()->generatedIconPixmap(iconMode, pixmap, option);
never executed: return baseStyle()->generatedIconPixmap(iconMode, pixmap, option);
0
4454} -
4455 -
4456QStyle::SubControl QStyleSheetStyle::hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, -
4457 const QPoint &pt, const QWidget *w) const -
4458{ -
4459 RECURSION_GUARD(return baseStyle()->hitTestComplexControl(cc, opt, pt, w))
never executed: return baseStyle()->hitTestComplexControl(cc, opt, pt, w);
never evaluated: globalStyleSheetStyle != 0
never evaluated: globalStyleSheetStyle != this
0
4460 switch (cc) { -
4461 case CC_TitleBar: -
4462 if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)) {
never evaluated: const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)
0
4463 QRenderRule rule = renderRule(w, opt, PseudoElement_TitleBar);
never executed (the execution status of this line is deduced): QRenderRule rule = renderRule(w, opt, PseudoElement_TitleBar);
-
4464 if (rule.hasDrawable() || rule.hasBox() || rule.hasBorder()) {
never evaluated: rule.hasDrawable()
never evaluated: rule.hasBox()
never evaluated: rule.hasBorder()
0
4465 QHash<QStyle::SubControl, QRect> layout = titleBarLayout(w, tb);
never executed (the execution status of this line is deduced): QHash<QStyle::SubControl, QRect> layout = titleBarLayout(w, tb);
-
4466 QRect r;
never executed (the execution status of this line is deduced): QRect r;
-
4467 QStyle::SubControl sc = QStyle::SC_None;
never executed (the execution status of this line is deduced): QStyle::SubControl sc = QStyle::SC_None;
-
4468 uint ctrl = SC_TitleBarSysMenu;
never executed (the execution status of this line is deduced): uint ctrl = SC_TitleBarSysMenu;
-
4469 while (ctrl <= SC_TitleBarLabel) {
never evaluated: ctrl <= SC_TitleBarLabel
0
4470 r = layout[QStyle::SubControl(ctrl)];
never executed (the execution status of this line is deduced): r = layout[QStyle::SubControl(ctrl)];
-
4471 if (r.isValid() && r.contains(pt)) {
never evaluated: r.isValid()
never evaluated: r.contains(pt)
0
4472 sc = QStyle::SubControl(ctrl);
never executed (the execution status of this line is deduced): sc = QStyle::SubControl(ctrl);
-
4473 break;
never executed: break;
0
4474 } -
4475 ctrl <<= 1;
never executed (the execution status of this line is deduced): ctrl <<= 1;
-
4476 }
never executed: }
0
4477 return sc;
never executed: return sc;
0
4478 } -
4479 }
never executed: }
0
4480 break;
never executed: break;
0
4481 -
4482 case CC_MdiControls: -
4483 if (hasStyleRule(w, PseudoElement_MdiCloseButton)
never evaluated: hasStyleRule(w, PseudoElement_MdiCloseButton)
0
4484 || hasStyleRule(w, PseudoElement_MdiNormalButton)
never evaluated: hasStyleRule(w, PseudoElement_MdiNormalButton)
0
4485 || hasStyleRule(w, PseudoElement_MdiMinButton))
never evaluated: hasStyleRule(w, PseudoElement_MdiMinButton)
0
4486 return QWindowsStyle::hitTestComplexControl(cc, opt, pt, w);
never executed: return QWindowsStyle::hitTestComplexControl(cc, opt, pt, w);
0
4487 break;
never executed: break;
0
4488 -
4489 case CC_ScrollBar: { -
4490 QRenderRule rule = renderRule(w, opt);
never executed (the execution status of this line is deduced): QRenderRule rule = renderRule(w, opt);
-
4491 if (!rule.hasDrawable() && !rule.hasBox())
never evaluated: !rule.hasDrawable()
never evaluated: !rule.hasBox()
0
4492 break;
never executed: break;
0
4493 } -
4494 // intentionally falls through -
4495 case CC_SpinBox: -
4496 case CC_GroupBox: -
4497 case CC_ComboBox: -
4498 case CC_Slider: -
4499 case CC_ToolButton: -
4500 return QWindowsStyle::hitTestComplexControl(cc, opt, pt, w);
never executed: return QWindowsStyle::hitTestComplexControl(cc, opt, pt, w);
0
4501 default: -
4502 break;
never executed: break;
0
4503 } -
4504 -
4505 return baseStyle()->hitTestComplexControl(cc, opt, pt, w);
never executed: return baseStyle()->hitTestComplexControl(cc, opt, pt, w);
0
4506} -
4507 -
4508QRect QStyleSheetStyle::itemPixmapRect(const QRect &rect, int alignment, const QPixmap &pixmap) const -
4509{ -
4510 return baseStyle()->itemPixmapRect(rect, alignment, pixmap);
never executed: return baseStyle()->itemPixmapRect(rect, alignment, pixmap);
0
4511} -
4512 -
4513QRect QStyleSheetStyle::itemTextRect(const QFontMetrics &metrics, const QRect& rect, int alignment, -
4514 bool enabled, const QString& text) const -
4515{ -
4516 return baseStyle()->itemTextRect(metrics, rect, alignment, enabled, text);
never executed: return baseStyle()->itemTextRect(metrics, rect, alignment, enabled, text);
0
4517} -
4518 -
4519int QStyleSheetStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWidget *w) const -
4520{ -
4521 RECURSION_GUARD(return baseStyle()->pixelMetric(m, opt, w))
never executed: return baseStyle()->pixelMetric(m, opt, w);
partially evaluated: globalStyleSheetStyle != 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:13
never evaluated: globalStyleSheetStyle != this
0-13
4522 -
4523 QRenderRule rule = renderRule(w, opt);
executed (the execution status of this line is deduced): QRenderRule rule = renderRule(w, opt);
-
4524 QRenderRule subRule;
executed (the execution status of this line is deduced): QRenderRule subRule;
-
4525 -
4526 switch (m) { -
4527 case PM_MenuButtonIndicator: -
4528#ifndef QT_NO_TOOLBUTTON -
4529 // QToolButton adds this directly to the width -
4530 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
4531 return 0;
never executed: return 0;
0
4532#endif -
4533 subRule = renderRule(w, opt, PseudoElement_PushButtonMenuIndicator);
never executed (the execution status of this line is deduced): subRule = renderRule(w, opt, PseudoElement_PushButtonMenuIndicator);
-
4534 if (subRule.hasContentsSize())
never evaluated: subRule.hasContentsSize()
0
4535 return subRule.size().width();
never executed: return subRule.size().width();
0
4536 break;
never executed: break;
0
4537 -
4538 case PM_ButtonShiftHorizontal: -
4539 case PM_ButtonShiftVertical: -
4540 case PM_ButtonMargin: -
4541 case PM_ButtonDefaultIndicator: -
4542 if (rule.hasBox())
never evaluated: rule.hasBox()
0
4543 return 0;
never executed: return 0;
0
4544 break;
never executed: break;
0
4545 -
4546 case PM_DefaultFrameWidth: -
4547 if (!rule.hasNativeBorder())
partially evaluated: !rule.hasNativeBorder()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9
0-9
4548 return rule.border()->borders[LeftEdge];
never executed: return rule.border()->borders[LeftEdge];
0
4549 break;
executed: break;
Execution Count:9
9
4550 -
4551 case PM_ExclusiveIndicatorWidth: -
4552 case PM_IndicatorWidth: -
4553 case PM_ExclusiveIndicatorHeight: -
4554 case PM_IndicatorHeight: -
4555 subRule = renderRule(w, opt, PseudoElement_Indicator);
never executed (the execution status of this line is deduced): subRule = renderRule(w, opt, PseudoElement_Indicator);
-
4556 if (subRule.hasContentsSize()) {
never evaluated: subRule.hasContentsSize()
0
4557 return (m == PM_ExclusiveIndicatorWidth) || (m == PM_IndicatorWidth)
never executed: return (m == PM_ExclusiveIndicatorWidth) || (m == PM_IndicatorWidth) ? subRule.size().width() : subRule.size().height();
0
4558 ? subRule.size().width() : subRule.size().height();
never executed: return (m == PM_ExclusiveIndicatorWidth) || (m == PM_IndicatorWidth) ? subRule.size().width() : subRule.size().height();
0
4559 } -
4560 break;
never executed: break;
0
4561 -
4562 case PM_DockWidgetFrameWidth: -
4563 case PM_ToolTipLabelFrameWidth: // border + margin + padding (support only one width) -
4564 if (!rule.hasDrawable())
never evaluated: !rule.hasDrawable()
0
4565 break;
never executed: break;
0
4566 -
4567 return (rule.border() ? rule.border()->borders[LeftEdge] : 0)
never executed: return (rule.border() ? rule.border()->borders[LeftEdge] : 0) + (rule.hasBox() ? rule.box()->margins[LeftEdge] + rule.box()->paddings[LeftEdge]: 0);
0
4568 + (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
4569 -
4570 case PM_ToolBarFrameWidth: -
4571 if (rule.hasBorder() || rule.hasBox())
never evaluated: rule.hasBorder()
never evaluated: rule.hasBox()
0
4572 return (rule.border() ? rule.border()->borders[LeftEdge] : 0)
never executed: return (rule.border() ? rule.border()->borders[LeftEdge] : 0) + (rule.hasBox() ? rule.box()->paddings[LeftEdge]: 0);
0
4573 + (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
4574 break;
never executed: break;
0
4575 -
4576 case PM_MenuPanelWidth: -
4577 case PM_MenuBarPanelWidth: -
4578 if (rule.hasBorder() || rule.hasBox())
never evaluated: rule.hasBorder()
never evaluated: rule.hasBox()
0
4579 return (rule.border() ? rule.border()->borders[LeftEdge] : 0)
never executed: return (rule.border() ? rule.border()->borders[LeftEdge] : 0) + (rule.hasBox() ? rule.box()->margins[LeftEdge]: 0);
0
4580 + (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
4581 break;
never executed: break;
0
4582 -
4583 -
4584 case PM_MenuHMargin: -
4585 case PM_MenuBarHMargin: -
4586 if (rule.hasBox())
never evaluated: rule.hasBox()
0
4587 return rule.box()->paddings[LeftEdge];
never executed: return rule.box()->paddings[LeftEdge];
0
4588 break;
never executed: break;
0
4589 -
4590 case PM_MenuVMargin: -
4591 case PM_MenuBarVMargin: -
4592 if (rule.hasBox())
never evaluated: rule.hasBox()
0
4593 return rule.box()->paddings[TopEdge];
never executed: return rule.box()->paddings[TopEdge];
0
4594 break;
never executed: break;
0
4595 -
4596 case PM_DockWidgetTitleBarButtonMargin: -
4597 case PM_ToolBarItemMargin: -
4598 if (rule.hasBox())
never evaluated: rule.hasBox()
0
4599 return rule.box()->margins[TopEdge];
never executed: return rule.box()->margins[TopEdge];
0
4600 break;
never executed: break;
0
4601 -
4602 case PM_ToolBarItemSpacing: -
4603 case PM_MenuBarItemSpacing: -
4604 if (rule.hasBox() && rule.box()->spacing != -1)
never evaluated: rule.hasBox()
never evaluated: rule.box()->spacing != -1
0
4605 return rule.box()->spacing;
never executed: return rule.box()->spacing;
0
4606 break;
never executed: break;
0
4607 -
4608 case PM_MenuTearoffHeight: -
4609 case PM_MenuScrollerHeight: { -
4610 PseudoElement ps = m == PM_MenuTearoffHeight ? PseudoElement_MenuTearoff : PseudoElement_MenuScroller;
never evaluated: m == PM_MenuTearoffHeight
0
4611 subRule = renderRule(w, opt, ps);
never executed (the execution status of this line is deduced): subRule = renderRule(w, opt, ps);
-
4612 if (subRule.hasContentsSize())
never evaluated: subRule.hasContentsSize()
0
4613 return subRule.size().height();
never executed: return subRule.size().height();
0
4614 break;
never executed: break;
0
4615 } -
4616 -
4617 case PM_ToolBarExtensionExtent: -
4618 break;
never executed: break;
0
4619 -
4620 case PM_SplitterWidth: -
4621 case PM_ToolBarSeparatorExtent: -
4622 case PM_ToolBarHandleExtent: { -
4623 PseudoElement ps;
never executed (the execution status of this line is deduced): PseudoElement ps;
-
4624 if (m == PM_ToolBarHandleExtent) ps = PseudoElement_ToolBarHandle;
never executed: ps = PseudoElement_ToolBarHandle;
never evaluated: m == PM_ToolBarHandleExtent
0
4625 else if (m == PM_SplitterWidth) ps = PseudoElement_SplitterHandle;
never executed: ps = PseudoElement_SplitterHandle;
never evaluated: m == PM_SplitterWidth
0
4626 else ps = PseudoElement_ToolBarSeparator;
never executed: ps = PseudoElement_ToolBarSeparator;
0
4627 subRule = renderRule(w, opt, ps);
never executed (the execution status of this line is deduced): subRule = renderRule(w, opt, ps);
-
4628 if (subRule.hasContentsSize()) {
never evaluated: subRule.hasContentsSize()
0
4629 QSize sz = subRule.size();
never executed (the execution status of this line is deduced): QSize sz = subRule.size();
-
4630 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
4631 } -
4632 break;
never executed: break;
0
4633 } -
4634 -
4635 case PM_RadioButtonLabelSpacing: -
4636 if (rule.hasBox() && rule.box()->spacing != -1)
never evaluated: rule.hasBox()
never evaluated: rule.box()->spacing != -1
0
4637 return rule.box()->spacing;
never executed: return rule.box()->spacing;
0
4638 break;
never executed: break;
0
4639 case PM_CheckBoxLabelSpacing: -
4640 if (qobject_cast<const QCheckBox *>(w)) {
never evaluated: qobject_cast<const QCheckBox *>(w)
0
4641 if (rule.hasBox() && rule.box()->spacing != -1)
never evaluated: rule.hasBox()
never evaluated: rule.box()->spacing != -1
0
4642 return rule.box()->spacing;
never executed: return rule.box()->spacing;
0
4643 }
never executed: }
0
4644 // assume group box -
4645 subRule = renderRule(w, opt, PseudoElement_GroupBoxTitle);
never executed (the execution status of this line is deduced): subRule = renderRule(w, opt, PseudoElement_GroupBoxTitle);
-
4646 if (subRule.hasBox() && subRule.box()->spacing != -1)
never evaluated: subRule.hasBox()
never evaluated: subRule.box()->spacing != -1
0
4647 return subRule.box()->spacing;
never executed: return subRule.box()->spacing;
0
4648 break;
never executed: break;
0
4649 -
4650#ifndef QT_NO_SCROLLBAR -
4651 case PM_ScrollBarExtent: -
4652 if (rule.hasContentsSize()) {
never evaluated: rule.hasContentsSize()
0
4653 QSize sz = rule.size();
never executed (the execution status of this line is deduced): QSize sz = rule.size();
-
4654 if (const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt))
never evaluated: const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt)
0
4655 return sb->orientation == Qt::Horizontal ? sz.height() : sz.width();
never executed: return sb->orientation == Qt::Horizontal ? sz.height() : sz.width();
0
4656 return sz.width() == -1 ? sz.height() : sz.width();
never executed: return sz.width() == -1 ? sz.height() : sz.width();
0
4657 } -
4658 break;
never executed: break;
0
4659 -
4660 case PM_ScrollBarSliderMin: -
4661 if (hasStyleRule(w, PseudoElement_ScrollBarSlider)) {
never evaluated: hasStyleRule(w, PseudoElement_ScrollBarSlider)
0
4662 subRule = renderRule(w, opt, PseudoElement_ScrollBarSlider);
never executed (the execution status of this line is deduced): subRule = renderRule(w, opt, PseudoElement_ScrollBarSlider);
-
4663 QSize msz = subRule.minimumSize();
never executed (the execution status of this line is deduced): QSize msz = subRule.minimumSize();
-
4664 if (const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt))
never evaluated: const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt)
0
4665 return sb->orientation == Qt::Horizontal ? msz.width() : msz.height();
never executed: return sb->orientation == Qt::Horizontal ? msz.width() : msz.height();
0
4666 return msz.width() == -1 ? msz.height() : msz.width();
never executed: return msz.width() == -1 ? msz.height() : msz.width();
0
4667 } -
4668 break;
never executed: break;
0
4669 -
4670 case PM_ScrollView_ScrollBarSpacing: -
4671 if(!rule.hasNativeBorder() || rule.hasBox())
never evaluated: !rule.hasNativeBorder()
never evaluated: rule.hasBox()
0
4672 return 0;
never executed: return 0;
0
4673 break;
never executed: break;
0
4674#endif // QT_NO_SCROLLBAR -
4675 -
4676 case PM_ProgressBarChunkWidth: -
4677 subRule = renderRule(w, opt, PseudoElement_ProgressBarChunk);
never executed (the execution status of this line is deduced): subRule = renderRule(w, opt, PseudoElement_ProgressBarChunk);
-
4678 if (subRule.hasContentsSize()) {
never evaluated: subRule.hasContentsSize()
0
4679 QSize sz = subRule.size();
never executed (the execution status of this line is deduced): QSize sz = subRule.size();
-
4680 return (opt->state & QStyle::State_Horizontal)
never executed: return (opt->state & QStyle::State_Horizontal) ? sz.width() : sz.height();
0
4681 ? sz.width() : sz.height();
never executed: return (opt->state & QStyle::State_Horizontal) ? sz.width() : sz.height();
0
4682 } -
4683 break;
never executed: break;
0
4684 -
4685#ifndef QT_NO_TABWIDGET -
4686 case PM_TabBarTabHSpace: -
4687 case PM_TabBarTabVSpace: -
4688 subRule = renderRule(w, opt, PseudoElement_TabBarTab);
never executed (the execution status of this line is deduced): subRule = renderRule(w, opt, PseudoElement_TabBarTab);
-
4689 if (subRule.hasBox() || subRule.hasBorder())
never evaluated: subRule.hasBox()
never evaluated: subRule.hasBorder()
0
4690 return 0;
never executed: return 0;
0
4691 break;
never executed: break;
0
4692 -
4693 case PM_TabBarScrollButtonWidth: { -
4694 subRule = renderRule(w, opt, PseudoElement_TabBarScroller);
never executed (the execution status of this line is deduced): subRule = renderRule(w, opt, PseudoElement_TabBarScroller);
-
4695 if (subRule.hasContentsSize()) {
never evaluated: subRule.hasContentsSize()
0
4696 QSize sz = subRule.size();
never executed (the execution status of this line is deduced): QSize sz = subRule.size();
-
4697 return sz.width() != -1 ? sz.width() : sz.height();
never executed: return sz.width() != -1 ? sz.width() : sz.height();
0
4698 } -
4699 } -
4700 break;
never executed: break;
0
4701 -
4702 case PM_TabBarTabShiftHorizontal: -
4703 case PM_TabBarTabShiftVertical: -
4704 subRule = renderRule(w, opt, PseudoElement_TabBarTab);
never executed (the execution status of this line is deduced): subRule = renderRule(w, opt, PseudoElement_TabBarTab);
-
4705 if (subRule.hasBox())
never evaluated: subRule.hasBox()
0
4706 return 0;
never executed: return 0;
0
4707 break;
never executed: break;
0
4708 -
4709 case PM_TabBarBaseOverlap: { -
4710 const QWidget *tabWidget = qobject_cast<const QTabWidget *>(w) ? w : w->parentWidget();
never evaluated: qobject_cast<const QTabWidget *>(w)
0
4711 if (hasStyleRule(tabWidget, PseudoElement_TabWidgetPane)) {
never evaluated: hasStyleRule(tabWidget, PseudoElement_TabWidgetPane)
0
4712 return 0;
never executed: return 0;
0
4713 } -
4714 break;
never executed: break;
0
4715 } -
4716#endif // QT_NO_TABWIDGET -
4717 -
4718 case PM_SliderThickness: // horizontal slider's height (sizeHint) -
4719 case PM_SliderLength: // minimum length of slider -
4720 if (rule.hasContentsSize()) {
never evaluated: rule.hasContentsSize()
0
4721 bool horizontal = opt->state & QStyle::State_Horizontal;
never executed (the execution status of this line is deduced): bool horizontal = opt->state & QStyle::State_Horizontal;
-
4722 if (m == PM_SliderThickness) {
never evaluated: m == PM_SliderThickness
0
4723 QSize sz = rule.size();
never executed (the execution status of this line is deduced): QSize sz = rule.size();
-
4724 return horizontal ? sz.height() : sz.width();
never executed: return horizontal ? sz.height() : sz.width();
0
4725 } else { -
4726 QSize msz = rule.minimumContentsSize();
never executed (the execution status of this line is deduced): QSize msz = rule.minimumContentsSize();
-
4727 return horizontal ? msz.width() : msz.height();
never executed: return horizontal ? msz.width() : msz.height();
0
4728 } -
4729 } -
4730 break;
never executed: break;
0
4731 -
4732 case PM_SliderControlThickness: { -
4733 QRenderRule subRule = renderRule(w, opt, PseudoElement_SliderHandle);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_SliderHandle);
-
4734 if (!subRule.hasContentsSize())
never evaluated: !subRule.hasContentsSize()
0
4735 break;
never executed: break;
0
4736 QSize size = subRule.size();
never executed (the execution status of this line is deduced): QSize size = subRule.size();
-
4737 return (opt->state & QStyle::State_Horizontal) ? size.height() : size.width();
never executed: return (opt->state & QStyle::State_Horizontal) ? size.height() : size.width();
0
4738 } -
4739 -
4740 case PM_ToolBarIconSize: -
4741 case PM_ListViewIconSize: -
4742 case PM_IconViewIconSize: -
4743 case PM_TabBarIconSize: -
4744 case PM_MessageBoxIconSize: -
4745 case PM_ButtonIconSize: -
4746 case PM_SmallIconSize: -
4747 if (rule.hasStyleHint(QLatin1String("icon-size"))) {
partially evaluated: rule.hasStyleHint(QLatin1String("icon-size"))
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
4748 return rule.styleHint(QLatin1String("icon-size")).toSize().width();
never executed: return rule.styleHint(QLatin1String("icon-size")).toSize().width();
0
4749 } -
4750 break;
executed: break;
Execution Count:1
1
4751 -
4752 case PM_DockWidgetTitleMargin: { -
4753 QRenderRule subRule = renderRule(w, opt, PseudoElement_DockWidgetTitle);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_DockWidgetTitle);
-
4754 if (!subRule.hasBox())
never evaluated: !subRule.hasBox()
0
4755 break;
never executed: break;
0
4756 return (subRule.border() ? subRule.border()->borders[TopEdge] : 0)
never executed: return (subRule.border() ? subRule.border()->borders[TopEdge] : 0) + (subRule.hasBox() ? subRule.box()->margins[TopEdge] + subRule.box()->paddings[TopEdge]: 0);
0
4757 + (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
4758 } -
4759 -
4760 case PM_DockWidgetSeparatorExtent: { -
4761 QRenderRule subRule = renderRule(w, opt, PseudoElement_DockWidgetSeparator);
executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_DockWidgetSeparator);
-
4762 if (!subRule.hasContentsSize())
partially evaluated: !subRule.hasContentsSize()
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
4763 break;
executed: break;
Execution Count:1
1
4764 QSize sz = subRule.size();
never executed (the execution status of this line is deduced): QSize sz = subRule.size();
-
4765 return qMax(sz.width(), sz.height());
never executed: return qMax(sz.width(), sz.height());
0
4766 } -
4767 -
4768 case PM_TitleBarHeight: { -
4769 QRenderRule subRule = renderRule(w, opt, PseudoElement_TitleBar);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_TitleBar);
-
4770 if (subRule.hasContentsSize())
never evaluated: subRule.hasContentsSize()
0
4771 return subRule.size().height();
never executed: return subRule.size().height();
0
4772 else if (subRule.hasBox() || subRule.hasBorder()) {
never evaluated: subRule.hasBox()
never evaluated: subRule.hasBorder()
0
4773 QFontMetrics fm = opt ? opt->fontMetrics : w->fontMetrics();
never evaluated: opt
0
4774 return subRule.size(QSize(0, fm.height())).height();
never executed: return subRule.size(QSize(0, fm.height())).height();
0
4775 } -
4776 break;
never executed: break;
0
4777 } -
4778 -
4779 case PM_MdiSubWindowFrameWidth: -
4780 if (rule.hasBox() || rule.hasBorder()) {
never evaluated: rule.hasBox()
never evaluated: rule.hasBorder()
0
4781 return (rule.border() ? rule.border()->borders[LeftEdge] : 0)
never executed: return (rule.border() ? rule.border()->borders[LeftEdge] : 0) + (rule.hasBox() ? rule.box()->paddings[LeftEdge]+rule.box()->margins[LeftEdge]: 0);
0
4782 + (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
4783 } -
4784 break;
never executed: break;
0
4785 -
4786 case PM_MdiSubWindowMinimizedWidth: { -
4787 QRenderRule subRule = renderRule(w, PseudoElement_None, PseudoClass_Minimized);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, PseudoElement_None, PseudoClass_Minimized);
-
4788 int width = subRule.size().width();
never executed (the execution status of this line is deduced): int width = subRule.size().width();
-
4789 if (width != -1)
never evaluated: width != -1
0
4790 return width;
never executed: return width;
0
4791 break;
never executed: break;
0
4792 } -
4793 default: -
4794 break;
executed: break;
Execution Count:2
2
4795 } -
4796 -
4797 return baseStyle()->pixelMetric(m, opt, w);
executed: return baseStyle()->pixelMetric(m, opt, w);
Execution Count:13
13
4798} -
4799 -
4800QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, -
4801 const QSize &csz, const QWidget *w) const -
4802{ -
4803 RECURSION_GUARD(return baseStyle()->sizeFromContents(ct, opt, csz, w))
never executed: return baseStyle()->sizeFromContents(ct, opt, csz, w);
partially evaluated: globalStyleSheetStyle != 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
never evaluated: globalStyleSheetStyle != this
0-2
4804 -
4805 QRenderRule rule = renderRule(w, opt);
executed (the execution status of this line is deduced): QRenderRule rule = renderRule(w, opt);
-
4806 QSize sz = rule.adjustSize(csz);
executed (the execution status of this line is deduced): QSize sz = rule.adjustSize(csz);
-
4807 -
4808 switch (ct) { -
4809 case CT_SpinBox: // ### hopelessly broken QAbstractSpinBox (part 1) -
4810 if (rule.hasBox() || !rule.hasNativeBorder())
never evaluated: rule.hasBox()
never evaluated: !rule.hasNativeBorder()
0
4811 return csz;
never executed: return csz;
0
4812 return rule.baseStyleCanDraw() ? baseStyle()->sizeFromContents(ct, opt, sz, w)
never executed: return rule.baseStyleCanDraw() ? baseStyle()->sizeFromContents(ct, opt, sz, w) : QWindowsStyle::sizeFromContents(ct, opt, sz, w);
0
4813 : QWindowsStyle::sizeFromContents(ct, opt, sz, w);
never executed: return rule.baseStyleCanDraw() ? baseStyle()->sizeFromContents(ct, opt, sz, w) : QWindowsStyle::sizeFromContents(ct, opt, sz, w);
0
4814 case CT_ToolButton: -
4815 if (rule.hasBox() || !rule.hasNativeBorder() || !rule.baseStyleCanDraw())
never evaluated: rule.hasBox()
never evaluated: !rule.hasNativeBorder()
never evaluated: !rule.baseStyleCanDraw()
0
4816 sz += QSize(3, 3); // ### broken QToolButton
never executed: sz += QSize(3, 3);
0
4817 //fall thought -
4818 case CT_ComboBox:
code before this statement never executed: case CT_ComboBox:
0
4819 case CT_PushButton: -
4820 if (rule.hasBox() || !rule.hasNativeBorder()) {
never evaluated: rule.hasBox()
never evaluated: !rule.hasNativeBorder()
0
4821 if(ct == CT_ComboBox) {
never evaluated: ct == CT_ComboBox
0
4822 //add some space for the drop down. -
4823 QRenderRule subRule = renderRule(w, opt, PseudoElement_ComboBoxDropDown);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_ComboBoxDropDown);
-
4824 QRect comboRect = positionRect(w, rule, subRule, PseudoElement_ComboBoxDropDown, opt->rect, opt->direction);
never executed (the execution status of this line is deduced): QRect comboRect = positionRect(w, rule, subRule, PseudoElement_ComboBoxDropDown, opt->rect, opt->direction);
-
4825 //+2 because there is hardcoded margins in QCommonStyle::drawControl(CE_ComboBoxLabel) -
4826 sz += QSize(comboRect.width() + 2, 0);
never executed (the execution status of this line is deduced): sz += QSize(comboRect.width() + 2, 0);
-
4827 }
never executed: }
0
4828 return rule.boxSize(sz);
never executed: return rule.boxSize(sz);
0
4829 } -
4830 sz = rule.baseStyleCanDraw() ? baseStyle()->sizeFromContents(ct, opt, sz, w)
never evaluated: rule.baseStyleCanDraw()
0
4831 : QWindowsStyle::sizeFromContents(ct, opt, sz, w);
never executed (the execution status of this line is deduced): : QWindowsStyle::sizeFromContents(ct, opt, sz, w);
-
4832 return rule.boxSize(sz, Margin);
never executed: return rule.boxSize(sz, Margin);
0
4833 -
4834 case CT_HeaderSection: { -
4835 if (const QStyleOptionHeader *hdr = qstyleoption_cast<const QStyleOptionHeader *>(opt)) {
never evaluated: const QStyleOptionHeader *hdr = qstyleoption_cast<const QStyleOptionHeader *>(opt)
0
4836 QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection);
-
4837 if (subRule.hasGeometry() || subRule.hasBox() || !subRule.hasNativeBorder()) {
never evaluated: subRule.hasGeometry()
never evaluated: subRule.hasBox()
never evaluated: !subRule.hasNativeBorder()
0
4838 sz = subRule.adjustSize(csz);
never executed (the execution status of this line is deduced): sz = subRule.adjustSize(csz);
-
4839 if (!subRule.hasGeometry()) {
never evaluated: !subRule.hasGeometry()
0
4840 QSize nativeContentsSize;
never executed (the execution status of this line is deduced): QSize nativeContentsSize;
-
4841 bool nullIcon = hdr->icon.isNull();
never executed (the execution status of this line is deduced): bool nullIcon = hdr->icon.isNull();
-
4842 int iconSize = nullIcon ? 0 : pixelMetric(QStyle::PM_SmallIconSize, hdr, w);
never evaluated: nullIcon
0
4843 QSize txt = hdr->fontMetrics.size(0, hdr->text);
never executed (the execution status of this line is deduced): QSize txt = hdr->fontMetrics.size(0, hdr->text);
-
4844 nativeContentsSize.setHeight(qMax(iconSize, txt.height()));
never executed (the execution status of this line is deduced): nativeContentsSize.setHeight(qMax(iconSize, txt.height()));
-
4845 nativeContentsSize.setWidth(iconSize + txt.width());
never executed (the execution status of this line is deduced): nativeContentsSize.setWidth(iconSize + txt.width());
-
4846 sz = sz.expandedTo(nativeContentsSize);
never executed (the execution status of this line is deduced): sz = sz.expandedTo(nativeContentsSize);
-
4847 }
never executed: }
0
4848 return subRule.size(sz);
never executed: return subRule.size(sz);
0
4849 } -
4850 return subRule.baseStyleCanDraw() ? baseStyle()->sizeFromContents(ct, opt, sz, w)
never executed: return subRule.baseStyleCanDraw() ? baseStyle()->sizeFromContents(ct, opt, sz, w) : QWindowsStyle::sizeFromContents(ct, opt, sz, w);
0
4851 : QWindowsStyle::sizeFromContents(ct, opt, sz, w);
never executed: return subRule.baseStyleCanDraw() ? baseStyle()->sizeFromContents(ct, opt, sz, w) : QWindowsStyle::sizeFromContents(ct, opt, sz, w);
0
4852 } -
4853 } -
4854 break;
never executed: break;
0
4855 case CT_GroupBox: -
4856 case CT_LineEdit: -
4857#ifndef QT_NO_SPINBOX -
4858 // ### hopelessly broken QAbstractSpinBox (part 2) -
4859 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
4860 QRenderRule rule = renderRule(spinBox, opt);
never executed (the execution status of this line is deduced): QRenderRule rule = renderRule(spinBox, opt);
-
4861 if (rule.hasBox() || !rule.hasNativeBorder())
never evaluated: rule.hasBox()
never evaluated: !rule.hasNativeBorder()
0
4862 return csz;
never executed: return csz;
0
4863 return rule.baseStyleCanDraw() ? baseStyle()->sizeFromContents(ct, opt, sz, w)
never executed: return rule.baseStyleCanDraw() ? baseStyle()->sizeFromContents(ct, opt, sz, w) : QWindowsStyle::sizeFromContents(ct, opt, sz, w);
0
4864 : QWindowsStyle::sizeFromContents(ct, opt, sz, w);
never executed: return rule.baseStyleCanDraw() ? baseStyle()->sizeFromContents(ct, opt, sz, w) : QWindowsStyle::sizeFromContents(ct, opt, sz, w);
0
4865 } -
4866#endif -
4867 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
4868 return rule.boxSize(sz);
never executed: return rule.boxSize(sz);
0
4869 } -
4870 break;
executed: break;
Execution Count:2
2
4871 -
4872 case CT_CheckBox: -
4873 case CT_RadioButton: -
4874 if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
never evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)
0
4875 if (rule.hasBox() || rule.hasBorder() || hasStyleRule(w, PseudoElement_Indicator)) {
never evaluated: rule.hasBox()
never evaluated: rule.hasBorder()
never evaluated: hasStyleRule(w, PseudoElement_Indicator)
0
4876 bool isRadio = (ct == CT_RadioButton);
never executed (the execution status of this line is deduced): bool isRadio = (ct == CT_RadioButton);
-
4877 int iw = pixelMetric(isRadio ? PM_ExclusiveIndicatorWidth
never executed (the execution status of this line is deduced): int iw = pixelMetric(isRadio ? PM_ExclusiveIndicatorWidth
-
4878 : PM_IndicatorWidth, btn, w);
never executed (the execution status of this line is deduced): : PM_IndicatorWidth, btn, w);
-
4879 int ih = pixelMetric(isRadio ? PM_ExclusiveIndicatorHeight
never executed (the execution status of this line is deduced): int ih = pixelMetric(isRadio ? PM_ExclusiveIndicatorHeight
-
4880 : PM_IndicatorHeight, btn, w);
never executed (the execution status of this line is deduced): : PM_IndicatorHeight, btn, w);
-
4881 -
4882 int spacing = pixelMetric(isRadio ? PM_RadioButtonLabelSpacing
never executed (the execution status of this line is deduced): int spacing = pixelMetric(isRadio ? PM_RadioButtonLabelSpacing
-
4883 : PM_CheckBoxLabelSpacing, btn, w);
never executed (the execution status of this line is deduced): : PM_CheckBoxLabelSpacing, btn, w);
-
4884 sz.setWidth(sz.width() + iw + spacing);
never executed (the execution status of this line is deduced): sz.setWidth(sz.width() + iw + spacing);
-
4885 sz.setHeight(qMax(sz.height(), ih));
never executed (the execution status of this line is deduced): sz.setHeight(qMax(sz.height(), ih));
-
4886 return rule.boxSize(sz);
never executed: return rule.boxSize(sz);
0
4887 } -
4888 }
never executed: }
0
4889 break;
never executed: break;
0
4890 -
4891 case CT_Menu: -
4892 case CT_MenuBar: // already has everything! -
4893 case CT_ScrollBar: -
4894 if (rule.hasBox() || rule.hasBorder())
never evaluated: rule.hasBox()
never evaluated: rule.hasBorder()
0
4895 return sz;
never executed: return sz;
0
4896 break;
never executed: break;
0
4897 -
4898 case CT_MenuItem: -
4899 if (const QStyleOptionMenuItem *mi = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
never evaluated: const QStyleOptionMenuItem *mi = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)
0
4900 PseudoElement pe = (mi->menuItemType == QStyleOptionMenuItem::Separator)
never evaluated: (mi->menuItemType == QStyleOptionMenuItem::Separator)
0
4901 ? PseudoElement_MenuSeparator : PseudoElement_Item;
never executed (the execution status of this line is deduced): ? PseudoElement_MenuSeparator : PseudoElement_Item;
-
4902 QRenderRule subRule = renderRule(w, opt, pe);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, pe);
-
4903 if ((pe == PseudoElement_MenuSeparator) && subRule.hasContentsSize()) {
never evaluated: (pe == PseudoElement_MenuSeparator)
never evaluated: subRule.hasContentsSize()
0
4904 return QSize(sz.width(), subRule.size().height());
never executed: return QSize(sz.width(), subRule.size().height());
0
4905 } else if ((pe == PseudoElement_Item) && (subRule.hasBox() || subRule.hasBorder())) {
never evaluated: (pe == PseudoElement_Item)
never evaluated: subRule.hasBox()
never evaluated: subRule.hasBorder()
0
4906 int width = csz.width();
never executed (the execution status of this line is deduced): int width = csz.width();
-
4907 if (mi->text.contains(QLatin1Char('\t')))
never evaluated: mi->text.contains(QLatin1Char('\t'))
0
4908 width += 12; //as in QCommonStyle
never executed: width += 12;
0
4909 return subRule.boxSize(subRule.adjustSize(QSize(width, csz.height())));
never executed: return subRule.boxSize(subRule.adjustSize(QSize(width, csz.height())));
0
4910 } -
4911 } -
4912 break;
never executed: break;
0
4913 -
4914 case CT_Splitter: -
4915 case CT_MenuBarItem: { -
4916 PseudoElement pe = (ct == CT_Splitter) ? PseudoElement_SplitterHandle : PseudoElement_Item;
never evaluated: (ct == CT_Splitter)
0
4917 QRenderRule subRule = renderRule(w, opt, pe);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, pe);
-
4918 if (subRule.hasBox() || subRule.hasBorder())
never evaluated: subRule.hasBox()
never evaluated: subRule.hasBorder()
0
4919 return subRule.boxSize(sz);
never executed: return subRule.boxSize(sz);
0
4920 break;
never executed: break;
0
4921 } -
4922 -
4923 case CT_ProgressBar: -
4924 case CT_SizeGrip: -
4925 return (rule.hasContentsSize())
never executed: return (rule.hasContentsSize()) ? rule.size(sz) : rule.boxSize(baseStyle()->sizeFromContents(ct, opt, sz, w));
0
4926 ? rule.size(sz)
never executed: return (rule.hasContentsSize()) ? rule.size(sz) : rule.boxSize(baseStyle()->sizeFromContents(ct, opt, sz, w));
0
4927 : 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
4928 break;
dead code: break;
-
4929 -
4930 case CT_Slider: -
4931 if (rule.hasBorder() || rule.hasBox() || rule.hasGeometry())
never evaluated: rule.hasBorder()
never evaluated: rule.hasBox()
never evaluated: rule.hasGeometry()
0
4932 return rule.boxSize(sz);
never executed: return rule.boxSize(sz);
0
4933 break;
never executed: break;
0
4934 -
4935#ifndef QT_NO_TABBAR -
4936 case CT_TabBarTab: { -
4937 QRenderRule subRule = renderRule(w, opt, PseudoElement_TabBarTab);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_TabBarTab);
-
4938 if (subRule.hasBox() || !subRule.hasNativeBorder()) {
never evaluated: subRule.hasBox()
never evaluated: !subRule.hasNativeBorder()
0
4939 int spaceForIcon = 0;
never executed (the execution status of this line is deduced): int spaceForIcon = 0;
-
4940 bool vertical = false;
never executed (the execution status of this line is deduced): bool vertical = false;
-
4941 if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
never evaluated: const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)
0
4942 if (!tab->icon.isNull())
never evaluated: !tab->icon.isNull()
0
4943 spaceForIcon = 6 /* icon offset */ + 4 /* spacing */ + 2 /* magic */; // ###: hardcoded to match with common style
never executed: spaceForIcon = 6 + 4 + 2 ;
0
4944 vertical = verticalTabs(tab->shape);
never executed (the execution status of this line is deduced): vertical = verticalTabs(tab->shape);
-
4945 }
never executed: }
0
4946 sz = csz + QSize(vertical ? 0 : spaceForIcon, vertical ? spaceForIcon : 0);
never executed (the execution status of this line is deduced): sz = csz + QSize(vertical ? 0 : spaceForIcon, vertical ? spaceForIcon : 0);
-
4947 return subRule.boxSize(subRule.adjustSize(sz));
never executed: return subRule.boxSize(subRule.adjustSize(sz));
0
4948 } -
4949#ifdef Q_WS_MAC -
4950 if (baseStyle()->inherits("QMacStyle")) { -
4951 //adjust the size after the call to the style because the mac style ignore the size arguments anyway. -
4952 //this might cause the (max-){width,height} property to include the native style border while they should not. -
4953 return subRule.adjustSize(baseStyle()->sizeFromContents(ct, opt, csz, w)); -
4954 } -
4955#endif -
4956 sz = subRule.adjustSize(csz);
never executed (the execution status of this line is deduced): sz = subRule.adjustSize(csz);
-
4957 break;
never executed: break;
0
4958 } -
4959#endif // QT_NO_TABBAR -
4960 -
4961 case CT_MdiControls: -
4962 if (const QStyleOptionComplex *ccOpt = qstyleoption_cast<const QStyleOptionComplex *>(opt)) {
never evaluated: const QStyleOptionComplex *ccOpt = qstyleoption_cast<const QStyleOptionComplex *>(opt)
0
4963 if (!hasStyleRule(w, PseudoElement_MdiCloseButton)
never evaluated: !hasStyleRule(w, PseudoElement_MdiCloseButton)
0
4964 && !hasStyleRule(w, PseudoElement_MdiNormalButton)
never evaluated: !hasStyleRule(w, PseudoElement_MdiNormalButton)
0
4965 && !hasStyleRule(w, PseudoElement_MdiMinButton))
never evaluated: !hasStyleRule(w, PseudoElement_MdiMinButton)
0
4966 break;
never executed: break;
0
4967 -
4968 QList<QVariant> layout = rule.styleHint(QLatin1String("button-layout")).toList();
never executed (the execution status of this line is deduced): QList<QVariant> layout = rule.styleHint(QLatin1String("button-layout")).toList();
-
4969 if (layout.isEmpty())
never evaluated: layout.isEmpty()
0
4970 layout = subControlLayout(QLatin1String("mNX"));
never executed: layout = subControlLayout(QLatin1String("mNX"));
0
4971 -
4972 int width = 0, height = 0;
never executed (the execution status of this line is deduced): int width = 0, height = 0;
-
4973 for (int i = 0; i < layout.count(); i++) {
never evaluated: i < layout.count()
0
4974 int layoutButton = layout[i].toInt();
never executed (the execution status of this line is deduced): int layoutButton = layout[i].toInt();
-
4975 if (layoutButton < PseudoElement_MdiCloseButton
never evaluated: layoutButton < PseudoElement_MdiCloseButton
0
4976 || layoutButton > PseudoElement_MdiNormalButton)
never evaluated: layoutButton > PseudoElement_MdiNormalButton
0
4977 continue;
never executed: continue;
0
4978 QStyle::SubControl sc = knownPseudoElements[layoutButton].subControl;
never executed (the execution status of this line is deduced): QStyle::SubControl sc = knownPseudoElements[layoutButton].subControl;
-
4979 if (!(ccOpt->subControls & sc))
never evaluated: !(ccOpt->subControls & sc)
0
4980 continue;
never executed: continue;
0
4981 QRenderRule subRule = renderRule(w, opt, layoutButton);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, layoutButton);
-
4982 QSize sz = subRule.size();
never executed (the execution status of this line is deduced): QSize sz = subRule.size();
-
4983 width += sz.width();
never executed (the execution status of this line is deduced): width += sz.width();
-
4984 height = qMax(height, sz.height());
never executed (the execution status of this line is deduced): height = qMax(height, sz.height());
-
4985 }
never executed: }
0
4986 -
4987 return QSize(width, height);
never executed: return QSize(width, height);
0
4988 } -
4989 break;
never executed: break;
0
4990 -
4991#ifndef QT_NO_ITEMVIEWS -
4992 case CT_ItemViewItem: { -
4993 QRenderRule subRule = renderRule(w, opt, PseudoElement_ViewItem);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_ViewItem);
-
4994 sz = baseStyle()->sizeFromContents(ct, opt, csz, w);
never executed (the execution status of this line is deduced): sz = baseStyle()->sizeFromContents(ct, opt, csz, w);
-
4995 sz = subRule.adjustSize(sz);
never executed (the execution status of this line is deduced): sz = subRule.adjustSize(sz);
-
4996 if (subRule.hasBox() || subRule.hasBorder())
never evaluated: subRule.hasBox()
never evaluated: subRule.hasBorder()
0
4997 sz = subRule.boxSize(sz);
never executed: sz = subRule.boxSize(sz);
0
4998 return sz;
never executed: return sz;
0
4999 } -
5000#endif // QT_NO_ITEMVIEWS -
5001 -
5002 default: -
5003 break;
never executed: break;
0
5004 } -
5005 -
5006 return baseStyle()->sizeFromContents(ct, opt, sz, w);
executed: return baseStyle()->sizeFromContents(ct, opt, sz, w);
Execution Count:2
2
5007} -
5008 -
5009/*! -
5010 \internal -
5011*/ -
5012static QLatin1String propertyNameForStandardPixmap(QStyle::StandardPixmap sp) -
5013{ -
5014 switch (sp) { -
5015 case QStyle::SP_TitleBarMenuButton: return QLatin1String("titlebar-menu-icon");
never executed: return QLatin1String("titlebar-menu-icon");
0
5016 case QStyle::SP_TitleBarMinButton: return QLatin1String("titlebar-minimize-icon");
never executed: return QLatin1String("titlebar-minimize-icon");
0
5017 case QStyle::SP_TitleBarMaxButton: return QLatin1String("titlebar-maximize-icon");
never executed: return QLatin1String("titlebar-maximize-icon");
0
5018 case QStyle::SP_TitleBarCloseButton: return QLatin1String("titlebar-close-icon");
never executed: return QLatin1String("titlebar-close-icon");
0
5019 case QStyle::SP_TitleBarNormalButton: return QLatin1String("titlebar-normal-icon");
never executed: return QLatin1String("titlebar-normal-icon");
0
5020 case QStyle::SP_TitleBarShadeButton: return QLatin1String("titlebar-shade-icon");
never executed: return QLatin1String("titlebar-shade-icon");
0
5021 case QStyle::SP_TitleBarUnshadeButton: return QLatin1String("titlebar-unshade-icon");
never executed: return QLatin1String("titlebar-unshade-icon");
0
5022 case QStyle::SP_TitleBarContextHelpButton: return QLatin1String("titlebar-contexthelp-icon");
never executed: return QLatin1String("titlebar-contexthelp-icon");
0
5023 case QStyle::SP_DockWidgetCloseButton: return QLatin1String("dockwidget-close-icon");
never executed: return QLatin1String("dockwidget-close-icon");
0
5024 case QStyle::SP_MessageBoxInformation: return QLatin1String("messagebox-information-icon");
never executed: return QLatin1String("messagebox-information-icon");
0
5025 case QStyle::SP_MessageBoxWarning: return QLatin1String("messagebox-warning-icon");
never executed: return QLatin1String("messagebox-warning-icon");
0
5026 case QStyle::SP_MessageBoxCritical: return QLatin1String("messagebox-critical-icon");
never executed: return QLatin1String("messagebox-critical-icon");
0
5027 case QStyle::SP_MessageBoxQuestion: return QLatin1String("messagebox-question-icon");
never executed: return QLatin1String("messagebox-question-icon");
0
5028 case QStyle::SP_DesktopIcon: return QLatin1String("desktop-icon");
never executed: return QLatin1String("desktop-icon");
0
5029 case QStyle::SP_TrashIcon: return QLatin1String("trash-icon");
never executed: return QLatin1String("trash-icon");
0
5030 case QStyle::SP_ComputerIcon: return QLatin1String("computer-icon");
never executed: return QLatin1String("computer-icon");
0
5031 case QStyle::SP_DriveFDIcon: return QLatin1String("floppy-icon");
never executed: return QLatin1String("floppy-icon");
0
5032 case QStyle::SP_DriveHDIcon: return QLatin1String("harddisk-icon");
never executed: return QLatin1String("harddisk-icon");
0
5033 case QStyle::SP_DriveCDIcon: return QLatin1String("cd-icon");
never executed: return QLatin1String("cd-icon");
0
5034 case QStyle::SP_DriveDVDIcon: return QLatin1String("dvd-icon");
never executed: return QLatin1String("dvd-icon");
0
5035 case QStyle::SP_DriveNetIcon: return QLatin1String("network-icon");
never executed: return QLatin1String("network-icon");
0
5036 case QStyle::SP_DirOpenIcon: return QLatin1String("directory-open-icon");
never executed: return QLatin1String("directory-open-icon");
0
5037 case QStyle::SP_DirClosedIcon: return QLatin1String("directory-closed-icon");
never executed: return QLatin1String("directory-closed-icon");
0
5038 case QStyle::SP_DirLinkIcon: return QLatin1String("directory-link-icon");
never executed: return QLatin1String("directory-link-icon");
0
5039 case QStyle::SP_FileIcon: return QLatin1String("file-icon");
never executed: return QLatin1String("file-icon");
0
5040 case QStyle::SP_FileLinkIcon: return QLatin1String("file-link-icon");
never executed: return QLatin1String("file-link-icon");
0
5041 case QStyle::SP_FileDialogStart: return QLatin1String("filedialog-start-icon");
never executed: return QLatin1String("filedialog-start-icon");
0
5042 case QStyle::SP_FileDialogEnd: return QLatin1String("filedialog-end-icon");
never executed: return QLatin1String("filedialog-end-icon");
0
5043 case QStyle::SP_FileDialogToParent: return QLatin1String("filedialog-parent-directory-icon");
never executed: return QLatin1String("filedialog-parent-directory-icon");
0
5044 case QStyle::SP_FileDialogNewFolder: return QLatin1String("filedialog-new-directory-icon");
never executed: return QLatin1String("filedialog-new-directory-icon");
0
5045 case QStyle::SP_FileDialogDetailedView: return QLatin1String("filedialog-detailedview-icon");
never executed: return QLatin1String("filedialog-detailedview-icon");
0
5046 case QStyle::SP_FileDialogInfoView: return QLatin1String("filedialog-infoview-icon");
never executed: return QLatin1String("filedialog-infoview-icon");
0
5047 case QStyle::SP_FileDialogContentsView: return QLatin1String("filedialog-contentsview-icon");
never executed: return QLatin1String("filedialog-contentsview-icon");
0
5048 case QStyle::SP_FileDialogListView: return QLatin1String("filedialog-listview-icon");
never executed: return QLatin1String("filedialog-listview-icon");
0
5049 case QStyle::SP_FileDialogBack: return QLatin1String("filedialog-backward-icon");
never executed: return QLatin1String("filedialog-backward-icon");
0
5050 case QStyle::SP_DirIcon: return QLatin1String("directory-icon");
never executed: return QLatin1String("directory-icon");
0
5051 case QStyle::SP_DialogOkButton: return QLatin1String("dialog-ok-icon");
never executed: return QLatin1String("dialog-ok-icon");
0
5052 case QStyle::SP_DialogCancelButton: return QLatin1String("dialog-cancel-icon");
never executed: return QLatin1String("dialog-cancel-icon");
0
5053 case QStyle::SP_DialogHelpButton: return QLatin1String("dialog-help-icon");
never executed: return QLatin1String("dialog-help-icon");
0
5054 case QStyle::SP_DialogOpenButton: return QLatin1String("dialog-open-icon");
never executed: return QLatin1String("dialog-open-icon");
0
5055 case QStyle::SP_DialogSaveButton: return QLatin1String("dialog-save-icon");
never executed: return QLatin1String("dialog-save-icon");
0
5056 case QStyle::SP_DialogCloseButton: return QLatin1String("dialog-close-icon");
never executed: return QLatin1String("dialog-close-icon");
0
5057 case QStyle::SP_DialogApplyButton: return QLatin1String("dialog-apply-icon");
never executed: return QLatin1String("dialog-apply-icon");
0
5058 case QStyle::SP_DialogResetButton: return QLatin1String("dialog-reset-icon");
never executed: return QLatin1String("dialog-reset-icon");
0
5059 case QStyle::SP_DialogDiscardButton: return QLatin1String("discard-icon");
never executed: return QLatin1String("discard-icon");
0
5060 case QStyle::SP_DialogYesButton: return QLatin1String("dialog-yes-icon");
never executed: return QLatin1String("dialog-yes-icon");
0
5061 case QStyle::SP_DialogNoButton: return QLatin1String("dialog-no-icon");
never executed: return QLatin1String("dialog-no-icon");
0
5062 case QStyle::SP_ArrowUp: return QLatin1String("uparrow-icon");
never executed: return QLatin1String("uparrow-icon");
0
5063 case QStyle::SP_ArrowDown: return QLatin1String("downarrow-icon");
never executed: return QLatin1String("downarrow-icon");
0
5064 case QStyle::SP_ArrowLeft: return QLatin1String("leftarrow-icon");
never executed: return QLatin1String("leftarrow-icon");
0
5065 case QStyle::SP_ArrowRight: return QLatin1String("rightarrow-icon");
never executed: return QLatin1String("rightarrow-icon");
0
5066 case QStyle::SP_ArrowBack: return QLatin1String("backward-icon");
never executed: return QLatin1String("backward-icon");
0
5067 case QStyle::SP_ArrowForward: return QLatin1String("forward-icon");
never executed: return QLatin1String("forward-icon");
0
5068 case QStyle::SP_DirHomeIcon: return QLatin1String("home-icon");
never executed: return QLatin1String("home-icon");
0
5069 default: return QLatin1String("");
executed: return QLatin1String("");
Execution Count:1
1
5070 } -
5071}
never executed: }
0
5072 -
5073QIcon QStyleSheetStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption *opt, -
5074 const QWidget *w) const -
5075{ -
5076 RECURSION_GUARD(return baseStyle()->standardIcon(standardIcon, opt, w))
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
5077 QString s = propertyNameForStandardPixmap(standardIcon);
executed (the execution status of this line is deduced): QString s = propertyNameForStandardPixmap(standardIcon);
-
5078 if (!s.isEmpty()) {
partially evaluated: !s.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
5079 QRenderRule rule = renderRule(w, opt);
never executed (the execution status of this line is deduced): QRenderRule rule = renderRule(w, opt);
-
5080 if (rule.hasStyleHint(s))
never evaluated: rule.hasStyleHint(s)
0
5081 return qvariant_cast<QIcon>(rule.styleHint(s));
never executed: return qvariant_cast<QIcon>(rule.styleHint(s));
0
5082 }
never executed: }
0
5083 return baseStyle()->standardIcon(standardIcon, opt, w);
executed: return baseStyle()->standardIcon(standardIcon, opt, w);
Execution Count:1
1
5084} -
5085 -
5086QPalette QStyleSheetStyle::standardPalette() const -
5087{ -
5088 return baseStyle()->standardPalette();
never executed: return baseStyle()->standardPalette();
0
5089} -
5090 -
5091QPixmap QStyleSheetStyle::standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, -
5092 const QWidget *w) const -
5093{ -
5094 RECURSION_GUARD(return baseStyle()->standardPixmap(standardPixmap, opt, w))
never executed: return baseStyle()->standardPixmap(standardPixmap, opt, w);
never evaluated: globalStyleSheetStyle != 0
never evaluated: globalStyleSheetStyle != this
0
5095 QString s = propertyNameForStandardPixmap(standardPixmap);
never executed (the execution status of this line is deduced): QString s = propertyNameForStandardPixmap(standardPixmap);
-
5096 if (!s.isEmpty()) {
never evaluated: !s.isEmpty()
0
5097 QRenderRule rule = renderRule(w, opt);
never executed (the execution status of this line is deduced): QRenderRule rule = renderRule(w, opt);
-
5098 if (rule.hasStyleHint(s)) {
never evaluated: rule.hasStyleHint(s)
0
5099 QIcon icon = qvariant_cast<QIcon>(rule.styleHint(s));
never executed (the execution status of this line is deduced): QIcon icon = qvariant_cast<QIcon>(rule.styleHint(s));
-
5100 return icon.pixmap(16, 16); // ###: unhard-code this if someone complains
never executed: return icon.pixmap(16, 16);
0
5101 } -
5102 }
never executed: }
0
5103 return baseStyle()->standardPixmap(standardPixmap, opt, w);
never executed: return baseStyle()->standardPixmap(standardPixmap, opt, w);
0
5104} -
5105 -
5106int QStyleSheetStyle::layoutSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, -
5107 Qt::Orientation orientation, const QStyleOption *option, -
5108 const QWidget *widget) const -
5109{ -
5110 return baseStyle()->layoutSpacing(control1, control2, orientation, option, widget);
never executed: return baseStyle()->layoutSpacing(control1, control2, orientation, option, widget);
0
5111} -
5112 -
5113int QStyleSheetStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w, -
5114 QStyleHintReturn *shret) const -
5115{ -
5116 RECURSION_GUARD(return baseStyle()->styleHint(sh, opt, w, shret))
never executed: return baseStyle()->styleHint(sh, opt, w, shret);
partially evaluated: globalStyleSheetStyle != 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:77
never evaluated: globalStyleSheetStyle != this
0-77
5117 // Prevent endless loop if somebody use isActiveWindow property as selector. -
5118 // QWidget::isActiveWindow uses this styleHint to determine if the window is active or not -
5119 if (sh == SH_Widget_ShareActivation)
evaluated: sh == SH_Widget_ShareActivation
TRUEFALSE
yes
Evaluation Count:32
yes
Evaluation Count:45
32-45
5120 return baseStyle()->styleHint(sh, opt, w, shret);
executed: return baseStyle()->styleHint(sh, opt, w, shret);
Execution Count:32
32
5121 -
5122 QRenderRule rule = renderRule(w, opt);
executed (the execution status of this line is deduced): QRenderRule rule = renderRule(w, opt);
-
5123 QString s;
executed (the execution status of this line is deduced): QString s;
-
5124 switch (sh) { -
5125 case SH_LineEdit_PasswordCharacter: s = QLatin1String("lineedit-password-character"); break;
executed: break;
Execution Count:3
3
5126 case SH_DitherDisabledText: s = QLatin1String("dither-disabled-text"); break;
never executed: break;
0
5127 case SH_EtchDisabledText: s = QLatin1String("etch-disabled-text"); break;
never executed: break;
0
5128 case SH_ItemView_ActivateItemOnSingleClick: s = QLatin1String("activate-on-singleclick"); break;
never executed: break;
0
5129 case SH_ItemView_ShowDecorationSelected: s = QLatin1String("show-decoration-selected"); break;
never executed: break;
0
5130 case SH_Table_GridLineColor: s = QLatin1String("gridline-color"); break;
never executed: break;
0
5131 case SH_DialogButtonLayout: s = QLatin1String("button-layout"); break;
never executed: break;
0
5132 case SH_ToolTipLabel_Opacity: s = QLatin1String("opacity"); break;
never executed: break;
0
5133 case SH_ComboBox_Popup: s = QLatin1String("combobox-popup"); break;
never executed: break;
0
5134 case SH_ComboBox_ListMouseTracking: s = QLatin1String("combobox-list-mousetracking"); break;
never executed: break;
0
5135 case SH_MenuBar_AltKeyNavigation: s = QLatin1String("menubar-altkey-navigation"); break;
executed: break;
Execution Count:1
1
5136 case SH_Menu_Scrollable: s = QLatin1String("menu-scrollable"); break;
executed: break;
Execution Count:1
1
5137 case SH_DrawMenuBarSeparator: s = QLatin1String("menubar-separator"); break;
never executed: break;
0
5138 case SH_MenuBar_MouseTracking: s = QLatin1String("mouse-tracking"); break;
executed: break;
Execution Count:1
1
5139 case SH_SpinBox_ClickAutoRepeatRate: s = QLatin1String("spinbox-click-autorepeat-rate"); break;
executed: break;
Execution Count:1
1
5140 case SH_SpinControls_DisableOnBounds: s = QLatin1String("spincontrol-disable-on-bounds"); break;
executed: break;
Execution Count:2
2
5141 case SH_MessageBox_TextInteractionFlags: s = QLatin1String("messagebox-text-interaction-flags"); break;
never executed: break;
0
5142 case SH_ToolButton_PopupDelay: s = QLatin1String("toolbutton-popup-delay"); break;
executed: break;
Execution Count:21
21
5143 case SH_ToolBox_SelectedPageTitleBold: -
5144 if (renderRule(w, opt, PseudoElement_ToolBoxTab).hasFont)
never evaluated: renderRule(w, opt, PseudoElement_ToolBoxTab).hasFont
0
5145 return 0;
never executed: return 0;
0
5146 break;
never executed: break;
0
5147 case SH_GroupBox_TextLabelColor: -
5148 if (rule.hasPalette() && rule.palette()->foreground.style() != Qt::NoBrush)
never evaluated: rule.hasPalette()
never evaluated: rule.palette()->foreground.style() != Qt::NoBrush
0
5149 return rule.palette()->foreground.color().rgba();
never executed: return rule.palette()->foreground.color().rgba();
0
5150 break;
never executed: break;
0
5151 case SH_ScrollView_FrameOnlyAroundContents: s = QLatin1String("scrollview-frame-around-contents"); break;
never executed: break;
0
5152 case SH_ScrollBar_ContextMenu: s = QLatin1String("scrollbar-contextmenu"); break;
never executed: break;
0
5153 case SH_ScrollBar_LeftClickAbsolutePosition: s = QLatin1String("scrollbar-leftclick-absolute-position"); break;
never executed: break;
0
5154 case SH_ScrollBar_MiddleClickAbsolutePosition: s = QLatin1String("scrollbar-middleclick-absolute-position"); break;
never executed: break;
0
5155 case SH_ScrollBar_RollBetweenButtons: s = QLatin1String("scrollbar-roll-between-buttons"); break;
never executed: break;
0
5156 case SH_ScrollBar_ScrollWhenPointerLeavesControl: s = QLatin1String("scrollbar-scroll-when-pointer-leaves-control"); break;
never executed: break;
0
5157 case SH_TabBar_Alignment: -
5158#ifndef QT_NO_TABWIDGET -
5159 if (qobject_cast<const QTabWidget *>(w)) {
never evaluated: qobject_cast<const QTabWidget *>(w)
0
5160 rule = renderRule(w, opt, PseudoElement_TabWidgetTabBar);
never executed (the execution status of this line is deduced): rule = renderRule(w, opt, PseudoElement_TabWidgetTabBar);
-
5161 if (rule.hasPosition())
never evaluated: rule.hasPosition()
0
5162 return rule.position()->position;
never executed: return rule.position()->position;
0
5163 }
never executed: }
0
5164#endif // QT_NO_TABWIDGET -
5165 s = QLatin1String("alignment");
never executed (the execution status of this line is deduced): s = QLatin1String("alignment");
-
5166 break;
never executed: break;
0
5167#ifndef QT_NO_TABBAR -
5168 case SH_TabBar_CloseButtonPosition: -
5169 rule = renderRule(w, opt, PseudoElement_TabBarTabCloseButton);
never executed (the execution status of this line is deduced): rule = renderRule(w, opt, PseudoElement_TabBarTabCloseButton);
-
5170 if (rule.hasPosition()) {
never evaluated: rule.hasPosition()
0
5171 Qt::Alignment align = rule.position()->position;
never executed (the execution status of this line is deduced): Qt::Alignment align = rule.position()->position;
-
5172 if (align & Qt::AlignLeft || align & Qt::AlignTop)
never evaluated: align & Qt::AlignLeft
never evaluated: align & Qt::AlignTop
0
5173 return QTabBar::LeftSide;
never executed: return QTabBar::LeftSide;
0
5174 if (align & Qt::AlignRight || align & Qt::AlignBottom)
never evaluated: align & Qt::AlignRight
never evaluated: align & Qt::AlignBottom
0
5175 return QTabBar::RightSide;
never executed: return QTabBar::RightSide;
0
5176 }
never executed: }
0
5177 break;
never executed: break;
0
5178#endif -
5179 case SH_TabBar_ElideMode: s = QLatin1String("tabbar-elide-mode"); break;
executed: break;
Execution Count:5
5
5180 case SH_TabBar_PreferNoArrows: s = QLatin1String("tabbar-prefer-no-arrows"); break;
executed: break;
Execution Count:7
7
5181 case SH_ComboBox_PopupFrameStyle: -
5182#ifndef QT_NO_COMBOBOX -
5183 if (qobject_cast<const QComboBox *>(w)) {
never evaluated: qobject_cast<const QComboBox *>(w)
0
5184 QAbstractItemView *view = w->findChild<QAbstractItemView *>();
never executed (the execution status of this line is deduced): QAbstractItemView *view = w->findChild<QAbstractItemView *>();
-
5185 if (view) {
never evaluated: view
0
5186 view->ensurePolished();
never executed (the execution status of this line is deduced): view->ensurePolished();
-
5187 QRenderRule subRule = renderRule(view, PseudoElement_None);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(view, PseudoElement_None);
-
5188 if (subRule.hasBox() || !subRule.hasNativeBorder())
never evaluated: subRule.hasBox()
never evaluated: !subRule.hasNativeBorder()
0
5189 return QFrame::NoFrame;
never executed: return QFrame::NoFrame;
0
5190 }
never executed: }
0
5191 }
never executed: }
0
5192#endif // QT_NO_COMBOBOX -
5193 break;
never executed: break;
0
5194 case SH_DialogButtonBox_ButtonsHaveIcons: s = QLatin1String("dialogbuttonbox-buttons-have-icons"); break;
never executed: break;
0
5195 case SH_Workspace_FillSpaceOnMaximize: s = QLatin1String("mdi-fill-space-on-maximize"); break;
never executed: break;
0
5196 case SH_TitleBar_NoBorder: -
5197 if (rule.hasBorder())
never evaluated: rule.hasBorder()
0
5198 return !rule.border()->borders[LeftEdge];
never executed: return !rule.border()->borders[LeftEdge];
0
5199 break;
never executed: break;
0
5200 case SH_TitleBar_AutoRaise: { // plain absurd -
5201 QRenderRule subRule = renderRule(w, opt, PseudoElement_TitleBar);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_TitleBar);
-
5202 if (subRule.hasDrawable())
never evaluated: subRule.hasDrawable()
0
5203 return 1;
never executed: return 1;
0
5204 break;
never executed: break;
0
5205 } -
5206 case SH_ItemView_ArrowKeysNavigateIntoChildren: s = QLatin1String("arrow-keys-navigate-into-children"); break;
never executed: break;
0
5207 case SH_ItemView_PaintAlternatingRowColorsForEmptyArea: s = QLatin1String("paint-alternating-row-colors-for-empty-area"); break;
never executed: break;
0
5208 default: break;
executed: break;
Execution Count:3
3
5209 } -
5210 if (!s.isEmpty() && rule.hasStyleHint(s)) {
evaluated: !s.isEmpty()
TRUEFALSE
yes
Evaluation Count:42
yes
Evaluation Count:3
partially evaluated: rule.hasStyleHint(s)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:42
0-42
5211 return rule.styleHint(s).toInt();
never executed: return rule.styleHint(s).toInt();
0
5212 } -
5213 -
5214 return baseStyle()->styleHint(sh, opt, w, shret);
executed: return baseStyle()->styleHint(sh, opt, w, shret);
Execution Count:45
45
5215} -
5216 -
5217QRect QStyleSheetStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, -
5218 const QWidget *w) const -
5219{ -
5220 RECURSION_GUARD(return baseStyle()->subControlRect(cc, opt, sc, w))
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
5221 -
5222 QRenderRule rule = renderRule(w, opt);
executed (the execution status of this line is deduced): QRenderRule rule = renderRule(w, opt);
-
5223 switch (cc) { -
5224 case CC_ComboBox: -
5225 if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
never evaluated: const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)
0
5226 if (rule.hasBox() || !rule.hasNativeBorder()) {
never evaluated: rule.hasBox()
never evaluated: !rule.hasNativeBorder()
0
5227 switch (sc) { -
5228 case SC_ComboBoxFrame: return rule.borderRect(opt->rect);
never executed: return rule.borderRect(opt->rect);
0
5229 case SC_ComboBoxEditField: -
5230 { -
5231 QRenderRule subRule = renderRule(w, opt, PseudoElement_ComboBoxDropDown);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_ComboBoxDropDown);
-
5232 QRect r = rule.contentsRect(opt->rect);
never executed (the execution status of this line is deduced): QRect r = rule.contentsRect(opt->rect);
-
5233 QRect r2 = positionRect(w, rule, subRule, PseudoElement_ComboBoxDropDown,
never executed (the execution status of this line is deduced): QRect r2 = positionRect(w, rule, subRule, PseudoElement_ComboBoxDropDown,
-
5234 opt->rect, opt->direction);
never executed (the execution status of this line is deduced): opt->rect, opt->direction);
-
5235 if (subRule.hasPosition() && subRule.position()->position & Qt::AlignLeft) {
never evaluated: subRule.hasPosition()
never evaluated: subRule.position()->position & Qt::AlignLeft
0
5236 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
5237 } else { -
5238 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
5239 } -
5240 } -
5241 case SC_ComboBoxArrow: { -
5242 QRenderRule subRule = renderRule(w, opt, PseudoElement_ComboBoxDropDown);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_ComboBoxDropDown);
-
5243 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
5244 } -
5245 case SC_ComboBoxListBoxPopup: -
5246 default: -
5247 return baseStyle()->subControlRect(cc, opt, sc, w);
never executed: return baseStyle()->subControlRect(cc, opt, sc, w);
0
5248 } -
5249 }
never executed: }
0
5250 -
5251 QStyleOptionComboBox comboBox(*cb);
never executed (the execution status of this line is deduced): QStyleOptionComboBox comboBox(*cb);
-
5252 comboBox.rect = rule.borderRect(opt->rect);
never executed (the execution status of this line is deduced): comboBox.rect = rule.borderRect(opt->rect);
-
5253 return rule.baseStyleCanDraw() ? baseStyle()->subControlRect(cc, &comboBox, sc, w)
never executed: return rule.baseStyleCanDraw() ? baseStyle()->subControlRect(cc, &comboBox, sc, w) : QWindowsStyle::subControlRect(cc, &comboBox, sc, w);
0
5254 : QWindowsStyle::subControlRect(cc, &comboBox, sc, w);
never executed: return rule.baseStyleCanDraw() ? baseStyle()->subControlRect(cc, &comboBox, sc, w) : QWindowsStyle::subControlRect(cc, &comboBox, sc, w);
0
5255 } -
5256 break;
never executed: break;
0
5257 -
5258#ifndef QT_NO_SPINBOX -
5259 case CC_SpinBox: -
5260 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
5261 QRenderRule upRule = renderRule(w, opt, PseudoElement_SpinBoxUpButton);
executed (the execution status of this line is deduced): QRenderRule upRule = renderRule(w, opt, PseudoElement_SpinBoxUpButton);
-
5262 QRenderRule downRule = renderRule(w, opt, PseudoElement_SpinBoxDownButton);
executed (the execution status of this line is deduced): QRenderRule downRule = renderRule(w, opt, PseudoElement_SpinBoxDownButton);
-
5263 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
5264 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
5265 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
5266 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
5267 switch (sc) { -
5268 case SC_SpinBoxFrame: -
5269 return rule.borderRect(opt->rect);
never executed: return rule.borderRect(opt->rect);
0
5270 case SC_SpinBoxEditField: -
5271 { -
5272 QRect r = rule.contentsRect(opt->rect);
never executed (the execution status of this line is deduced): QRect r = rule.contentsRect(opt->rect);
-
5273 // Use the widest button on each side to determine edit field size. -
5274 Qt::Alignment upAlign, downAlign;
never executed (the execution status of this line is deduced): Qt::Alignment upAlign, downAlign;
-
5275 -
5276 upAlign = upRule.hasPosition() ? upRule.position()->position
never evaluated: upRule.hasPosition()
0
5277 : Qt::Alignment(Qt::AlignRight);
never executed (the execution status of this line is deduced): : Qt::Alignment(Qt::AlignRight);
-
5278 upAlign = resolveAlignment(opt->direction, upAlign);
never executed (the execution status of this line is deduced): upAlign = resolveAlignment(opt->direction, upAlign);
-
5279 -
5280 downAlign = downRule.hasPosition() ? downRule.position()->position
never evaluated: downRule.hasPosition()
0
5281 : Qt::Alignment(Qt::AlignRight);
never executed (the execution status of this line is deduced): : Qt::Alignment(Qt::AlignRight);
-
5282 downAlign = resolveAlignment(opt->direction, downAlign);
never executed (the execution status of this line is deduced): downAlign = resolveAlignment(opt->direction, downAlign);
-
5283 -
5284 int upSize = subControlRect(CC_SpinBox, opt, SC_SpinBoxUp, w).width();
never executed (the execution status of this line is deduced): int upSize = subControlRect(CC_SpinBox, opt, SC_SpinBoxUp, w).width();
-
5285 int downSize = subControlRect(CC_SpinBox, opt, SC_SpinBoxDown, w).width();
never executed (the execution status of this line is deduced): int downSize = subControlRect(CC_SpinBox, opt, SC_SpinBoxDown, w).width();
-
5286 int widestL = qMax((upAlign & Qt::AlignLeft) ? upSize : 0,
never executed (the execution status of this line is deduced): int widestL = qMax((upAlign & Qt::AlignLeft) ? upSize : 0,
-
5287 (downAlign & Qt::AlignLeft) ? downSize : 0);
never executed (the execution status of this line is deduced): (downAlign & Qt::AlignLeft) ? downSize : 0);
-
5288 int widestR = qMax((upAlign & Qt::AlignRight) ? upSize : 0,
never executed (the execution status of this line is deduced): int widestR = qMax((upAlign & Qt::AlignRight) ? upSize : 0,
-
5289 (downAlign & Qt::AlignRight) ? downSize : 0);
never executed (the execution status of this line is deduced): (downAlign & Qt::AlignRight) ? downSize : 0);
-
5290 r.setRight(r.right() - widestR);
never executed (the execution status of this line is deduced): r.setRight(r.right() - widestR);
-
5291 r.setLeft(r.left() + widestL);
never executed (the execution status of this line is deduced): r.setLeft(r.left() + widestL);
-
5292 return r;
never executed: return r;
0
5293 } -
5294 case SC_SpinBoxDown: -
5295 if (downRuleMatch)
never evaluated: downRuleMatch
0
5296 return positionRect(w, rule, downRule, PseudoElement_SpinBoxDownButton,
never executed: return positionRect(w, rule, downRule, PseudoElement_SpinBoxDownButton, opt->rect, opt->direction);
0
5297 opt->rect, opt->direction);
never executed: return positionRect(w, rule, downRule, PseudoElement_SpinBoxDownButton, opt->rect, opt->direction);
0
5298 break;
never executed: break;
0
5299 case SC_SpinBoxUp: -
5300 if (upRuleMatch)
never evaluated: upRuleMatch
0
5301 return positionRect(w, rule, upRule, PseudoElement_SpinBoxUpButton,
never executed: return positionRect(w, rule, upRule, PseudoElement_SpinBoxUpButton, opt->rect, opt->direction);
0
5302 opt->rect, opt->direction);
never executed: return positionRect(w, rule, upRule, PseudoElement_SpinBoxUpButton, opt->rect, opt->direction);
0
5303 break;
never executed: break;
0
5304 default: -
5305 break;
never executed: break;
0
5306 } -
5307 -
5308 return baseStyle()->subControlRect(cc, opt, sc, w);
never executed: return baseStyle()->subControlRect(cc, opt, sc, w);
0
5309 } -
5310 -
5311 QStyleOptionSpinBox spinBox(*spin);
executed (the execution status of this line is deduced): QStyleOptionSpinBox spinBox(*spin);
-
5312 spinBox.rect = rule.borderRect(opt->rect);
executed (the execution status of this line is deduced): spinBox.rect = rule.borderRect(opt->rect);
-
5313 return rule.baseStyleCanDraw() ? baseStyle()->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
5314 : 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
5315 } -
5316 break;
never executed: break;
0
5317#endif // QT_NO_SPINBOX -
5318 -
5319 case CC_GroupBox: -
5320 if (const QStyleOptionGroupBox *gb = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)) {
never evaluated: const QStyleOptionGroupBox *gb = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)
0
5321 switch (sc) { -
5322 case SC_GroupBoxFrame: -
5323 case SC_GroupBoxContents: { -
5324 if (rule.hasBox() || !rule.hasNativeBorder()) {
never evaluated: rule.hasBox()
never evaluated: !rule.hasNativeBorder()
0
5325 return sc == SC_GroupBoxFrame ? rule.borderRect(opt->rect)
never executed: return sc == SC_GroupBoxFrame ? rule.borderRect(opt->rect) : rule.contentsRect(opt->rect);
0
5326 : rule.contentsRect(opt->rect);
never executed: return sc == SC_GroupBoxFrame ? rule.borderRect(opt->rect) : rule.contentsRect(opt->rect);
0
5327 } -
5328 QStyleOptionGroupBox groupBox(*gb);
never executed (the execution status of this line is deduced): QStyleOptionGroupBox groupBox(*gb);
-
5329 groupBox.rect = rule.borderRect(opt->rect);
never executed (the execution status of this line is deduced): groupBox.rect = rule.borderRect(opt->rect);
-
5330 return baseStyle()->subControlRect(cc, &groupBox, sc, w);
never executed: return baseStyle()->subControlRect(cc, &groupBox, sc, w);
0
5331 } -
5332 default: -
5333 case SC_GroupBoxLabel: -
5334 case SC_GroupBoxCheckBox: { -
5335 QRenderRule indRule = renderRule(w, opt, PseudoElement_GroupBoxIndicator);
never executed (the execution status of this line is deduced): QRenderRule indRule = renderRule(w, opt, PseudoElement_GroupBoxIndicator);
-
5336 QRenderRule labelRule = renderRule(w, opt, PseudoElement_GroupBoxTitle);
never executed (the execution status of this line is deduced): QRenderRule labelRule = renderRule(w, opt, PseudoElement_GroupBoxTitle);
-
5337 if (!labelRule.hasPosition() && !labelRule.hasGeometry() && !labelRule.hasBox()
never evaluated: !labelRule.hasPosition()
never evaluated: !labelRule.hasGeometry()
never evaluated: !labelRule.hasBox()
0
5338 && !labelRule.hasBorder() && !indRule.hasContentsSize()) {
never evaluated: !labelRule.hasBorder()
never evaluated: !indRule.hasContentsSize()
0
5339 QStyleOptionGroupBox groupBox(*gb);
never executed (the execution status of this line is deduced): QStyleOptionGroupBox groupBox(*gb);
-
5340 groupBox.rect = rule.borderRect(opt->rect);
never executed (the execution status of this line is deduced): groupBox.rect = rule.borderRect(opt->rect);
-
5341 return baseStyle()->subControlRect(cc, &groupBox, sc, w);
never executed: return baseStyle()->subControlRect(cc, &groupBox, sc, w);
0
5342 } -
5343 int tw = opt->fontMetrics.width(gb->text);
never executed (the execution status of this line is deduced): int tw = opt->fontMetrics.width(gb->text);
-
5344 int th = opt->fontMetrics.height();
never executed (the execution status of this line is deduced): int th = opt->fontMetrics.height();
-
5345 int spacing = pixelMetric(QStyle::PM_CheckBoxLabelSpacing, opt, w);
never executed (the execution status of this line is deduced): int spacing = pixelMetric(QStyle::PM_CheckBoxLabelSpacing, opt, w);
-
5346 int iw = pixelMetric(QStyle::PM_IndicatorWidth, opt, w);
never executed (the execution status of this line is deduced): int iw = pixelMetric(QStyle::PM_IndicatorWidth, opt, w);
-
5347 int ih = pixelMetric(QStyle::PM_IndicatorHeight, opt, w);
never executed (the execution status of this line is deduced): int ih = pixelMetric(QStyle::PM_IndicatorHeight, opt, w);
-
5348 -
5349 if (gb->subControls & QStyle::SC_GroupBoxCheckBox) {
never evaluated: gb->subControls & QStyle::SC_GroupBoxCheckBox
0
5350 tw = tw + iw + spacing;
never executed (the execution status of this line is deduced): tw = tw + iw + spacing;
-
5351 th = qMax(th, ih);
never executed (the execution status of this line is deduced): th = qMax(th, ih);
-
5352 }
never executed: }
0
5353 if (!labelRule.hasGeometry()) {
never evaluated: !labelRule.hasGeometry()
0
5354 labelRule.geo = new QStyleSheetGeometryData(tw, th, tw, th, -1, -1);
never executed (the execution status of this line is deduced): labelRule.geo = new QStyleSheetGeometryData(tw, th, tw, th, -1, -1);
-
5355 } else {
never executed: }
0
5356 labelRule.geo->width = tw;
never executed (the execution status of this line is deduced): labelRule.geo->width = tw;
-
5357 labelRule.geo->height = th;
never executed (the execution status of this line is deduced): labelRule.geo->height = th;
-
5358 }
never executed: }
0
5359 if (!labelRule.hasPosition()) {
never evaluated: !labelRule.hasPosition()
0
5360 labelRule.p = new QStyleSheetPositionData(0, 0, 0, 0, defaultOrigin(PseudoElement_GroupBoxTitle),
never executed (the execution status of this line is deduced): labelRule.p = new QStyleSheetPositionData(0, 0, 0, 0, defaultOrigin(PseudoElement_GroupBoxTitle),
-
5361 gb->textAlignment, PositionMode_Static);
never executed (the execution status of this line is deduced): gb->textAlignment, PositionMode_Static);
-
5362 }
never executed: }
0
5363 QRect r = positionRect(w, rule, labelRule, PseudoElement_GroupBoxTitle,
never executed (the execution status of this line is deduced): QRect r = positionRect(w, rule, labelRule, PseudoElement_GroupBoxTitle,
-
5364 opt->rect, opt->direction);
never executed (the execution status of this line is deduced): opt->rect, opt->direction);
-
5365 if (gb->subControls & SC_GroupBoxCheckBox) {
never evaluated: gb->subControls & SC_GroupBoxCheckBox
0
5366 r = labelRule.contentsRect(r);
never executed (the execution status of this line is deduced): r = labelRule.contentsRect(r);
-
5367 if (sc == SC_GroupBoxLabel) {
never evaluated: sc == SC_GroupBoxLabel
0
5368 r.setLeft(r.left() + iw + spacing);
never executed (the execution status of this line is deduced): r.setLeft(r.left() + iw + spacing);
-
5369 r.setTop(r.center().y() - th/2);
never executed (the execution status of this line is deduced): r.setTop(r.center().y() - th/2);
-
5370 } else {
never executed: }
0
5371 r = QRect(r.left(), r.center().y() - ih/2, iw, ih);
never executed (the execution status of this line is deduced): r = QRect(r.left(), r.center().y() - ih/2, iw, ih);
-
5372 }
never executed: }
0
5373 return r;
never executed: return r;
0
5374 } else { -
5375 return labelRule.contentsRect(r);
never executed: return labelRule.contentsRect(r);
0
5376 } -
5377 } -
5378 } // switch -
5379 }
never executed: }
0
5380 break;
never executed: break;
0
5381 -
5382 case CC_ToolButton: -
5383 if (const QStyleOptionToolButton *tb = qstyleoption_cast<const QStyleOptionToolButton *>(opt)) {
never evaluated: const QStyleOptionToolButton *tb = qstyleoption_cast<const QStyleOptionToolButton *>(opt)
0
5384 if (rule.hasBox() || !rule.hasNativeBorder()) {
never evaluated: rule.hasBox()
never evaluated: !rule.hasNativeBorder()
0
5385 switch (sc) { -
5386 case SC_ToolButton: return rule.borderRect(opt->rect);
never executed: return rule.borderRect(opt->rect);
0
5387 case SC_ToolButtonMenu: { -
5388 QRenderRule subRule = renderRule(w, opt, PseudoElement_ToolButtonMenu);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_ToolButtonMenu);
-
5389 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
5390 } -
5391 default: -
5392 break;
never executed: break;
0
5393 } -
5394 }
never executed: }
0
5395 -
5396 QStyleOptionToolButton tool(*tb);
never executed (the execution status of this line is deduced): QStyleOptionToolButton tool(*tb);
-
5397 tool.rect = rule.borderRect(opt->rect);
never executed (the execution status of this line is deduced): tool.rect = rule.borderRect(opt->rect);
-
5398 return rule.baseStyleCanDraw() ? baseStyle()->subControlRect(cc, &tool, sc, w)
never executed: return rule.baseStyleCanDraw() ? baseStyle()->subControlRect(cc, &tool, sc, w) : QWindowsStyle::subControlRect(cc, &tool, sc, w);
0
5399 : QWindowsStyle::subControlRect(cc, &tool, sc, w);
never executed: return rule.baseStyleCanDraw() ? baseStyle()->subControlRect(cc, &tool, sc, w) : QWindowsStyle::subControlRect(cc, &tool, sc, w);
0
5400 } -
5401 break;
never executed: break;
0
5402 -
5403#ifndef QT_NO_SCROLLBAR -
5404 case CC_ScrollBar: -
5405 if (const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
never evaluated: const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt)
0
5406 QStyleOptionSlider styleOptionSlider(*sb);
never executed (the execution status of this line is deduced): QStyleOptionSlider styleOptionSlider(*sb);
-
5407 styleOptionSlider.rect = rule.borderRect(opt->rect);
never executed (the execution status of this line is deduced): styleOptionSlider.rect = rule.borderRect(opt->rect);
-
5408 if (rule.hasDrawable() || rule.hasBox()) {
never evaluated: rule.hasDrawable()
never evaluated: rule.hasBox()
0
5409 QRect grooveRect;
never executed (the execution status of this line is deduced): QRect grooveRect;
-
5410 if (!rule.hasBox()) {
never evaluated: !rule.hasBox()
0
5411 grooveRect = rule.baseStyleCanDraw() ? baseStyle()->subControlRect(cc, sb, SC_ScrollBarGroove, w)
never evaluated: rule.baseStyleCanDraw()
0
5412 : QWindowsStyle::subControlRect(cc, sb, SC_ScrollBarGroove, w);
never executed (the execution status of this line is deduced): : QWindowsStyle::subControlRect(cc, sb, SC_ScrollBarGroove, w);
-
5413 } else {
never executed: }
0
5414 grooveRect = rule.contentsRect(opt->rect);
never executed (the execution status of this line is deduced): grooveRect = rule.contentsRect(opt->rect);
-
5415 }
never executed: }
0
5416 -
5417 PseudoElement pe = PseudoElement_None;
never executed (the execution status of this line is deduced): PseudoElement pe = PseudoElement_None;
-
5418 -
5419 switch (sc) { -
5420 case SC_ScrollBarGroove: -
5421 return grooveRect;
never executed: return grooveRect;
0
5422 case SC_ScrollBarAddPage: -
5423 case SC_ScrollBarSubPage: -
5424 case SC_ScrollBarSlider: { -
5425 QRect contentRect = grooveRect;
never executed (the execution status of this line is deduced): QRect contentRect = grooveRect;
-
5426 if (hasStyleRule(w, PseudoElement_ScrollBarSlider)) {
never evaluated: hasStyleRule(w, PseudoElement_ScrollBarSlider)
0
5427 QRenderRule sliderRule = renderRule(w, opt, PseudoElement_ScrollBarSlider);
never executed (the execution status of this line is deduced): QRenderRule sliderRule = renderRule(w, opt, PseudoElement_ScrollBarSlider);
-
5428 Origin origin = sliderRule.hasPosition() ? sliderRule.position()->origin : defaultOrigin(PseudoElement_ScrollBarSlider);
never evaluated: sliderRule.hasPosition()
0
5429 contentRect = rule.originRect(opt->rect, origin);
never executed (the execution status of this line is deduced): contentRect = rule.originRect(opt->rect, origin);
-
5430 }
never executed: }
0
5431 int maxlen = (styleOptionSlider.orientation == Qt::Horizontal) ? contentRect.width() : contentRect.height();
never evaluated: (styleOptionSlider.orientation == Qt::Horizontal)
0
5432 int sliderlen;
never executed (the execution status of this line is deduced): int sliderlen;
-
5433 if (sb->maximum != sb->minimum) {
never evaluated: sb->maximum != sb->minimum
0
5434 uint range = sb->maximum - sb->minimum;
never executed (the execution status of this line is deduced): uint range = sb->maximum - sb->minimum;
-
5435 sliderlen = (qint64(sb->pageStep) * maxlen) / (range + sb->pageStep);
never executed (the execution status of this line is deduced): sliderlen = (qint64(sb->pageStep) * maxlen) / (range + sb->pageStep);
-
5436 -
5437 int slidermin = pixelMetric(PM_ScrollBarSliderMin, sb, w);
never executed (the execution status of this line is deduced): int slidermin = pixelMetric(PM_ScrollBarSliderMin, sb, w);
-
5438 if (sliderlen < slidermin || range > INT_MAX / 2)
never evaluated: sliderlen < slidermin
never evaluated: range > 2147483647 / 2
0
5439 sliderlen = slidermin;
never executed: sliderlen = slidermin;
0
5440 if (sliderlen > maxlen)
never evaluated: sliderlen > maxlen
0
5441 sliderlen = maxlen;
never executed: sliderlen = maxlen;
0
5442 } else {
never executed: }
0
5443 sliderlen = maxlen;
never executed (the execution status of this line is deduced): sliderlen = maxlen;
-
5444 }
never executed: }
0
5445 -
5446 int sliderstart = (styleOptionSlider.orientation == Qt::Horizontal ? contentRect.left() : contentRect.top())
never evaluated: styleOptionSlider.orientation == Qt::Horizontal
0
5447 + sliderPositionFromValue(sb->minimum, sb->maximum, sb->sliderPosition,
never executed (the execution status of this line is deduced): + sliderPositionFromValue(sb->minimum, sb->maximum, sb->sliderPosition,
-
5448 maxlen - sliderlen, sb->upsideDown);
never executed (the execution status of this line is deduced): maxlen - sliderlen, sb->upsideDown);
-
5449 -
5450 QRect sr = (sb->orientation == Qt::Horizontal)
never evaluated: (sb->orientation == Qt::Horizontal)
0
5451 ? QRect(sliderstart, contentRect.top(), sliderlen, contentRect.height())
never executed (the execution status of this line is deduced): ? QRect(sliderstart, contentRect.top(), sliderlen, contentRect.height())
-
5452 : QRect(contentRect.left(), sliderstart, contentRect.width(), sliderlen);
never executed (the execution status of this line is deduced): : QRect(contentRect.left(), sliderstart, contentRect.width(), sliderlen);
-
5453 if (sc == SC_ScrollBarSlider) {
never evaluated: sc == SC_ScrollBarSlider
0
5454 return sr;
never executed: return sr;
0
5455 } else if (sc == SC_ScrollBarSubPage) {
never evaluated: sc == SC_ScrollBarSubPage
0
5456 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
5457 } else { // SC_ScrollBarAddPage -
5458 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
5459 } -
5460 break;
dead code: break;
-
5461 } -
5462 case SC_ScrollBarAddLine: pe = PseudoElement_ScrollBarAddLine; break;
never executed: break;
0
5463 case SC_ScrollBarSubLine: pe = PseudoElement_ScrollBarSubLine; break;
never executed: break;
0
5464 case SC_ScrollBarFirst: pe = PseudoElement_ScrollBarFirst; break;
never executed: break;
0
5465 case SC_ScrollBarLast: pe = PseudoElement_ScrollBarLast; break;
never executed: break;
0
5466 default: break;
never executed: break;
0
5467 } -
5468 if (hasStyleRule(w,pe)) {
never evaluated: hasStyleRule(w,pe)
0
5469 QRenderRule subRule = renderRule(w, opt, pe);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, pe);
-
5470 if (subRule.hasPosition() || subRule.hasGeometry() || subRule.hasBox()) {
never evaluated: subRule.hasPosition()
never evaluated: subRule.hasGeometry()
never evaluated: subRule.hasBox()
0
5471 const QStyleSheetPositionData *pos = subRule.position();
never executed (the execution status of this line is deduced): const QStyleSheetPositionData *pos = subRule.position();
-
5472 QRect originRect = grooveRect;
never executed (the execution status of this line is deduced): QRect originRect = grooveRect;
-
5473 if (rule.hasBox()) {
never evaluated: rule.hasBox()
0
5474 Origin origin = (pos && pos->origin != Origin_Unknown) ? pos->origin : defaultOrigin(pe);
never evaluated: pos
never evaluated: pos->origin != Origin_Unknown
0
5475 originRect = rule.originRect(opt->rect, origin);
never executed (the execution status of this line is deduced): originRect = rule.originRect(opt->rect, origin);
-
5476 }
never executed: }
0
5477 return positionRect(w, subRule, pe, originRect, styleOptionSlider.direction);
never executed: return positionRect(w, subRule, pe, originRect, styleOptionSlider.direction);
0
5478 } -
5479 }
never executed: }
0
5480 }
never executed: }
0
5481 return rule.baseStyleCanDraw() ? baseStyle()->subControlRect(cc, &styleOptionSlider, sc, w)
never executed: return rule.baseStyleCanDraw() ? baseStyle()->subControlRect(cc, &styleOptionSlider, sc, w) : QWindowsStyle::subControlRect(cc, &styleOptionSlider, sc, w);
0
5482 : QWindowsStyle::subControlRect(cc, &styleOptionSlider, sc, w);
never executed: return rule.baseStyleCanDraw() ? baseStyle()->subControlRect(cc, &styleOptionSlider, sc, w) : QWindowsStyle::subControlRect(cc, &styleOptionSlider, sc, w);
0
5483 } -
5484 break;
never executed: break;
0
5485#endif // QT_NO_SCROLLBAR -
5486 -
5487#ifndef QT_NO_SLIDER -
5488 case CC_Slider: -
5489 if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
never evaluated: const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)
0
5490 QRenderRule subRule = renderRule(w, opt, PseudoElement_SliderGroove);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_SliderGroove);
-
5491 if (!subRule.hasDrawable())
never evaluated: !subRule.hasDrawable()
0
5492 break;
never executed: break;
0
5493 subRule.img = 0;
never executed (the execution status of this line is deduced): subRule.img = 0;
-
5494 QRect gr = positionRect(w, rule, subRule, PseudoElement_SliderGroove, opt->rect, opt->direction);
never executed (the execution status of this line is deduced): QRect gr = positionRect(w, rule, subRule, PseudoElement_SliderGroove, opt->rect, opt->direction);
-
5495 switch (sc) { -
5496 case SC_SliderGroove: -
5497 return gr;
never executed: return gr;
0
5498 case SC_SliderHandle: { -
5499 bool horizontal = slider->orientation & Qt::Horizontal;
never executed (the execution status of this line is deduced): bool horizontal = slider->orientation & Qt::Horizontal;
-
5500 QRect cr = subRule.contentsRect(gr);
never executed (the execution status of this line is deduced): QRect cr = subRule.contentsRect(gr);
-
5501 QRenderRule subRule2 = renderRule(w, opt, PseudoElement_SliderHandle);
never executed (the execution status of this line is deduced): QRenderRule subRule2 = renderRule(w, opt, PseudoElement_SliderHandle);
-
5502 int len = horizontal ? subRule2.size().width() : subRule2.size().height();
never evaluated: horizontal
0
5503 subRule2.img = 0;
never executed (the execution status of this line is deduced): subRule2.img = 0;
-
5504 subRule2.geo = 0;
never executed (the execution status of this line is deduced): subRule2.geo = 0;
-
5505 cr = positionRect(w, subRule2, PseudoElement_SliderHandle, cr, opt->direction);
never executed (the execution status of this line is deduced): cr = positionRect(w, subRule2, PseudoElement_SliderHandle, cr, opt->direction);
-
5506 int thickness = horizontal ? cr.height() : cr.width();
never evaluated: horizontal
0
5507 int sliderPos = sliderPositionFromValue(slider->minimum, slider->maximum, slider->sliderPosition,
never executed (the execution status of this line is deduced): int sliderPos = sliderPositionFromValue(slider->minimum, slider->maximum, slider->sliderPosition,
-
5508 (horizontal ? cr.width() : cr.height()) - len, slider->upsideDown);
never executed (the execution status of this line is deduced): (horizontal ? cr.width() : cr.height()) - len, slider->upsideDown);
-
5509 cr = horizontal ? QRect(cr.x() + sliderPos, cr.y(), len, thickness)
never evaluated: horizontal
0
5510 : QRect(cr.x(), cr.y() + sliderPos, thickness, len);
never executed (the execution status of this line is deduced): : QRect(cr.x(), cr.y() + sliderPos, thickness, len);
-
5511 return subRule2.borderRect(cr);
never executed: return subRule2.borderRect(cr);
0
5512 break; }
dead code: break;
-
5513 case SC_SliderTickmarks: -
5514 // TODO... -
5515 default: -
5516 break;
never executed: break;
0
5517 } -
5518 }
never executed: }
0
5519 break;
never executed: break;
0
5520#endif // QT_NO_SLIDER -
5521 -
5522 case CC_MdiControls: -
5523 if (hasStyleRule(w, PseudoElement_MdiCloseButton)
never evaluated: hasStyleRule(w, PseudoElement_MdiCloseButton)
0
5524 || hasStyleRule(w, PseudoElement_MdiNormalButton)
never evaluated: hasStyleRule(w, PseudoElement_MdiNormalButton)
0
5525 || hasStyleRule(w, PseudoElement_MdiMinButton)) {
never evaluated: hasStyleRule(w, PseudoElement_MdiMinButton)
0
5526 QList<QVariant> layout = rule.styleHint(QLatin1String("button-layout")).toList();
never executed (the execution status of this line is deduced): QList<QVariant> layout = rule.styleHint(QLatin1String("button-layout")).toList();
-
5527 if (layout.isEmpty())
never evaluated: layout.isEmpty()
0
5528 layout = subControlLayout(QLatin1String("mNX"));
never executed: layout = subControlLayout(QLatin1String("mNX"));
0
5529 -
5530 int x = 0, width = 0;
never executed (the execution status of this line is deduced): int x = 0, width = 0;
-
5531 QRenderRule subRule;
never executed (the execution status of this line is deduced): QRenderRule subRule;
-
5532 for (int i = 0; i < layout.count(); i++) {
never evaluated: i < layout.count()
0
5533 int layoutButton = layout[i].toInt();
never executed (the execution status of this line is deduced): int layoutButton = layout[i].toInt();
-
5534 if (layoutButton < PseudoElement_MdiCloseButton
never evaluated: layoutButton < PseudoElement_MdiCloseButton
0
5535 || layoutButton > PseudoElement_MdiNormalButton)
never evaluated: layoutButton > PseudoElement_MdiNormalButton
0
5536 continue;
never executed: continue;
0
5537 QStyle::SubControl control = knownPseudoElements[layoutButton].subControl;
never executed (the execution status of this line is deduced): QStyle::SubControl control = knownPseudoElements[layoutButton].subControl;
-
5538 if (!(opt->subControls & control))
never evaluated: !(opt->subControls & control)
0
5539 continue;
never executed: continue;
0
5540 subRule = renderRule(w, opt, layoutButton);
never executed (the execution status of this line is deduced): subRule = renderRule(w, opt, layoutButton);
-
5541 width = subRule.size().width();
never executed (the execution status of this line is deduced): width = subRule.size().width();
-
5542 if (sc == control)
never evaluated: sc == control
0
5543 break;
never executed: break;
0
5544 x += width;
never executed (the execution status of this line is deduced): x += width;
-
5545 }
never executed: }
0
5546 -
5547 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
5548 } -
5549 break;
never executed: break;
0
5550 -
5551 case CC_TitleBar: -
5552 if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)) {
never evaluated: const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)
0
5553 QRenderRule subRule = renderRule(w, opt, PseudoElement_TitleBar);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_TitleBar);
-
5554 if (!subRule.hasDrawable() && !subRule.hasBox() && !subRule.hasBorder())
never evaluated: !subRule.hasDrawable()
never evaluated: !subRule.hasBox()
never evaluated: !subRule.hasBorder()
0
5555 break;
never executed: break;
0
5556 QHash<QStyle::SubControl, QRect> layoutRects = titleBarLayout(w, tb);
never executed (the execution status of this line is deduced): QHash<QStyle::SubControl, QRect> layoutRects = titleBarLayout(w, tb);
-
5557 return layoutRects.value(sc);
never executed: return layoutRects.value(sc);
0
5558 } -
5559 break;
never executed: break;
0
5560 -
5561 default: -
5562 break;
never executed: break;
0
5563 } -
5564 -
5565 return baseStyle()->subControlRect(cc, opt, sc, w);
never executed: return baseStyle()->subControlRect(cc, opt, sc, w);
0
5566} -
5567 -
5568QRect QStyleSheetStyle::subElementRect(SubElement se, const QStyleOption *opt, const QWidget *w) const -
5569{ -
5570 RECURSION_GUARD(return baseStyle()->subElementRect(se, opt, w))
never executed: return baseStyle()->subElementRect(se, opt, w);
partially evaluated: globalStyleSheetStyle != 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:25
never evaluated: globalStyleSheetStyle != this
0-25
5571 -
5572 QRenderRule rule = renderRule(w, opt);
executed (the execution status of this line is deduced): QRenderRule rule = renderRule(w, opt);
-
5573#ifndef QT_NO_TABBAR -
5574 int pe = PseudoElement_None;
executed (the execution status of this line is deduced): int pe = PseudoElement_None;
-
5575#endif -
5576 -
5577 switch (se) { -
5578 case SE_PushButtonContents: -
5579 case SE_PushButtonFocusRect: -
5580 if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
never evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)
0
5581 QStyleOptionButton btnOpt(*btn);
never executed (the execution status of this line is deduced): QStyleOptionButton btnOpt(*btn);
-
5582 if (rule.hasBox() || !rule.hasNativeBorder())
never evaluated: rule.hasBox()
never evaluated: !rule.hasNativeBorder()
0
5583 return visualRect(opt->direction, opt->rect, rule.contentsRect(opt->rect));
never executed: return visualRect(opt->direction, opt->rect, rule.contentsRect(opt->rect));
0
5584 return rule.baseStyleCanDraw() ? baseStyle()->subElementRect(se, &btnOpt, w)
never executed: return rule.baseStyleCanDraw() ? baseStyle()->subElementRect(se, &btnOpt, w) : QWindowsStyle::subElementRect(se, &btnOpt, w);
0
5585 : QWindowsStyle::subElementRect(se, &btnOpt, w);
never executed: return rule.baseStyleCanDraw() ? baseStyle()->subElementRect(se, &btnOpt, w) : QWindowsStyle::subElementRect(se, &btnOpt, w);
0
5586 } -
5587 break;
never executed: break;
0
5588 -
5589 case SE_LineEditContents: -
5590 case SE_FrameContents: -
5591 case SE_ShapedFrameContents: -
5592 if (rule.hasBox() || !rule.hasNativeBorder()) {
partially evaluated: rule.hasBox()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
partially evaluated: !rule.hasNativeBorder()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
5593 return visualRect(opt->direction, opt->rect, rule.contentsRect(opt->rect));
never executed: return visualRect(opt->direction, opt->rect, rule.contentsRect(opt->rect));
0
5594 } -
5595 break;
executed: break;
Execution Count:3
3
5596 -
5597 case SE_CheckBoxIndicator: -
5598 case SE_RadioButtonIndicator: -
5599 if (rule.hasBox() || rule.hasBorder() || hasStyleRule(w, PseudoElement_Indicator)) {
never evaluated: rule.hasBox()
never evaluated: rule.hasBorder()
never evaluated: hasStyleRule(w, PseudoElement_Indicator)
0
5600 PseudoElement pe = se == SE_CheckBoxIndicator ? PseudoElement_Indicator : PseudoElement_ExclusiveIndicator;
never evaluated: se == SE_CheckBoxIndicator
0
5601 QRenderRule subRule = renderRule(w, opt, pe);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, pe);
-
5602 return positionRect(w, rule, subRule, pe, opt->rect, opt->direction);
never executed: return positionRect(w, rule, subRule, pe, opt->rect, opt->direction);
0
5603 } -
5604 break;
never executed: break;
0
5605 -
5606 case SE_CheckBoxContents: -
5607 case SE_RadioButtonContents: -
5608 if (rule.hasBox() || rule.hasBorder() || hasStyleRule(w, PseudoElement_Indicator)) {
never evaluated: rule.hasBox()
never evaluated: rule.hasBorder()
never evaluated: hasStyleRule(w, PseudoElement_Indicator)
0
5609 bool isRadio = se == SE_RadioButtonContents;
never executed (the execution status of this line is deduced): bool isRadio = se == SE_RadioButtonContents;
-
5610 QRect ir = subElementRect(isRadio ? SE_RadioButtonIndicator : SE_CheckBoxIndicator,
never executed (the execution status of this line is deduced): QRect ir = subElementRect(isRadio ? SE_RadioButtonIndicator : SE_CheckBoxIndicator,
-
5611 opt, w);
never executed (the execution status of this line is deduced): opt, w);
-
5612 ir = visualRect(opt->direction, opt->rect, ir);
never executed (the execution status of this line is deduced): ir = visualRect(opt->direction, opt->rect, ir);
-
5613 int spacing = pixelMetric(isRadio ? PM_RadioButtonLabelSpacing : PM_CheckBoxLabelSpacing, 0, w);
never executed (the execution status of this line is deduced): int spacing = pixelMetric(isRadio ? PM_RadioButtonLabelSpacing : PM_CheckBoxLabelSpacing, 0, w);
-
5614 QRect cr = rule.contentsRect(opt->rect);
never executed (the execution status of this line is deduced): QRect cr = rule.contentsRect(opt->rect);
-
5615 ir.setRect(ir.left() + ir.width() + spacing, cr.y(),
never executed (the execution status of this line is deduced): ir.setRect(ir.left() + ir.width() + spacing, cr.y(),
-
5616 cr.width() - ir.width() - spacing, cr.height());
never executed (the execution status of this line is deduced): cr.width() - ir.width() - spacing, cr.height());
-
5617 return visualRect(opt->direction, opt->rect, ir);
never executed: return visualRect(opt->direction, opt->rect, ir);
0
5618 } -
5619 break;
never executed: break;
0
5620 -
5621 case SE_ToolBoxTabContents: -
5622 if (w && hasStyleRule(w->parentWidget(), PseudoElement_ToolBoxTab)) {
never evaluated: w
never evaluated: hasStyleRule(w->parentWidget(), PseudoElement_ToolBoxTab)
0
5623 QRenderRule subRule = renderRule(w->parentWidget(), opt, PseudoElement_ToolBoxTab);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w->parentWidget(), opt, PseudoElement_ToolBoxTab);
-
5624 return visualRect(opt->direction, opt->rect, subRule.contentsRect(opt->rect));
never executed: return visualRect(opt->direction, opt->rect, subRule.contentsRect(opt->rect));
0
5625 } -
5626 break;
never executed: break;
0
5627 -
5628 case SE_RadioButtonFocusRect: -
5629 case SE_RadioButtonClickRect: // focusrect | indicator -
5630 if (rule.hasBox() || rule.hasBorder() || hasStyleRule(w, PseudoElement_Indicator)) {
never evaluated: rule.hasBox()
never evaluated: rule.hasBorder()
never evaluated: hasStyleRule(w, PseudoElement_Indicator)
0
5631 return opt->rect;
never executed: return opt->rect;
0
5632 } -
5633 break;
never executed: break;
0
5634 -
5635 case SE_CheckBoxFocusRect: -
5636 case SE_CheckBoxClickRect: // relies on indicator and contents -
5637 return ParentStyle::subElementRect(se, opt, w);
never executed: return ParentStyle::subElementRect(se, opt, w);
0
5638 -
5639#ifndef QT_NO_ITEMVIEWS -
5640 case SE_ViewItemCheckIndicator: -
5641 if (!qstyleoption_cast<const QStyleOptionViewItem *>(opt)) {
never evaluated: !qstyleoption_cast<const QStyleOptionViewItem *>(opt)
0
5642 return subElementRect(SE_CheckBoxIndicator, opt, w);
never executed: return subElementRect(SE_CheckBoxIndicator, opt, w);
0
5643 } -
5644 // intentionally falls through -
5645 case SE_ItemViewItemText:
code before this statement never executed: case SE_ItemViewItemText:
0
5646 case SE_ItemViewItemDecoration: -
5647 case SE_ItemViewItemFocusRect: -
5648 if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) {
never evaluated: const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)
0
5649 QRenderRule subRule = renderRule(w, opt, PseudoElement_ViewItem);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_ViewItem);
-
5650 PseudoElement pe = PseudoElement_None;
never executed (the execution status of this line is deduced): PseudoElement pe = PseudoElement_None;
-
5651 if (se == SE_ItemViewItemText || se == SE_ItemViewItemFocusRect)
never evaluated: se == SE_ItemViewItemText
never evaluated: se == SE_ItemViewItemFocusRect
0
5652 pe = PseudoElement_ViewItemText;
never executed: pe = PseudoElement_ViewItemText;
0
5653 else if (se == SE_ItemViewItemDecoration && vopt->features & QStyleOptionViewItem::HasDecoration)
never evaluated: se == SE_ItemViewItemDecoration
never evaluated: vopt->features & QStyleOptionViewItem::HasDecoration
0
5654 pe = PseudoElement_ViewItemIcon;
never executed: pe = PseudoElement_ViewItemIcon;
0
5655 else if (se == SE_ItemViewItemCheckIndicator && vopt->features & QStyleOptionViewItem::HasCheckIndicator)
never evaluated: se == SE_ItemViewItemCheckIndicator
never evaluated: vopt->features & QStyleOptionViewItem::HasCheckIndicator
0
5656 pe = PseudoElement_ViewItemIndicator;
never executed: pe = PseudoElement_ViewItemIndicator;
0
5657 else -
5658 break;
never executed: break;
0
5659 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
5660 QRenderRule subRule2 = renderRule(w, opt, pe);
never executed (the execution status of this line is deduced): QRenderRule subRule2 = renderRule(w, opt, pe);
-
5661 QStyleOptionViewItem optCopy(*vopt);
never executed (the execution status of this line is deduced): QStyleOptionViewItem optCopy(*vopt);
-
5662 optCopy.rect = subRule.contentsRect(vopt->rect);
never executed (the execution status of this line is deduced): optCopy.rect = subRule.contentsRect(vopt->rect);
-
5663 QRect rect = ParentStyle::subElementRect(se, &optCopy, w);
never executed (the execution status of this line is deduced): QRect rect = ParentStyle::subElementRect(se, &optCopy, w);
-
5664 return positionRect(w, subRule2, pe, rect, opt->direction);
never executed: return positionRect(w, subRule2, pe, rect, opt->direction);
0
5665 } -
5666 }
never executed: }
0
5667 break;
never executed: break;
0
5668#endif // QT_NO_ITEMVIEWS -
5669 -
5670 case SE_HeaderArrow: { -
5671 QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewUpArrow);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewUpArrow);
-
5672 if (subRule.hasPosition() || subRule.hasGeometry())
never evaluated: subRule.hasPosition()
never evaluated: subRule.hasGeometry()
0
5673 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
5674 } -
5675 break;
never executed: break;
0
5676 -
5677 case SE_HeaderLabel: { -
5678 QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection);
-
5679 if (subRule.hasBox() || !subRule.hasNativeBorder())
never evaluated: subRule.hasBox()
never evaluated: !subRule.hasNativeBorder()
0
5680 return subRule.contentsRect(opt->rect);
never executed: return subRule.contentsRect(opt->rect);
0
5681 } -
5682 break;
never executed: break;
0
5683 -
5684 case SE_ProgressBarGroove: -
5685 case SE_ProgressBarContents: -
5686 case SE_ProgressBarLabel: -
5687 if (const QStyleOptionProgressBarV2 *pb = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt)) {
never evaluated: const QStyleOptionProgressBarV2 *pb = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt)
0
5688 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
5689 if (se == SE_ProgressBarGroove)
never evaluated: se == SE_ProgressBarGroove
0
5690 return rule.borderRect(pb->rect);
never executed: return rule.borderRect(pb->rect);
0
5691 else if (se == SE_ProgressBarContents)
never evaluated: se == SE_ProgressBarContents
0
5692 return rule.contentsRect(pb->rect);
never executed: return rule.contentsRect(pb->rect);
0
5693 -
5694 QSize sz = pb->fontMetrics.size(0, pb->text);
never executed (the execution status of this line is deduced): QSize sz = pb->fontMetrics.size(0, pb->text);
-
5695 return QStyle::alignedRect(Qt::LeftToRight, rule.hasPosition() ? rule.position()->textAlignment : pb->textAlignment,
never executed: return QStyle::alignedRect(Qt::LeftToRight, rule.hasPosition() ? rule.position()->textAlignment : pb->textAlignment, sz, pb->rect);
0
5696 sz, pb->rect);
never executed: return QStyle::alignedRect(Qt::LeftToRight, rule.hasPosition() ? rule.position()->textAlignment : pb->textAlignment, sz, pb->rect);
0
5697 } -
5698 }
never executed: }
0
5699 break;
never executed: break;
0
5700 -
5701#ifndef QT_NO_TABBAR -
5702 case SE_TabWidgetLeftCorner: -
5703 pe = PseudoElement_TabWidgetLeftCorner;
never executed (the execution status of this line is deduced): pe = PseudoElement_TabWidgetLeftCorner;
-
5704 // intentionally falls through -
5705 case SE_TabWidgetRightCorner:
code before this statement never executed: case SE_TabWidgetRightCorner:
0
5706 if (pe == PseudoElement_None)
never evaluated: pe == PseudoElement_None
0
5707 pe = PseudoElement_TabWidgetRightCorner;
never executed: pe = PseudoElement_TabWidgetRightCorner;
0
5708 // intentionally falls through -
5709 case SE_TabWidgetTabBar:
code before this statement never executed: case SE_TabWidgetTabBar:
0
5710 if (pe == PseudoElement_None)
never evaluated: pe == PseudoElement_None
0
5711 pe = PseudoElement_TabWidgetTabBar;
never executed: pe = PseudoElement_TabWidgetTabBar;
0
5712 // intentionally falls through -
5713 case SE_TabWidgetTabPane:
code before this statement never executed: case SE_TabWidgetTabPane:
0
5714 case SE_TabWidgetTabContents: -
5715 if (pe == PseudoElement_None)
never evaluated: pe == PseudoElement_None
0
5716 pe = PseudoElement_TabWidgetPane;
never executed: pe = PseudoElement_TabWidgetPane;
0
5717 -
5718 if (hasStyleRule(w, pe)) {
never evaluated: hasStyleRule(w, pe)
0
5719 QRect r = QWindowsStyle::subElementRect(pe == PseudoElement_TabWidgetPane ? SE_TabWidgetTabPane : se, opt, w);
never executed (the execution status of this line is deduced): QRect r = QWindowsStyle::subElementRect(pe == PseudoElement_TabWidgetPane ? SE_TabWidgetTabPane : se, opt, w);
-
5720 QRenderRule subRule = renderRule(w, opt, pe);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, pe);
-
5721 r = positionRect(w, subRule, pe, r, opt->direction);
never executed (the execution status of this line is deduced): r = positionRect(w, subRule, pe, r, opt->direction);
-
5722 if (pe == PseudoElement_TabWidgetTabBar) {
never evaluated: pe == PseudoElement_TabWidgetTabBar
0
5723 Q_ASSERT(opt);
never executed (the execution status of this line is deduced): qt_noop();
-
5724 r = opt->rect.intersected(r);
never executed (the execution status of this line is deduced): r = opt->rect.intersected(r);
-
5725 }
never executed: }
0
5726 if (se == SE_TabWidgetTabContents)
never evaluated: se == SE_TabWidgetTabContents
0
5727 r = subRule.contentsRect(r);
never executed: r = subRule.contentsRect(r);
0
5728 return r;
never executed: return r;
0
5729 } -
5730 break;
never executed: break;
0
5731 -
5732 case SE_TabBarTearIndicator: { -
5733 QRenderRule subRule = renderRule(w, opt, PseudoElement_TabBarTear);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_TabBarTear);
-
5734 if (subRule.hasContentsSize()) {
never evaluated: subRule.hasContentsSize()
0
5735 QRect r;
never executed (the execution status of this line is deduced): QRect r;
-
5736 if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
never evaluated: const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)
0
5737 switch (tab->shape) { -
5738 case QTabBar::RoundedNorth: -
5739 case QTabBar::TriangularNorth: -
5740 case QTabBar::RoundedSouth: -
5741 case QTabBar::TriangularSouth: -
5742 r.setRect(tab->rect.left(), tab->rect.top(), subRule.size().width(), opt->rect.height());
never executed (the execution status of this line is deduced): r.setRect(tab->rect.left(), tab->rect.top(), subRule.size().width(), opt->rect.height());
-
5743 break;
never executed: break;
0
5744 case QTabBar::RoundedWest: -
5745 case QTabBar::TriangularWest: -
5746 case QTabBar::RoundedEast: -
5747 case QTabBar::TriangularEast: -
5748 r.setRect(tab->rect.left(), tab->rect.top(), opt->rect.width(), subRule.size().height());
never executed (the execution status of this line is deduced): r.setRect(tab->rect.left(), tab->rect.top(), opt->rect.width(), subRule.size().height());
-
5749 break;
never executed: break;
0
5750 default: -
5751 break;
never executed: break;
0
5752 } -
5753 r = visualRect(opt->direction, opt->rect, r);
never executed (the execution status of this line is deduced): r = visualRect(opt->direction, opt->rect, r);
-
5754 }
never executed: }
0
5755 return r;
never executed: return r;
0
5756 } -
5757 break;
never executed: break;
0
5758 } -
5759 case SE_TabBarTabText: -
5760 case SE_TabBarTabLeftButton: -
5761 case SE_TabBarTabRightButton: { -
5762 QRenderRule subRule = renderRule(w, opt, PseudoElement_TabBarTab);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_TabBarTab);
-
5763 if (subRule.hasBox() || !subRule.hasNativeBorder()) {
never evaluated: subRule.hasBox()
never evaluated: !subRule.hasNativeBorder()
0
5764 return ParentStyle::subElementRect(se, opt, w);
never executed: return ParentStyle::subElementRect(se, opt, w);
0
5765 } -
5766 break;
never executed: break;
0
5767 } -
5768#endif // QT_NO_TABBAR -
5769 -
5770 case SE_DockWidgetCloseButton: -
5771 case SE_DockWidgetFloatButton: { -
5772 PseudoElement pe = (se == SE_DockWidgetCloseButton) ? PseudoElement_DockWidgetCloseButton : PseudoElement_DockWidgetFloatButton;
never evaluated: (se == SE_DockWidgetCloseButton)
0
5773 QRenderRule subRule2 = renderRule(w, opt, pe);
never executed (the execution status of this line is deduced): QRenderRule subRule2 = renderRule(w, opt, pe);
-
5774 if (!subRule2.hasPosition())
never evaluated: !subRule2.hasPosition()
0
5775 break;
never executed: break;
0
5776 QRenderRule subRule = renderRule(w, opt, PseudoElement_DockWidgetTitle);
never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_DockWidgetTitle);
-
5777 return positionRect(w, subRule, subRule2, pe, opt->rect, opt->direction);
never executed: return positionRect(w, subRule, subRule2, pe, opt->rect, opt->direction);
0
5778 } -
5779 -
5780#ifndef QT_NO_TOOLBAR -
5781 case SE_ToolBarHandle: -
5782 if (hasStyleRule(w, PseudoElement_ToolBarHandle))
never evaluated: hasStyleRule(w, PseudoElement_ToolBarHandle)
0
5783 return ParentStyle::subElementRect(se, opt, w);
never executed: return ParentStyle::subElementRect(se, opt, w);
0
5784 break;
never executed: break;
0
5785#endif //QT_NO_TOOLBAR -
5786 -
5787 default: -
5788 break;
executed: break;
Execution Count:22
22
5789 } -
5790 -
5791 return baseStyle()->subElementRect(se, opt, w);
executed: return baseStyle()->subElementRect(se, opt, w);
Execution Count:25
25
5792} -
5793 -
5794bool QStyleSheetStyle::event(QEvent *e) -
5795{ -
5796 return (baseStyle()->event(e) && e->isAccepted()) || ParentStyle::event(e);
executed: return (baseStyle()->event(e) && e->isAccepted()) || ParentStyle::event(e);
Execution Count:4
4
5797} -
5798 -
5799void QStyleSheetStyle::updateStyleSheetFont(QWidget* w) const -
5800{ -
5801 QWidget *container = containerWidget(w);
executed (the execution status of this line is deduced): QWidget *container = containerWidget(w);
-
5802 QRenderRule rule = renderRule(container, PseudoElement_None,
executed (the execution status of this line is deduced): QRenderRule rule = renderRule(container, PseudoElement_None,
-
5803 PseudoClass_Active | PseudoClass_Enabled | extendedPseudoClass(container));
executed (the execution status of this line is deduced): PseudoClass_Active | PseudoClass_Enabled | extendedPseudoClass(container));
-
5804 QFont font = rule.font.resolve(w->font());
executed (the execution status of this line is deduced): QFont font = rule.font.resolve(w->font());
-
5805 -
5806 if ((!w->isWindow() || w->testAttribute(Qt::WA_WindowPropagation))
evaluated: !w->isWindow()
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:1
partially evaluated: w->testAttribute(Qt::WA_WindowPropagation)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-2
5807 && isNaturalChild(w) && qobject_cast<QWidget *>(w->parent())) {
partially evaluated: isNaturalChild(w)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
never evaluated: qobject_cast<QWidget *>(w->parent())
0-2
5808 -
5809 font = font.resolve(static_cast<QWidget *>(w->parent())->font());
never executed (the execution status of this line is deduced): font = font.resolve(static_cast<QWidget *>(w->parent())->font());
-
5810 }
never executed: }
0
5811 -
5812 if (w->data->fnt == font)
evaluated: w->data->fnt == font
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:1
1-2
5813 return;
executed: return;
Execution Count:2
2
5814 -
5815 w->data->fnt = font;
executed (the execution status of this line is deduced): w->data->fnt = font;
-
5816 -
5817 QEvent e(QEvent::FontChange);
executed (the execution status of this line is deduced): QEvent e(QEvent::FontChange);
-
5818 QApplication::sendEvent(w, &e);
executed (the execution status of this line is deduced): QApplication::sendEvent(w, &e);
-
5819}
executed: }
Execution Count:1
1
5820 -
5821void QStyleSheetStyle::saveWidgetFont(QWidget* w, const QFont& font) const -
5822{ -
5823 w->setProperty("_q_styleSheetWidgetFont", font);
executed (the execution status of this line is deduced): w->setProperty("_q_styleSheetWidgetFont", font);
-
5824}
executed: }
Execution Count:3
3
5825 -
5826void QStyleSheetStyle::clearWidgetFont(QWidget* w) const -
5827{ -
5828 w->setProperty("_q_styleSheetWidgetFont", QVariant(QVariant::Invalid));
never executed (the execution status of this line is deduced): w->setProperty("_q_styleSheetWidgetFont", QVariant(QVariant::Invalid));
-
5829}
never executed: }
0
5830 -
5831// Polish palette that should be used for a particular widget, with particular states -
5832// (eg. :focus, :hover, ...) -
5833// this is called by widgets that paint themself in their paint event -
5834// Returns true if there is a new palette in pal. -
5835bool QStyleSheetStyle::styleSheetPalette(const QWidget* w, const QStyleOption* opt, QPalette* pal) -
5836{ -
5837 if (!w || !opt || !pal)
partially evaluated: !w
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
partially evaluated: !opt
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
partially evaluated: !pal
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
5838 return false;
never executed: return false;
0
5839 -
5840 RECURSION_GUARD(return false)
never executed: return false;
partially evaluated: globalStyleSheetStyle != 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
never evaluated: globalStyleSheetStyle != this
0-2
5841 -
5842 w = containerWidget(w);
executed (the execution status of this line is deduced): w = containerWidget(w);
-
5843 -
5844 QRenderRule rule = renderRule(w, PseudoElement_None, pseudoClass(opt->state) | extendedPseudoClass(w));
executed (the execution status of this line is deduced): QRenderRule rule = renderRule(w, PseudoElement_None, pseudoClass(opt->state) | extendedPseudoClass(w));
-
5845 if (!rule.hasPalette())
partially evaluated: !rule.hasPalette()
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
5846 return false;
executed: return false;
Execution Count:2
2
5847 -
5848 rule.configurePalette(pal, QPalette::NoRole, QPalette::NoRole);
never executed (the execution status of this line is deduced): rule.configurePalette(pal, QPalette::NoRole, QPalette::NoRole);
-
5849 return true;
never executed: return true;
0
5850} -
5851 -
5852Qt::Alignment QStyleSheetStyle::resolveAlignment(Qt::LayoutDirection layDir, Qt::Alignment src) -
5853{ -
5854 if (layDir == Qt::LeftToRight || src & Qt::AlignAbsolute)
never evaluated: layDir == Qt::LeftToRight
never evaluated: src & Qt::AlignAbsolute
0
5855 return src;
never executed: return src;
0
5856 -
5857 if (src & Qt::AlignLeft) {
never evaluated: src & Qt::AlignLeft
0
5858 src &= ~Qt::AlignLeft;
never executed (the execution status of this line is deduced): src &= ~Qt::AlignLeft;
-
5859 src |= Qt::AlignRight;
never executed (the execution status of this line is deduced): src |= Qt::AlignRight;
-
5860 } else if (src & Qt::AlignRight) {
never executed: }
never evaluated: src & Qt::AlignRight
0
5861 src &= ~Qt::AlignRight;
never executed (the execution status of this line is deduced): src &= ~Qt::AlignRight;
-
5862 src |= Qt::AlignLeft;
never executed (the execution status of this line is deduced): src |= Qt::AlignLeft;
-
5863 }
never executed: }
0
5864 src |= Qt::AlignAbsolute;
never executed (the execution status of this line is deduced): src |= Qt::AlignAbsolute;
-
5865 return src;
never executed: return src;
0
5866} -
5867 -
5868// Returns whether the given QWidget has a "natural" parent, meaning that -
5869// the parent contains this child as part of its normal operation. -
5870// An example is the QTabBar inside a QTabWidget. -
5871// This does not mean that any QTabBar which is a child of QTabWidget will -
5872// match, only the one that was created by the QTabWidget initialization -
5873// (and hence has the correct object name). -
5874bool QStyleSheetStyle::isNaturalChild(const QObject *obj) -
5875{ -
5876 if (obj->objectName().startsWith(QLatin1String("qt_")))
partially evaluated: obj->objectName().startsWith(QLatin1String("qt_"))
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
5877 return true;
never executed: return true;
0
5878 -
5879 return false;
executed: return false;
Execution Count:2
2
5880} -
5881 -
5882QT_END_NAMESPACE -
5883 -
5884#include "moc_qstylesheetstyle_p.cpp" -
5885 -
5886#endif // QT_NO_STYLE_STYLESHEET -
5887 -
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial