Line | Source Code | Coverage |
---|
1 | /**************************************************************************** | - |
2 | ** | - |
3 | ** Copyright (C) 2013 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 | | - |
87 | QT_BEGIN_NAMESPACE | - |
88 | | - |
89 | using namespace QCss; | - |
90 | | - |
91 | | - |
92 | class QStyleSheetStylePrivate : public QWindowsStylePrivate | - |
93 | { | - |
94 | Q_DECLARE_PUBLIC(QStyleSheetStyle) | - |
95 | public: | - |
96 | QStyleSheetStylePrivate() { } | - |
97 | }; | - |
98 | | - |
99 | | - |
100 | static 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 | */ | - |
111 | static const QStyleSheetStyle *globalStyleSheetStyle = 0; | - |
112 | class QStyleSheetStyleRecursionGuard | - |
113 | { | - |
114 | public: | - |
115 | QStyleSheetStyleRecursionGuard(const QStyleSheetStyle *that) | - |
116 | : guarded(globalStyleSheetStyle == 0) | - |
117 | { | - |
118 | if (guarded) globalStyleSheetStyle = that; executed: globalStyleSheetStyle = that; Execution Count:47083 evaluated: guarded yes Evaluation Count:47083 | yes Evaluation Count:778 |
| 778-47083 |
119 | } executed: } Execution Count:47861 | 47861 |
120 | ~QStyleSheetStyleRecursionGuard() { if (guarded) globalStyleSheetStyle = 0; } executed: globalStyleSheetStyle = 0; Execution Count:47083 executed: } Execution Count:47861 evaluated: guarded yes Evaluation Count:47083 | yes Evaluation Count:778 |
| 778-47861 |
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 | | - |
129 | enum 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 | | - |
213 | struct PseudoElementInfo { | - |
214 | QStyle::SubControl subControl; | - |
215 | const char *name; | - |
216 | }; | - |
217 | | - |
218 | static 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 | | - |
302 | struct QStyleSheetBorderImageData : public QSharedData | - |
303 | { | - |
304 | QStyleSheetBorderImageData() | - |
305 | : horizStretch(QCss::TileMode_Unknown), vertStretch(QCss::TileMode_Unknown) | - |
306 | { | - |
307 | for (int i = 0; i < 4; i++) | 0 |
308 | cuts[i] = -1; never executed: cuts[i] = -1; | 0 |
309 | } | 0 |
310 | int cuts[4]; | - |
311 | QPixmap pixmap; | - |
312 | QImage image; | - |
313 | QCss::TileMode horizStretch, vertStretch; | - |
314 | }; | - |
315 | | - |
316 | struct 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:54 | 54 |
321 | | - |
322 | bool isTransparent() const { | - |
323 | if (brush.style() != Qt::NoBrush) partially evaluated: brush.style() != Qt::NoBrush yes Evaluation Count:9 | no Evaluation Count:0 |
| 0-9 |
324 | return !brush.isOpaque(); executed: return !brush.isOpaque(); Execution Count:9 | 9 |
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 | | - |
336 | struct QStyleSheetBorderData : public QSharedData | - |
337 | { | - |
338 | QStyleSheetBorderData() : bi(0) | - |
339 | { | - |
340 | for (int i = 0; i < 4; i++) { | 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 | } | 0 |
344 | } | 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 yes Evaluation Count:4904 | yes Evaluation Count:1226 |
| 1226-4904 |
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:4904 | 4904 |
354 | } executed: } Execution Count:1226 | 1226 |
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:6519 | 6519 |
364 | | - |
365 | QSharedDataPointer<QStyleSheetBorderImageData> bi; | - |
366 | | - |
367 | bool isOpaque() const | - |
368 | { | - |
369 | for (int i = 0; i < 4; i++) { evaluated: i < 4 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 no Evaluation Count:0 | yes Evaluation Count:8 |
partially evaluated: styles[i] == QCss::BorderStyle_None 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 | } | 0 |
380 | if (bi != 0 && bi->pixmap.hasAlpha()) partially evaluated: bi != 0 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 | | - |
387 | struct QStyleSheetOutlineData : public QStyleSheetBorderData | - |
388 | { | - |
389 | QStyleSheetOutlineData() | - |
390 | { | - |
391 | for (int i = 0; i < 4; i++) { | 0 |
392 | offsets[i] = 0; never executed (the execution status of this line is deduced): offsets[i] = 0; | - |
393 | } | 0 |
394 | } | 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++) { | 0 |
400 | offsets[i] = o[i]; never executed (the execution status of this line is deduced): offsets[i] = o[i]; | - |
401 | } | 0 |
402 | } | 0 |
403 | | - |
404 | int offsets[4]; | - |
405 | }; | - |
406 | | - |
407 | struct QStyleSheetBoxData : public QSharedData | - |
408 | { | - |
409 | QStyleSheetBoxData(int *m, int *p, int s) : spacing(s) | - |
410 | { | - |
411 | for (int i = 0; i < 4; i++) { | 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 | } | 0 |
415 | } | 0 |
416 | | - |
417 | int margins[4]; | - |
418 | int paddings[4]; | - |
419 | | - |
420 | int spacing; | - |
421 | }; | - |
422 | | - |
423 | struct 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) { } | 0 |
429 | | - |
430 | QBrush foreground; | - |
431 | QBrush selectionForeground; | - |
432 | QBrush selectionBackground; | - |
433 | QBrush alternateBackground; | - |
434 | }; | - |
435 | | - |
436 | struct 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) { } | 0 |
440 | | - |
441 | int minWidth, minHeight, width, height, maxWidth, maxHeight; | - |
442 | }; | - |
443 | | - |
444 | struct 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) { } | 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 | | - |
456 | struct QStyleSheetImageData : public QSharedData | - |
457 | { | - |
458 | QStyleSheetImageData(const QIcon &i, Qt::Alignment a, const QSize &sz) | - |
459 | : icon(i), alignment(a), size(sz) { } | 0 |
460 | | - |
461 | QIcon icon; | - |
462 | Qt::Alignment alignment; | - |
463 | QSize size; | - |
464 | }; | - |
465 | | - |
466 | class QRenderRule | - |
467 | { | - |
468 | public: | - |
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:32096 | 32096 |
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:23 | 23 |
498 | const QStyleSheetBorderData *border() const { return bd; } executed: return bd; Execution Count:2792 | 2792 |
499 | const QStyleSheetOutlineData *outline() const { return ou; } never executed: return ou; | 0 |
500 | const QStyleSheetGeometryData *geometry() const { return geo; } executed: return geo; Execution Count:1957 | 1957 |
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:6775 | 6775 |
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:4458 | 4458 |
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:7 | 7 |
506 | && bg->brush.style() <= Qt::ConicalGradientPattern; } executed: return bg && bg->brush.style() >= Qt::LinearGradientPattern && bg->brush.style() <= Qt::ConicalGradientPattern; Execution Count:7 | 7 |
507 | | - |
508 | bool hasNativeBorder() const { | - |
509 | return bd == 0 executed: return bd == 0 || (!bd->hasBorderImage() && bd->styles[0] == BorderStyle_Native); Execution Count:4874 | 4874 |
510 | || (!bd->hasBorderImage() && bd->styles[0] == BorderStyle_Native); executed: return bd == 0 || (!bd->hasBorderImage() && bd->styles[0] == BorderStyle_Native); Execution Count:4874 | 4874 |
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() yes Evaluation Count:12 | yes Evaluation Count:7 |
partially evaluated: background()->brush.style() == Qt::NoBrush no Evaluation Count:0 | yes Evaluation Count:7 |
never evaluated: bg->pixmap.isNull() | 0-12 |
520 | return true; executed: return true; Execution Count:12 | 12 |
521 | if (bg && !bg->pixmap.isNull()) partially evaluated: bg yes Evaluation Count:7 | no Evaluation Count:0 |
partially evaluated: !bg->pixmap.isNull() no Evaluation Count:0 | yes Evaluation Count:7 |
| 0-7 |
522 | return false; never executed: return false; | 0 |
523 | if (hasGradientBackground()) partially evaluated: hasGradientBackground() no Evaluation Count:0 | yes Evaluation Count:7 |
| 0-7 |
524 | return features & StyleFeature_BackgroundGradient; never executed: return features & StyleFeature_BackgroundGradient; | 0 |
525 | return features & StyleFeature_BackgroundColor; executed: return features & StyleFeature_BackgroundColor; Execution Count:7 | 7 |
526 | } | - |
527 | | - |
528 | bool hasBox() const { return b != 0; } executed: return b != 0; Execution Count:9015 | 9015 |
529 | bool hasBorder() const { return bd != 0; } executed: return bd != 0; Execution Count:10374 | 10374 |
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:1966 | 1966 |
533 | bool hasDrawable() const { return !hasNativeBorder() || hasBackground() || hasImage(); } executed: return !hasNativeBorder() || hasBackground() || hasImage(); Execution Count:2571 | 2571 |
534 | bool hasImage() const { return img != 0; } executed: return img != 0; Execution Count:2544 | 2544 |
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:6609 | 6609 |
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 yes Evaluation Count:5101 | no Evaluation Count:0 |
| 0-5101 |
559 | return sz; executed: return sz; Execution Count:5101 | 5101 |
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:2065 | 2065 |
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 | /////////////////////////////////////////////////////////////////////////////////////////// | - |
597 | static 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 | | - |
686 | static const int numKnownStyleHints = sizeof(knownStyleHints)/sizeof(knownStyleHints[0]); | - |
687 | | - |
688 | static 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; | 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; | 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; | 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; | 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; | 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; | 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; | 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; | 0 |
721 | default: | - |
722 | buttons.append(button); never executed (the execution status of this line is deduced): buttons.append(button); | - |
723 | break; | 0 |
724 | } | - |
725 | } | 0 |
726 | return buttons; never executed: return buttons; | 0 |
727 | } | - |
728 | | - |
729 | namespace { | - |
730 | struct ButtonInfo { | - |
731 | QRenderRule rule; | - |
732 | int element; | - |
733 | int offset; | - |
734 | int where; | - |
735 | int width; | - |
736 | }; | - |
737 | } | - |
738 | | - |
739 | QHash<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 { | 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; | 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; | 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; | 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; | 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; | 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; | 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 { | 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 | } | 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 | } | 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; } | 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; | 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; | 0 |
833 | default: | - |
834 | 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 | } | 0 |
839 | | - |
840 | return layoutRects; never executed: return layoutRects; | 0 |
841 | } | - |
842 | | - |
843 | static 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; | 0 |
857 | } | - |
858 | return QStyle::SP_CustomBase; never executed: return QStyle::SP_CustomBase; | 0 |
859 | } | - |
860 | | - |
861 | QRenderRule::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) no Evaluation Count:0 | yes Evaluation Count:3726 |
| 0-3726 |
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) no Evaluation Count:0 | yes Evaluation Count:3726 |
| 0-3726 |
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 yes Evaluation Count:14904 | yes Evaluation Count:3726 |
| 3726-14904 |
882 | margins[i] = paddings[i] = 0; executed: margins[i] = paddings[i] = 0; Execution Count:14904 | 14904 |
883 | if (v.extractBox(margins, paddings, &spacing)) partially evaluated: v.extractBox(margins, paddings, &spacing) no Evaluation Count:0 | yes Evaluation Count:3726 |
| 0-3726 |
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 yes Evaluation Count:14904 | yes Evaluation Count:3726 |
| 3726-14904 |
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:14904 | 14904 |
894 | if (v.extractBorder(borders, colors, styles, radii)) evaluated: v.extractBorder(borders, colors, styles, radii) yes Evaluation Count:1226 | yes Evaluation Count:2500 |
| 1226-2500 |
895 | bd = new QStyleSheetBorderData(borders, colors, styles, radii); executed: bd = new QStyleSheetBorderData(borders, colors, styles, radii); Execution Count:1226 | 1226 |
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 yes Evaluation Count:14904 | yes Evaluation Count:3726 |
| 3726-14904 |
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:14904 | 14904 |
902 | if (v.extractOutline(borders, colors, styles, radii, offsets)) partially evaluated: v.extractOutline(borders, colors, styles, radii, offsets) no Evaluation Count:0 | yes Evaluation Count:3726 |
| 0-3726 |
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) yes Evaluation Count:54 | yes Evaluation Count:3672 |
| 54-3672 |
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:54 | 54 |
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) no Evaluation Count:0 | yes Evaluation Count:3726 |
| 0-3726 |
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) no Evaluation Count:0 | yes Evaluation Count:3726 |
| 0-3726 |
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 yes Evaluation Count:3726 | no Evaluation Count:0 |
partially evaluated: qstrcmp(object->metaObject()->className(), "QTipLabel") == 0 no Evaluation Count:0 | yes Evaluation Count:3726 |
| 0-3726 |
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() yes Evaluation Count:2915 | yes Evaluation Count:3726 |
| 2915-3726 |
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 no Evaluation Count:0 | yes Evaluation Count:2915 |
| 0-2915 |
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 { | 0 |
946 | if (!bd) | 0 |
947 | bd = new QStyleSheetBorderData; never executed: bd = new QStyleSheetBorderData; | 0 |
948 | if (!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++) | 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 | } | 0 |
958 | } else if (decl.d->propertyId == QtBackgroundRole) { evaluated: decl.d->propertyId == QtBackgroundRole yes Evaluation Count:1593 | yes Evaluation Count:1322 |
| 1322-1593 |
959 | if (bg && bg->brush.style() != Qt::NoBrush) evaluated: bg yes Evaluation Count:21 | yes Evaluation Count:1572 |
partially evaluated: bg->brush.style() != Qt::NoBrush yes Evaluation Count:21 | no Evaluation Count:0 |
| 0-1572 |
960 | continue; executed: continue; Execution Count:21 | 21 |
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 yes Evaluation Count:1572 | no Evaluation Count:0 |
partially evaluated: role <= Value_LastColorRole yes Evaluation Count:1572 | no Evaluation Count:0 |
| 0-1572 |
963 | defaultBackground = palette.color((QPalette::ColorRole)(role-Value_FirstColorRole)); executed: defaultBackground = palette.color((QPalette::ColorRole)(role-Value_FirstColorRole)); Execution Count:1572 | 1572 |
964 | } else if (decl.d->property.startsWith(QLatin1String("qproperty-"), Qt::CaseInsensitive)) { executed: } Execution Count:1572 partially evaluated: decl.d->property.startsWith(QLatin1String("qproperty-"), Qt::CaseInsensitive) no Evaluation Count:0 | yes Evaluation Count:1322 |
| 0-1572 |
965 | // intentionally left blank... | - |
966 | } else if (decl.d->propertyId == UnknownProperty) { never executed: } partially evaluated: decl.d->propertyId == UnknownProperty no Evaluation Count:0 | yes Evaluation Count:1322 |
| 0-1322 |
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 { | 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 | } | 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; | 0 |
992 | } | - |
993 | } | 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 | } | 0 |
997 | } | - |
998 | | - |
999 | if (const QWidget *widget = qobject_cast<const QWidget *>(object)) { partially evaluated: const QWidget *widget = qobject_cast<const QWidget *>(object) yes Evaluation Count:3726 | no Evaluation Count:0 |
| 0-3726 |
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 no Evaluation Count:0 | yes Evaluation Count:3726 |
| 0-3726 |
1002 | style = qobject_cast<QStyleSheetStyle *>(widget->style()); never executed: style = qobject_cast<QStyleSheetStyle *>(widget->style()); | 0 |
1003 | if (style) partially evaluated: style yes Evaluation Count:3726 | no Evaluation Count:0 |
| 0-3726 |
1004 | fixupBorder(style->nativeFrameWidth(widget)); executed: fixupBorder(style->nativeFrameWidth(widget)); Execution Count:3726 | 3726 |
1005 | } executed: } Execution Count:3726 | 3726 |
1006 | if (hasBorder() && border()->hasBorderImage()) evaluated: hasBorder() yes Evaluation Count:1226 | yes Evaluation Count:2500 |
partially evaluated: border()->hasBorderImage() no Evaluation Count:0 | yes Evaluation Count:1226 |
| 0-2500 |
1007 | defaultBackground = QBrush(); never executed: defaultBackground = QBrush(); | 0 |
1008 | } executed: } Execution Count:3726 | 3726 |
1009 | | - |
1010 | QRect QRenderRule::borderRect(const QRect& r) const | - |
1011 | { | - |
1012 | if (!hasBox()) partially evaluated: !hasBox() yes Evaluation Count:789 | no Evaluation Count:0 |
| 0-789 |
1013 | return r; executed: return r; Execution Count:789 | 789 |
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 | | - |
1018 | QRect 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 | | - |
1027 | QRect QRenderRule::paddingRect(const QRect& r) const | - |
1028 | { | - |
1029 | QRect br = borderRect(r); executed (the execution status of this line is deduced): QRect br = borderRect(r); | - |
1030 | if (!hasBorder()) partially evaluated: !hasBorder() no Evaluation Count:0 | yes Evaluation Count:6 |
| 0-6 |
1031 | return br; never executed: return br; | 0 |
1032 | const int *b = border()->borders; 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]); executed: return br.adjusted(b[LeftEdge], b[TopEdge], -b[RightEdge], -b[BottomEdge]); Execution Count:6 | 6 |
1034 | } | - |
1035 | | - |
1036 | QRect QRenderRule::contentsRect(const QRect& r) const | - |
1037 | { | - |
1038 | QRect pr = paddingRect(r); executed (the execution status of this line is deduced): QRect pr = paddingRect(r); | - |
1039 | if (!hasBox()) partially evaluated: !hasBox() yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
1040 | return pr; executed: return pr; Execution Count:6 | 6 |
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 | | - |
1045 | QRect 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 | } | 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 | } | 0 |
1057 | } | 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 | } | 0 |
1062 | return r; never executed: return r; | 0 |
1063 | } | - |
1064 | | - |
1065 | QSize 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 | | - |
1073 | void QRenderRule::fixupBorder(int nativeWidth) | - |
1074 | { | - |
1075 | if (bd == 0) evaluated: bd == 0 yes Evaluation Count:2500 | yes Evaluation Count:1226 |
| 1226-2500 |
1076 | return; executed: return; Execution Count:2500 | 2500 |
1077 | | - |
1078 | if (!bd->hasBorderImage() || bd->bi->pixmap.isNull()) { partially evaluated: !bd->hasBorderImage() yes Evaluation Count:1226 | no Evaluation Count:0 |
never evaluated: bd->bi->pixmap.isNull() | 0-1226 |
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 no Evaluation Count:0 | yes Evaluation Count:1226 |
| 0-1226 |
1082 | const bool hasRadius = bd->radii[0].isValid() || bd->radii[1].isValid() partially evaluated: bd->radii[0].isValid() no Evaluation Count:0 | yes Evaluation Count:1226 |
partially evaluated: bd->radii[1].isValid() no Evaluation Count:0 | yes Evaluation Count:1226 |
| 0-1226 |
1083 | || bd->radii[2].isValid() || bd->radii[3].isValid(); partially evaluated: bd->radii[2].isValid() no Evaluation Count:0 | yes Evaluation Count:1226 |
partially evaluated: bd->radii[3].isValid() no Evaluation Count:0 | yes Evaluation Count:1226 |
| 0-1226 |
1084 | for (int i = 0; i < 4; i++) { evaluated: i < 4 yes Evaluation Count:4904 | yes Evaluation Count:1226 |
| 1226-4904 |
1085 | if ((bd->styles[i] == BorderStyle_Native) && hasRadius) evaluated: (bd->styles[i] == BorderStyle_Native) yes Evaluation Count:4752 | yes Evaluation Count:152 |
partially evaluated: hasRadius no Evaluation Count:0 | yes Evaluation Count:4752 |
| 0-4752 |
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 yes Evaluation Count:4752 | no Evaluation Count:0 |
| 0-4752 |
1096 | bd->borders[i] = nativeWidth; executed: bd->borders[i] = nativeWidth; Execution Count:4752 | 4752 |
1097 | // intentional fall through | - |
1098 | default: code before this statement executed: default: Execution Count:4752 | 4752 |
1099 | if (!bd->colors[i].style() != Qt::NoBrush) // auto-acquire 'color' evaluated: !bd->colors[i].style() != Qt::NoBrush yes Evaluation Count:84 | yes Evaluation Count:4812 |
| 84-4812 |
1100 | bd->colors[i] = color; executed: bd->colors[i] = color; Execution Count:84 | 84 |
1101 | break; executed: break; Execution Count:4896 | 4896 |
1102 | } | - |
1103 | } executed: } Execution Count:4904 | 4904 |
1104 | | - |
1105 | return; executed: return; Execution Count:1226 | 1226 |
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 | 0 |
1112 | bi->cuts[i] = int(border()->borders[i]); never executed: bi->cuts[i] = int(border()->borders[i]); | 0 |
1113 | } | 0 |
1114 | } | 0 |
1115 | | - |
1116 | void 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 | } | 0 |
1138 | | - |
1139 | QRect 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 | } | 0 |
1153 | | - |
1154 | void QRenderRule::drawBackgroundImage(QPainter *p, const QRect &rect, QPoint off) | - |
1155 | { | - |
1156 | if (!hasBackground()) evaluated: !hasBackground() yes Evaluation Count:292 | yes Evaluation Count:7 |
| 7-292 |
1157 | return; executed: return; Execution Count:292 | 292 |
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() yes Evaluation Count:7 | no Evaluation Count:0 |
| 0-7 |
1161 | return; executed: return; Execution Count:7 | 7 |
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 | } | 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; | 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; | 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; | 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; | 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 | } | 0 |
1206 | | - |
1207 | void QRenderRule::drawOutline(QPainter *p, const QRect &rect) | - |
1208 | { | - |
1209 | if (!hasOutline()) never evaluated: !hasOutline() | 0 |
1210 | 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 | } | 0 |
1217 | | - |
1218 | void QRenderRule::drawBorder(QPainter *p, const QRect& rect) | - |
1219 | { | - |
1220 | if (!hasBorder()) partially evaluated: !hasBorder() no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
1221 | return; | 0 |
1222 | | - |
1223 | if (border()->hasBorderImage()) { partially evaluated: border()->hasBorderImage() no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
1224 | drawBorderImage(p, rect); never executed (the execution status of this line is deduced): drawBorderImage(p, rect); | - |
1225 | return; | 0 |
1226 | } | - |
1227 | | - |
1228 | bool wasAntialiased = p->renderHints() & QPainter::Antialiasing; executed (the execution status of this line is deduced): bool wasAntialiased = p->renderHints() & QPainter::Antialiasing; | - |
1229 | p->setRenderHint(QPainter::Antialiasing); 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); 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); executed (the execution status of this line is deduced): p->setRenderHint(QPainter::Antialiasing, wasAntialiased); | - |
1232 | } executed: } Execution Count:2 | 2 |
1233 | | - |
1234 | QPainterPath 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 | */ | - |
1275 | void QRenderRule::setClip(QPainter *p, const QRect &rect) | - |
1276 | { | - |
1277 | if (clipset++) never evaluated: clipset++ | 0 |
1278 | 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 | } | 0 |
1284 | } | 0 |
1285 | | - |
1286 | void QRenderRule::unsetClip(QPainter *p) | - |
1287 | { | - |
1288 | if (--clipset) never evaluated: --clipset | 0 |
1289 | return; | 0 |
1290 | if (!clipPath.isEmpty()) never evaluated: !clipPath.isEmpty() | 0 |
1291 | p->restore(); never executed: p->restore(); | 0 |
1292 | } | 0 |
1293 | | - |
1294 | void QRenderRule::drawBackground(QPainter *p, const QRect& rect, const QPoint& off) | - |
1295 | { | - |
1296 | QBrush brush = hasBackground() ? background()->brush : QBrush(); partially evaluated: hasBackground() no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
1297 | if (brush.style() == Qt::NoBrush) partially evaluated: brush.style() == Qt::NoBrush yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
1298 | brush = defaultBackground; executed: brush = defaultBackground; Execution Count:2 | 2 |
1299 | | - |
1300 | if (brush.style() != Qt::NoBrush) { partially evaluated: brush.style() != Qt::NoBrush no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
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 { | 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 | } | 0 |
1313 | } | - |
1314 | | - |
1315 | drawBackgroundImage(p, rect, off); executed (the execution status of this line is deduced): drawBackgroundImage(p, rect, off); | - |
1316 | } executed: } Execution Count:2 | 2 |
1317 | | - |
1318 | void 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 | } | 0 |
1324 | | - |
1325 | void QRenderRule::drawImage(QPainter *p, const QRect &rect) | - |
1326 | { | - |
1327 | if (!hasImage()) never evaluated: !hasImage() | 0 |
1328 | 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 | } | 0 |
1331 | | - |
1332 | void 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 | } | 0 |
1337 | | - |
1338 | // *shudder* , *horror*, *whoa* <-- what you might feel when you see the functions below | - |
1339 | void QRenderRule::configurePalette(QPalette *p, QPalette::ColorRole fr, QPalette::ColorRole br) | - |
1340 | { | - |
1341 | if (bg && bg->brush.style() != Qt::NoBrush) { evaluated: bg yes Evaluation Count:7 | yes Evaluation Count:886 |
partially evaluated: bg->brush.style() != Qt::NoBrush yes Evaluation Count:7 | no Evaluation Count:0 |
| 0-886 |
1342 | if (br != QPalette::NoRole) partially evaluated: br != QPalette::NoRole yes Evaluation Count:7 | no Evaluation Count:0 |
| 0-7 |
1343 | p->setBrush(br, bg->brush); executed: p->setBrush(br, bg->brush); Execution Count:7 | 7 |
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 yes Evaluation Count:7 | no Evaluation Count:0 |
| 0-7 |
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:7 | 7 |
1351 | } executed: } Execution Count:7 | 7 |
1352 | | - |
1353 | if (!hasPalette()) partially evaluated: !hasPalette() yes Evaluation Count:893 | no Evaluation Count:0 |
| 0-893 |
1354 | return; executed: return; Execution Count:893 | 893 |
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 | } | 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 | } | 0 |
1369 | | - |
1370 | void QRenderRule::configurePalette(QPalette *p, QPalette::ColorGroup cg, const QWidget *w, bool embedded) | - |
1371 | { | - |
1372 | if (bg && bg->brush.style() != Qt::NoBrush) { evaluated: bg yes Evaluation Count:27 | yes Evaluation Count:5844 |
partially evaluated: bg->brush.style() != Qt::NoBrush yes Evaluation Count:27 | no Evaluation Count:0 |
| 0-5844 |
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:27 | 27 |
1378 | | - |
1379 | if (embedded) { evaluated: embedded yes Evaluation Count:1167 | yes Evaluation Count:4704 |
| 1167-4704 |
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()) partially evaluated: hasBackground() no Evaluation Count:0 | yes Evaluation Count:1167 |
never evaluated: background()->isTransparent() | 0-1167 |
1383 | || (hasBorder() && border()->hasBorderImage() && !border()->borderImage()->pixmap.isNull())) partially evaluated: hasBorder() yes Evaluation Count:1167 | no Evaluation Count:0 |
partially evaluated: border()->hasBorderImage() no Evaluation Count:0 | yes Evaluation Count:1167 |
never evaluated: !border()->borderImage()->pixmap.isNull() | 0-1167 |
1384 | p->setBrush(cg, w->backgroundRole(), Qt::NoBrush); never executed: p->setBrush(cg, w->backgroundRole(), Qt::NoBrush); | 0 |
1385 | } executed: } Execution Count:1167 | 1167 |
1386 | | - |
1387 | if (!hasPalette()) partially evaluated: !hasPalette() yes Evaluation Count:5871 | no Evaluation Count:0 |
| 0-5871 |
1388 | return; executed: return; Execution Count:5871 | 5871 |
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 | } | 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 | } | 0 |
1403 | | - |
1404 | /////////////////////////////////////////////////////////////////////////////// | - |
1405 | // Style rules | - |
1406 | #define OBJECT_PTR(x) (static_cast<QObject *>(x.ptr)) | - |
1407 | | - |
1408 | static 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) no Evaluation Count:0 | yes Evaluation Count:4825 |
never evaluated: qstrcmp(obj->metaObject()->className(), "QTipLabel") == 0 | 0-4825 |
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) | 0 |
1413 | return p; never executed: return p; | 0 |
1414 | } | 0 |
1415 | return obj->parent(); executed: return obj->parent(); Execution Count:4825 | 4825 |
1416 | } | - |
1417 | | - |
1418 | class QStyleSheetStyleSelector : public StyleSelector | - |
1419 | { | - |
1420 | public: | - |
1421 | QStyleSheetStyleSelector() { } | - |
1422 | | - |
1423 | QStringList nodeNames(NodePtr node) const | - |
1424 | { | - |
1425 | if (isNullNode(node)) partially evaluated: isNullNode(node) no Evaluation Count:0 | yes Evaluation Count:2423 |
| 0-2423 |
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 no Evaluation Count:0 | yes Evaluation Count:2423 |
| 0-2423 |
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:8892 evaluated: metaObject != 0 yes Evaluation Count:6469 | yes Evaluation Count:2423 |
| 2423-8892 |
1437 | return result; executed: return result; Execution Count:2423 | 2423 |
1438 | } | - |
1439 | QString attribute(NodePtr node, const QString& name) const | - |
1440 | { | - |
1441 | if (isNullNode(node)) partially evaluated: isNullNode(node) 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() 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() yes Evaluation Count:3 | yes Evaluation Count:3 |
| 3 |
1452 | if (name == QLatin1String("class")) { partially evaluated: name == QLatin1String("class") 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") 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; | 0 |
1461 | if (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 | } | 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 no Evaluation Count:0 | yes Evaluation Count:6 |
partially evaluated: value.type() == QVariant::List 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) no Evaluation Count:0 | yes Evaluation Count:1650 |
| 0-1650 |
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 no Evaluation Count:0 | yes Evaluation Count:1650 |
| 0-1650 |
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 yes Evaluation Count:16563 | yes Evaluation Count:1650 |
partially evaluated: uc != e yes Evaluation Count:16563 | no Evaluation Count:0 |
evaluated: *uc == *c yes Evaluation Count:14943 | yes Evaluation Count:1620 |
partially evaluated: *c == ':' no Evaluation Count:0 | yes Evaluation Count:1620 |
never evaluated: *uc == '-' | 0-16563 |
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:14943 | 14943 |
1493 | if (uc == e && !*c) evaluated: uc == e yes Evaluation Count:1650 | yes Evaluation Count:1620 |
partially evaluated: !*c yes Evaluation Count:1650 | no Evaluation Count:0 |
| 0-1650 |
1494 | return true; executed: return true; Execution Count:1650 | 1650 |
1495 | metaObject = metaObject->superClass(); executed (the execution status of this line is deduced): metaObject = metaObject->superClass(); | - |
1496 | } while (metaObject != 0); executed: } Execution Count:1620 partially evaluated: metaObject != 0 yes Evaluation Count:1620 | no Evaluation Count:0 |
| 0-1620 |
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:4079 | 4079 |
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 | | - |
1514 | private: | - |
1515 | mutable QHash<const QObject *, QHash<QString, QString> > m_attributeCache; | - |
1516 | }; | - |
1517 | | - |
1518 | QVector<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() yes Evaluation Count:16725 | yes Evaluation Count:2392 |
| 2392-16725 |
1522 | return cacheIt.value(); executed: return cacheIt.value(); Execution Count:16725 | 16725 |
1523 | | - |
1524 | if (!initObject(obj)) { partially evaluated: !initObject(obj) no Evaluation Count:0 | yes Evaluation Count:2392 |
| 0-2392 |
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() yes Evaluation Count:401 | yes Evaluation Count:1991 |
| 401-1991 |
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:401 | 401 |
1538 | defaultSs = defaultCacheIt.value(); executed (the execution status of this line is deduced): defaultSs = defaultCacheIt.value(); | - |
1539 | } executed: } Execution Count:1991 | 1991 |
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() yes Evaluation Count:19 | yes Evaluation Count:2373 |
| 19-2373 |
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()) { evaluated: appCacheIt == styleSheetCaches->styleSheetCache.constEnd() yes Evaluation Count:3 | yes Evaluation Count:16 |
| 3-16 |
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:///")) no Evaluation Count:0 | yes Evaluation Count:3 |
| 0-3 |
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) no Evaluation Count:0 | yes Evaluation Count:3 |
| 0-3 |
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:3 | 3 |
1556 | appSs = appCacheIt.value(); executed (the execution status of this line is deduced): appSs = appCacheIt.value(); | - |
1557 | } executed: } Execution Count:16 | 16 |
1558 | styleSelector.styleSheets += appSs; executed (the execution status of this line is deduced): styleSelector.styleSheets += appSs; | - |
1559 | } executed: } Execution Count:19 | 19 |
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 yes Evaluation Count:4825 | yes Evaluation Count:2392 |
| 2392-4825 |
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() yes Evaluation Count:2452 | yes Evaluation Count:2373 |
| 2373-2452 |
1565 | continue; executed: continue; Execution Count:2452 | 2452 |
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() yes Evaluation Count:399 | yes Evaluation Count:1974 |
| 399-1974 |
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) yes Evaluation Count:4 | yes Evaluation Count:395 |
| 4-395 |
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) no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
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:4 | 4 |
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:399 | 399 |
1578 | ss = objCacheIt.value(); executed (the execution status of this line is deduced): ss = objCacheIt.value(); | - |
1579 | } executed: } Execution Count:1974 | 1974 |
1580 | objectSs.append(ss); executed (the execution status of this line is deduced): objectSs.append(ss); | - |
1581 | } executed: } Execution Count:2373 | 2373 |
1582 | | - |
1583 | for (int i = 0; i < objectSs.count(); i++) evaluated: i < objectSs.count() yes Evaluation Count:2373 | yes Evaluation Count:2392 |
| 2373-2392 |
1584 | objectSs[i].depth = objectSs.count() - i + 2; executed: objectSs[i].depth = objectSs.count() - i + 2; Execution Count:2373 | 2373 |
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:2392 | 2392 |
1593 | } | - |
1594 | | - |
1595 | ///////////////////////////////////////////////////////////////////////////////////////// | - |
1596 | // Rendering rules | - |
1597 | static 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() yes Evaluation Count:4258 | yes Evaluation Count:5683 |
| 4258-5683 |
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 yes Evaluation Count:170 | yes Evaluation Count:4088 |
| 170-4088 |
1605 | continue; executed: continue; Execution Count:170 | 170 |
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) yes Evaluation Count:1206 | yes Evaluation Count:2882 |
evaluated: (cssClass == PseudoClass_Unspecified) yes Evaluation Count:2875 | yes Evaluation Count:7 |
| 7-2882 |
1609 | || ((((cssClass & pseudoClass) == cssClass)) && ((negated & pseudoClass) == 0))) evaluated: (((cssClass & pseudoClass) == cssClass)) yes Evaluation Count:1 | yes Evaluation Count:6 |
partially evaluated: ((negated & pseudoClass) == 0) yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-6 |
1610 | decls += styleRules.at(i).declarations; executed: decls += styleRules.at(i).declarations; Execution Count:4082 | 4082 |
1611 | } executed: } Execution Count:4088 | 4088 |
1612 | return decls; executed: return decls; Execution Count:5683 | 5683 |
1613 | } | - |
1614 | | - |
1615 | int 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) yes Evaluation Count:3 | yes Evaluation Count:3723 |
| 3-3723 |
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) no Evaluation Count:0 | yes Evaluation Count:3723 |
| 0-3723 |
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) yes Evaluation Count:1 | yes Evaluation Count:3722 |
| 1-3722 |
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) yes Evaluation Count:1 | yes Evaluation Count:3721 |
| 1-3721 |
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)) { evaluated: const QFrame *frame = qobject_cast<const QFrame *>(w) yes Evaluation Count:1317 | yes Evaluation Count:2404 |
| 1317-2404 |
1640 | if (frame->frameShape() == QFrame::NoFrame) evaluated: frame->frameShape() == QFrame::NoFrame yes Evaluation Count:637 | yes Evaluation Count:680 |
| 637-680 |
1641 | return 0; executed: return 0; Execution Count:637 | 637 |
1642 | } executed: } Execution Count:680 | 680 |
1643 | #endif | - |
1644 | | - |
1645 | if (qstrcmp(w->metaObject()->className(), "QTipLabel") == 0) partially evaluated: qstrcmp(w->metaObject()->className(), "QTipLabel") == 0 no Evaluation Count:0 | yes Evaluation Count:3084 |
| 0-3084 |
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:3084 | 3084 |
1649 | } | - |
1650 | | - |
1651 | static 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 yes Evaluation Count:20967 | yes Evaluation Count:10935 |
| 10935-20967 |
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 yes Evaluation Count:755 | yes Evaluation Count:20212 |
| 755-20212 |
1657 | pc |= PseudoClass_Hover; executed: pc |= PseudoClass_Hover; Execution Count:755 | 755 |
1658 | } else { executed: } Execution Count:20967 | 20967 |
1659 | pc |= PseudoClass_Disabled; executed (the execution status of this line is deduced): pc |= PseudoClass_Disabled; | - |
1660 | } executed: } Execution Count:10935 | 10935 |
1661 | if (state & QStyle::State_Active) evaluated: state & QStyle::State_Active yes Evaluation Count:3275 | yes Evaluation Count:28627 |
| 3275-28627 |
1662 | pc |= PseudoClass_Active; executed: pc |= PseudoClass_Active; Execution Count:3275 | 3275 |
1663 | if (state & QStyle::State_Window) evaluated: state & QStyle::State_Window yes Evaluation Count:5141 | yes Evaluation Count:26761 |
| 5141-26761 |
1664 | pc |= PseudoClass_Window; executed: pc |= PseudoClass_Window; Execution Count:5141 | 5141 |
1665 | if (state & QStyle::State_Sunken) evaluated: state & QStyle::State_Sunken yes Evaluation Count:15 | yes Evaluation Count:31887 |
| 15-31887 |
1666 | pc |= PseudoClass_Pressed; executed: pc |= PseudoClass_Pressed; Execution Count:15 | 15 |
1667 | if (state & QStyle::State_HasFocus) evaluated: state & QStyle::State_HasFocus yes Evaluation Count:786 | yes Evaluation Count:31116 |
| 786-31116 |
1668 | pc |= PseudoClass_Focus; executed: pc |= PseudoClass_Focus; Execution Count:786 | 786 |
1669 | if (state & QStyle::State_On) evaluated: state & QStyle::State_On yes Evaluation Count:1 | yes Evaluation Count:31901 |
| 1-31901 |
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 yes Evaluation Count:1 | yes Evaluation Count:31901 |
| 1-31901 |
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 no Evaluation Count:0 | yes Evaluation Count:31902 |
| 0-31902 |
1674 | pc |= PseudoClass_Indeterminate; never executed: pc |= PseudoClass_Indeterminate; | 0 |
1675 | if (state & QStyle::State_Selected) partially evaluated: state & QStyle::State_Selected no Evaluation Count:0 | yes Evaluation Count:31902 |
| 0-31902 |
1676 | pc |= PseudoClass_Selected; never executed: pc |= PseudoClass_Selected; | 0 |
1677 | if (state & QStyle::State_Horizontal) evaluated: state & QStyle::State_Horizontal yes Evaluation Count:7576 | yes Evaluation Count:24326 |
| 7576-24326 |
1678 | pc |= PseudoClass_Horizontal; executed: pc |= PseudoClass_Horizontal; Execution Count:7576 | 7576 |
1679 | else | - |
1680 | pc |= PseudoClass_Vertical; executed: pc |= PseudoClass_Vertical; Execution Count:24326 | 24326 |
1681 | if (state & (QStyle::State_Open | QStyle::State_On | QStyle::State_Sunken)) evaluated: state & (QStyle::State_Open | QStyle::State_On | QStyle::State_Sunken) yes Evaluation Count:16 | yes Evaluation Count:31886 |
| 16-31886 |
1682 | pc |= PseudoClass_Open; executed: pc |= PseudoClass_Open; Execution Count:16 | 16 |
1683 | else | - |
1684 | pc |= PseudoClass_Closed; executed: pc |= PseudoClass_Closed; Execution Count:31886 | 31886 |
1685 | if (state & QStyle::State_Children) evaluated: state & QStyle::State_Children yes Evaluation Count:96 | yes Evaluation Count:31806 |
| 96-31806 |
1686 | pc |= PseudoClass_Children; executed: pc |= PseudoClass_Children; Execution Count:96 | 96 |
1687 | if (state & QStyle::State_Sibling) evaluated: state & QStyle::State_Sibling yes Evaluation Count:84 | yes Evaluation Count:31818 |
| 84-31818 |
1688 | pc |= PseudoClass_Sibling; executed: pc |= PseudoClass_Sibling; Execution Count:84 | 84 |
1689 | if (state & QStyle::State_ReadOnly) partially evaluated: state & QStyle::State_ReadOnly no Evaluation Count:0 | yes Evaluation Count:31902 |
| 0-31902 |
1690 | pc |= PseudoClass_ReadOnly; never executed: pc |= PseudoClass_ReadOnly; | 0 |
1691 | if (state & QStyle::State_Item) evaluated: state & QStyle::State_Item yes Evaluation Count:32 | yes Evaluation Count:31870 |
| 32-31870 |
1692 | pc |= PseudoClass_Item; executed: pc |= PseudoClass_Item; Execution Count:32 | 32 |
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:31902 | 31902 |
1698 | } | - |
1699 | | - |
1700 | static 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 yes Evaluation Count:43644 | yes Evaluation Count:778 |
partially evaluated: qstrcmp((*obj)->metaObject()->className(), "QDockWidgetTitleButton") == 0 no Evaluation Count:0 | yes Evaluation Count:43644 |
| 0-43644 |
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 | } | 0 |
1712 | *obj = (*obj)->parent(); never executed (the execution status of this line is deduced): *obj = (*obj)->parent(); | - |
1713 | } | 0 |
1714 | #endif | - |
1715 | } executed: } Execution Count:44422 | 44422 |
1716 | | - |
1717 | QRenderRule 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() yes Evaluation Count:29225 | yes Evaluation Count:15197 |
| 15197-29225 |
1723 | return cacheIt.value(); executed: return cacheIt.value(); Execution Count:29225 | 29225 |
1724 | | - |
1725 | if (!initObject(obj)) evaluated: !initObject(obj) yes Evaluation Count:782 | yes Evaluation Count:14415 |
| 782-14415 |
1726 | return QRenderRule(); executed: return QRenderRule(); Execution Count:782 | 782 |
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() yes Evaluation Count:10815 | yes Evaluation Count:14415 |
| 10815-14415 |
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:10815 | 10815 |
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() yes Evaluation Count:10689 | yes Evaluation Count:3726 |
| 3726-10689 |
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:10689 | 10689 |
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 yes Evaluation Count:3726 | no Evaluation Count:0 |
| 0-3726 |
1750 | cache[state&stateMask] = newRule; executed: cache[state&stateMask] = newRule; Execution Count:3726 | 3726 |
1751 | return newRule; executed: return newRule; Execution Count:3726 | 3726 |
1752 | } | - |
1753 | | - |
1754 | QRenderRule 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 yes Evaluation Count:20960 | yes Evaluation Count:10935 |
| 10935-20960 |
1758 | | - |
1759 | if (const QStyleOptionComplex *complex = qstyleoption_cast<const QStyleOptionComplex *>(opt)) { evaluated: const QStyleOptionComplex *complex = qstyleoption_cast<const QStyleOptionComplex *>(opt) yes Evaluation Count:15511 | yes Evaluation Count:16384 |
| 15511-16384 |
1760 | if (pseudoElement != PseudoElement_None) { evaluated: pseudoElement != PseudoElement_None yes Evaluation Count:2 | yes Evaluation Count:15509 |
| 2-15509 |
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) 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; | 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) 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 yes Evaluation Count:1 | yes Evaluation Count:1 |
| 1 |
1781 | || pseudoElement == PseudoElement_SpinBoxUpArrow; partially evaluated: pseudoElement == PseudoElement_SpinBoxUpArrow no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
1782 | if ((sb->stepEnabled & QAbstractSpinBox::StepUpEnabled) && up) partially evaluated: (sb->stepEnabled & QAbstractSpinBox::StepUpEnabled) yes Evaluation Count:2 | no Evaluation Count:0 |
evaluated: up 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) 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 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; | 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; | 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; | 0 |
1804 | default: | - |
1805 | break; executed: break; Execution Count:15509 | 15509 |
1806 | } | - |
1807 | | - |
1808 | if (const QStyleOptionComboBox *combo = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) { partially evaluated: const QStyleOptionComboBox *combo = qstyleoption_cast<const QStyleOptionComboBox *>(opt) no Evaluation Count:0 | yes Evaluation Count:15511 |
| 0-15511 |
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 | } | 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)) { evaluated: const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt) yes Evaluation Count:5 | yes Evaluation Count:15506 |
| 5-15506 |
1825 | if (!spin->frame) partially evaluated: !spin->frame 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 partially evaluated: const QStyleOptionGroupBox *gb = qstyleoption_cast<const QStyleOptionGroupBox *>(opt) no Evaluation Count:0 | yes Evaluation Count:15506 |
| 0-15506 |
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: } partially evaluated: const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt) no Evaluation Count:0 | yes Evaluation Count:15506 |
| 0-15506 |
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 | } | 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) no Evaluation Count:0 | yes Evaluation Count:16384 |
| 0-16384 |
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: } evaluated: const QStyleOptionHeader *hdr = qstyleoption_cast<const QStyleOptionHeader *>(opt) yes Evaluation Count:22 | yes Evaluation Count:16362 |
| 0-16362 |
1853 | if (hdr->position == QStyleOptionHeader::OnlyOneSection) evaluated: hdr->position == QStyleOptionHeader::OnlyOneSection yes Evaluation Count:8 | yes Evaluation Count:14 |
| 8-14 |
1854 | extraClass |= PseudoClass_OnlyOne; executed: extraClass |= PseudoClass_OnlyOne; Execution Count:8 | 8 |
1855 | else if (hdr->position == QStyleOptionHeader::Beginning) partially evaluated: hdr->position == QStyleOptionHeader::Beginning yes Evaluation Count:14 | no Evaluation Count:0 |
| 0-14 |
1856 | extraClass |= PseudoClass_First; executed: extraClass |= PseudoClass_First; Execution Count:14 | 14 |
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) partially evaluated: hdr->selectedPosition == QStyleOptionHeader::NextAndPreviousAreSelected no Evaluation Count:0 | yes Evaluation Count:22 |
| 0-22 |
1863 | extraClass |= (PseudoClass_NextSelected | PseudoClass_PreviousSelected); never executed: extraClass |= (PseudoClass_NextSelected | PseudoClass_PreviousSelected); | 0 |
1864 | else if (hdr->selectedPosition == QStyleOptionHeader::NextIsSelected) partially evaluated: hdr->selectedPosition == QStyleOptionHeader::NextIsSelected no Evaluation Count:0 | yes Evaluation Count:22 |
| 0-22 |
1865 | extraClass |= PseudoClass_NextSelected; never executed: extraClass |= PseudoClass_NextSelected; | 0 |
1866 | else if (hdr->selectedPosition == QStyleOptionHeader::PreviousIsSelected) partially evaluated: hdr->selectedPosition == QStyleOptionHeader::PreviousIsSelected no Evaluation Count:0 | yes Evaluation Count:22 |
| 0-22 |
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) no Evaluation Count:0 | yes Evaluation Count:16362 |
| 0-16362 |
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; | 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; | 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; | 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; | 0 |
1887 | default: | - |
1888 | 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) no Evaluation Count:0 | yes Evaluation Count:16362 |
| 0-16362 |
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; | 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; | 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; | 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; | 0 |
1924 | default: | - |
1925 | 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) no Evaluation Count:0 | yes Evaluation Count:16362 |
| 0-16362 |
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) yes Evaluation Count:2093 | yes Evaluation Count:14269 |
| 0-14269 |
1934 | if (frm->lineWidth == 0) evaluated: frm->lineWidth == 0 yes Evaluation Count:118 | yes Evaluation Count:1975 |
| 118-1975 |
1935 | extraClass |= PseudoClass_Frameless; executed: extraClass |= PseudoClass_Frameless; Execution Count:118 | 118 |
1936 | if (const QStyleOptionFrameV2 *frame2 = qstyleoption_cast<const QStyleOptionFrameV2 *>(opt)) { partially evaluated: const QStyleOptionFrameV2 *frame2 = qstyleoption_cast<const QStyleOptionFrameV2 *>(opt) yes Evaluation Count:2093 | no Evaluation Count:0 |
| 0-2093 |
1937 | if (frame2->features & QStyleOptionFrameV2::Flat) partially evaluated: frame2->features & QStyleOptionFrameV2::Flat no Evaluation Count:0 | yes Evaluation Count:2093 |
| 0-2093 |
1938 | extraClass |= PseudoClass_Flat; never executed: extraClass |= PseudoClass_Flat; | 0 |
1939 | } executed: } Execution Count:2093 | 2093 |
1940 | } executed: } Execution Count:2093 | 2093 |
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) no Evaluation Count:0 | yes Evaluation Count:14269 |
| 0-14269 |
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) no Evaluation Count:0 | yes Evaluation Count:14269 |
| 0-14269 |
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) no Evaluation Count:0 | yes Evaluation Count:14269 |
| 0-14269 |
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 | } | 0 |
1992 | #endif // QT_NO_DOCKWIDGET | - |
1993 | #ifndef QT_NO_ITEMVIEWS | - |
1994 | else if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) { evaluated: const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt) yes Evaluation Count:118 | yes Evaluation Count:14151 |
| 118-14151 |
1995 | if (vopt->features & QStyleOptionViewItem::Alternate) partially evaluated: vopt->features & QStyleOptionViewItem::Alternate no Evaluation Count:0 | yes Evaluation Count:118 |
| 0-118 |
1996 | extraClass |= PseudoClass_Alternate; never executed: extraClass |= PseudoClass_Alternate; | 0 |
1997 | if (vopt->viewItemPosition == QStyleOptionViewItem::OnlyOne) evaluated: vopt->viewItemPosition == QStyleOptionViewItem::OnlyOne yes Evaluation Count:64 | yes Evaluation Count:54 |
| 54-64 |
1998 | extraClass |= PseudoClass_OnlyOne; executed: extraClass |= PseudoClass_OnlyOne; Execution Count:64 | 64 |
1999 | else if (vopt->viewItemPosition == QStyleOptionViewItem::Beginning) partially evaluated: vopt->viewItemPosition == QStyleOptionViewItem::Beginning no Evaluation Count:0 | yes Evaluation Count:54 |
| 0-54 |
2000 | extraClass |= PseudoClass_First; never executed: extraClass |= PseudoClass_First; | 0 |
2001 | else if (vopt->viewItemPosition == QStyleOptionViewItem::End) partially evaluated: vopt->viewItemPosition == QStyleOptionViewItem::End no Evaluation Count:0 | yes Evaluation Count:54 |
| 0-54 |
2002 | extraClass |= PseudoClass_Last; never executed: extraClass |= PseudoClass_Last; | 0 |
2003 | else if (vopt->viewItemPosition == QStyleOptionViewItem::Middle) partially evaluated: vopt->viewItemPosition == QStyleOptionViewItem::Middle no Evaluation Count:0 | yes Evaluation Count:54 |
| 0-54 |
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) yes Evaluation Count:49 | yes Evaluation Count:16335 |
| 49-16335 |
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() yes Evaluation Count:49 | no Evaluation Count:0 |
| 0-49 |
2013 | extraClass &= ~PseudoClass_Frameless; executed (the execution status of this line is deduced): extraClass &= ~PseudoClass_Frameless; | - |
2014 | } else { executed: } Execution Count:49 | 49 |
2015 | extraClass |= PseudoClass_Frameless; never executed (the execution status of this line is deduced): extraClass |= PseudoClass_Frameless; | - |
2016 | } | 0 |
2017 | } else | - |
2018 | #endif | - |
2019 | if (const QFrame *frm = qobject_cast<const QFrame *>(obj)) { evaluated: const QFrame *frm = qobject_cast<const QFrame *>(obj) yes Evaluation Count:7755 | yes Evaluation Count:8580 |
| 7755-8580 |
2020 | if (frm->lineWidth() == 0) partially evaluated: frm->lineWidth() == 0 no Evaluation Count:0 | yes Evaluation Count:7755 |
| 0-7755 |
2021 | extraClass |= PseudoClass_Frameless; never executed: extraClass |= PseudoClass_Frameless; | 0 |
2022 | } executed: } Execution Count:7755 | 7755 |
2023 | } | - |
2024 | | - |
2025 | return renderRule(obj, pseudoElement, pseudoClass(state) | extraClass); executed: return renderRule(obj, pseudoElement, pseudoClass(state) | extraClass); Execution Count:31895 | 31895 |
2026 | } | - |
2027 | | - |
2028 | bool QStyleSheetStyle::hasStyleRule(const QObject *obj, int part) const | - |
2029 | { | - |
2030 | QHash<int, bool> &cache = styleSheetCaches->hasStyleRuleCache[obj]; 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); executed (the execution status of this line is deduced): QHash<int, bool>::const_iterator cacheIt = cache.constFind(part); | - |
2032 | if (cacheIt != cache.constEnd()) evaluated: cacheIt != cache.constEnd() yes Evaluation Count:4312 | yes Evaluation Count:788 |
| 788-4312 |
2033 | return cacheIt.value(); executed: return cacheIt.value(); Execution Count:4312 | 4312 |
2034 | | - |
2035 | if (!initObject(obj)) partially evaluated: !initObject(obj) no Evaluation Count:0 | yes Evaluation Count:788 |
| 0-788 |
2036 | return false; never executed: return false; | 0 |
2037 | | - |
2038 | | - |
2039 | const QVector<StyleRule> &rules = styleRules(obj); executed (the execution status of this line is deduced): const QVector<StyleRule> &rules = styleRules(obj); | - |
2040 | if (part == PseudoElement_None) { partially evaluated: part == PseudoElement_None no Evaluation Count:0 | yes Evaluation Count:788 |
| 0-788 |
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); executed (the execution status of this line is deduced): QString pseudoElement = QLatin1String(knownPseudoElements[part].name); | - |
2047 | QVector<Declaration> declarations; executed (the execution status of this line is deduced): QVector<Declaration> declarations; | - |
2048 | for (int i = 0; i < rules.count(); i++) { evaluated: i < rules.count() yes Evaluation Count:806 | yes Evaluation Count:787 |
| 787-806 |
2049 | 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); | - |
2050 | if (pseudoElement.compare(selector.pseudoElement(), Qt::CaseInsensitive) == 0) { evaluated: pseudoElement.compare(selector.pseudoElement(), Qt::CaseInsensitive) == 0 yes Evaluation Count:1 | yes Evaluation Count:805 |
| 1-805 |
2051 | cache[part] = true; executed (the execution status of this line is deduced): cache[part] = true; | - |
2052 | return true; executed: return true; Execution Count:1 | 1 |
2053 | } | - |
2054 | } executed: } Execution Count:805 | 805 |
2055 | | - |
2056 | cache[part] = false; executed (the execution status of this line is deduced): cache[part] = false; | - |
2057 | return false; executed: return false; Execution Count:787 | 787 |
2058 | } | - |
2059 | | - |
2060 | static 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 | } | 0 |
2107 | | - |
2108 | static 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 | } | 0 |
2158 | | - |
2159 | QSize 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; | 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; | 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; | 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; | 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; | 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; | 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; | 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; | 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; | 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; | 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 | | - |
2260 | static 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 | } | 0 |
2278 | | - |
2279 | QRect 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) { | 0 |
2292 | int left = p->left ? p->left : -p->right; | 0 |
2293 | int top = p->top ? p->top : -p->bottom; | 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 | } | 0 |
2296 | } else { | 0 |
2297 | r = p ? originRect.adjusted(dir == Qt::LeftToRight ? p->left : p->right, p->top, | 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 | } | 0 |
2306 | } | 0 |
2307 | return r; never executed: return r; | 0 |
2308 | } | - |
2309 | | - |
2310 | QRect 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 | */ | - |
2324 | static 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) no Evaluation Count:0 | yes Evaluation Count:1996 |
| 0-1996 |
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) no Evaluation Count:0 | yes Evaluation Count:1996 |
| 0-1996 |
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)) evaluated: QAbstractScrollArea *sa = qobject_cast<QAbstractScrollArea *>(w) yes Evaluation Count:394 | yes Evaluation Count:1602 |
| 394-1602 |
2342 | return sa->viewport(); executed: return sa->viewport(); Execution Count:394 | 394 |
2343 | #endif | - |
2344 | | - |
2345 | return w; executed: return w; Execution Count:1602 | 1602 |
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 | */ | - |
2355 | static QWidget *containerWidget(const QWidget *w) | - |
2356 | { | - |
2357 | #ifndef QT_NO_LINEEDIT | - |
2358 | if (qobject_cast<const QLineEdit *>(w)) { evaluated: qobject_cast<const QLineEdit *>(w) yes Evaluation Count:11 | yes Evaluation Count:4333 |
| 11-4333 |
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()) no Evaluation Count:0 | yes Evaluation Count:11 |
| 0-11 |
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()) yes Evaluation Count:2 | yes Evaluation Count:9 |
| 2-9 |
2366 | return w->parentWidget(); executed: return w->parentWidget(); Execution Count:2 | 2 |
2367 | #endif | - |
2368 | } executed: } Execution Count:9 | 9 |
2369 | #endif // QT_NO_LINEEDIT | - |
2370 | | - |
2371 | #ifndef QT_NO_SCROLLAREA | - |
2372 | if (const QAbstractScrollArea *sa = qobject_cast<const QAbstractScrollArea *>(w->parentWidget())) { evaluated: const QAbstractScrollArea *sa = qobject_cast<const QAbstractScrollArea *>(w->parentWidget()) yes Evaluation Count:2350 | yes Evaluation Count:1992 |
| 1992-2350 |
2373 | if (sa->viewport() == w) evaluated: sa->viewport() == w yes Evaluation Count:782 | yes Evaluation Count:1568 |
| 782-1568 |
2374 | return w->parentWidget(); executed: return w->parentWidget(); Execution Count:782 | 782 |
2375 | } executed: } Execution Count:1568 | 1568 |
2376 | #endif | - |
2377 | | - |
2378 | return const_cast<QWidget *>(w); executed: return const_cast<QWidget *>(w); Execution Count:3560 | 3560 |
2379 | } | - |
2380 | | - |
2381 | /** \internal | - |
2382 | returns true if the widget can NOT be styled directly | - |
2383 | */ | - |
2384 | static bool unstylable(const QWidget *w) | - |
2385 | { | - |
2386 | if (w->windowType() == Qt::Desktop) partially evaluated: w->windowType() == Qt::Desktop no Evaluation Count:0 | yes Evaluation Count:2388 |
| 0-2388 |
2387 | return true; never executed: return true; | 0 |
2388 | | - |
2389 | if (!w->styleSheet().isEmpty()) evaluated: !w->styleSheet().isEmpty() yes Evaluation Count:399 | yes Evaluation Count:1989 |
| 399-1989 |
2390 | return false; executed: return false; Execution Count:399 | 399 |
2391 | | - |
2392 | if (containerWidget(w) != w) evaluated: containerWidget(w) != w yes Evaluation Count:393 | yes Evaluation Count:1596 |
| 393-1596 |
2393 | return true; executed: return true; Execution Count:393 | 393 |
2394 | | - |
2395 | #ifndef QT_NO_FRAME | - |
2396 | // detect QComboBoxPrivateContainer | - |
2397 | else if (qobject_cast<const QFrame *>(w)) { evaluated: qobject_cast<const QFrame *>(w) yes Evaluation Count:6 | yes Evaluation Count:1590 |
| 6-1590 |
2398 | if (0 partially evaluated: 0 no Evaluation Count:0 | yes Evaluation Count:6 |
| 0-6 |
2399 | #ifndef QT_NO_COMBOBOX executed (the execution status of this line is deduced):
| - |
2400 | || qobject_cast<const QComboBox *>(w->parentWidget()) partially evaluated: qobject_cast<const QComboBox *>(w->parentWidget()) no Evaluation Count:0 | yes Evaluation Count:6 |
| 0-6 |
2401 | #endif | - |
2402 | ) | - |
2403 | return true; never executed: return true; | 0 |
2404 | } executed: } Execution Count:6 | 6 |
2405 | #endif | - |
2406 | return false; executed: return false; Execution Count:1596 | 1596 |
2407 | } | - |
2408 | | - |
2409 | static quint64 extendedPseudoClass(const QWidget *w) | - |
2410 | { | - |
2411 | quint64 pc = w->isWindow() ? quint64(PseudoClass_Window) : 0; evaluated: w->isWindow() yes Evaluation Count:2320 | yes Evaluation Count:7861 |
| 2320-7861 |
2412 | if (const QAbstractSlider *slider = qobject_cast<const QAbstractSlider *>(w)) { evaluated: const QAbstractSlider *slider = qobject_cast<const QAbstractSlider *>(w) yes Evaluation Count:3920 | yes Evaluation Count:6261 |
| 3920-6261 |
2413 | pc |= ((slider->orientation() == Qt::Vertical) ? PseudoClass_Vertical : PseudoClass_Horizontal); evaluated: (slider->orientation() == Qt::Vertical) yes Evaluation Count:1960 | yes Evaluation Count:1960 |
| 1960 |
2414 | } else executed: } Execution Count:3920 | 3920 |
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) no Evaluation Count:0 | yes Evaluation Count:6261 |
| 0-6261 |
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 | 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) yes Evaluation Count:17 | yes Evaluation Count:6244 |
| 17-6244 |
2423 | pc |= (edit->isReadOnly() ? PseudoClass_ReadOnly : PseudoClass_Editable); partially evaluated: edit->isReadOnly() no Evaluation Count:0 | yes Evaluation Count:17 |
| 0-17 |
2424 | } else executed: } Execution Count:17 | 17 |
2425 | #endif | - |
2426 | { } // required for the above ifdef'ery to work executed: } Execution Count:6244 | 6244 |
2427 | return pc; executed: return pc; Execution Count:10181 | 10181 |
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. | - |
2436 | void 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() no Evaluation Count:0 | yes Evaluation Count:1957 |
| 0-1957 |
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 | } | 0 |
2445 | if (w->property("_q_stylesheet_minh").toBool() partially evaluated: w->property("_q_stylesheet_minh").toBool() no Evaluation Count:0 | yes Evaluation Count:1957 |
| 0-1957 |
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 | } | 0 |
2450 | if (w->property("_q_stylesheet_maxw").toBool() partially evaluated: w->property("_q_stylesheet_maxw").toBool() no Evaluation Count:0 | yes Evaluation Count:1957 |
| 0-1957 |
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 | } | 0 |
2455 | if (w->property("_q_stylesheet_maxh").toBool() partially evaluated: w->property("_q_stylesheet_maxh").toBool() no Evaluation Count:0 | yes Evaluation Count:1957 |
| 0-1957 |
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 | } | 0 |
2460 | | - |
2461 | | - |
2462 | if (rule.hasGeometry()) { partially evaluated: rule.hasGeometry() no Evaluation Count:0 | yes Evaluation Count:1957 |
| 0-1957 |
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 | } | 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 | } | 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 | } | 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 | } | 0 |
2481 | } | 0 |
2482 | } executed: } Execution Count:1957 | 1957 |
2483 | | - |
2484 | void 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 yes Evaluation Count:1208 | yes Evaluation Count:1957 |
| 1208-1957 |
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) yes Evaluation Count:1208 | no Evaluation Count:0 |
| 0-1208 |
2499 | continue; executed: continue; Execution Count:1208 | 1208 |
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 | } | 0 |
2504 | } | 0 |
2505 | } | - |
2506 | | - |
2507 | for (int i = finals.count() - 1; i >= 0; --i) { partially evaluated: i >= 0 no Evaluation Count:0 | yes Evaluation Count:1957 |
| 0-1957 |
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; | 0 |
2528 | case QVariant::Image: v = QImage(decl.uriValue()); break; | 0 |
2529 | case QVariant::Pixmap: v = QPixmap(decl.uriValue()); break; | 0 |
2530 | case QVariant::Rect: v = decl.rectValue(); break; | 0 |
2531 | case QVariant::Size: v = decl.sizeValue(); break; | 0 |
2532 | case QVariant::Color: v = decl.colorValue(); break; | 0 |
2533 | case QVariant::Brush: v = decl.brushValue(); break; | 0 |
2534 | #ifndef QT_NO_SHORTCUT | - |
2535 | case QVariant::KeySequence: v = QKeySequence(decl.d->values.at(0).variant.toString()); break; | 0 |
2536 | #endif | - |
2537 | default: v = decl.d->values.at(0).variant; 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 | } | 0 |
2542 | } executed: } Execution Count:1957 | 1957 |
2543 | | - |
2544 | void 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 yes Evaluation Count:5871 | yes Evaluation Count:1957 |
| 1957-5871 |
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 yes Evaluation Count:1957 | yes Evaluation Count:3914 |
| 1957-3914 |
2561 | if (!w->property("_q_styleSheetWidgetFont").isValid()) { partially evaluated: !w->property("_q_styleSheetWidgetFont").isValid() yes Evaluation Count:1957 | no Evaluation Count:0 |
| 0-1957 |
2562 | saveWidgetFont(w, w->font()); executed (the execution status of this line is deduced): saveWidgetFont(w, w->font()); | - |
2563 | } executed: } Execution Count:1957 | 1957 |
2564 | updateStyleSheetFont(w); executed (the execution status of this line is deduced): updateStyleSheetFont(w); | - |
2565 | if (ew != w) evaluated: ew != w yes Evaluation Count:389 | yes Evaluation Count:1568 |
| 389-1568 |
2566 | updateStyleSheetFont(ew); executed: updateStyleSheetFont(ew); Execution Count:389 | 389 |
2567 | } executed: } Execution Count:1957 | 1957 |
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:5871 | 5871 |
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) evaluated: ew != w yes Evaluation Count:389 | yes Evaluation Count:1568 |
| 389-1568 |
2575 | ew->setPalette(p); executed: ew->setPalette(p); Execution Count:389 | 389 |
2576 | } executed: } Execution Count:1957 | 1957 |
2577 | | - |
2578 | void QStyleSheetStyle::unsetPalette(QWidget *w) | - |
2579 | { | - |
2580 | if (styleSheetCaches->customPaletteWidgets.contains(w)) { evaluated: styleSheetCaches->customPaletteWidgets.contains(w) yes Evaluation Count:14 | yes Evaluation Count:1957 |
| 14-1957 |
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) evaluated: ew != w yes Evaluation Count:2 | yes Evaluation Count:12 |
| 2-12 |
2585 | ew->setPalette(p); executed: ew->setPalette(p); Execution Count:2 | 2 |
2586 | styleSheetCaches->customPaletteWidgets.remove(w); executed (the execution status of this line is deduced): styleSheetCaches->customPaletteWidgets.remove(w); | - |
2587 | } executed: } Execution Count:14 | 14 |
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() yes Evaluation Count:14 | yes Evaluation Count:1957 |
| 14-1957 |
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:14 | 14 |
2592 | if (styleSheetCaches->autoFillDisabledWidgets.contains(w)) { partially evaluated: styleSheetCaches->autoFillDisabledWidgets.contains(w) no Evaluation Count:0 | yes Evaluation Count:1971 |
| 0-1971 |
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 | } | 0 |
2596 | } executed: } Execution Count:1971 | 1971 |
2597 | | - |
2598 | static 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 | } | 0 |
2607 | } | 0 |
2608 | | - |
2609 | QWidgetList widgets; never executed (the execution status of this line is deduced): QWidgetList widgets; | - |
2610 | foreach (const QObject *object, objects) { never executed (the execution status of this line is deduced): for (QForeachContainer<__typeof__(objects)> _container_(objects); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (const QObject *object = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
2611 | if (QWidget *w = qobject_cast<QWidget*>(const_cast<QObject*>(object))) never evaluated: QWidget *w = qobject_cast<QWidget*>(const_cast<QObject*>(object)) | 0 |
2612 | widgets << w; never executed: widgets << w; | 0 |
2613 | } | 0 |
2614 | | - |
2615 | QEvent event(QEvent::StyleChange); never executed (the execution status of this line is deduced): QEvent event(QEvent::StyleChange); | - |
2616 | foreach (QWidget *widget, widgets) { never executed (the execution status of this line is deduced): for (QForeachContainer<__typeof__(widgets)> _container_(widgets); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QWidget *widget = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
2617 | widget->style()->polish(widget); never executed (the execution status of this line is deduced): widget->style()->polish(widget); | - |
2618 | QApplication::sendEvent(widget, &event); never executed (the execution status of this line is deduced): QApplication::sendEvent(widget, &event); | - |
2619 | } | 0 |
2620 | } | 0 |
2621 | | - |
2622 | ///////////////////////////////////////////////////////////////////////////////////////// | - |
2623 | // The stylesheet style | - |
2624 | int QStyleSheetStyle::numinstances = 0; | - |
2625 | | - |
2626 | QStyleSheetStyle::QStyleSheetStyle(QStyle *base) | - |
2627 | : QWindowsStyle(*new QStyleSheetStylePrivate), base(base), refcount(1) | - |
2628 | { | - |
2629 | ++numinstances; executed (the execution status of this line is deduced): ++numinstances; | - |
2630 | if (numinstances == 1) { evaluated: numinstances == 1 yes Evaluation Count:401 | yes Evaluation Count:1 |
| 1-401 |
2631 | styleSheetCaches = new QStyleSheetStyleCaches; executed (the execution status of this line is deduced): styleSheetCaches = new QStyleSheetStyleCaches; | - |
2632 | } executed: } Execution Count:401 | 401 |
2633 | } executed: } Execution Count:402 | 402 |
2634 | | - |
2635 | QStyleSheetStyle::~QStyleSheetStyle() | - |
2636 | { | - |
2637 | --numinstances; executed (the execution status of this line is deduced): --numinstances; | - |
2638 | if (numinstances == 0) { evaluated: numinstances == 0 yes Evaluation Count:401 | yes Evaluation Count:1 |
| 1-401 |
2639 | delete styleSheetCaches; executed (the execution status of this line is deduced): delete styleSheetCaches; | - |
2640 | } executed: } Execution Count:401 | 401 |
2641 | } executed: } Execution Count:402 | 402 |
2642 | QStyle *QStyleSheetStyle::baseStyle() const | - |
2643 | { | - |
2644 | if (base) evaluated: base yes Evaluation Count:56458 | yes Evaluation Count:1048 |
| 1048-56458 |
2645 | return base; executed: return base; Execution Count:56458 | 56458 |
2646 | if (QStyleSheetStyle *me = qobject_cast<QStyleSheetStyle *>(QApplication::style())) partially evaluated: QStyleSheetStyle *me = qobject_cast<QStyleSheetStyle *>(QApplication::style()) no Evaluation Count:0 | yes Evaluation Count:1048 |
| 0-1048 |
2647 | return me->base; never executed: return me->base; | 0 |
2648 | return QApplication::style(); executed: return QApplication::style(); Execution Count:1048 | 1048 |
2649 | } | - |
2650 | | - |
2651 | void QStyleSheetStyleCaches::objectDestroyed(QObject *o) | - |
2652 | { | - |
2653 | styleRulesCache.remove(o); executed (the execution status of this line is deduced): styleRulesCache.remove(o); | - |
2654 | hasStyleRuleCache.remove(o); executed (the execution status of this line is deduced): hasStyleRuleCache.remove(o); | - |
2655 | renderRulesCache.remove(o); executed (the execution status of this line is deduced): renderRulesCache.remove(o); | - |
2656 | customPaletteWidgets.remove((const QWidget *)o); executed (the execution status of this line is deduced): customPaletteWidgets.remove((const QWidget *)o); | - |
2657 | styleSheetCache.remove(o); executed (the execution status of this line is deduced): styleSheetCache.remove(o); | - |
2658 | autoFillDisabledWidgets.remove((const QWidget *)o); executed (the execution status of this line is deduced): autoFillDisabledWidgets.remove((const QWidget *)o); | - |
2659 | } executed: } Execution Count:1981 | 1981 |
2660 | | - |
2661 | void QStyleSheetStyleCaches::styleDestroyed(QObject *o) | - |
2662 | { | - |
2663 | styleSheetCache.remove(o); never executed (the execution status of this line is deduced): styleSheetCache.remove(o); | - |
2664 | } | 0 |
2665 | | - |
2666 | /*! | - |
2667 | * Make sure that the cache will be clean by connecting destroyed if needed. | - |
2668 | * return false if the widget is not stylable; | - |
2669 | */ | - |
2670 | bool QStyleSheetStyle::initObject(const QObject *obj) const | - |
2671 | { | - |
2672 | if (!obj) evaluated: !obj yes Evaluation Count:778 | yes Evaluation Count:19945 |
| 778-19945 |
2673 | return false; executed: return false; Execution Count:778 | 778 |
2674 | if (const QWidget *w = qobject_cast<const QWidget*>(obj)) { partially evaluated: const QWidget *w = qobject_cast<const QWidget*>(obj) yes Evaluation Count:19945 | no Evaluation Count:0 |
| 0-19945 |
2675 | if (w->testAttribute(Qt::WA_StyleSheet)) evaluated: w->testAttribute(Qt::WA_StyleSheet) yes Evaluation Count:17557 | yes Evaluation Count:2388 |
| 2388-17557 |
2676 | return true; executed: return true; Execution Count:17557 | 17557 |
2677 | if (unstylable(w)) evaluated: unstylable(w) yes Evaluation Count:393 | yes Evaluation Count:1995 |
| 393-1995 |
2678 | return false; executed: return false; Execution Count:393 | 393 |
2679 | 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); | - |
2680 | } executed: } Execution Count:1995 | 1995 |
2681 | | - |
2682 | 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); | - |
2683 | return true; executed: return true; Execution Count:1995 | 1995 |
2684 | } | - |
2685 | | - |
2686 | void QStyleSheetStyle::polish(QWidget *w) | - |
2687 | { | - |
2688 | baseStyle()->polish(w); executed (the execution status of this line is deduced): baseStyle()->polish(w); | - |
2689 | RECURSION_GUARD(return) never executed: return; partially evaluated: globalStyleSheetStyle != 0 no Evaluation Count:0 | yes Evaluation Count:2346 |
never evaluated: globalStyleSheetStyle != this | 0-2346 |
2690 | | - |
2691 | if (!initObject(w)) evaluated: !initObject(w) yes Evaluation Count:389 | yes Evaluation Count:1957 |
| 389-1957 |
2692 | return; executed: return; Execution Count:389 | 389 |
2693 | | - |
2694 | if (styleSheetCaches->styleRulesCache.contains(w)) { evaluated: styleSheetCaches->styleRulesCache.contains(w) yes Evaluation Count:397 | yes Evaluation Count:1560 |
| 397-1560 |
2695 | // the widget accessed its style pointer before polish (or repolish) | - |
2696 | // (exemple: the QAbstractSpinBox constructor ask for the stylehint) | - |
2697 | styleSheetCaches->styleRulesCache.remove(w); executed (the execution status of this line is deduced): styleSheetCaches->styleRulesCache.remove(w); | - |
2698 | styleSheetCaches->hasStyleRuleCache.remove(w); executed (the execution status of this line is deduced): styleSheetCaches->hasStyleRuleCache.remove(w); | - |
2699 | styleSheetCaches->renderRulesCache.remove(w); executed (the execution status of this line is deduced): styleSheetCaches->renderRulesCache.remove(w); | - |
2700 | } executed: } Execution Count:397 | 397 |
2701 | setGeometry(w); executed (the execution status of this line is deduced): setGeometry(w); | - |
2702 | setProperties(w); executed (the execution status of this line is deduced): setProperties(w); | - |
2703 | unsetPalette(w); executed (the execution status of this line is deduced): unsetPalette(w); | - |
2704 | setPalette(w); executed (the execution status of this line is deduced): setPalette(w); | - |
2705 | | - |
2706 | //set the WA_Hover attribute if one of the selector depends of the hover state | - |
2707 | QVector<StyleRule> rules = styleRules(w); executed (the execution status of this line is deduced): QVector<StyleRule> rules = styleRules(w); | - |
2708 | for (int i = 0; i < rules.count(); i++) { evaluated: i < rules.count() yes Evaluation Count:1211 | yes Evaluation Count:1957 |
| 1211-1957 |
2709 | 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); | - |
2710 | quint64 negated = 0; executed (the execution status of this line is deduced): quint64 negated = 0; | - |
2711 | quint64 cssClass = selector.pseudoClass(&negated); executed (the execution status of this line is deduced): quint64 cssClass = selector.pseudoClass(&negated); | - |
2712 | if ( cssClass & PseudoClass_Hover || negated & PseudoClass_Hover) { partially evaluated: cssClass & PseudoClass_Hover no Evaluation Count:0 | yes Evaluation Count:1211 |
partially evaluated: negated & PseudoClass_Hover no Evaluation Count:0 | yes Evaluation Count:1211 |
| 0-1211 |
2713 | w->setAttribute(Qt::WA_Hover); never executed (the execution status of this line is deduced): w->setAttribute(Qt::WA_Hover); | - |
2714 | embeddedWidget(w)->setAttribute(Qt::WA_Hover); never executed (the execution status of this line is deduced): embeddedWidget(w)->setAttribute(Qt::WA_Hover); | - |
2715 | } | 0 |
2716 | } executed: } Execution Count:1211 | 1211 |
2717 | | - |
2718 | | - |
2719 | #ifndef QT_NO_SCROLLAREA | - |
2720 | if (QAbstractScrollArea *sa = qobject_cast<QAbstractScrollArea *>(w)) { evaluated: QAbstractScrollArea *sa = qobject_cast<QAbstractScrollArea *>(w) yes Evaluation Count:389 | yes Evaluation Count:1568 |
| 389-1568 |
2721 | QRenderRule rule = renderRule(sa, PseudoElement_None, PseudoClass_Enabled); executed (the execution status of this line is deduced): QRenderRule rule = renderRule(sa, PseudoElement_None, PseudoClass_Enabled); | - |
2722 | if ((rule.hasBorder() && rule.border()->hasBorderImage()) partially evaluated: rule.hasBorder() yes Evaluation Count:389 | no Evaluation Count:0 |
partially evaluated: rule.border()->hasBorderImage() no Evaluation Count:0 | yes Evaluation Count:389 |
| 0-389 |
2723 | || (rule.hasBackground() && !rule.background()->pixmap.isNull())) { partially evaluated: rule.hasBackground() no Evaluation Count:0 | yes Evaluation Count:389 |
never evaluated: !rule.background()->pixmap.isNull() | 0-389 |
2724 | QObject::connect(sa->horizontalScrollBar(), SIGNAL(valueChanged(int)), never executed (the execution status of this line is deduced): QObject::connect(sa->horizontalScrollBar(), "2""valueChanged(int)", | - |
2725 | sa, SLOT(update()), Qt::UniqueConnection); never executed (the execution status of this line is deduced): sa, "1""update()", Qt::UniqueConnection); | - |
2726 | QObject::connect(sa->verticalScrollBar(), SIGNAL(valueChanged(int)), never executed (the execution status of this line is deduced): QObject::connect(sa->verticalScrollBar(), "2""valueChanged(int)", | - |
2727 | sa, SLOT(update()), Qt::UniqueConnection); never executed (the execution status of this line is deduced): sa, "1""update()", Qt::UniqueConnection); | - |
2728 | } | 0 |
2729 | } executed: } Execution Count:389 | 389 |
2730 | #endif | - |
2731 | | - |
2732 | 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); | - |
2733 | if (rule.hasDrawable() || rule.hasBox()) { evaluated: rule.hasDrawable() yes Evaluation Count:25 | yes Evaluation Count:1932 |
partially evaluated: rule.hasBox() no Evaluation Count:0 | yes Evaluation Count:1932 |
| 0-1932 |
2734 | if (w->metaObject() == &QWidget::staticMetaObject evaluated: w->metaObject() == &QWidget::staticMetaObject yes Evaluation Count:6 | yes Evaluation Count:19 |
| 6-19 |
2735 | #ifndef QT_NO_ITEMVIEWS executed (the execution status of this line is deduced):
| - |
2736 | || qobject_cast<QHeaderView *>(w) evaluated: qobject_cast<QHeaderView *>(w) yes Evaluation Count:2 | yes Evaluation Count:17 |
| 2-17 |
2737 | #endif executed (the execution status of this line is deduced):
| - |
2738 | #ifndef QT_NO_TABBAR executed (the execution status of this line is deduced):
| - |
2739 | || qobject_cast<QTabBar *>(w) partially evaluated: qobject_cast<QTabBar *>(w) no Evaluation Count:0 | yes Evaluation Count:17 |
| 0-17 |
2740 | #endif executed (the execution status of this line is deduced):
| - |
2741 | #ifndef QT_NO_FRAME executed (the execution status of this line is deduced):
| - |
2742 | || qobject_cast<QFrame *>(w) evaluated: qobject_cast<QFrame *>(w) yes Evaluation Count:1 | yes Evaluation Count:16 |
| 1-16 |
2743 | #endif executed (the execution status of this line is deduced):
| - |
2744 | #ifndef QT_NO_MAINWINDOW executed (the execution status of this line is deduced):
| - |
2745 | || qobject_cast<QMainWindow *>(w) partially evaluated: qobject_cast<QMainWindow *>(w) no Evaluation Count:0 | yes Evaluation Count:16 |
| 0-16 |
2746 | #endif executed (the execution status of this line is deduced):
| - |
2747 | #ifndef QT_NO_MDIAREA executed (the execution status of this line is deduced):
| - |
2748 | || qobject_cast<QMdiSubWindow *>(w) partially evaluated: qobject_cast<QMdiSubWindow *>(w) no Evaluation Count:0 | yes Evaluation Count:16 |
| 0-16 |
2749 | #endif executed (the execution status of this line is deduced):
| - |
2750 | #ifndef QT_NO_MENUBAR executed (the execution status of this line is deduced):
| - |
2751 | || qobject_cast<QMenuBar *>(w) partially evaluated: qobject_cast<QMenuBar *>(w) no Evaluation Count:0 | yes Evaluation Count:16 |
| 0-16 |
2752 | #endif executed (the execution status of this line is deduced):
| - |
2753 | || qobject_cast<QDialog *>(w)) { partially evaluated: qobject_cast<QDialog *>(w) no Evaluation Count:0 | yes Evaluation Count:16 |
| 0-16 |
2754 | w->setAttribute(Qt::WA_StyledBackground, true); executed (the execution status of this line is deduced): w->setAttribute(Qt::WA_StyledBackground, true); | - |
2755 | } executed: } Execution Count:9 | 9 |
2756 | QWidget *ew = embeddedWidget(w); executed (the execution status of this line is deduced): QWidget *ew = embeddedWidget(w); | - |
2757 | if (ew->autoFillBackground()) { evaluated: ew->autoFillBackground() yes Evaluation Count:3 | yes Evaluation Count:22 |
| 3-22 |
2758 | ew->setAutoFillBackground(false); executed (the execution status of this line is deduced): ew->setAutoFillBackground(false); | - |
2759 | styleSheetCaches->autoFillDisabledWidgets.insert(w); executed (the execution status of this line is deduced): styleSheetCaches->autoFillDisabledWidgets.insert(w); | - |
2760 | if (ew != w) { //eg. viewport of a scrollarea partially evaluated: ew != w yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-3 |
2761 | //(in order to draw the background anyway in case we don't.) | - |
2762 | ew->setAttribute(Qt::WA_StyledBackground, true); executed (the execution status of this line is deduced): ew->setAttribute(Qt::WA_StyledBackground, true); | - |
2763 | } executed: } Execution Count:3 | 3 |
2764 | } executed: } Execution Count:3 | 3 |
2765 | if (!rule.hasBackground() || rule.background()->isTransparent() || rule.hasBox() evaluated: !rule.hasBackground() yes Evaluation Count:16 | yes Evaluation Count:9 |
partially evaluated: rule.background()->isTransparent() no Evaluation Count:0 | yes Evaluation Count:9 |
partially evaluated: rule.hasBox() no Evaluation Count:0 | yes Evaluation Count:9 |
| 0-16 |
2766 | || (!rule.hasNativeBorder() && !rule.border()->isOpaque())) evaluated: !rule.hasNativeBorder() yes Evaluation Count:2 | yes Evaluation Count:7 |
partially evaluated: !rule.border()->isOpaque() no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-7 |
2767 | w->setAttribute(Qt::WA_OpaquePaintEvent, false); executed: w->setAttribute(Qt::WA_OpaquePaintEvent, false); Execution Count:16 | 16 |
2768 | } executed: } Execution Count:25 | 25 |
2769 | } executed: } Execution Count:1957 | 1957 |
2770 | | - |
2771 | void QStyleSheetStyle::polish(QApplication *app) | - |
2772 | { | - |
2773 | baseStyle()->polish(app); executed (the execution status of this line is deduced): baseStyle()->polish(app); | - |
2774 | } executed: } Execution Count:3 | 3 |
2775 | | - |
2776 | void QStyleSheetStyle::polish(QPalette &pal) | - |
2777 | { | - |
2778 | baseStyle()->polish(pal); executed (the execution status of this line is deduced): baseStyle()->polish(pal); | - |
2779 | } executed: } Execution Count:3 | 3 |
2780 | | - |
2781 | void QStyleSheetStyle::repolish(QWidget *w) | - |
2782 | { | - |
2783 | 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()); | - |
2784 | children.append(w); never executed (the execution status of this line is deduced): children.append(w); | - |
2785 | styleSheetCaches->styleSheetCache.remove(w); never executed (the execution status of this line is deduced): styleSheetCaches->styleSheetCache.remove(w); | - |
2786 | updateObjects(children); never executed (the execution status of this line is deduced): updateObjects(children); | - |
2787 | } | 0 |
2788 | | - |
2789 | void QStyleSheetStyle::repolish(QApplication *app) | - |
2790 | { | - |
2791 | Q_UNUSED(app); never executed (the execution status of this line is deduced): (void)app;; | - |
2792 | 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(); | - |
2793 | styleSheetCaches->styleSheetCache.remove(qApp); never executed (the execution status of this line is deduced): styleSheetCaches->styleSheetCache.remove((static_cast<QApplication *>(QCoreApplication::instance()))); | - |
2794 | styleSheetCaches->styleRulesCache.clear(); never executed (the execution status of this line is deduced): styleSheetCaches->styleRulesCache.clear(); | - |
2795 | styleSheetCaches->hasStyleRuleCache.clear(); never executed (the execution status of this line is deduced): styleSheetCaches->hasStyleRuleCache.clear(); | - |
2796 | styleSheetCaches->renderRulesCache.clear(); never executed (the execution status of this line is deduced): styleSheetCaches->renderRulesCache.clear(); | - |
2797 | updateObjects(allObjects); never executed (the execution status of this line is deduced): updateObjects(allObjects); | - |
2798 | } | 0 |
2799 | | - |
2800 | void QStyleSheetStyle::unpolish(QWidget *w) | - |
2801 | { | - |
2802 | if (!w || !w->testAttribute(Qt::WA_StyleSheet)) { partially evaluated: !w no Evaluation Count:0 | yes Evaluation Count:16 |
evaluated: !w->testAttribute(Qt::WA_StyleSheet) yes Evaluation Count:2 | yes Evaluation Count:14 |
| 0-16 |
2803 | baseStyle()->unpolish(w); executed (the execution status of this line is deduced): baseStyle()->unpolish(w); | - |
2804 | return; executed: return; Execution Count:2 | 2 |
2805 | } | - |
2806 | | - |
2807 | styleSheetCaches->styleRulesCache.remove(w); executed (the execution status of this line is deduced): styleSheetCaches->styleRulesCache.remove(w); | - |
2808 | styleSheetCaches->hasStyleRuleCache.remove(w); executed (the execution status of this line is deduced): styleSheetCaches->hasStyleRuleCache.remove(w); | - |
2809 | styleSheetCaches->renderRulesCache.remove(w); executed (the execution status of this line is deduced): styleSheetCaches->renderRulesCache.remove(w); | - |
2810 | styleSheetCaches->styleSheetCache.remove(w); executed (the execution status of this line is deduced): styleSheetCaches->styleSheetCache.remove(w); | - |
2811 | unsetPalette(w); executed (the execution status of this line is deduced): unsetPalette(w); | - |
2812 | w->setProperty("_q_stylesheet_minw", QVariant()); executed (the execution status of this line is deduced): w->setProperty("_q_stylesheet_minw", QVariant()); | - |
2813 | w->setProperty("_q_stylesheet_minh", QVariant()); executed (the execution status of this line is deduced): w->setProperty("_q_stylesheet_minh", QVariant()); | - |
2814 | w->setProperty("_q_stylesheet_maxw", QVariant()); executed (the execution status of this line is deduced): w->setProperty("_q_stylesheet_maxw", QVariant()); | - |
2815 | w->setProperty("_q_stylesheet_maxh", QVariant()); executed (the execution status of this line is deduced): w->setProperty("_q_stylesheet_maxh", QVariant()); | - |
2816 | w->setAttribute(Qt::WA_StyleSheet, false); executed (the execution status of this line is deduced): w->setAttribute(Qt::WA_StyleSheet, false); | - |
2817 | QObject::disconnect(w, 0, this, 0); executed (the execution status of this line is deduced): QObject::disconnect(w, 0, this, 0); | - |
2818 | #ifndef QT_NO_SCROLLAREA | - |
2819 | if (QAbstractScrollArea *sa = qobject_cast<QAbstractScrollArea *>(w)) { evaluated: QAbstractScrollArea *sa = qobject_cast<QAbstractScrollArea *>(w) yes Evaluation Count:2 | yes Evaluation Count:12 |
| 2-12 |
2820 | QObject::disconnect(sa->horizontalScrollBar(), SIGNAL(valueChanged(int)), executed (the execution status of this line is deduced): QObject::disconnect(sa->horizontalScrollBar(), "2""valueChanged(int)", | - |
2821 | sa, SLOT(update())); executed (the execution status of this line is deduced): sa, "1""update()"); | - |
2822 | QObject::disconnect(sa->verticalScrollBar(), SIGNAL(valueChanged(int)), executed (the execution status of this line is deduced): QObject::disconnect(sa->verticalScrollBar(), "2""valueChanged(int)", | - |
2823 | sa, SLOT(update())); executed (the execution status of this line is deduced): sa, "1""update()"); | - |
2824 | } executed: } Execution Count:2 | 2 |
2825 | #endif | - |
2826 | baseStyle()->unpolish(w); executed (the execution status of this line is deduced): baseStyle()->unpolish(w); | - |
2827 | } executed: } Execution Count:14 | 14 |
2828 | | - |
2829 | void QStyleSheetStyle::unpolish(QApplication *app) | - |
2830 | { | - |
2831 | baseStyle()->unpolish(app); executed (the execution status of this line is deduced): baseStyle()->unpolish(app); | - |
2832 | RECURSION_GUARD(return) never executed: return; partially evaluated: globalStyleSheetStyle != 0 no Evaluation Count:0 | yes Evaluation Count:2 |
never evaluated: globalStyleSheetStyle != this | 0-2 |
2833 | styleSheetCaches->styleRulesCache.clear(); executed (the execution status of this line is deduced): styleSheetCaches->styleRulesCache.clear(); | - |
2834 | styleSheetCaches->hasStyleRuleCache.clear(); executed (the execution status of this line is deduced): styleSheetCaches->hasStyleRuleCache.clear(); | - |
2835 | styleSheetCaches->renderRulesCache.clear(); executed (the execution status of this line is deduced): styleSheetCaches->renderRulesCache.clear(); | - |
2836 | styleSheetCaches->styleSheetCache.remove(qApp); executed (the execution status of this line is deduced): styleSheetCaches->styleSheetCache.remove((static_cast<QApplication *>(QCoreApplication::instance()))); | - |
2837 | } executed: } Execution Count:2 | 2 |
2838 | | - |
2839 | #ifndef QT_NO_TABBAR | - |
2840 | inline static bool verticalTabs(QTabBar::Shape shape) | - |
2841 | { | - |
2842 | return shape == QTabBar::RoundedWest never executed: return shape == QTabBar::RoundedWest || shape == QTabBar::RoundedEast || shape == QTabBar::TriangularWest || shape == QTabBar::TriangularEast; | 0 |
2843 | || shape == QTabBar::RoundedEast never executed: return shape == QTabBar::RoundedWest || shape == QTabBar::RoundedEast || shape == QTabBar::TriangularWest || shape == QTabBar::TriangularEast; | 0 |
2844 | || shape == QTabBar::TriangularWest never executed: return shape == QTabBar::RoundedWest || shape == QTabBar::RoundedEast || shape == QTabBar::TriangularWest || shape == QTabBar::TriangularEast; | 0 |
2845 | || shape == QTabBar::TriangularEast; never executed: return shape == QTabBar::RoundedWest || shape == QTabBar::RoundedEast || shape == QTabBar::TriangularWest || shape == QTabBar::TriangularEast; | 0 |
2846 | } | - |
2847 | #endif // QT_NO_TABBAR | - |
2848 | | - |
2849 | void QStyleSheetStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, | - |
2850 | const QWidget *w) const | - |
2851 | { | - |
2852 | RECURSION_GUARD(baseStyle()->drawComplexControl(cc, opt, p, w); return) never executed: return; partially evaluated: globalStyleSheetStyle != 0 no Evaluation Count:0 | yes Evaluation Count:290 |
never evaluated: globalStyleSheetStyle != this | 0-290 |
2853 | | - |
2854 | QRenderRule rule = renderRule(w, opt); executed (the execution status of this line is deduced): QRenderRule rule = renderRule(w, opt); | - |
2855 | | - |
2856 | switch (cc) { | - |
2857 | case CC_ComboBox: | - |
2858 | if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) { never evaluated: const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(opt) | 0 |
2859 | QStyleOptionComboBox cmbOpt(*cmb); never executed (the execution status of this line is deduced): QStyleOptionComboBox cmbOpt(*cmb); | - |
2860 | cmbOpt.rect = rule.borderRect(opt->rect); never executed (the execution status of this line is deduced): cmbOpt.rect = rule.borderRect(opt->rect); | - |
2861 | if (rule.hasNativeBorder()) { never evaluated: rule.hasNativeBorder() | 0 |
2862 | rule.drawBackgroundImage(p, cmbOpt.rect); never executed (the execution status of this line is deduced): rule.drawBackgroundImage(p, cmbOpt.rect); | - |
2863 | 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); | - |
2864 | bool customDropDown = (opt->subControls & QStyle::SC_ComboBoxArrow) never evaluated: (opt->subControls & QStyle::SC_ComboBoxArrow) | 0 |
2865 | && (hasStyleRule(w, PseudoElement_ComboBoxDropDown) || hasStyleRule(w, PseudoElement_ComboBoxArrow)); never evaluated: hasStyleRule(w, PseudoElement_ComboBoxDropDown) never evaluated: hasStyleRule(w, PseudoElement_ComboBoxArrow) | 0 |
2866 | if (customDropDown) never evaluated: customDropDown | 0 |
2867 | cmbOpt.subControls &= ~QStyle::SC_ComboBoxArrow; never executed: cmbOpt.subControls &= ~QStyle::SC_ComboBoxArrow; | 0 |
2868 | if (rule.baseStyleCanDraw()) { never evaluated: rule.baseStyleCanDraw() | 0 |
2869 | baseStyle()->drawComplexControl(cc, &cmbOpt, p, w); never executed (the execution status of this line is deduced): baseStyle()->drawComplexControl(cc, &cmbOpt, p, w); | - |
2870 | } else { | 0 |
2871 | QWindowsStyle::drawComplexControl(cc, &cmbOpt, p, w); never executed (the execution status of this line is deduced): QWindowsStyle::drawComplexControl(cc, &cmbOpt, p, w); | - |
2872 | } | 0 |
2873 | if (!customDropDown) never evaluated: !customDropDown | 0 |
2874 | return; | 0 |
2875 | } else { | 0 |
2876 | rule.drawRule(p, opt->rect); never executed (the execution status of this line is deduced): rule.drawRule(p, opt->rect); | - |
2877 | } | 0 |
2878 | | - |
2879 | if (opt->subControls & QStyle::SC_ComboBoxArrow) { never evaluated: opt->subControls & QStyle::SC_ComboBoxArrow | 0 |
2880 | QRenderRule subRule = renderRule(w, opt, PseudoElement_ComboBoxDropDown); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_ComboBoxDropDown); | - |
2881 | if (subRule.hasDrawable()) { never evaluated: subRule.hasDrawable() | 0 |
2882 | 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); | - |
2883 | subRule.drawRule(p, r); never executed (the execution status of this line is deduced): subRule.drawRule(p, r); | - |
2884 | QRenderRule subRule2 = renderRule(w, opt, PseudoElement_ComboBoxArrow); never executed (the execution status of this line is deduced): QRenderRule subRule2 = renderRule(w, opt, PseudoElement_ComboBoxArrow); | - |
2885 | 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); | - |
2886 | subRule2.drawRule(p, r); never executed (the execution status of this line is deduced): subRule2.drawRule(p, r); | - |
2887 | } else { | 0 |
2888 | cmbOpt.subControls = QStyle::SC_ComboBoxArrow; never executed (the execution status of this line is deduced): cmbOpt.subControls = QStyle::SC_ComboBoxArrow; | - |
2889 | QWindowsStyle::drawComplexControl(cc, &cmbOpt, p, w); never executed (the execution status of this line is deduced): QWindowsStyle::drawComplexControl(cc, &cmbOpt, p, w); | - |
2890 | } | 0 |
2891 | } | - |
2892 | | - |
2893 | return; | 0 |
2894 | } | - |
2895 | break; | 0 |
2896 | | - |
2897 | #ifndef QT_NO_SPINBOX | - |
2898 | case CC_SpinBox: | - |
2899 | if (const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) { never evaluated: const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt) | 0 |
2900 | QStyleOptionSpinBox spinOpt(*spin); never executed (the execution status of this line is deduced): QStyleOptionSpinBox spinOpt(*spin); | - |
2901 | 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); | - |
2902 | 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); | - |
2903 | spinOpt.rect = rule.borderRect(opt->rect); never executed (the execution status of this line is deduced): spinOpt.rect = rule.borderRect(opt->rect); | - |
2904 | bool customUp = true, customDown = true; never executed (the execution status of this line is deduced): bool customUp = true, customDown = true; | - |
2905 | QRenderRule upRule = renderRule(w, opt, PseudoElement_SpinBoxUpButton); never executed (the execution status of this line is deduced): QRenderRule upRule = renderRule(w, opt, PseudoElement_SpinBoxUpButton); | - |
2906 | QRenderRule downRule = renderRule(w, opt, PseudoElement_SpinBoxDownButton); never executed (the execution status of this line is deduced): QRenderRule downRule = renderRule(w, opt, PseudoElement_SpinBoxDownButton); | - |
2907 | bool upRuleMatch = upRule.hasGeometry() || upRule.hasPosition(); never evaluated: upRule.hasGeometry() never evaluated: upRule.hasPosition() | 0 |
2908 | bool downRuleMatch = downRule.hasGeometry() || downRule.hasPosition(); never evaluated: downRule.hasGeometry() never evaluated: downRule.hasPosition() | 0 |
2909 | if (rule.hasNativeBorder() && !upRuleMatch && !downRuleMatch) { never evaluated: rule.hasNativeBorder() never evaluated: !upRuleMatch never evaluated: !downRuleMatch | 0 |
2910 | rule.drawBackgroundImage(p, spinOpt.rect); never executed (the execution status of this line is deduced): rule.drawBackgroundImage(p, spinOpt.rect); | - |
2911 | customUp = (opt->subControls & QStyle::SC_SpinBoxUp) never evaluated: (opt->subControls & QStyle::SC_SpinBoxUp) | 0 |
2912 | && (hasStyleRule(w, PseudoElement_SpinBoxUpButton) || hasStyleRule(w, PseudoElement_UpArrow)); never evaluated: hasStyleRule(w, PseudoElement_SpinBoxUpButton) never evaluated: hasStyleRule(w, PseudoElement_UpArrow) | 0 |
2913 | if (customUp) never evaluated: customUp | 0 |
2914 | spinOpt.subControls &= ~QStyle::SC_SpinBoxUp; never executed: spinOpt.subControls &= ~QStyle::SC_SpinBoxUp; | 0 |
2915 | customDown = (opt->subControls & QStyle::SC_SpinBoxDown) never evaluated: (opt->subControls & QStyle::SC_SpinBoxDown) | 0 |
2916 | && (hasStyleRule(w, PseudoElement_SpinBoxDownButton) || hasStyleRule(w, PseudoElement_DownArrow)); never evaluated: hasStyleRule(w, PseudoElement_SpinBoxDownButton) never evaluated: hasStyleRule(w, PseudoElement_DownArrow) | 0 |
2917 | if (customDown) never evaluated: customDown | 0 |
2918 | spinOpt.subControls &= ~QStyle::SC_SpinBoxDown; never executed: spinOpt.subControls &= ~QStyle::SC_SpinBoxDown; | 0 |
2919 | if (rule.baseStyleCanDraw()) { never evaluated: rule.baseStyleCanDraw() | 0 |
2920 | baseStyle()->drawComplexControl(cc, &spinOpt, p, w); never executed (the execution status of this line is deduced): baseStyle()->drawComplexControl(cc, &spinOpt, p, w); | - |
2921 | } else { | 0 |
2922 | QWindowsStyle::drawComplexControl(cc, &spinOpt, p, w); never executed (the execution status of this line is deduced): QWindowsStyle::drawComplexControl(cc, &spinOpt, p, w); | - |
2923 | } | 0 |
2924 | if (!customUp && !customDown) never evaluated: !customUp never evaluated: !customDown | 0 |
2925 | return; | 0 |
2926 | } else { | 0 |
2927 | rule.drawRule(p, opt->rect); never executed (the execution status of this line is deduced): rule.drawRule(p, opt->rect); | - |
2928 | } | 0 |
2929 | | - |
2930 | if ((opt->subControls & QStyle::SC_SpinBoxUp) && customUp) { never evaluated: (opt->subControls & QStyle::SC_SpinBoxUp) never evaluated: customUp | 0 |
2931 | QRenderRule subRule = renderRule(w, opt, PseudoElement_SpinBoxUpButton); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_SpinBoxUpButton); | - |
2932 | if (subRule.hasDrawable()) { never evaluated: subRule.hasDrawable() | 0 |
2933 | 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); | - |
2934 | subRule.drawRule(p, r); never executed (the execution status of this line is deduced): subRule.drawRule(p, r); | - |
2935 | QRenderRule subRule2 = renderRule(w, opt, PseudoElement_SpinBoxUpArrow); never executed (the execution status of this line is deduced): QRenderRule subRule2 = renderRule(w, opt, PseudoElement_SpinBoxUpArrow); | - |
2936 | 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); | - |
2937 | subRule2.drawRule(p, r); never executed (the execution status of this line is deduced): subRule2.drawRule(p, r); | - |
2938 | } else { | 0 |
2939 | spinOpt.subControls = QStyle::SC_SpinBoxUp; never executed (the execution status of this line is deduced): spinOpt.subControls = QStyle::SC_SpinBoxUp; | - |
2940 | QWindowsStyle::drawComplexControl(cc, &spinOpt, p, w); never executed (the execution status of this line is deduced): QWindowsStyle::drawComplexControl(cc, &spinOpt, p, w); | - |
2941 | } | 0 |
2942 | } | - |
2943 | | - |
2944 | if ((opt->subControls & QStyle::SC_SpinBoxDown) && customDown) { never evaluated: (opt->subControls & QStyle::SC_SpinBoxDown) never evaluated: customDown | 0 |
2945 | QRenderRule subRule = renderRule(w, opt, PseudoElement_SpinBoxDownButton); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_SpinBoxDownButton); | - |
2946 | if (subRule.hasDrawable()) { never evaluated: subRule.hasDrawable() | 0 |
2947 | 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); | - |
2948 | subRule.drawRule(p, r); never executed (the execution status of this line is deduced): subRule.drawRule(p, r); | - |
2949 | QRenderRule subRule2 = renderRule(w, opt, PseudoElement_SpinBoxDownArrow); never executed (the execution status of this line is deduced): QRenderRule subRule2 = renderRule(w, opt, PseudoElement_SpinBoxDownArrow); | - |
2950 | 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); | - |
2951 | subRule2.drawRule(p, r); never executed (the execution status of this line is deduced): subRule2.drawRule(p, r); | - |
2952 | } else { | 0 |
2953 | spinOpt.subControls = QStyle::SC_SpinBoxDown; never executed (the execution status of this line is deduced): spinOpt.subControls = QStyle::SC_SpinBoxDown; | - |
2954 | QWindowsStyle::drawComplexControl(cc, &spinOpt, p, w); never executed (the execution status of this line is deduced): QWindowsStyle::drawComplexControl(cc, &spinOpt, p, w); | - |
2955 | } | 0 |
2956 | } | - |
2957 | return; | 0 |
2958 | } | - |
2959 | break; | 0 |
2960 | #endif // QT_NO_SPINBOX | - |
2961 | | - |
2962 | case CC_GroupBox: | - |
2963 | if (const QStyleOptionGroupBox *gb = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)) { never evaluated: const QStyleOptionGroupBox *gb = qstyleoption_cast<const QStyleOptionGroupBox *>(opt) | 0 |
2964 | | - |
2965 | QRect labelRect, checkBoxRect, titleRect, frameRect; never executed (the execution status of this line is deduced): QRect labelRect, checkBoxRect, titleRect, frameRect; | - |
2966 | bool hasTitle = (gb->subControls & QStyle::SC_GroupBoxCheckBox) || !gb->text.isEmpty(); never evaluated: (gb->subControls & QStyle::SC_GroupBoxCheckBox) never evaluated: !gb->text.isEmpty() | 0 |
2967 | | - |
2968 | if (!rule.hasDrawable() && (!hasTitle || !hasStyleRule(w, PseudoElement_GroupBoxTitle)) never evaluated: !rule.hasDrawable() never evaluated: !hasTitle never evaluated: !hasStyleRule(w, PseudoElement_GroupBoxTitle) | 0 |
2969 | && !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 |
2970 | // let the native style draw the combobox if there is no style for it. | - |
2971 | break; | 0 |
2972 | } | - |
2973 | rule.drawBackground(p, opt->rect); never executed (the execution status of this line is deduced): rule.drawBackground(p, opt->rect); | - |
2974 | | - |
2975 | QRenderRule titleRule = renderRule(w, opt, PseudoElement_GroupBoxTitle); never executed (the execution status of this line is deduced): QRenderRule titleRule = renderRule(w, opt, PseudoElement_GroupBoxTitle); | - |
2976 | bool clipSet = false; never executed (the execution status of this line is deduced): bool clipSet = false; | - |
2977 | | - |
2978 | if (hasTitle) { never evaluated: hasTitle | 0 |
2979 | 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); | - |
2980 | //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. | - |
2981 | 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())); | - |
2982 | if (gb->subControls & QStyle::SC_GroupBoxCheckBox) { never evaluated: gb->subControls & QStyle::SC_GroupBoxCheckBox | 0 |
2983 | 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); | - |
2984 | titleRect = titleRule.boxRect(checkBoxRect.united(labelRect)); never executed (the execution status of this line is deduced): titleRect = titleRule.boxRect(checkBoxRect.united(labelRect)); | - |
2985 | } else { | 0 |
2986 | titleRect = titleRule.boxRect(labelRect); never executed (the execution status of this line is deduced): titleRect = titleRule.boxRect(labelRect); | - |
2987 | } | 0 |
2988 | if (!titleRule.hasBackground() || !titleRule.background()->isTransparent()) { never evaluated: !titleRule.hasBackground() never evaluated: !titleRule.background()->isTransparent() | 0 |
2989 | clipSet = true; never executed (the execution status of this line is deduced): clipSet = true; | - |
2990 | p->save(); never executed (the execution status of this line is deduced): p->save(); | - |
2991 | p->setClipRegion(QRegion(opt->rect) - titleRect); never executed (the execution status of this line is deduced): p->setClipRegion(QRegion(opt->rect) - titleRect); | - |
2992 | } | 0 |
2993 | } | 0 |
2994 | | - |
2995 | 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); | - |
2996 | QStyleOptionFrameV2 frame; never executed (the execution status of this line is deduced): QStyleOptionFrameV2 frame; | - |
2997 | frame.QStyleOption::operator=(*gb); never executed (the execution status of this line is deduced): frame.QStyleOption::operator=(*gb); | - |
2998 | frame.features = gb->features; never executed (the execution status of this line is deduced): frame.features = gb->features; | - |
2999 | frame.lineWidth = gb->lineWidth; never executed (the execution status of this line is deduced): frame.lineWidth = gb->lineWidth; | - |
3000 | frame.midLineWidth = gb->midLineWidth; never executed (the execution status of this line is deduced): frame.midLineWidth = gb->midLineWidth; | - |
3001 | frame.rect = frameRect; never executed (the execution status of this line is deduced): frame.rect = frameRect; | - |
3002 | drawPrimitive(PE_FrameGroupBox, &frame, p, w); never executed (the execution status of this line is deduced): drawPrimitive(PE_FrameGroupBox, &frame, p, w); | - |
3003 | | - |
3004 | if (clipSet) | 0 |
3005 | p->restore(); never executed: p->restore(); | 0 |
3006 | | - |
3007 | // draw background and frame of the title | - |
3008 | if (hasTitle) never evaluated: hasTitle | 0 |
3009 | titleRule.drawRule(p, titleRect); never executed: titleRule.drawRule(p, titleRect); | 0 |
3010 | | - |
3011 | // draw the indicator | - |
3012 | if (gb->subControls & QStyle::SC_GroupBoxCheckBox) { never evaluated: gb->subControls & QStyle::SC_GroupBoxCheckBox | 0 |
3013 | QStyleOptionButton box; never executed (the execution status of this line is deduced): QStyleOptionButton box; | - |
3014 | box.QStyleOption::operator=(*gb); never executed (the execution status of this line is deduced): box.QStyleOption::operator=(*gb); | - |
3015 | box.rect = checkBoxRect; never executed (the execution status of this line is deduced): box.rect = checkBoxRect; | - |
3016 | drawPrimitive(PE_IndicatorCheckBox, &box, p, w); never executed (the execution status of this line is deduced): drawPrimitive(PE_IndicatorCheckBox, &box, p, w); | - |
3017 | } | 0 |
3018 | | - |
3019 | // draw the text | - |
3020 | if (!gb->text.isEmpty()) { never evaluated: !gb->text.isEmpty() | 0 |
3021 | int alignment = int(Qt::AlignCenter | Qt::TextShowMnemonic); never executed (the execution status of this line is deduced): int alignment = int(Qt::AlignCenter | Qt::TextShowMnemonic); | - |
3022 | if (!styleHint(QStyle::SH_UnderlineShortcut, opt, w)) { never evaluated: !styleHint(QStyle::SH_UnderlineShortcut, opt, w) | 0 |
3023 | alignment |= Qt::TextHideMnemonic; never executed (the execution status of this line is deduced): alignment |= Qt::TextHideMnemonic; | - |
3024 | } | 0 |
3025 | | - |
3026 | QPalette pal = gb->palette; never executed (the execution status of this line is deduced): QPalette pal = gb->palette; | - |
3027 | if (gb->textColor.isValid()) never evaluated: gb->textColor.isValid() | 0 |
3028 | pal.setColor(QPalette::WindowText, gb->textColor); never executed: pal.setColor(QPalette::WindowText, gb->textColor); | 0 |
3029 | titleRule.configurePalette(&pal, QPalette::WindowText, QPalette::Window); never executed (the execution status of this line is deduced): titleRule.configurePalette(&pal, QPalette::WindowText, QPalette::Window); | - |
3030 | 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, | - |
3031 | gb->text, QPalette::WindowText); never executed (the execution status of this line is deduced): gb->text, QPalette::WindowText); | - |
3032 | | - |
3033 | if (gb->state & State_HasFocus) { never evaluated: gb->state & State_HasFocus | 0 |
3034 | QStyleOptionFocusRect fropt; never executed (the execution status of this line is deduced): QStyleOptionFocusRect fropt; | - |
3035 | fropt.QStyleOption::operator=(*gb); never executed (the execution status of this line is deduced): fropt.QStyleOption::operator=(*gb); | - |
3036 | fropt.rect = labelRect; never executed (the execution status of this line is deduced): fropt.rect = labelRect; | - |
3037 | drawPrimitive(PE_FrameFocusRect, &fropt, p, w); never executed (the execution status of this line is deduced): drawPrimitive(PE_FrameFocusRect, &fropt, p, w); | - |
3038 | } | 0 |
3039 | } | 0 |
3040 | | - |
3041 | return; | 0 |
3042 | } | - |
3043 | break; | 0 |
3044 | | - |
3045 | case CC_ToolButton: | - |
3046 | if (const QStyleOptionToolButton *tool = qstyleoption_cast<const QStyleOptionToolButton *>(opt)) { never evaluated: const QStyleOptionToolButton *tool = qstyleoption_cast<const QStyleOptionToolButton *>(opt) | 0 |
3047 | QStyleOptionToolButton toolOpt(*tool); never executed (the execution status of this line is deduced): QStyleOptionToolButton toolOpt(*tool); | - |
3048 | 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); | - |
3049 | toolOpt.font = rule.font.resolve(toolOpt.font); never executed (the execution status of this line is deduced): toolOpt.font = rule.font.resolve(toolOpt.font); | - |
3050 | toolOpt.rect = rule.borderRect(opt->rect); never executed (the execution status of this line is deduced): toolOpt.rect = rule.borderRect(opt->rect); | - |
3051 | 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)); | - |
3052 | bool customDropDown = tool->features & QStyleOptionToolButton::MenuButtonPopup; never executed (the execution status of this line is deduced): bool customDropDown = tool->features & QStyleOptionToolButton::MenuButtonPopup; | - |
3053 | if (rule.hasNativeBorder()) { never evaluated: rule.hasNativeBorder() | 0 |
3054 | if (tool->subControls & SC_ToolButton) { never evaluated: tool->subControls & SC_ToolButton | 0 |
3055 | //in some case (eg. the button is "auto raised") the style doesn't draw the background | - |
3056 | //so we need to draw the background. | - |
3057 | // use the same condition as in QCommonStyle | - |
3058 | State bflags = tool->state & ~State_Sunken; never executed (the execution status of this line is deduced): State bflags = tool->state & ~State_Sunken; | - |
3059 | 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 |
3060 | bflags &= ~State_Raised; never executed: bflags &= ~State_Raised; | 0 |
3061 | if (tool->state & State_Sunken && tool->activeSubControls & SC_ToolButton) never evaluated: tool->state & State_Sunken never evaluated: tool->activeSubControls & SC_ToolButton | 0 |
3062 | bflags |= State_Sunken; never executed: bflags |= State_Sunken; | 0 |
3063 | if (!(bflags & (State_Sunken | State_On | State_Raised))) never evaluated: !(bflags & (State_Sunken | State_On | State_Raised)) | 0 |
3064 | rule.drawBackground(p, toolOpt.rect); never executed: rule.drawBackground(p, toolOpt.rect); | 0 |
3065 | } | 0 |
3066 | customArrow = customArrow && hasStyleRule(w, PseudoElement_ToolButtonDownArrow); never evaluated: customArrow never evaluated: hasStyleRule(w, PseudoElement_ToolButtonDownArrow) | 0 |
3067 | if (customArrow) never evaluated: customArrow | 0 |
3068 | toolOpt.features &= ~QStyleOptionToolButton::HasMenu; never executed: toolOpt.features &= ~QStyleOptionToolButton::HasMenu; | 0 |
3069 | customDropDown = customDropDown && hasStyleRule(w, PseudoElement_ToolButtonMenu); never evaluated: customDropDown never evaluated: hasStyleRule(w, PseudoElement_ToolButtonMenu) | 0 |
3070 | if (customDropDown) never evaluated: customDropDown | 0 |
3071 | toolOpt.subControls &= ~QStyle::SC_ToolButtonMenu; never executed: toolOpt.subControls &= ~QStyle::SC_ToolButtonMenu; | 0 |
3072 | | - |
3073 | if (rule.baseStyleCanDraw() && !(tool->features & QStyleOptionToolButton::Arrow)) { never evaluated: rule.baseStyleCanDraw() never evaluated: !(tool->features & QStyleOptionToolButton::Arrow) | 0 |
3074 | baseStyle()->drawComplexControl(cc, &toolOpt, p, w); never executed (the execution status of this line is deduced): baseStyle()->drawComplexControl(cc, &toolOpt, p, w); | - |
3075 | } else { | 0 |
3076 | QWindowsStyle::drawComplexControl(cc, &toolOpt, p, w); never executed (the execution status of this line is deduced): QWindowsStyle::drawComplexControl(cc, &toolOpt, p, w); | - |
3077 | } | 0 |
3078 | | - |
3079 | if (!customArrow && !customDropDown) never evaluated: !customArrow never evaluated: !customDropDown | 0 |
3080 | return; | 0 |
3081 | } else { | 0 |
3082 | rule.drawRule(p, opt->rect); never executed (the execution status of this line is deduced): rule.drawRule(p, opt->rect); | - |
3083 | toolOpt.rect = rule.contentsRect(opt->rect); never executed (the execution status of this line is deduced): toolOpt.rect = rule.contentsRect(opt->rect); | - |
3084 | if (rule.hasFont) never evaluated: rule.hasFont | 0 |
3085 | toolOpt.font = rule.font; never executed: toolOpt.font = rule.font; | 0 |
3086 | drawControl(CE_ToolButtonLabel, &toolOpt, p, w); never executed (the execution status of this line is deduced): drawControl(CE_ToolButtonLabel, &toolOpt, p, w); | - |
3087 | } | 0 |
3088 | | - |
3089 | QRenderRule subRule = renderRule(w, opt, PseudoElement_ToolButtonMenu); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_ToolButtonMenu); | - |
3090 | 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); | - |
3091 | if (customDropDown) { never evaluated: customDropDown | 0 |
3092 | if (opt->subControls & QStyle::SC_ToolButtonMenu) { never evaluated: opt->subControls & QStyle::SC_ToolButtonMenu | 0 |
3093 | if (subRule.hasDrawable()) { never evaluated: subRule.hasDrawable() | 0 |
3094 | subRule.drawRule(p, r); never executed (the execution status of this line is deduced): subRule.drawRule(p, r); | - |
3095 | } else { | 0 |
3096 | toolOpt.rect = r; never executed (the execution status of this line is deduced): toolOpt.rect = r; | - |
3097 | baseStyle()->drawPrimitive(PE_IndicatorButtonDropDown, &toolOpt, p, w); never executed (the execution status of this line is deduced): baseStyle()->drawPrimitive(PE_IndicatorButtonDropDown, &toolOpt, p, w); | - |
3098 | } | 0 |
3099 | } | - |
3100 | } | 0 |
3101 | | - |
3102 | if (customArrow) { never evaluated: customArrow | 0 |
3103 | QRenderRule subRule2 = customDropDown ? renderRule(w, opt, PseudoElement_ToolButtonMenuArrow) never evaluated: customDropDown | 0 |
3104 | : renderRule(w, opt, PseudoElement_ToolButtonDownArrow); never executed (the execution status of this line is deduced): : renderRule(w, opt, PseudoElement_ToolButtonDownArrow); | - |
3105 | QRect r2 = customDropDown never evaluated: customDropDown | 0 |
3106 | ? 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) | - |
3107 | : 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); | - |
3108 | if (subRule2.hasDrawable()) { never evaluated: subRule2.hasDrawable() | 0 |
3109 | subRule2.drawRule(p, r2); never executed (the execution status of this line is deduced): subRule2.drawRule(p, r2); | - |
3110 | } else { | 0 |
3111 | toolOpt.rect = r2; never executed (the execution status of this line is deduced): toolOpt.rect = r2; | - |
3112 | 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); | - |
3113 | } | 0 |
3114 | } | - |
3115 | | - |
3116 | return; | 0 |
3117 | } | - |
3118 | break; | 0 |
3119 | | - |
3120 | #ifndef QT_NO_SCROLLBAR | - |
3121 | case CC_ScrollBar: | - |
3122 | if (const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt)) { partially evaluated: const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt) yes Evaluation Count:290 | no Evaluation Count:0 |
| 0-290 |
3123 | QStyleOptionSlider sbOpt(*sb); executed (the execution status of this line is deduced): QStyleOptionSlider sbOpt(*sb); | - |
3124 | if (!rule.hasDrawable()) { partially evaluated: !rule.hasDrawable() yes Evaluation Count:290 | no Evaluation Count:0 |
| 0-290 |
3125 | sbOpt.rect = rule.borderRect(opt->rect); executed (the execution status of this line is deduced): sbOpt.rect = rule.borderRect(opt->rect); | - |
3126 | rule.drawBackgroundImage(p, opt->rect); executed (the execution status of this line is deduced): rule.drawBackgroundImage(p, opt->rect); | - |
3127 | baseStyle()->drawComplexControl(cc, &sbOpt, p, w); executed (the execution status of this line is deduced): baseStyle()->drawComplexControl(cc, &sbOpt, p, w); | - |
3128 | } else { executed: } Execution Count:290 | 290 |
3129 | rule.drawRule(p, opt->rect); never executed (the execution status of this line is deduced): rule.drawRule(p, opt->rect); | - |
3130 | QWindowsStyle::drawComplexControl(cc, opt, p, w); never executed (the execution status of this line is deduced): QWindowsStyle::drawComplexControl(cc, opt, p, w); | - |
3131 | } | 0 |
3132 | return; executed: return; Execution Count:290 | 290 |
3133 | } | - |
3134 | break; | 0 |
3135 | #endif // QT_NO_SCROLLBAR | - |
3136 | | - |
3137 | #ifndef QT_NO_SLIDER | - |
3138 | case CC_Slider: | - |
3139 | if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) { never evaluated: const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt) | 0 |
3140 | rule.drawRule(p, opt->rect); never executed (the execution status of this line is deduced): rule.drawRule(p, opt->rect); | - |
3141 | | - |
3142 | QRenderRule grooveSubRule = renderRule(w, opt, PseudoElement_SliderGroove); never executed (the execution status of this line is deduced): QRenderRule grooveSubRule = renderRule(w, opt, PseudoElement_SliderGroove); | - |
3143 | QRenderRule handleSubRule = renderRule(w, opt, PseudoElement_SliderHandle); never executed (the execution status of this line is deduced): QRenderRule handleSubRule = renderRule(w, opt, PseudoElement_SliderHandle); | - |
3144 | if (!grooveSubRule.hasDrawable()) { never evaluated: !grooveSubRule.hasDrawable() | 0 |
3145 | QStyleOptionSlider slOpt(*slider); never executed (the execution status of this line is deduced): QStyleOptionSlider slOpt(*slider); | - |
3146 | bool handleHasRule = handleSubRule.hasDrawable(); never executed (the execution status of this line is deduced): bool handleHasRule = handleSubRule.hasDrawable(); | - |
3147 | // If the style specifies a different handler rule, draw the groove without the handler. | - |
3148 | if (handleHasRule) never evaluated: handleHasRule | 0 |
3149 | slOpt.subControls &= ~SC_SliderHandle; never executed: slOpt.subControls &= ~SC_SliderHandle; | 0 |
3150 | baseStyle()->drawComplexControl(cc, &slOpt, p, w); never executed (the execution status of this line is deduced): baseStyle()->drawComplexControl(cc, &slOpt, p, w); | - |
3151 | if (!handleHasRule) never evaluated: !handleHasRule | 0 |
3152 | return; | 0 |
3153 | } | 0 |
3154 | | - |
3155 | 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); | - |
3156 | if (slider->subControls & SC_SliderGroove) { never evaluated: slider->subControls & SC_SliderGroove | 0 |
3157 | grooveSubRule.drawRule(p, gr); never executed (the execution status of this line is deduced): grooveSubRule.drawRule(p, gr); | - |
3158 | } | 0 |
3159 | | - |
3160 | if (slider->subControls & SC_SliderHandle) { never evaluated: slider->subControls & SC_SliderHandle | 0 |
3161 | 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); | - |
3162 | | - |
3163 | QRenderRule subRule1 = renderRule(w, opt, PseudoElement_SliderSubPage); never executed (the execution status of this line is deduced): QRenderRule subRule1 = renderRule(w, opt, PseudoElement_SliderSubPage); | - |
3164 | if (subRule1.hasDrawable()) { never evaluated: subRule1.hasDrawable() | 0 |
3165 | QRect r(gr.topLeft(), never executed (the execution status of this line is deduced): QRect r(gr.topLeft(), | - |
3166 | slider->orientation == Qt::Horizontal never executed (the execution status of this line is deduced): slider->orientation == Qt::Horizontal | - |
3167 | ? 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) | - |
3168 | : 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)); | - |
3169 | subRule1.drawRule(p, r); never executed (the execution status of this line is deduced): subRule1.drawRule(p, r); | - |
3170 | } | 0 |
3171 | | - |
3172 | QRenderRule subRule2 = renderRule(w, opt, PseudoElement_SliderAddPage); never executed (the execution status of this line is deduced): QRenderRule subRule2 = renderRule(w, opt, PseudoElement_SliderAddPage); | - |
3173 | if (subRule2.hasDrawable()) { never evaluated: subRule2.hasDrawable() | 0 |
3174 | QRect r(slider->orientation == Qt::Horizontal never executed (the execution status of this line is deduced): QRect r(slider->orientation == Qt::Horizontal | - |
3175 | ? 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()) | - |
3176 | : 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), | - |
3177 | gr.bottomRight()); never executed (the execution status of this line is deduced): gr.bottomRight()); | - |
3178 | subRule2.drawRule(p, r); never executed (the execution status of this line is deduced): subRule2.drawRule(p, r); | - |
3179 | } | 0 |
3180 | | - |
3181 | handleSubRule.drawRule(p, handleSubRule.boxRect(hr, Margin)); never executed (the execution status of this line is deduced): handleSubRule.drawRule(p, handleSubRule.boxRect(hr, Margin)); | - |
3182 | } | 0 |
3183 | | - |
3184 | if (slider->subControls & SC_SliderTickmarks) { never evaluated: slider->subControls & SC_SliderTickmarks | 0 |
3185 | // TODO... | - |
3186 | } | 0 |
3187 | | - |
3188 | return; | 0 |
3189 | } | - |
3190 | break; | 0 |
3191 | #endif // QT_NO_SLIDER | - |
3192 | | - |
3193 | case CC_MdiControls: | - |
3194 | if (hasStyleRule(w, PseudoElement_MdiCloseButton) never evaluated: hasStyleRule(w, PseudoElement_MdiCloseButton) | 0 |
3195 | || hasStyleRule(w, PseudoElement_MdiNormalButton) never evaluated: hasStyleRule(w, PseudoElement_MdiNormalButton) | 0 |
3196 | || hasStyleRule(w, PseudoElement_MdiMinButton)) { never evaluated: hasStyleRule(w, PseudoElement_MdiMinButton) | 0 |
3197 | 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(); | - |
3198 | if (layout.isEmpty()) never evaluated: layout.isEmpty() | 0 |
3199 | layout = subControlLayout(QLatin1String("mNX")); never executed: layout = subControlLayout(QLatin1String("mNX")); | 0 |
3200 | | - |
3201 | QStyleOptionComplex optCopy(*opt); never executed (the execution status of this line is deduced): QStyleOptionComplex optCopy(*opt); | - |
3202 | optCopy.subControls = 0; never executed (the execution status of this line is deduced): optCopy.subControls = 0; | - |
3203 | for (int i = 0; i < layout.count(); i++) { never evaluated: i < layout.count() | 0 |
3204 | int layoutButton = layout[i].toInt(); never executed (the execution status of this line is deduced): int layoutButton = layout[i].toInt(); | - |
3205 | if (layoutButton < PseudoElement_MdiCloseButton never evaluated: layoutButton < PseudoElement_MdiCloseButton | 0 |
3206 | || layoutButton > PseudoElement_MdiNormalButton) never evaluated: layoutButton > PseudoElement_MdiNormalButton | 0 |
3207 | continue; never executed: continue; | 0 |
3208 | QStyle::SubControl control = knownPseudoElements[layoutButton].subControl; never executed (the execution status of this line is deduced): QStyle::SubControl control = knownPseudoElements[layoutButton].subControl; | - |
3209 | if (!(opt->subControls & control)) never evaluated: !(opt->subControls & control) | 0 |
3210 | continue; never executed: continue; | 0 |
3211 | QRenderRule subRule = renderRule(w, opt, layoutButton); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, layoutButton); | - |
3212 | if (subRule.hasDrawable()) { never evaluated: subRule.hasDrawable() | 0 |
3213 | 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); | - |
3214 | subRule.drawRule(p, rect); never executed (the execution status of this line is deduced): subRule.drawRule(p, rect); | - |
3215 | QIcon icon = standardIcon(subControlIcon(layoutButton), opt); never executed (the execution status of this line is deduced): QIcon icon = standardIcon(subControlIcon(layoutButton), opt); | - |
3216 | 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); | - |
3217 | } else { | 0 |
3218 | optCopy.subControls |= control; never executed (the execution status of this line is deduced): optCopy.subControls |= control; | - |
3219 | } | 0 |
3220 | } | - |
3221 | | - |
3222 | if (optCopy.subControls) never evaluated: optCopy.subControls | 0 |
3223 | baseStyle()->drawComplexControl(CC_MdiControls, &optCopy, p, w); never executed: baseStyle()->drawComplexControl(CC_MdiControls, &optCopy, p, w); | 0 |
3224 | return; | 0 |
3225 | } | - |
3226 | break; | 0 |
3227 | | - |
3228 | case CC_TitleBar: | - |
3229 | if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)) { never evaluated: const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt) | 0 |
3230 | QRenderRule subRule = renderRule(w, opt, PseudoElement_TitleBar); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_TitleBar); | - |
3231 | if (!subRule.hasDrawable() && !subRule.hasBox() && !subRule.hasBorder()) never evaluated: !subRule.hasDrawable() never evaluated: !subRule.hasBox() never evaluated: !subRule.hasBorder() | 0 |
3232 | break; | 0 |
3233 | subRule.drawRule(p, opt->rect); never executed (the execution status of this line is deduced): subRule.drawRule(p, opt->rect); | - |
3234 | 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); | - |
3235 | | - |
3236 | QRect ir; never executed (the execution status of this line is deduced): QRect ir; | - |
3237 | ir = layout[SC_TitleBarLabel]; never executed (the execution status of this line is deduced): ir = layout[SC_TitleBarLabel]; | - |
3238 | if (ir.isValid()) { never evaluated: ir.isValid() | 0 |
3239 | if (subRule.hasPalette()) never evaluated: subRule.hasPalette() | 0 |
3240 | p->setPen(subRule.palette()->foreground.color()); never executed: p->setPen(subRule.palette()->foreground.color()); | 0 |
3241 | p->fillRect(ir, Qt::white); never executed (the execution status of this line is deduced): p->fillRect(ir, Qt::white); | - |
3242 | 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); | - |
3243 | } | 0 |
3244 | | - |
3245 | QPixmap pm; never executed (the execution status of this line is deduced): QPixmap pm; | - |
3246 | | - |
3247 | ir = layout[SC_TitleBarSysMenu]; never executed (the execution status of this line is deduced): ir = layout[SC_TitleBarSysMenu]; | - |
3248 | if (ir.isValid()) { never evaluated: ir.isValid() | 0 |
3249 | QRenderRule subSubRule = renderRule(w, opt, PseudoElement_TitleBarSysMenu); never executed (the execution status of this line is deduced): QRenderRule subSubRule = renderRule(w, opt, PseudoElement_TitleBarSysMenu); | - |
3250 | subSubRule.drawRule(p, ir); never executed (the execution status of this line is deduced): subSubRule.drawRule(p, ir); | - |
3251 | ir = subSubRule.contentsRect(ir); never executed (the execution status of this line is deduced): ir = subSubRule.contentsRect(ir); | - |
3252 | if (!tb->icon.isNull()) { never evaluated: !tb->icon.isNull() | 0 |
3253 | tb->icon.paint(p, ir); never executed (the execution status of this line is deduced): tb->icon.paint(p, ir); | - |
3254 | } else { | 0 |
3255 | int iconSize = pixelMetric(PM_SmallIconSize, tb, w); never executed (the execution status of this line is deduced): int iconSize = pixelMetric(PM_SmallIconSize, tb, w); | - |
3256 | 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); | - |
3257 | drawItemPixmap(p, ir, Qt::AlignCenter, pm); never executed (the execution status of this line is deduced): drawItemPixmap(p, ir, Qt::AlignCenter, pm); | - |
3258 | } | 0 |
3259 | } | - |
3260 | | - |
3261 | ir = layout[SC_TitleBarCloseButton]; never executed (the execution status of this line is deduced): ir = layout[SC_TitleBarCloseButton]; | - |
3262 | if (ir.isValid()) { never evaluated: ir.isValid() | 0 |
3263 | QRenderRule subSubRule = renderRule(w, opt, PseudoElement_TitleBarCloseButton); never executed (the execution status of this line is deduced): QRenderRule subSubRule = renderRule(w, opt, PseudoElement_TitleBarCloseButton); | - |
3264 | subSubRule.drawRule(p, ir); never executed (the execution status of this line is deduced): subSubRule.drawRule(p, ir); | - |
3265 | | - |
3266 | QSize sz = subSubRule.contentsRect(ir).size(); never executed (the execution status of this line is deduced): QSize sz = subSubRule.contentsRect(ir).size(); | - |
3267 | if ((tb->titleBarFlags & Qt::WindowType_Mask) == Qt::Tool) never evaluated: (tb->titleBarFlags & Qt::WindowType_Mask) == Qt::Tool | 0 |
3268 | pm = standardIcon(SP_DockWidgetCloseButton, 0, w).pixmap(sz); never executed: pm = standardIcon(SP_DockWidgetCloseButton, 0, w).pixmap(sz); | 0 |
3269 | else | - |
3270 | pm = standardIcon(SP_TitleBarCloseButton, 0, w).pixmap(sz); never executed: pm = standardIcon(SP_TitleBarCloseButton, 0, w).pixmap(sz); | 0 |
3271 | drawItemPixmap(p, ir, Qt::AlignCenter, pm); never executed (the execution status of this line is deduced): drawItemPixmap(p, ir, Qt::AlignCenter, pm); | - |
3272 | } | 0 |
3273 | | - |
3274 | int pes[] = { never executed (the execution status of this line is deduced): int pes[] = { | - |
3275 | PseudoElement_TitleBarMaxButton, never executed (the execution status of this line is deduced): PseudoElement_TitleBarMaxButton, | - |
3276 | PseudoElement_TitleBarMinButton, never executed (the execution status of this line is deduced): PseudoElement_TitleBarMinButton, | - |
3277 | PseudoElement_TitleBarNormalButton, never executed (the execution status of this line is deduced): PseudoElement_TitleBarNormalButton, | - |
3278 | PseudoElement_TitleBarShadeButton, never executed (the execution status of this line is deduced): PseudoElement_TitleBarShadeButton, | - |
3279 | PseudoElement_TitleBarUnshadeButton, never executed (the execution status of this line is deduced): PseudoElement_TitleBarUnshadeButton, | - |
3280 | PseudoElement_TitleBarContextHelpButton never executed (the execution status of this line is deduced): PseudoElement_TitleBarContextHelpButton | - |
3281 | }; never executed (the execution status of this line is deduced): }; | - |
3282 | | - |
3283 | for (unsigned int i = 0; i < sizeof(pes)/sizeof(int); i++) { never evaluated: i < sizeof(pes)/sizeof(int) | 0 |
3284 | int pe = pes[i]; never executed (the execution status of this line is deduced): int pe = pes[i]; | - |
3285 | QStyle::SubControl sc = knownPseudoElements[pe].subControl; never executed (the execution status of this line is deduced): QStyle::SubControl sc = knownPseudoElements[pe].subControl; | - |
3286 | ir = layout[sc]; never executed (the execution status of this line is deduced): ir = layout[sc]; | - |
3287 | if (!ir.isValid()) never evaluated: !ir.isValid() | 0 |
3288 | continue; never executed: continue; | 0 |
3289 | QRenderRule subSubRule = renderRule(w, opt, pe); never executed (the execution status of this line is deduced): QRenderRule subSubRule = renderRule(w, opt, pe); | - |
3290 | subSubRule.drawRule(p, ir); never executed (the execution status of this line is deduced): subSubRule.drawRule(p, ir); | - |
3291 | 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()); | - |
3292 | drawItemPixmap(p, ir, Qt::AlignCenter, pm); never executed (the execution status of this line is deduced): drawItemPixmap(p, ir, Qt::AlignCenter, pm); | - |
3293 | } | 0 |
3294 | | - |
3295 | return; | 0 |
3296 | } | - |
3297 | break; | 0 |
3298 | | - |
3299 | | - |
3300 | default: | - |
3301 | break; | 0 |
3302 | } | - |
3303 | | - |
3304 | baseStyle()->drawComplexControl(cc, opt, p, w); never executed (the execution status of this line is deduced): baseStyle()->drawComplexControl(cc, opt, p, w); | - |
3305 | } | 0 |
3306 | | - |
3307 | void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter *p, | - |
3308 | const QWidget *w) const | - |
3309 | { | - |
3310 | RECURSION_GUARD(baseStyle()->drawControl(ce, opt, p, w); return) never executed: return; partially evaluated: globalStyleSheetStyle != 0 no Evaluation Count:0 | yes Evaluation Count:505 |
never evaluated: globalStyleSheetStyle != this | 0-505 |
3311 | | - |
3312 | QRenderRule rule = renderRule(w, opt); executed (the execution status of this line is deduced): QRenderRule rule = renderRule(w, opt); | - |
3313 | int pe1 = PseudoElement_None, pe2 = PseudoElement_None; executed (the execution status of this line is deduced): int pe1 = PseudoElement_None, pe2 = PseudoElement_None; | - |
3314 | bool fallback = false; executed (the execution status of this line is deduced): bool fallback = false; | - |
3315 | | - |
3316 | switch (ce) { | - |
3317 | case CE_ToolButtonLabel: | - |
3318 | if (const QStyleOptionToolButton *btn = qstyleoption_cast<const QStyleOptionToolButton *>(opt)) { never evaluated: const QStyleOptionToolButton *btn = qstyleoption_cast<const QStyleOptionToolButton *>(opt) | 0 |
3319 | if (rule.hasBox() || btn->features & QStyleOptionToolButton::Arrow) { never evaluated: rule.hasBox() never evaluated: btn->features & QStyleOptionToolButton::Arrow | 0 |
3320 | QCommonStyle::drawControl(ce, opt, p, w); never executed (the execution status of this line is deduced): QCommonStyle::drawControl(ce, opt, p, w); | - |
3321 | } else { | 0 |
3322 | QStyleOptionToolButton butOpt(*btn); never executed (the execution status of this line is deduced): QStyleOptionToolButton butOpt(*btn); | - |
3323 | 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); | - |
3324 | baseStyle()->drawControl(ce, &butOpt, p, w); never executed (the execution status of this line is deduced): baseStyle()->drawControl(ce, &butOpt, p, w); | - |
3325 | } | 0 |
3326 | return; | 0 |
3327 | } | - |
3328 | break; | 0 |
3329 | | - |
3330 | case CE_FocusFrame: | - |
3331 | if (!rule.hasNativeBorder()) { never evaluated: !rule.hasNativeBorder() | 0 |
3332 | rule.drawBorder(p, opt->rect); never executed (the execution status of this line is deduced): rule.drawBorder(p, opt->rect); | - |
3333 | return; | 0 |
3334 | } | - |
3335 | break; | 0 |
3336 | | - |
3337 | case CE_PushButton: | - |
3338 | if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) { never evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt) | 0 |
3339 | 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 |
3340 | ((btn->features & QStyleOptionButton::HasMenu) && hasStyleRule(w, PseudoElement_PushButtonMenuIndicator))) { never evaluated: (btn->features & QStyleOptionButton::HasMenu) never evaluated: hasStyleRule(w, PseudoElement_PushButtonMenuIndicator) | 0 |
3341 | ParentStyle::drawControl(ce, opt, p, w); never executed (the execution status of this line is deduced): ParentStyle::drawControl(ce, opt, p, w); | - |
3342 | return; | 0 |
3343 | } | - |
3344 | } | 0 |
3345 | break; | 0 |
3346 | case CE_PushButtonBevel: | - |
3347 | if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) { never evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt) | 0 |
3348 | QStyleOptionButton btnOpt(*btn); never executed (the execution status of this line is deduced): QStyleOptionButton btnOpt(*btn); | - |
3349 | btnOpt.rect = rule.borderRect(opt->rect); never executed (the execution status of this line is deduced): btnOpt.rect = rule.borderRect(opt->rect); | - |
3350 | if (rule.hasNativeBorder()) { never evaluated: rule.hasNativeBorder() | 0 |
3351 | rule.drawBackgroundImage(p, btnOpt.rect); never executed (the execution status of this line is deduced): rule.drawBackgroundImage(p, btnOpt.rect); | - |
3352 | 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); | - |
3353 | bool customMenu = (btn->features & QStyleOptionButton::HasMenu never evaluated: btn->features & QStyleOptionButton::HasMenu | 0 |
3354 | && hasStyleRule(w, PseudoElement_PushButtonMenuIndicator)); never evaluated: hasStyleRule(w, PseudoElement_PushButtonMenuIndicator) | 0 |
3355 | if (customMenu) never evaluated: customMenu | 0 |
3356 | btnOpt.features &= ~QStyleOptionButton::HasMenu; never executed: btnOpt.features &= ~QStyleOptionButton::HasMenu; | 0 |
3357 | if (rule.baseStyleCanDraw()) { never evaluated: rule.baseStyleCanDraw() | 0 |
3358 | baseStyle()->drawControl(ce, &btnOpt, p, w); never executed (the execution status of this line is deduced): baseStyle()->drawControl(ce, &btnOpt, p, w); | - |
3359 | } else { | 0 |
3360 | QWindowsStyle::drawControl(ce, &btnOpt, p, w); never executed (the execution status of this line is deduced): QWindowsStyle::drawControl(ce, &btnOpt, p, w); | - |
3361 | } | 0 |
3362 | if (!customMenu) never evaluated: !customMenu | 0 |
3363 | return; | 0 |
3364 | } else { | 0 |
3365 | rule.drawRule(p, opt->rect); never executed (the execution status of this line is deduced): rule.drawRule(p, opt->rect); | - |
3366 | } | 0 |
3367 | | - |
3368 | if (btn->features & QStyleOptionButton::HasMenu) { never evaluated: btn->features & QStyleOptionButton::HasMenu | 0 |
3369 | QRenderRule subRule = renderRule(w, opt, PseudoElement_PushButtonMenuIndicator); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_PushButtonMenuIndicator); | - |
3370 | 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); | - |
3371 | if (subRule.hasDrawable()) { never evaluated: subRule.hasDrawable() | 0 |
3372 | subRule.drawRule(p, ir); never executed (the execution status of this line is deduced): subRule.drawRule(p, ir); | - |
3373 | } else { | 0 |
3374 | btnOpt.rect = ir; never executed (the execution status of this line is deduced): btnOpt.rect = ir; | - |
3375 | baseStyle()->drawPrimitive(PE_IndicatorArrowDown, &btnOpt, p, w); never executed (the execution status of this line is deduced): baseStyle()->drawPrimitive(PE_IndicatorArrowDown, &btnOpt, p, w); | - |
3376 | } | 0 |
3377 | } | - |
3378 | } | 0 |
3379 | return; | 0 |
3380 | | - |
3381 | case CE_PushButtonLabel: | - |
3382 | if (const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton *>(opt)) { never evaluated: const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton *>(opt) | 0 |
3383 | QStyleOptionButton butOpt(*button); never executed (the execution status of this line is deduced): QStyleOptionButton butOpt(*button); | - |
3384 | 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); | - |
3385 | if (rule.hasPosition() && rule.position()->textAlignment != 0) { never evaluated: rule.hasPosition() never evaluated: rule.position()->textAlignment != 0 | 0 |
3386 | Qt::Alignment textAlignment = rule.position()->textAlignment; never executed (the execution status of this line is deduced): Qt::Alignment textAlignment = rule.position()->textAlignment; | - |
3387 | QRect textRect = button->rect; never executed (the execution status of this line is deduced): QRect textRect = button->rect; | - |
3388 | uint tf = Qt::TextShowMnemonic; never executed (the execution status of this line is deduced): uint tf = Qt::TextShowMnemonic; | - |
3389 | 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; | - |
3390 | tf |= (textAlignment & verticalAlignMask) ? (textAlignment & verticalAlignMask) : Qt::AlignVCenter; never evaluated: (textAlignment & verticalAlignMask) | 0 |
3391 | if (!styleHint(SH_UnderlineShortcut, button, w)) never evaluated: !styleHint(SH_UnderlineShortcut, button, w) | 0 |
3392 | tf |= Qt::TextHideMnemonic; never executed: tf |= Qt::TextHideMnemonic; | 0 |
3393 | if (!button->icon.isNull()) { never evaluated: !button->icon.isNull() | 0 |
3394 | //Group both icon and text | - |
3395 | QRect iconRect; never executed (the execution status of this line is deduced): QRect iconRect; | - |
3396 | QIcon::Mode mode = button->state & State_Enabled ? QIcon::Normal : QIcon::Disabled; never evaluated: button->state & State_Enabled | 0 |
3397 | if (mode == QIcon::Normal && button->state & State_HasFocus) never evaluated: mode == QIcon::Normal never evaluated: button->state & State_HasFocus | 0 |
3398 | mode = QIcon::Active; never executed: mode = QIcon::Active; | 0 |
3399 | QIcon::State state = QIcon::Off; never executed (the execution status of this line is deduced): QIcon::State state = QIcon::Off; | - |
3400 | if (button->state & State_On) never evaluated: button->state & State_On | 0 |
3401 | state = QIcon::On; never executed: state = QIcon::On; | 0 |
3402 | | - |
3403 | 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); | - |
3404 | int labelWidth = pixmap.width(); never executed (the execution status of this line is deduced): int labelWidth = pixmap.width(); | - |
3405 | int labelHeight = pixmap.height(); never executed (the execution status of this line is deduced): int labelHeight = pixmap.height(); | - |
3406 | int iconSpacing = 4;//### 4 is currently hardcoded in QPushButton::sizeHint() never executed (the execution status of this line is deduced): int iconSpacing = 4; | - |
3407 | 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(); | - |
3408 | if (!button->text.isEmpty()) never evaluated: !button->text.isEmpty() | 0 |
3409 | labelWidth += (textWidth + iconSpacing); never executed: labelWidth += (textWidth + iconSpacing); | 0 |
3410 | | - |
3411 | //Determine label alignment: | - |
3412 | if (textAlignment & Qt::AlignLeft) { /*left*/ never evaluated: textAlignment & Qt::AlignLeft | 0 |
3413 | 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, | - |
3414 | pixmap.width(), pixmap.height()); never executed (the execution status of this line is deduced): pixmap.width(), pixmap.height()); | - |
3415 | } else if (textAlignment & Qt::AlignHCenter) { /* center */ never executed: } never evaluated: textAlignment & Qt::AlignHCenter | 0 |
3416 | 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, | - |
3417 | textRect.y() + (textRect.height() - labelHeight) / 2, never executed (the execution status of this line is deduced): textRect.y() + (textRect.height() - labelHeight) / 2, | - |
3418 | pixmap.width(), pixmap.height()); never executed (the execution status of this line is deduced): pixmap.width(), pixmap.height()); | - |
3419 | } else { /*right*/ | 0 |
3420 | iconRect = QRect(textRect.x() + textRect.width() - labelWidth, never executed (the execution status of this line is deduced): iconRect = QRect(textRect.x() + textRect.width() - labelWidth, | - |
3421 | textRect.y() + (textRect.height() - labelHeight) / 2, never executed (the execution status of this line is deduced): textRect.y() + (textRect.height() - labelHeight) / 2, | - |
3422 | pixmap.width(), pixmap.height()); never executed (the execution status of this line is deduced): pixmap.width(), pixmap.height()); | - |
3423 | } | 0 |
3424 | | - |
3425 | iconRect = visualRect(button->direction, textRect, iconRect); never executed (the execution status of this line is deduced): iconRect = visualRect(button->direction, textRect, iconRect); | - |
3426 | | - |
3427 | tf |= Qt::AlignLeft; //left align, we adjust the text-rect instead never executed (the execution status of this line is deduced): tf |= Qt::AlignLeft; | - |
3428 | | - |
3429 | if (button->direction == Qt::RightToLeft) never evaluated: button->direction == Qt::RightToLeft | 0 |
3430 | textRect.setRight(iconRect.left() - iconSpacing); never executed: textRect.setRight(iconRect.left() - iconSpacing); | 0 |
3431 | else | - |
3432 | textRect.setLeft(iconRect.left() + iconRect.width() + iconSpacing); never executed: textRect.setLeft(iconRect.left() + iconRect.width() + iconSpacing); | 0 |
3433 | | - |
3434 | if (button->state & (State_On | State_Sunken)) never evaluated: button->state & (State_On | State_Sunken) | 0 |
3435 | iconRect.translate(pixelMetric(PM_ButtonShiftHorizontal, opt, w), never executed: iconRect.translate(pixelMetric(PM_ButtonShiftHorizontal, opt, w), pixelMetric(PM_ButtonShiftVertical, opt, w)); | 0 |
3436 | pixelMetric(PM_ButtonShiftVertical, opt, w)); never executed: iconRect.translate(pixelMetric(PM_ButtonShiftHorizontal, opt, w), pixelMetric(PM_ButtonShiftVertical, opt, w)); | 0 |
3437 | p->drawPixmap(iconRect, pixmap); never executed (the execution status of this line is deduced): p->drawPixmap(iconRect, pixmap); | - |
3438 | } else { | 0 |
3439 | tf |= textAlignment; never executed (the execution status of this line is deduced): tf |= textAlignment; | - |
3440 | } | 0 |
3441 | if (button->state & (State_On | State_Sunken)) never evaluated: button->state & (State_On | State_Sunken) | 0 |
3442 | textRect.translate(pixelMetric(PM_ButtonShiftHorizontal, opt, w), never executed: textRect.translate(pixelMetric(PM_ButtonShiftHorizontal, opt, w), pixelMetric(PM_ButtonShiftVertical, opt, w)); | 0 |
3443 | pixelMetric(PM_ButtonShiftVertical, opt, w)); never executed: textRect.translate(pixelMetric(PM_ButtonShiftHorizontal, opt, w), pixelMetric(PM_ButtonShiftVertical, opt, w)); | 0 |
3444 | | - |
3445 | if (button->features & QStyleOptionButton::HasMenu) { never evaluated: button->features & QStyleOptionButton::HasMenu | 0 |
3446 | int indicatorSize = pixelMetric(PM_MenuButtonIndicator, button, w); never executed (the execution status of this line is deduced): int indicatorSize = pixelMetric(PM_MenuButtonIndicator, button, w); | - |
3447 | if (button->direction == Qt::LeftToRight) never evaluated: button->direction == Qt::LeftToRight | 0 |
3448 | textRect = textRect.adjusted(0, 0, -indicatorSize, 0); never executed: textRect = textRect.adjusted(0, 0, -indicatorSize, 0); | 0 |
3449 | else | - |
3450 | textRect = textRect.adjusted(indicatorSize, 0, 0, 0); never executed: textRect = textRect.adjusted(indicatorSize, 0, 0, 0); | 0 |
3451 | } | - |
3452 | 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), | - |
3453 | button->text, QPalette::ButtonText); never executed (the execution status of this line is deduced): button->text, QPalette::ButtonText); | - |
3454 | } else { | 0 |
3455 | ParentStyle::drawControl(ce, &butOpt, p, w); never executed (the execution status of this line is deduced): ParentStyle::drawControl(ce, &butOpt, p, w); | - |
3456 | } | 0 |
3457 | } | - |
3458 | return; | 0 |
3459 | | - |
3460 | case CE_RadioButton: | - |
3461 | case CE_CheckBox: | - |
3462 | 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 |
3463 | rule.drawRule(p, opt->rect); never executed (the execution status of this line is deduced): rule.drawRule(p, opt->rect); | - |
3464 | ParentStyle::drawControl(ce, opt, p, w); never executed (the execution status of this line is deduced): ParentStyle::drawControl(ce, opt, p, w); | - |
3465 | return; | 0 |
3466 | } else if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) { never evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt) | 0 |
3467 | QStyleOptionButton butOpt(*btn); never executed (the execution status of this line is deduced): QStyleOptionButton butOpt(*btn); | - |
3468 | 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); | - |
3469 | baseStyle()->drawControl(ce, &butOpt, p, w); never executed (the execution status of this line is deduced): baseStyle()->drawControl(ce, &butOpt, p, w); | - |
3470 | return; | 0 |
3471 | } | - |
3472 | break; | 0 |
3473 | case CE_RadioButtonLabel: | - |
3474 | case CE_CheckBoxLabel: | - |
3475 | if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) { never evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt) | 0 |
3476 | QStyleOptionButton butOpt(*btn); never executed (the execution status of this line is deduced): QStyleOptionButton butOpt(*btn); | - |
3477 | 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); | - |
3478 | ParentStyle::drawControl(ce, &butOpt, p, w); never executed (the execution status of this line is deduced): ParentStyle::drawControl(ce, &butOpt, p, w); | - |
3479 | } | 0 |
3480 | return; | 0 |
3481 | | - |
3482 | case CE_Splitter: | - |
3483 | pe1 = PseudoElement_SplitterHandle; never executed (the execution status of this line is deduced): pe1 = PseudoElement_SplitterHandle; | - |
3484 | break; | 0 |
3485 | | - |
3486 | case CE_ToolBar: | - |
3487 | if (rule.hasBackground()) { never evaluated: rule.hasBackground() | 0 |
3488 | rule.drawBackground(p, opt->rect); never executed (the execution status of this line is deduced): rule.drawBackground(p, opt->rect); | - |
3489 | } | 0 |
3490 | if (rule.hasBorder()) { never evaluated: rule.hasBorder() | 0 |
3491 | rule.drawBorder(p, rule.borderRect(opt->rect)); never executed (the execution status of this line is deduced): rule.drawBorder(p, rule.borderRect(opt->rect)); | - |
3492 | } else { | 0 |
3493 | #ifndef QT_NO_TOOLBAR | - |
3494 | if (const QStyleOptionToolBar *tb = qstyleoption_cast<const QStyleOptionToolBar *>(opt)) { never evaluated: const QStyleOptionToolBar *tb = qstyleoption_cast<const QStyleOptionToolBar *>(opt) | 0 |
3495 | QStyleOptionToolBar newTb(*tb); never executed (the execution status of this line is deduced): QStyleOptionToolBar newTb(*tb); | - |
3496 | newTb.rect = rule.borderRect(opt->rect); never executed (the execution status of this line is deduced): newTb.rect = rule.borderRect(opt->rect); | - |
3497 | baseStyle()->drawControl(ce, &newTb, p, w); never executed (the execution status of this line is deduced): baseStyle()->drawControl(ce, &newTb, p, w); | - |
3498 | } | 0 |
3499 | #endif // QT_NO_TOOLBAR | - |
3500 | } | 0 |
3501 | return; | 0 |
3502 | | - |
3503 | case CE_MenuEmptyArea: | - |
3504 | case CE_MenuBarEmptyArea: | - |
3505 | if (rule.hasDrawable()) { never evaluated: rule.hasDrawable() | 0 |
3506 | // Drawn by PE_Widget | - |
3507 | return; | 0 |
3508 | } | - |
3509 | break; | 0 |
3510 | | - |
3511 | case CE_MenuTearoff: | - |
3512 | case CE_MenuScroller: | - |
3513 | if (const QStyleOptionMenuItem *m = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) { never evaluated: const QStyleOptionMenuItem *m = qstyleoption_cast<const QStyleOptionMenuItem *>(opt) | 0 |
3514 | QStyleOptionMenuItem mi(*m); never executed (the execution status of this line is deduced): QStyleOptionMenuItem mi(*m); | - |
3515 | int pe = ce == CE_MenuTearoff ? PseudoElement_MenuTearoff : PseudoElement_MenuScroller; never evaluated: ce == CE_MenuTearoff | 0 |
3516 | QRenderRule subRule = renderRule(w, opt, pe); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, pe); | - |
3517 | mi.rect = subRule.contentsRect(opt->rect); never executed (the execution status of this line is deduced): mi.rect = subRule.contentsRect(opt->rect); | - |
3518 | 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); | - |
3519 | 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); | - |
3520 | | - |
3521 | if (subRule.hasDrawable()) { never evaluated: subRule.hasDrawable() | 0 |
3522 | subRule.drawRule(p, opt->rect); never executed (the execution status of this line is deduced): subRule.drawRule(p, opt->rect); | - |
3523 | } else { | 0 |
3524 | baseStyle()->drawControl(ce, &mi, p, w); never executed (the execution status of this line is deduced): baseStyle()->drawControl(ce, &mi, p, w); | - |
3525 | } | 0 |
3526 | } | - |
3527 | return; | 0 |
3528 | | - |
3529 | case CE_MenuItem: | - |
3530 | if (const QStyleOptionMenuItem *m = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) { never evaluated: const QStyleOptionMenuItem *m = qstyleoption_cast<const QStyleOptionMenuItem *>(opt) | 0 |
3531 | QStyleOptionMenuItem mi(*m); never executed (the execution status of this line is deduced): QStyleOptionMenuItem mi(*m); | - |
3532 | | - |
3533 | int pseudo = (mi.menuItemType == QStyleOptionMenuItem::Separator) ? PseudoElement_MenuSeparator : PseudoElement_Item; never evaluated: (mi.menuItemType == QStyleOptionMenuItem::Separator) | 0 |
3534 | QRenderRule subRule = renderRule(w, opt, pseudo); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, pseudo); | - |
3535 | mi.rect = subRule.contentsRect(opt->rect); never executed (the execution status of this line is deduced): mi.rect = subRule.contentsRect(opt->rect); | - |
3536 | 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); | - |
3537 | 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); | - |
3538 | 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); | - |
3539 | 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); | - |
3540 | QFont oldFont = p->font(); never executed (the execution status of this line is deduced): QFont oldFont = p->font(); | - |
3541 | if (subRule.hasFont) never evaluated: subRule.hasFont | 0 |
3542 | p->setFont(subRule.font.resolve(p->font())); never executed: p->setFont(subRule.font.resolve(p->font())); | 0 |
3543 | | - |
3544 | // We fall back to drawing with the style sheet code whenever at least one of the | - |
3545 | // items are styled in an incompatible way, such as having a background image. | - |
3546 | 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); | - |
3547 | | - |
3548 | if ((pseudo == PseudoElement_MenuSeparator) && subRule.hasDrawable()) { never evaluated: (pseudo == PseudoElement_MenuSeparator) never evaluated: subRule.hasDrawable() | 0 |
3549 | subRule.drawRule(p, opt->rect); never executed (the execution status of this line is deduced): subRule.drawRule(p, opt->rect); | - |
3550 | } else if ((pseudo == PseudoElement_Item) never executed: } never evaluated: (pseudo == PseudoElement_Item) | 0 |
3551 | && (allRules.hasBox() || allRules.hasBorder() never evaluated: allRules.hasBox() never evaluated: allRules.hasBorder() | 0 |
3552 | || (allRules.background() && !allRules.background()->pixmap.isNull()))) { never evaluated: allRules.background() never evaluated: !allRules.background()->pixmap.isNull() | 0 |
3553 | subRule.drawRule(p, opt->rect); never executed (the execution status of this line is deduced): subRule.drawRule(p, opt->rect); | - |
3554 | if (subRule.hasBackground()) { never evaluated: subRule.hasBackground() | 0 |
3555 | mi.palette.setBrush(QPalette::Highlight, Qt::NoBrush); never executed (the execution status of this line is deduced): mi.palette.setBrush(QPalette::Highlight, Qt::NoBrush); | - |
3556 | mi.palette.setBrush(QPalette::Button, Qt::NoBrush); never executed (the execution status of this line is deduced): mi.palette.setBrush(QPalette::Button, Qt::NoBrush); | - |
3557 | } else { | 0 |
3558 | 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)); | - |
3559 | } | 0 |
3560 | 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)); | - |
3561 | | - |
3562 | bool checkable = mi.checkType != QStyleOptionMenuItem::NotCheckable; never executed (the execution status of this line is deduced): bool checkable = mi.checkType != QStyleOptionMenuItem::NotCheckable; | - |
3563 | bool checked = checkable ? mi.checked : false; never evaluated: checkable | 0 |
3564 | | - |
3565 | bool dis = !(opt->state & QStyle::State_Enabled), never executed (the execution status of this line is deduced): bool dis = !(opt->state & QStyle::State_Enabled), | - |
3566 | act = opt->state & QStyle::State_Selected; never executed (the execution status of this line is deduced): act = opt->state & QStyle::State_Selected; | - |
3567 | | - |
3568 | if (!mi.icon.isNull()) { never evaluated: !mi.icon.isNull() | 0 |
3569 | QIcon::Mode mode = dis ? QIcon::Disabled : QIcon::Normal; | 0 |
3570 | if (act && !dis) never evaluated: act never evaluated: !dis | 0 |
3571 | mode = QIcon::Active; never executed: mode = QIcon::Active; | 0 |
3572 | QPixmap pixmap; never executed (the execution status of this line is deduced): QPixmap pixmap; | - |
3573 | if (checked) | 0 |
3574 | pixmap = mi.icon.pixmap(pixelMetric(PM_SmallIconSize), mode, QIcon::On); never executed: pixmap = mi.icon.pixmap(pixelMetric(PM_SmallIconSize), mode, QIcon::On); | 0 |
3575 | else | - |
3576 | pixmap = mi.icon.pixmap(pixelMetric(PM_SmallIconSize), mode); never executed: pixmap = mi.icon.pixmap(pixelMetric(PM_SmallIconSize), mode); | 0 |
3577 | int pixw = pixmap.width(); never executed (the execution status of this line is deduced): int pixw = pixmap.width(); | - |
3578 | int pixh = pixmap.height(); never executed (the execution status of this line is deduced): int pixh = pixmap.height(); | - |
3579 | QRenderRule iconRule = renderRule(w, opt, PseudoElement_MenuIcon); never executed (the execution status of this line is deduced): QRenderRule iconRule = renderRule(w, opt, PseudoElement_MenuIcon); | - |
3580 | if (!iconRule.hasGeometry()) { never evaluated: !iconRule.hasGeometry() | 0 |
3581 | 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); | - |
3582 | } else { | 0 |
3583 | iconRule.geo->width = pixw; never executed (the execution status of this line is deduced): iconRule.geo->width = pixw; | - |
3584 | iconRule.geo->height = pixh; never executed (the execution status of this line is deduced): iconRule.geo->height = pixh; | - |
3585 | } | 0 |
3586 | 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); | - |
3587 | iconRule.drawRule(p, iconRect); never executed (the execution status of this line is deduced): iconRule.drawRule(p, iconRect); | - |
3588 | QRect pmr(0, 0, pixw, pixh); never executed (the execution status of this line is deduced): QRect pmr(0, 0, pixw, pixh); | - |
3589 | pmr.moveCenter(iconRect.center()); never executed (the execution status of this line is deduced): pmr.moveCenter(iconRect.center()); | - |
3590 | p->drawPixmap(pmr.topLeft(), pixmap); never executed (the execution status of this line is deduced): p->drawPixmap(pmr.topLeft(), pixmap); | - |
3591 | } else if (checkable) { never executed: } never evaluated: checkable | 0 |
3592 | QRenderRule subSubRule = renderRule(w, opt, PseudoElement_MenuCheckMark); never executed (the execution status of this line is deduced): QRenderRule subSubRule = renderRule(w, opt, PseudoElement_MenuCheckMark); | - |
3593 | if (subSubRule.hasDrawable() || checked) { never evaluated: subSubRule.hasDrawable() never evaluated: checked | 0 |
3594 | QStyleOptionMenuItem newMi = mi; never executed (the execution status of this line is deduced): QStyleOptionMenuItem newMi = mi; | - |
3595 | 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); | - |
3596 | drawPrimitive(PE_IndicatorMenuCheckMark, &newMi, p, w); never executed (the execution status of this line is deduced): drawPrimitive(PE_IndicatorMenuCheckMark, &newMi, p, w); | - |
3597 | } | 0 |
3598 | } | 0 |
3599 | | - |
3600 | QRect textRect = subRule.contentsRect(opt->rect); never executed (the execution status of this line is deduced): QRect textRect = subRule.contentsRect(opt->rect); | - |
3601 | textRect.setWidth(textRect.width() - mi.tabWidth); never executed (the execution status of this line is deduced): textRect.setWidth(textRect.width() - mi.tabWidth); | - |
3602 | QString s = mi.text; never executed (the execution status of this line is deduced): QString s = mi.text; | - |
3603 | p->setPen(mi.palette.buttonText().color()); never executed (the execution status of this line is deduced): p->setPen(mi.palette.buttonText().color()); | - |
3604 | if (!s.isEmpty()) { never evaluated: !s.isEmpty() | 0 |
3605 | 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; | - |
3606 | if (!styleHint(SH_UnderlineShortcut, &mi, w)) never evaluated: !styleHint(SH_UnderlineShortcut, &mi, w) | 0 |
3607 | text_flags |= Qt::TextHideMnemonic; never executed: text_flags |= Qt::TextHideMnemonic; | 0 |
3608 | int t = s.indexOf(QLatin1Char('\t')); never executed (the execution status of this line is deduced): int t = s.indexOf(QLatin1Char('\t')); | - |
3609 | if (t >= 0) { | 0 |
3610 | QRect vShortcutRect = visualRect(opt->direction, mi.rect, never executed (the execution status of this line is deduced): QRect vShortcutRect = visualRect(opt->direction, mi.rect, | - |
3611 | 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()))); | - |
3612 | 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)); | - |
3613 | s = s.left(t); never executed (the execution status of this line is deduced): s = s.left(t); | - |
3614 | } | 0 |
3615 | 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)); | - |
3616 | } | 0 |
3617 | | - |
3618 | if (mi.menuItemType == QStyleOptionMenuItem::SubMenu) {// draw sub menu arrow never evaluated: mi.menuItemType == QStyleOptionMenuItem::SubMenu | 0 |
3619 | PrimitiveElement arrow = (opt->direction == Qt::RightToLeft) ? PE_IndicatorArrowLeft : PE_IndicatorArrowRight; never evaluated: (opt->direction == Qt::RightToLeft) | 0 |
3620 | QRenderRule subRule2 = renderRule(w, opt, PseudoElement_MenuRightArrow); never executed (the execution status of this line is deduced): QRenderRule subRule2 = renderRule(w, opt, PseudoElement_MenuRightArrow); | - |
3621 | 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); | - |
3622 | drawPrimitive(arrow, &mi, p, w); never executed (the execution status of this line is deduced): drawPrimitive(arrow, &mi, p, w); | - |
3623 | } | 0 |
3624 | } 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 |
3625 | QWindowsStyle::drawControl(ce, &mi, p, w); never executed (the execution status of this line is deduced): QWindowsStyle::drawControl(ce, &mi, p, w); | - |
3626 | if (mi.checkType != QStyleOptionMenuItem::NotCheckable && !mi.checked) { never evaluated: mi.checkType != QStyleOptionMenuItem::NotCheckable never evaluated: !mi.checked | 0 |
3627 | // We have a style defined, but QWindowsStyle won't draw anything if not checked. | - |
3628 | // So we mimick what QWindowsStyle would do. | - |
3629 | 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); | - |
3630 | 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())); | - |
3631 | 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 |
3632 | 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)); | - |
3633 | } else { | 0 |
3634 | 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); | - |
3635 | 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); | - |
3636 | } | 0 |
3637 | QRenderRule subSubRule = renderRule(w, opt, PseudoElement_MenuCheckMark); never executed (the execution status of this line is deduced): QRenderRule subSubRule = renderRule(w, opt, PseudoElement_MenuCheckMark); | - |
3638 | if (subSubRule.hasDrawable()) { never evaluated: subSubRule.hasDrawable() | 0 |
3639 | QStyleOptionMenuItem newMi(mi); never executed (the execution status of this line is deduced): QStyleOptionMenuItem newMi(mi); | - |
3640 | 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, | - |
3641 | mi.rect.y() + QWindowsStylePrivate::windowsItemFrame, never executed (the execution status of this line is deduced): mi.rect.y() + QWindowsStylePrivate::windowsItemFrame, | - |
3642 | checkcol - 2 * QWindowsStylePrivate::windowsItemFrame, never executed (the execution status of this line is deduced): checkcol - 2 * QWindowsStylePrivate::windowsItemFrame, | - |
3643 | mi.rect.height() - 2 * QWindowsStylePrivate::windowsItemFrame)); never executed (the execution status of this line is deduced): mi.rect.height() - 2 * QWindowsStylePrivate::windowsItemFrame)); | - |
3644 | drawPrimitive(PE_IndicatorMenuCheckMark, &newMi, p, w); never executed (the execution status of this line is deduced): drawPrimitive(PE_IndicatorMenuCheckMark, &newMi, p, w); | - |
3645 | } | 0 |
3646 | } | 0 |
3647 | } else { | 0 |
3648 | 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 |
3649 | mi.palette.setColor(QPalette::Window, Qt::transparent); never executed (the execution status of this line is deduced): mi.palette.setColor(QPalette::Window, Qt::transparent); | - |
3650 | mi.palette.setColor(QPalette::Button, Qt::transparent); never executed (the execution status of this line is deduced): mi.palette.setColor(QPalette::Button, Qt::transparent); | - |
3651 | } | 0 |
3652 | if (rule.baseStyleCanDraw() && subRule.baseStyleCanDraw()) { never evaluated: rule.baseStyleCanDraw() never evaluated: subRule.baseStyleCanDraw() | 0 |
3653 | baseStyle()->drawControl(ce, &mi, p, w); never executed (the execution status of this line is deduced): baseStyle()->drawControl(ce, &mi, p, w); | - |
3654 | } else { | 0 |
3655 | ParentStyle::drawControl(ce, &mi, p, w); never executed (the execution status of this line is deduced): ParentStyle::drawControl(ce, &mi, p, w); | - |
3656 | } | 0 |
3657 | } | - |
3658 | | - |
3659 | if (subRule.hasFont) never evaluated: subRule.hasFont | 0 |
3660 | p->setFont(oldFont); never executed: p->setFont(oldFont); | 0 |
3661 | | - |
3662 | return; | 0 |
3663 | } | - |
3664 | return; | 0 |
3665 | | - |
3666 | case CE_MenuBarItem: | - |
3667 | if (const QStyleOptionMenuItem *m = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) { never evaluated: const QStyleOptionMenuItem *m = qstyleoption_cast<const QStyleOptionMenuItem *>(opt) | 0 |
3668 | QStyleOptionMenuItem mi(*m); never executed (the execution status of this line is deduced): QStyleOptionMenuItem mi(*m); | - |
3669 | QRenderRule subRule = renderRule(w, opt, PseudoElement_Item); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_Item); | - |
3670 | mi.rect = subRule.contentsRect(opt->rect); never executed (the execution status of this line is deduced): mi.rect = subRule.contentsRect(opt->rect); | - |
3671 | 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); | - |
3672 | 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); | - |
3673 | | - |
3674 | if (subRule.hasDrawable()) { never evaluated: subRule.hasDrawable() | 0 |
3675 | subRule.drawRule(p, opt->rect); never executed (the execution status of this line is deduced): subRule.drawRule(p, opt->rect); | - |
3676 | QCommonStyle::drawControl(ce, &mi, p, w); never executed (the execution status of this line is deduced): QCommonStyle::drawControl(ce, &mi, p, w); | - |
3677 | } else { | 0 |
3678 | if (rule.hasDrawable() && !(opt->state & QStyle::State_Selected)) { never evaluated: rule.hasDrawable() never evaluated: !(opt->state & QStyle::State_Selected) | 0 |
3679 | // So that the menu bar background is not hidden by the items | - |
3680 | mi.palette.setColor(QPalette::Window, Qt::transparent); never executed (the execution status of this line is deduced): mi.palette.setColor(QPalette::Window, Qt::transparent); | - |
3681 | mi.palette.setColor(QPalette::Button, Qt::transparent); never executed (the execution status of this line is deduced): mi.palette.setColor(QPalette::Button, Qt::transparent); | - |
3682 | } | 0 |
3683 | baseStyle()->drawControl(ce, &mi, p, w); never executed (the execution status of this line is deduced): baseStyle()->drawControl(ce, &mi, p, w); | - |
3684 | } | 0 |
3685 | } | - |
3686 | return; | 0 |
3687 | | - |
3688 | #ifndef QT_NO_COMBOBOX | - |
3689 | case CE_ComboBoxLabel: | - |
3690 | if (!rule.hasBox()) never evaluated: !rule.hasBox() | 0 |
3691 | break; | 0 |
3692 | if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) { never evaluated: const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt) | 0 |
3693 | 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); | - |
3694 | p->save(); never executed (the execution status of this line is deduced): p->save(); | - |
3695 | p->setClipRect(editRect); never executed (the execution status of this line is deduced): p->setClipRect(editRect); | - |
3696 | if (!cb->currentIcon.isNull()) { never evaluated: !cb->currentIcon.isNull() | 0 |
3697 | int spacing = rule.hasBox() ? rule.box()->spacing : -1; never evaluated: rule.hasBox() | 0 |
3698 | if (spacing == -1) never evaluated: spacing == -1 | 0 |
3699 | spacing = 6; never executed: spacing = 6; | 0 |
3700 | QIcon::Mode mode = cb->state & State_Enabled ? QIcon::Normal : QIcon::Disabled; never evaluated: cb->state & State_Enabled | 0 |
3701 | 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); | - |
3702 | QRect iconRect(editRect); never executed (the execution status of this line is deduced): QRect iconRect(editRect); | - |
3703 | iconRect.setWidth(cb->iconSize.width()); never executed (the execution status of this line is deduced): iconRect.setWidth(cb->iconSize.width()); | - |
3704 | iconRect = alignedRect(cb->direction, never executed (the execution status of this line is deduced): iconRect = alignedRect(cb->direction, | - |
3705 | Qt::AlignLeft | Qt::AlignVCenter, never executed (the execution status of this line is deduced): Qt::AlignLeft | Qt::AlignVCenter, | - |
3706 | iconRect.size(), editRect); never executed (the execution status of this line is deduced): iconRect.size(), editRect); | - |
3707 | drawItemPixmap(p, iconRect, Qt::AlignCenter, pixmap); never executed (the execution status of this line is deduced): drawItemPixmap(p, iconRect, Qt::AlignCenter, pixmap); | - |
3708 | | - |
3709 | if (cb->direction == Qt::RightToLeft) never evaluated: cb->direction == Qt::RightToLeft | 0 |
3710 | editRect.translate(-spacing - cb->iconSize.width(), 0); never executed: editRect.translate(-spacing - cb->iconSize.width(), 0); | 0 |
3711 | else | - |
3712 | editRect.translate(cb->iconSize.width() + spacing, 0); never executed: editRect.translate(cb->iconSize.width() + spacing, 0); | 0 |
3713 | } | - |
3714 | if (!cb->currentText.isEmpty() && !cb->editable) { never evaluated: !cb->currentText.isEmpty() never evaluated: !cb->editable | 0 |
3715 | QPalette styledPalette(cb->palette); never executed (the execution status of this line is deduced): QPalette styledPalette(cb->palette); | - |
3716 | rule.configurePalette(&styledPalette, QPalette::Text, QPalette::Base); never executed (the execution status of this line is deduced): rule.configurePalette(&styledPalette, QPalette::Text, QPalette::Base); | - |
3717 | 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, | - |
3718 | 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); | - |
3719 | } | 0 |
3720 | p->restore(); never executed (the execution status of this line is deduced): p->restore(); | - |
3721 | return; | 0 |
3722 | } | - |
3723 | break; | 0 |
3724 | #endif // QT_NO_COMBOBOX | - |
3725 | | - |
3726 | case CE_Header: | - |
3727 | if (hasStyleRule(w, PseudoElement_HeaderViewUpArrow) partially evaluated: hasStyleRule(w, PseudoElement_HeaderViewUpArrow) no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
3728 | || hasStyleRule(w, PseudoElement_HeaderViewDownArrow)) { partially evaluated: hasStyleRule(w, PseudoElement_HeaderViewDownArrow) no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
3729 | ParentStyle::drawControl(ce, opt, p, w); never executed (the execution status of this line is deduced): ParentStyle::drawControl(ce, opt, p, w); | - |
3730 | return; | 0 |
3731 | } | - |
3732 | if(hasStyleRule(w, PseudoElement_HeaderViewSection)) { partially evaluated: hasStyleRule(w, PseudoElement_HeaderViewSection) yes Evaluation Count:4 | no Evaluation Count:0 |
| 0-4 |
3733 | QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection); executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection); | - |
3734 | if (!subRule.hasNativeBorder() || !subRule.baseStyleCanDraw() partially evaluated: !subRule.hasNativeBorder() no Evaluation Count:0 | yes Evaluation Count:4 |
partially evaluated: !subRule.baseStyleCanDraw() no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
3735 | || subRule.hasBackground() || subRule.hasPalette()) { partially evaluated: subRule.hasBackground() no Evaluation Count:0 | yes Evaluation Count:4 |
partially evaluated: subRule.hasPalette() no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
3736 | ParentStyle::drawControl(ce, opt, p, w); never executed (the execution status of this line is deduced): ParentStyle::drawControl(ce, opt, p, w); | - |
3737 | return; | 0 |
3738 | } | - |
3739 | } executed: } Execution Count:4 | 4 |
3740 | break; executed: break; Execution Count:4 | 4 |
3741 | case CE_HeaderSection: | - |
3742 | if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt)) { never evaluated: const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt) | 0 |
3743 | QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection); | - |
3744 | if (subRule.hasNativeBorder()) { never evaluated: subRule.hasNativeBorder() | 0 |
3745 | QStyleOptionHeader hdr(*header); never executed (the execution status of this line is deduced): QStyleOptionHeader hdr(*header); | - |
3746 | 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); | - |
3747 | | - |
3748 | if (subRule.baseStyleCanDraw()) { never evaluated: subRule.baseStyleCanDraw() | 0 |
3749 | baseStyle()->drawControl(CE_HeaderSection, &hdr, p, w); never executed (the execution status of this line is deduced): baseStyle()->drawControl(CE_HeaderSection, &hdr, p, w); | - |
3750 | } else { | 0 |
3751 | QWindowsStyle::drawControl(CE_HeaderSection, &hdr, p, w); never executed (the execution status of this line is deduced): QWindowsStyle::drawControl(CE_HeaderSection, &hdr, p, w); | - |
3752 | } | 0 |
3753 | } else { | - |
3754 | subRule.drawRule(p, opt->rect); never executed (the execution status of this line is deduced): subRule.drawRule(p, opt->rect); | - |
3755 | } | 0 |
3756 | return; | 0 |
3757 | } | - |
3758 | break; | 0 |
3759 | | - |
3760 | case CE_HeaderLabel: | - |
3761 | if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt)) { never evaluated: const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt) | 0 |
3762 | QStyleOptionHeader hdr(*header); never executed (the execution status of this line is deduced): QStyleOptionHeader hdr(*header); | - |
3763 | QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection); | - |
3764 | 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); | - |
3765 | QFont oldFont = p->font(); never executed (the execution status of this line is deduced): QFont oldFont = p->font(); | - |
3766 | if (subRule.hasFont) never evaluated: subRule.hasFont | 0 |
3767 | p->setFont(subRule.font.resolve(p->font())); never executed: p->setFont(subRule.font.resolve(p->font())); | 0 |
3768 | baseStyle()->drawControl(ce, &hdr, p, w); never executed (the execution status of this line is deduced): baseStyle()->drawControl(ce, &hdr, p, w); | - |
3769 | if (subRule.hasFont) never evaluated: subRule.hasFont | 0 |
3770 | p->setFont(oldFont); never executed: p->setFont(oldFont); | 0 |
3771 | return; | 0 |
3772 | } | - |
3773 | break; | 0 |
3774 | | - |
3775 | case CE_HeaderEmptyArea: | - |
3776 | if (rule.hasDrawable()) { never evaluated: rule.hasDrawable() | 0 |
3777 | return; | 0 |
3778 | } | - |
3779 | break; | 0 |
3780 | | - |
3781 | case CE_ProgressBar: | - |
3782 | QWindowsStyle::drawControl(ce, opt, p, w); never executed (the execution status of this line is deduced): QWindowsStyle::drawControl(ce, opt, p, w); | - |
3783 | return; | 0 |
3784 | | - |
3785 | case CE_ProgressBarGroove: | - |
3786 | if (!rule.hasNativeBorder()) { never evaluated: !rule.hasNativeBorder() | 0 |
3787 | 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)); | - |
3788 | return; | 0 |
3789 | } | - |
3790 | break; | 0 |
3791 | | - |
3792 | case CE_ProgressBarContents: { | - |
3793 | QRenderRule subRule = renderRule(w, opt, PseudoElement_ProgressBarChunk); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_ProgressBarChunk); | - |
3794 | if (subRule.hasDrawable()) { never evaluated: subRule.hasDrawable() | 0 |
3795 | if (const QStyleOptionProgressBarV2 *pb = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt)) { never evaluated: const QStyleOptionProgressBarV2 *pb = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt) | 0 |
3796 | p->save(); never executed (the execution status of this line is deduced): p->save(); | - |
3797 | p->setClipRect(pb->rect); never executed (the execution status of this line is deduced): p->setClipRect(pb->rect); | - |
3798 | | - |
3799 | qint64 minimum = qint64(pb->minimum); never executed (the execution status of this line is deduced): qint64 minimum = qint64(pb->minimum); | - |
3800 | qint64 maximum = qint64(pb->maximum); never executed (the execution status of this line is deduced): qint64 maximum = qint64(pb->maximum); | - |
3801 | qint64 progress = qint64(pb->progress); never executed (the execution status of this line is deduced): qint64 progress = qint64(pb->progress); | - |
3802 | bool vertical = (pb->orientation == Qt::Vertical); never executed (the execution status of this line is deduced): bool vertical = (pb->orientation == Qt::Vertical); | - |
3803 | bool inverted = pb->invertedAppearance; never executed (the execution status of this line is deduced): bool inverted = pb->invertedAppearance; | - |
3804 | | - |
3805 | QTransform m; never executed (the execution status of this line is deduced): QTransform m; | - |
3806 | QRect rect = pb->rect; never executed (the execution status of this line is deduced): QRect rect = pb->rect; | - |
3807 | if (vertical) { never evaluated: vertical | 0 |
3808 | 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()); | - |
3809 | m.rotate(90); never executed (the execution status of this line is deduced): m.rotate(90); | - |
3810 | 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)); | - |
3811 | } | 0 |
3812 | | - |
3813 | bool reverse = ((!vertical && (pb->direction == Qt::RightToLeft)) || vertical); never evaluated: !vertical never evaluated: (pb->direction == Qt::RightToLeft) never evaluated: vertical | 0 |
3814 | if (inverted) never evaluated: inverted | 0 |
3815 | reverse = !reverse; never executed: reverse = !reverse; | 0 |
3816 | const bool indeterminate = pb->minimum == pb->maximum; never executed (the execution status of this line is deduced): const bool indeterminate = pb->minimum == pb->maximum; | - |
3817 | qreal fillRatio = indeterminate ? 0.50 : qreal(progress - minimum)/(maximum - minimum); never evaluated: indeterminate | 0 |
3818 | int fillWidth = int(rect.width() * fillRatio); never executed (the execution status of this line is deduced): int fillWidth = int(rect.width() * fillRatio); | - |
3819 | int chunkWidth = fillWidth; never executed (the execution status of this line is deduced): int chunkWidth = fillWidth; | - |
3820 | if (subRule.hasContentsSize()) { never evaluated: subRule.hasContentsSize() | 0 |
3821 | QSize sz = subRule.size(); never executed (the execution status of this line is deduced): QSize sz = subRule.size(); | - |
3822 | chunkWidth = (opt->state & QStyle::State_Horizontal) ? sz.width() : sz.height(); never evaluated: (opt->state & QStyle::State_Horizontal) | 0 |
3823 | } | 0 |
3824 | | - |
3825 | QRect r = rect; never executed (the execution status of this line is deduced): QRect r = rect; | - |
3826 | Q_D(const QWindowsStyle); never executed (the execution status of this line is deduced): const QWindowsStylePrivate * const d = d_func(); | - |
3827 | if (pb->minimum == 0 && pb->maximum == 0) { never evaluated: pb->minimum == 0 never evaluated: pb->maximum == 0 | 0 |
3828 | int chunkCount = fillWidth/chunkWidth; never executed (the execution status of this line is deduced): int chunkCount = fillWidth/chunkWidth; | - |
3829 | int offset = 0; never executed (the execution status of this line is deduced): int offset = 0; | - |
3830 | if (QProgressStyleAnimation *animation = qobject_cast<QProgressStyleAnimation*>(d->animation(opt->styleObject))) never evaluated: QProgressStyleAnimation *animation = qobject_cast<QProgressStyleAnimation*>(d->animation(opt->styleObject)) | 0 |
3831 | offset = animation->animationStep() * 8 % rect.width(); never executed: offset = animation->animationStep() * 8 % rect.width(); | 0 |
3832 | else | - |
3833 | d->startAnimation(new QProgressStyleAnimation(d->animationFps, opt->styleObject)); never executed: d->startAnimation(new QProgressStyleAnimation(d->animationFps, opt->styleObject)); | 0 |
3834 | int x = reverse ? r.left() + r.width() - offset - chunkWidth : r.x() + offset; | 0 |
3835 | while (chunkCount > 0) { never evaluated: chunkCount > 0 | 0 |
3836 | 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()); | - |
3837 | r = m.mapRect(QRectF(r)).toRect(); never executed (the execution status of this line is deduced): r = m.mapRect(QRectF(r)).toRect(); | - |
3838 | subRule.drawRule(p, r); never executed (the execution status of this line is deduced): subRule.drawRule(p, r); | - |
3839 | x += reverse ? -chunkWidth : chunkWidth; | 0 |
3840 | if (reverse ? x < rect.left() : x > rect.right()) | 0 |
3841 | break; | 0 |
3842 | --chunkCount; never executed (the execution status of this line is deduced): --chunkCount; | - |
3843 | } | 0 |
3844 | | - |
3845 | r = rect; never executed (the execution status of this line is deduced): r = rect; | - |
3846 | x = reverse ? r.right() - (r.left() - x - chunkWidth) | 0 |
3847 | : r.left() + (x - r.right() - chunkWidth); never executed (the execution status of this line is deduced): : r.left() + (x - r.right() - chunkWidth); | - |
3848 | while (chunkCount > 0) { never evaluated: chunkCount > 0 | 0 |
3849 | 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()); | - |
3850 | r = m.mapRect(QRectF(r)).toRect(); never executed (the execution status of this line is deduced): r = m.mapRect(QRectF(r)).toRect(); | - |
3851 | subRule.drawRule(p, r); never executed (the execution status of this line is deduced): subRule.drawRule(p, r); | - |
3852 | x += reverse ? -chunkWidth : chunkWidth; | 0 |
3853 | --chunkCount; never executed (the execution status of this line is deduced): --chunkCount; | - |
3854 | }; | 0 |
3855 | } else { | 0 |
3856 | int x = reverse ? r.left() + r.width() - chunkWidth : r.x(); | 0 |
3857 | | - |
3858 | 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 |
3859 | 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()); | - |
3860 | r = m.mapRect(QRectF(r)).toRect(); never executed (the execution status of this line is deduced): r = m.mapRect(QRectF(r)).toRect(); | - |
3861 | subRule.drawRule(p, r); never executed (the execution status of this line is deduced): subRule.drawRule(p, r); | - |
3862 | x += reverse ? -chunkWidth : chunkWidth; | 0 |
3863 | } | 0 |
3864 | | - |
3865 | d->stopAnimation(opt->styleObject); never executed (the execution status of this line is deduced): d->stopAnimation(opt->styleObject); | - |
3866 | } | 0 |
3867 | | - |
3868 | p->restore(); never executed (the execution status of this line is deduced): p->restore(); | - |
3869 | return; | 0 |
3870 | } | - |
3871 | } | 0 |
3872 | } | - |
3873 | break; | 0 |
3874 | | - |
3875 | case CE_ProgressBarLabel: | - |
3876 | if (const QStyleOptionProgressBarV2 *pb = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt)) { never evaluated: const QStyleOptionProgressBarV2 *pb = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt) | 0 |
3877 | if (rule.hasBox() || rule.hasBorder() || hasStyleRule(w, PseudoElement_ProgressBarChunk)) { never evaluated: rule.hasBox() never evaluated: rule.hasBorder() never evaluated: hasStyleRule(w, PseudoElement_ProgressBarChunk) | 0 |
3878 | 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, | - |
3879 | 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); | - |
3880 | } else { | 0 |
3881 | QStyleOptionProgressBarV2 pbCopy(*pb); never executed (the execution status of this line is deduced): QStyleOptionProgressBarV2 pbCopy(*pb); | - |
3882 | 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); | - |
3883 | baseStyle()->drawControl(ce, &pbCopy, p, w); never executed (the execution status of this line is deduced): baseStyle()->drawControl(ce, &pbCopy, p, w); | - |
3884 | } | 0 |
3885 | return; | 0 |
3886 | } | - |
3887 | break; | 0 |
3888 | | - |
3889 | case CE_SizeGrip: | - |
3890 | if (const QStyleOptionSizeGrip *sgOpt = qstyleoption_cast<const QStyleOptionSizeGrip *>(opt)) { never evaluated: const QStyleOptionSizeGrip *sgOpt = qstyleoption_cast<const QStyleOptionSizeGrip *>(opt) | 0 |
3891 | if (rule.hasDrawable()) { never evaluated: rule.hasDrawable() | 0 |
3892 | rule.drawFrame(p, opt->rect); never executed (the execution status of this line is deduced): rule.drawFrame(p, opt->rect); | - |
3893 | p->save(); never executed (the execution status of this line is deduced): p->save(); | - |
3894 | switch (sgOpt->corner) { | - |
3895 | case Qt::BottomRightCorner: break; | 0 |
3896 | case Qt::BottomLeftCorner: p->rotate(90); break; | 0 |
3897 | case Qt::TopLeftCorner: p->rotate(180); break; | 0 |
3898 | case Qt::TopRightCorner: p->rotate(270); break; | 0 |
3899 | default: break; | 0 |
3900 | } | - |
3901 | rule.drawImage(p, opt->rect); never executed (the execution status of this line is deduced): rule.drawImage(p, opt->rect); | - |
3902 | p->restore(); never executed (the execution status of this line is deduced): p->restore(); | - |
3903 | } else { | 0 |
3904 | QStyleOptionSizeGrip sg(*sgOpt); never executed (the execution status of this line is deduced): QStyleOptionSizeGrip sg(*sgOpt); | - |
3905 | sg.rect = rule.contentsRect(opt->rect); never executed (the execution status of this line is deduced): sg.rect = rule.contentsRect(opt->rect); | - |
3906 | baseStyle()->drawControl(CE_SizeGrip, &sg, p, w); never executed (the execution status of this line is deduced): baseStyle()->drawControl(CE_SizeGrip, &sg, p, w); | - |
3907 | } | 0 |
3908 | return; | 0 |
3909 | } | - |
3910 | break; | 0 |
3911 | | - |
3912 | case CE_ToolBoxTab: | - |
3913 | QWindowsStyle::drawControl(ce, opt, p, w); never executed (the execution status of this line is deduced): QWindowsStyle::drawControl(ce, opt, p, w); | - |
3914 | return; | 0 |
3915 | | - |
3916 | case CE_ToolBoxTabShape: { | - |
3917 | QRenderRule subRule = renderRule(w, opt, PseudoElement_ToolBoxTab); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_ToolBoxTab); | - |
3918 | if (subRule.hasDrawable()) { never evaluated: subRule.hasDrawable() | 0 |
3919 | subRule.drawRule(p, opt->rect); never executed (the execution status of this line is deduced): subRule.drawRule(p, opt->rect); | - |
3920 | return; | 0 |
3921 | } | - |
3922 | } | - |
3923 | break; | 0 |
3924 | | - |
3925 | case CE_ToolBoxTabLabel: | - |
3926 | if (const QStyleOptionToolBox *box = qstyleoption_cast<const QStyleOptionToolBox *>(opt)) { never evaluated: const QStyleOptionToolBox *box = qstyleoption_cast<const QStyleOptionToolBox *>(opt) | 0 |
3927 | QStyleOptionToolBox boxCopy(*box); never executed (the execution status of this line is deduced): QStyleOptionToolBox boxCopy(*box); | - |
3928 | QRenderRule subRule = renderRule(w, opt, PseudoElement_ToolBoxTab); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_ToolBoxTab); | - |
3929 | 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); | - |
3930 | QFont oldFont = p->font(); never executed (the execution status of this line is deduced): QFont oldFont = p->font(); | - |
3931 | if (subRule.hasFont) never evaluated: subRule.hasFont | 0 |
3932 | p->setFont(subRule.font); never executed: p->setFont(subRule.font); | 0 |
3933 | boxCopy.rect = subRule.contentsRect(opt->rect); never executed (the execution status of this line is deduced): boxCopy.rect = subRule.contentsRect(opt->rect); | - |
3934 | QWindowsStyle::drawControl(ce, &boxCopy, p , w); never executed (the execution status of this line is deduced): QWindowsStyle::drawControl(ce, &boxCopy, p , w); | - |
3935 | if (subRule.hasFont) never evaluated: subRule.hasFont | 0 |
3936 | p->setFont(oldFont); never executed: p->setFont(oldFont); | 0 |
3937 | return; | 0 |
3938 | } | - |
3939 | break; | 0 |
3940 | | - |
3941 | case CE_ScrollBarAddPage: | - |
3942 | pe1 = PseudoElement_ScrollBarAddPage; never executed (the execution status of this line is deduced): pe1 = PseudoElement_ScrollBarAddPage; | - |
3943 | break; | 0 |
3944 | | - |
3945 | case CE_ScrollBarSubPage: | - |
3946 | pe1 = PseudoElement_ScrollBarSubPage; never executed (the execution status of this line is deduced): pe1 = PseudoElement_ScrollBarSubPage; | - |
3947 | break; | 0 |
3948 | | - |
3949 | case CE_ScrollBarAddLine: | - |
3950 | pe1 = PseudoElement_ScrollBarAddLine; never executed (the execution status of this line is deduced): pe1 = PseudoElement_ScrollBarAddLine; | - |
3951 | pe2 = (opt->state & QStyle::State_Horizontal) ? PseudoElement_ScrollBarRightArrow : PseudoElement_ScrollBarDownArrow; never evaluated: (opt->state & QStyle::State_Horizontal) | 0 |
3952 | fallback = true; never executed (the execution status of this line is deduced): fallback = true; | - |
3953 | break; | 0 |
3954 | | - |
3955 | case CE_ScrollBarSubLine: | - |
3956 | pe1 = PseudoElement_ScrollBarSubLine; never executed (the execution status of this line is deduced): pe1 = PseudoElement_ScrollBarSubLine; | - |
3957 | pe2 = (opt->state & QStyle::State_Horizontal) ? PseudoElement_ScrollBarLeftArrow : PseudoElement_ScrollBarUpArrow; never evaluated: (opt->state & QStyle::State_Horizontal) | 0 |
3958 | fallback = true; never executed (the execution status of this line is deduced): fallback = true; | - |
3959 | break; | 0 |
3960 | | - |
3961 | case CE_ScrollBarFirst: | - |
3962 | pe1 = PseudoElement_ScrollBarFirst; never executed (the execution status of this line is deduced): pe1 = PseudoElement_ScrollBarFirst; | - |
3963 | break; | 0 |
3964 | | - |
3965 | case CE_ScrollBarLast: | - |
3966 | pe1 = PseudoElement_ScrollBarLast; never executed (the execution status of this line is deduced): pe1 = PseudoElement_ScrollBarLast; | - |
3967 | break; | 0 |
3968 | | - |
3969 | case CE_ScrollBarSlider: | - |
3970 | pe1 = PseudoElement_ScrollBarSlider; never executed (the execution status of this line is deduced): pe1 = PseudoElement_ScrollBarSlider; | - |
3971 | fallback = true; never executed (the execution status of this line is deduced): fallback = true; | - |
3972 | break; | 0 |
3973 | | - |
3974 | #ifndef QT_NO_ITEMVIEWS | - |
3975 | case CE_ItemViewItem: | - |
3976 | if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) { partially evaluated: const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt) yes Evaluation Count:16 | no Evaluation Count:0 |
| 0-16 |
3977 | QRenderRule subRule = renderRule(w, opt, PseudoElement_ViewItem); executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_ViewItem); | - |
3978 | if (subRule.hasDrawable() || hasStyleRule(w, PseudoElement_Indicator)) { partially evaluated: subRule.hasDrawable() no Evaluation Count:0 | yes Evaluation Count:16 |
partially evaluated: hasStyleRule(w, PseudoElement_Indicator) no Evaluation Count:0 | yes Evaluation Count:16 |
| 0-16 |
3979 | QStyleOptionViewItem optCopy(*vopt); never executed (the execution status of this line is deduced): QStyleOptionViewItem optCopy(*vopt); | - |
3980 | 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, | - |
3981 | 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); | - |
3982 | QWindowsStyle::drawControl(ce, &optCopy, p, w); never executed (the execution status of this line is deduced): QWindowsStyle::drawControl(ce, &optCopy, p, w); | - |
3983 | } else { | 0 |
3984 | QStyleOptionViewItem voptCopy(*vopt); executed (the execution status of this line is deduced): QStyleOptionViewItem voptCopy(*vopt); | - |
3985 | subRule.configurePalette(&voptCopy.palette, QPalette::Text, QPalette::NoRole); executed (the execution status of this line is deduced): subRule.configurePalette(&voptCopy.palette, QPalette::Text, QPalette::NoRole); | - |
3986 | baseStyle()->drawControl(ce, &voptCopy, p, w); executed (the execution status of this line is deduced): baseStyle()->drawControl(ce, &voptCopy, p, w); | - |
3987 | } executed: } Execution Count:16 | 16 |
3988 | return; executed: return; Execution Count:16 | 16 |
3989 | } | - |
3990 | break; | 0 |
3991 | #endif // QT_NO_ITEMVIEWS | - |
3992 | | - |
3993 | #ifndef QT_NO_TABBAR | - |
3994 | case CE_TabBarTab: | - |
3995 | if (hasStyleRule(w, PseudoElement_TabBarTab)) { never evaluated: hasStyleRule(w, PseudoElement_TabBarTab) | 0 |
3996 | QWindowsStyle::drawControl(ce, opt, p, w); never executed (the execution status of this line is deduced): QWindowsStyle::drawControl(ce, opt, p, w); | - |
3997 | return; | 0 |
3998 | } | - |
3999 | break; | 0 |
4000 | | - |
4001 | case CE_TabBarTabLabel: | - |
4002 | case CE_TabBarTabShape: | - |
4003 | if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) { never evaluated: const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt) | 0 |
4004 | QStyleOptionTabV3 tabCopy(*tab); never executed (the execution status of this line is deduced): QStyleOptionTabV3 tabCopy(*tab); | - |
4005 | QRenderRule subRule = renderRule(w, opt, PseudoElement_TabBarTab); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_TabBarTab); | - |
4006 | 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); | - |
4007 | if (ce == CE_TabBarTabShape && subRule.hasDrawable()) { never evaluated: ce == CE_TabBarTabShape never evaluated: subRule.hasDrawable() | 0 |
4008 | subRule.drawRule(p, r); never executed (the execution status of this line is deduced): subRule.drawRule(p, r); | - |
4009 | return; | 0 |
4010 | } | - |
4011 | 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); | - |
4012 | QFont oldFont = p->font(); never executed (the execution status of this line is deduced): QFont oldFont = p->font(); | - |
4013 | if (subRule.hasFont) never evaluated: subRule.hasFont | 0 |
4014 | p->setFont(subRule.font); never executed: p->setFont(subRule.font); | 0 |
4015 | if (subRule.hasBox() || !subRule.hasNativeBorder()) { never evaluated: subRule.hasBox() never evaluated: !subRule.hasNativeBorder() | 0 |
4016 | tabCopy.rect = ce == CE_TabBarTabShape ? subRule.borderRect(r) never evaluated: ce == CE_TabBarTabShape | 0 |
4017 | : subRule.contentsRect(r); never executed (the execution status of this line is deduced): : subRule.contentsRect(r); | - |
4018 | QWindowsStyle::drawControl(ce, &tabCopy, p, w); never executed (the execution status of this line is deduced): QWindowsStyle::drawControl(ce, &tabCopy, p, w); | - |
4019 | } else { | 0 |
4020 | baseStyle()->drawControl(ce, &tabCopy, p, w); never executed (the execution status of this line is deduced): baseStyle()->drawControl(ce, &tabCopy, p, w); | - |
4021 | } | 0 |
4022 | if (subRule.hasFont) never evaluated: subRule.hasFont | 0 |
4023 | p->setFont(oldFont); never executed: p->setFont(oldFont); | 0 |
4024 | | - |
4025 | return; | 0 |
4026 | } | - |
4027 | break; | 0 |
4028 | #endif // QT_NO_TABBAR | - |
4029 | | - |
4030 | case CE_ColumnViewGrip: | - |
4031 | if (rule.hasDrawable()) { never evaluated: rule.hasDrawable() | 0 |
4032 | rule.drawRule(p, opt->rect); never executed (the execution status of this line is deduced): rule.drawRule(p, opt->rect); | - |
4033 | return; | 0 |
4034 | } | - |
4035 | break; | 0 |
4036 | | - |
4037 | case CE_DockWidgetTitle: | - |
4038 | if (const QStyleOptionDockWidgetV2 *dwOpt = qstyleoption_cast<const QStyleOptionDockWidgetV2 *>(opt)) { never evaluated: const QStyleOptionDockWidgetV2 *dwOpt = qstyleoption_cast<const QStyleOptionDockWidgetV2 *>(opt) | 0 |
4039 | QRenderRule subRule = renderRule(w, opt, PseudoElement_DockWidgetTitle); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_DockWidgetTitle); | - |
4040 | if (!subRule.hasDrawable() && !subRule.hasPosition()) never evaluated: !subRule.hasDrawable() never evaluated: !subRule.hasPosition() | 0 |
4041 | break; | 0 |
4042 | if (subRule.hasDrawable()) { never evaluated: subRule.hasDrawable() | 0 |
4043 | subRule.drawRule(p, opt->rect); never executed (the execution status of this line is deduced): subRule.drawRule(p, opt->rect); | - |
4044 | } else { | 0 |
4045 | QStyleOptionDockWidgetV2 dwCopy(*dwOpt); never executed (the execution status of this line is deduced): QStyleOptionDockWidgetV2 dwCopy(*dwOpt); | - |
4046 | dwCopy.title = QString(); never executed (the execution status of this line is deduced): dwCopy.title = QString(); | - |
4047 | baseStyle()->drawControl(ce, &dwCopy, p, w); never executed (the execution status of this line is deduced): baseStyle()->drawControl(ce, &dwCopy, p, w); | - |
4048 | } | 0 |
4049 | | - |
4050 | if (!dwOpt->title.isEmpty()) { never evaluated: !dwOpt->title.isEmpty() | 0 |
4051 | QRect r = opt->rect; never executed (the execution status of this line is deduced): QRect r = opt->rect; | - |
4052 | if (dwOpt->verticalTitleBar) { never evaluated: dwOpt->verticalTitleBar | 0 |
4053 | QSize s = r.size(); never executed (the execution status of this line is deduced): QSize s = r.size(); | - |
4054 | s.transpose(); never executed (the execution status of this line is deduced): s.transpose(); | - |
4055 | r.setSize(s); never executed (the execution status of this line is deduced): r.setSize(s); | - |
4056 | | - |
4057 | p->save(); never executed (the execution status of this line is deduced): p->save(); | - |
4058 | 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()); | - |
4059 | p->rotate(-90); never executed (the execution status of this line is deduced): p->rotate(-90); | - |
4060 | p->translate(-r.left(), -r.top()); never executed (the execution status of this line is deduced): p->translate(-r.left(), -r.top()); | - |
4061 | } | 0 |
4062 | | - |
4063 | Qt::Alignment alignment = 0; never executed (the execution status of this line is deduced): Qt::Alignment alignment = 0; | - |
4064 | if (subRule.hasPosition()) never evaluated: subRule.hasPosition() | 0 |
4065 | alignment = subRule.position()->textAlignment; never executed: alignment = subRule.position()->textAlignment; | 0 |
4066 | if (alignment == 0) never evaluated: alignment == 0 | 0 |
4067 | alignment = Qt::AlignLeft; never executed: alignment = Qt::AlignLeft; | 0 |
4068 | drawItemText(p, subRule.contentsRect(opt->rect), never executed (the execution status of this line is deduced): drawItemText(p, subRule.contentsRect(opt->rect), | - |
4069 | alignment | Qt::TextShowMnemonic, dwOpt->palette, never executed (the execution status of this line is deduced): alignment | Qt::TextShowMnemonic, dwOpt->palette, | - |
4070 | dwOpt->state & State_Enabled, dwOpt->title, never executed (the execution status of this line is deduced): dwOpt->state & State_Enabled, dwOpt->title, | - |
4071 | QPalette::WindowText); never executed (the execution status of this line is deduced): QPalette::WindowText); | - |
4072 | | - |
4073 | if (dwOpt->verticalTitleBar) never evaluated: dwOpt->verticalTitleBar | 0 |
4074 | p->restore(); never executed: p->restore(); | 0 |
4075 | } | 0 |
4076 | | - |
4077 | return; | 0 |
4078 | } | - |
4079 | break; | 0 |
4080 | case CE_ShapedFrame: | - |
4081 | if (const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(opt)) { partially evaluated: const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(opt) yes Evaluation Count:485 | no Evaluation Count:0 |
| 0-485 |
4082 | if (rule.hasNativeBorder()) { evaluated: rule.hasNativeBorder() yes Evaluation Count:483 | yes Evaluation Count:2 |
| 2-483 |
4083 | QStyleOptionFrameV3 frmOpt(*frm); executed (the execution status of this line is deduced): QStyleOptionFrameV3 frmOpt(*frm); | - |
4084 | 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); | - |
4085 | frmOpt.rect = rule.borderRect(frmOpt.rect); executed (the execution status of this line is deduced): frmOpt.rect = rule.borderRect(frmOpt.rect); | - |
4086 | baseStyle()->drawControl(ce, &frmOpt, p, w); executed (the execution status of this line is deduced): baseStyle()->drawControl(ce, &frmOpt, p, w); | - |
4087 | } executed: } Execution Count:483 | 483 |
4088 | // else, borders are already drawn in PE_Widget | - |
4089 | } executed: } Execution Count:485 | 485 |
4090 | return; executed: return; Execution Count:485 | 485 |
4091 | | - |
4092 | | - |
4093 | default: | - |
4094 | break; | 0 |
4095 | } | - |
4096 | | - |
4097 | if (pe1 != PseudoElement_None) { partially evaluated: pe1 != PseudoElement_None no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
4098 | QRenderRule subRule = renderRule(w, opt, pe1); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, pe1); | - |
4099 | if (subRule.bg != 0 || subRule.hasDrawable()) { never evaluated: subRule.bg != 0 never evaluated: subRule.hasDrawable() | 0 |
4100 | //We test subRule.bg directly because hasBackground() would return false for background:none. | - |
4101 | //But we still don't want the default drawning in that case (example for QScrollBar::add-page) (task 198926) | - |
4102 | subRule.drawRule(p, opt->rect); never executed (the execution status of this line is deduced): subRule.drawRule(p, opt->rect); | - |
4103 | } else if (fallback) { never executed: } never evaluated: fallback | 0 |
4104 | QWindowsStyle::drawControl(ce, opt, p, w); never executed (the execution status of this line is deduced): QWindowsStyle::drawControl(ce, opt, p, w); | - |
4105 | pe2 = PseudoElement_None; never executed (the execution status of this line is deduced): pe2 = PseudoElement_None; | - |
4106 | } else { | 0 |
4107 | baseStyle()->drawControl(ce, opt, p, w); never executed (the execution status of this line is deduced): baseStyle()->drawControl(ce, opt, p, w); | - |
4108 | } | 0 |
4109 | if (pe2 != PseudoElement_None) { never evaluated: pe2 != PseudoElement_None | 0 |
4110 | QRenderRule subSubRule = renderRule(w, opt, pe2); never executed (the execution status of this line is deduced): QRenderRule subSubRule = renderRule(w, opt, pe2); | - |
4111 | 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); | - |
4112 | subSubRule.drawRule(p, r); never executed (the execution status of this line is deduced): subSubRule.drawRule(p, r); | - |
4113 | } | 0 |
4114 | return; | 0 |
4115 | } | - |
4116 | | - |
4117 | baseStyle()->drawControl(ce, opt, p, w); executed (the execution status of this line is deduced): baseStyle()->drawControl(ce, opt, p, w); | - |
4118 | } executed: } Execution Count:4 | 4 |
4119 | | - |
4120 | void QStyleSheetStyle::drawItemPixmap(QPainter *p, const QRect &rect, int alignment, const | - |
4121 | QPixmap &pixmap) const | - |
4122 | { | - |
4123 | baseStyle()->drawItemPixmap(p, rect, alignment, pixmap); never executed (the execution status of this line is deduced): baseStyle()->drawItemPixmap(p, rect, alignment, pixmap); | - |
4124 | } | 0 |
4125 | | - |
4126 | void QStyleSheetStyle::drawItemText(QPainter *painter, const QRect& rect, int alignment, const QPalette &pal, | - |
4127 | bool enabled, const QString& text, QPalette::ColorRole textRole) const | - |
4128 | { | - |
4129 | 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); | - |
4130 | } | 0 |
4131 | | - |
4132 | void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, | - |
4133 | const QWidget *w) const | - |
4134 | { | - |
4135 | RECURSION_GUARD(baseStyle()->drawPrimitive(pe, opt, p, w); return) never executed: return; evaluated: globalStyleSheetStyle != 0 yes Evaluation Count:387 | yes Evaluation Count:347 |
partially evaluated: globalStyleSheetStyle != this no Evaluation Count:0 | yes Evaluation Count:387 |
| 0-387 |
4136 | | - |
4137 | int pseudoElement = PseudoElement_None; executed (the execution status of this line is deduced): int pseudoElement = PseudoElement_None; | - |
4138 | QRenderRule rule = renderRule(w, opt); executed (the execution status of this line is deduced): QRenderRule rule = renderRule(w, opt); | - |
4139 | QRect rect = opt->rect; executed (the execution status of this line is deduced): QRect rect = opt->rect; | - |
4140 | | - |
4141 | switch (pe) { | - |
4142 | | - |
4143 | case PE_FrameStatusBar: { | - |
4144 | 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); | - |
4145 | if (subRule.hasDrawable()) { never evaluated: subRule.hasDrawable() | 0 |
4146 | subRule.drawRule(p, opt->rect); never executed (the execution status of this line is deduced): subRule.drawRule(p, opt->rect); | - |
4147 | return; | 0 |
4148 | } | - |
4149 | break; | 0 |
4150 | } | - |
4151 | | - |
4152 | case PE_IndicatorArrowDown: | - |
4153 | pseudoElement = PseudoElement_DownArrow; never executed (the execution status of this line is deduced): pseudoElement = PseudoElement_DownArrow; | - |
4154 | break; | 0 |
4155 | | - |
4156 | case PE_IndicatorArrowUp: | - |
4157 | pseudoElement = PseudoElement_UpArrow; never executed (the execution status of this line is deduced): pseudoElement = PseudoElement_UpArrow; | - |
4158 | break; | 0 |
4159 | | - |
4160 | case PE_IndicatorRadioButton: | - |
4161 | pseudoElement = PseudoElement_ExclusiveIndicator; never executed (the execution status of this line is deduced): pseudoElement = PseudoElement_ExclusiveIndicator; | - |
4162 | break; | 0 |
4163 | | - |
4164 | case PE_IndicatorViewItemCheck: | - |
4165 | pseudoElement = PseudoElement_ViewItemIndicator; never executed (the execution status of this line is deduced): pseudoElement = PseudoElement_ViewItemIndicator; | - |
4166 | break; | 0 |
4167 | | - |
4168 | case PE_IndicatorCheckBox: | - |
4169 | pseudoElement = PseudoElement_Indicator; never executed (the execution status of this line is deduced): pseudoElement = PseudoElement_Indicator; | - |
4170 | break; | 0 |
4171 | | - |
4172 | case PE_IndicatorHeaderArrow: | - |
4173 | if (const QStyleOptionHeader *hdr = qstyleoption_cast<const QStyleOptionHeader *>(opt)) { never evaluated: const QStyleOptionHeader *hdr = qstyleoption_cast<const QStyleOptionHeader *>(opt) | 0 |
4174 | pseudoElement = hdr->sortIndicator == QStyleOptionHeader::SortUp never evaluated: hdr->sortIndicator == QStyleOptionHeader::SortUp | 0 |
4175 | ? PseudoElement_HeaderViewUpArrow never executed (the execution status of this line is deduced): ? PseudoElement_HeaderViewUpArrow | - |
4176 | : PseudoElement_HeaderViewDownArrow; never executed (the execution status of this line is deduced): : PseudoElement_HeaderViewDownArrow; | - |
4177 | } | 0 |
4178 | break; | 0 |
4179 | | - |
4180 | case PE_PanelButtonTool: | - |
4181 | case PE_PanelButtonCommand: | - |
4182 | 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 |
4183 | //the window style will draw the borders | - |
4184 | ParentStyle::drawPrimitive(pe, opt, p, w); never executed (the execution status of this line is deduced): ParentStyle::drawPrimitive(pe, opt, p, w); | - |
4185 | if (!rule.background()->pixmap.isNull() || rule.hasImage()) { never evaluated: !rule.background()->pixmap.isNull() never evaluated: rule.hasImage() | 0 |
4186 | 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)); | - |
4187 | } | 0 |
4188 | return; | 0 |
4189 | } | - |
4190 | if (!rule.hasNativeBorder()) { never evaluated: !rule.hasNativeBorder() | 0 |
4191 | 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)); | - |
4192 | return; | 0 |
4193 | } | - |
4194 | break; | 0 |
4195 | | - |
4196 | case PE_IndicatorButtonDropDown: { | - |
4197 | QRenderRule subRule = renderRule(w, opt, PseudoElement_ToolButtonMenu); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_ToolButtonMenu); | - |
4198 | if (!subRule.hasNativeBorder()) { never evaluated: !subRule.hasNativeBorder() | 0 |
4199 | rule.drawBorder(p, opt->rect); never executed (the execution status of this line is deduced): rule.drawBorder(p, opt->rect); | - |
4200 | return; | 0 |
4201 | } | - |
4202 | break; | 0 |
4203 | } | - |
4204 | | - |
4205 | case PE_FrameDefaultButton: | - |
4206 | if (rule.hasNativeBorder()) { never evaluated: rule.hasNativeBorder() | 0 |
4207 | if (rule.baseStyleCanDraw()) never evaluated: rule.baseStyleCanDraw() | 0 |
4208 | break; | 0 |
4209 | QWindowsStyle::drawPrimitive(pe, opt, p, w); never executed (the execution status of this line is deduced): QWindowsStyle::drawPrimitive(pe, opt, p, w); | - |
4210 | } | 0 |
4211 | return; | 0 |
4212 | | - |
4213 | case PE_FrameWindow: | - |
4214 | case PE_FrameDockWidget: | - |
4215 | case PE_Frame: | - |
4216 | if (const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(opt)) { partially evaluated: const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(opt) yes Evaluation Count:387 | no Evaluation Count:0 |
| 0-387 |
4217 | if (rule.hasNativeBorder()) { partially evaluated: rule.hasNativeBorder() yes Evaluation Count:387 | no Evaluation Count:0 |
| 0-387 |
4218 | QStyleOptionFrameV2 frmOpt(*frm); executed (the execution status of this line is deduced): QStyleOptionFrameV2 frmOpt(*frm); | - |
4219 | 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); | - |
4220 | if (!qstyleoption_cast<const QStyleOptionFrameV3 *>(opt)) //if it comes from CE_ShapedFrame, the margins are already sustracted partially evaluated: !qstyleoption_cast<const QStyleOptionFrameV3 *>(opt) no Evaluation Count:0 | yes Evaluation Count:387 |
| 0-387 |
4221 | frmOpt.rect = rule.borderRect(frmOpt.rect); never executed: frmOpt.rect = rule.borderRect(frmOpt.rect); | 0 |
4222 | baseStyle()->drawPrimitive(pe, &frmOpt, p, w); executed (the execution status of this line is deduced): baseStyle()->drawPrimitive(pe, &frmOpt, p, w); | - |
4223 | } else { executed: } Execution Count:387 | 387 |
4224 | rule.drawBorder(p, rule.borderRect(opt->rect)); never executed (the execution status of this line is deduced): rule.drawBorder(p, rule.borderRect(opt->rect)); | - |
4225 | } | 0 |
4226 | } | - |
4227 | return; executed: return; Execution Count:387 | 387 |
4228 | | - |
4229 | case PE_PanelLineEdit: | - |
4230 | if (const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(opt)) { partially evaluated: const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(opt) yes Evaluation Count:7 | no Evaluation Count:0 |
| 0-7 |
4231 | #ifndef QT_NO_SPINBOX | - |
4232 | if (w && qobject_cast<const QAbstractSpinBox *>(w->parentWidget())) { partially evaluated: w yes Evaluation Count:7 | no Evaluation Count:0 |
partially evaluated: qobject_cast<const QAbstractSpinBox *>(w->parentWidget()) no Evaluation Count:0 | yes Evaluation Count:7 |
| 0-7 |
4233 | QRenderRule spinboxRule = renderRule(w->parentWidget(), opt); never executed (the execution status of this line is deduced): QRenderRule spinboxRule = renderRule(w->parentWidget(), opt); | - |
4234 | if (!spinboxRule.hasNativeBorder() || !spinboxRule.baseStyleCanDraw()) never evaluated: !spinboxRule.hasNativeBorder() never evaluated: !spinboxRule.baseStyleCanDraw() | 0 |
4235 | return; | 0 |
4236 | rule = spinboxRule; never executed (the execution status of this line is deduced): rule = spinboxRule; | - |
4237 | } | 0 |
4238 | #endif | - |
4239 | if (rule.hasNativeBorder()) { partially evaluated: rule.hasNativeBorder() yes Evaluation Count:7 | no Evaluation Count:0 |
| 0-7 |
4240 | QStyleOptionFrame frmOpt(*frm); executed (the execution status of this line is deduced): QStyleOptionFrame frmOpt(*frm); | - |
4241 | 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); | - |
4242 | frmOpt.rect = rule.borderRect(frmOpt.rect); executed (the execution status of this line is deduced): frmOpt.rect = rule.borderRect(frmOpt.rect); | - |
4243 | if (rule.baseStyleCanDraw()) { partially evaluated: rule.baseStyleCanDraw() yes Evaluation Count:7 | no Evaluation Count:0 |
| 0-7 |
4244 | rule.drawBackgroundImage(p, opt->rect); executed (the execution status of this line is deduced): rule.drawBackgroundImage(p, opt->rect); | - |
4245 | baseStyle()->drawPrimitive(pe, &frmOpt, p, w); executed (the execution status of this line is deduced): baseStyle()->drawPrimitive(pe, &frmOpt, p, w); | - |
4246 | } else { executed: } Execution Count:7 | 7 |
4247 | rule.drawBackground(p, opt->rect); never executed (the execution status of this line is deduced): rule.drawBackground(p, opt->rect); | - |
4248 | if (frmOpt.lineWidth > 0) never evaluated: frmOpt.lineWidth > 0 | 0 |
4249 | baseStyle()->drawPrimitive(PE_FrameLineEdit, &frmOpt, p, w); never executed: baseStyle()->drawPrimitive(PE_FrameLineEdit, &frmOpt, p, w); | 0 |
4250 | } | 0 |
4251 | } else { | - |
4252 | rule.drawRule(p, opt->rect); never executed (the execution status of this line is deduced): rule.drawRule(p, opt->rect); | - |
4253 | } | 0 |
4254 | } | - |
4255 | return; executed: return; Execution Count:7 | 7 |
4256 | | - |
4257 | case PE_Widget: | - |
4258 | if (w && !rule.hasDrawable()) { partially evaluated: w yes Evaluation Count:4 | no Evaluation Count:0 |
evaluated: !rule.hasDrawable() yes Evaluation Count:2 | yes Evaluation Count:2 |
| 0-4 |
4259 | QWidget *container = containerWidget(w); executed (the execution status of this line is deduced): QWidget *container = containerWidget(w); | - |
4260 | if (styleSheetCaches->autoFillDisabledWidgets.contains(container) partially evaluated: styleSheetCaches->autoFillDisabledWidgets.contains(container) yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
4261 | && (container == w || !renderRule(container, opt).hasBackground())) { partially evaluated: container == w no Evaluation Count:0 | yes Evaluation Count:2 |
partially evaluated: !renderRule(container, opt).hasBackground() yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
4262 | //we do not have a background, but we disabled the autofillbackground anyway. so fill the background now. | - |
4263 | // (this may happen if we have rules like :focus) | - |
4264 | p->fillRect(opt->rect, opt->palette.brush(w->backgroundRole())); executed (the execution status of this line is deduced): p->fillRect(opt->rect, opt->palette.brush(w->backgroundRole())); | - |
4265 | } executed: } Execution Count:2 | 2 |
4266 | break; executed: break; Execution Count:2 | 2 |
4267 | } | - |
4268 | #ifndef QT_NO_SCROLLAREA | - |
4269 | if (const QAbstractScrollArea *sa = qobject_cast<const QAbstractScrollArea *>(w)) { partially evaluated: const QAbstractScrollArea *sa = qobject_cast<const QAbstractScrollArea *>(w) yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
4270 | const QAbstractScrollAreaPrivate *sap = sa->d_func(); executed (the execution status of this line is deduced): const QAbstractScrollAreaPrivate *sap = sa->d_func(); | - |
4271 | rule.drawBackground(p, opt->rect, sap->contentsOffset()); executed (the execution status of this line is deduced): rule.drawBackground(p, opt->rect, sap->contentsOffset()); | - |
4272 | if (rule.hasBorder()) { partially evaluated: rule.hasBorder() yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
4273 | QRect brect = rule.borderRect(opt->rect); executed (the execution status of this line is deduced): QRect brect = rule.borderRect(opt->rect); | - |
4274 | if (styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents, opt, w)) { partially evaluated: styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents, opt, w) no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
4275 | 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, | - |
4276 | sa->horizontalScrollBar()->isVisible() ? -sa->horizontalScrollBar()->height() : 0); never executed (the execution status of this line is deduced): sa->horizontalScrollBar()->isVisible() ? -sa->horizontalScrollBar()->height() : 0); | - |
4277 | brect = QStyle::visualRect(opt->direction, brect, r); never executed (the execution status of this line is deduced): brect = QStyle::visualRect(opt->direction, brect, r); | - |
4278 | } | 0 |
4279 | rule.drawBorder(p, brect); executed (the execution status of this line is deduced): rule.drawBorder(p, brect); | - |
4280 | } executed: } Execution Count:2 | 2 |
4281 | break; executed: break; Execution Count:2 | 2 |
4282 | } | - |
4283 | #endif | - |
4284 | //fall tghought | - |
4285 | case PE_PanelMenu: code before this statement never executed: case PE_PanelMenu: | 0 |
4286 | case PE_PanelStatusBar: | - |
4287 | if(rule.hasDrawable()) { never evaluated: rule.hasDrawable() | 0 |
4288 | rule.drawRule(p, opt->rect); never executed (the execution status of this line is deduced): rule.drawRule(p, opt->rect); | - |
4289 | return; | 0 |
4290 | } | - |
4291 | break; | 0 |
4292 | | - |
4293 | case PE_FrameMenu: | - |
4294 | if (rule.hasDrawable()) { never evaluated: rule.hasDrawable() | 0 |
4295 | // Drawn by PE_PanelMenu | - |
4296 | return; | 0 |
4297 | } | - |
4298 | break; | 0 |
4299 | | - |
4300 | case PE_PanelMenuBar: | - |
4301 | if (rule.hasDrawable()) { never evaluated: rule.hasDrawable() | 0 |
4302 | // Drawn by PE_Widget | - |
4303 | return; | 0 |
4304 | } | - |
4305 | break; | 0 |
4306 | | - |
4307 | case PE_IndicatorToolBarSeparator: | - |
4308 | case PE_IndicatorToolBarHandle: { | - |
4309 | PseudoElement ps = pe == PE_IndicatorToolBarHandle ? PseudoElement_ToolBarHandle : PseudoElement_ToolBarSeparator; never evaluated: pe == PE_IndicatorToolBarHandle | 0 |
4310 | QRenderRule subRule = renderRule(w, opt, ps); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, ps); | - |
4311 | if (subRule.hasDrawable()) { never evaluated: subRule.hasDrawable() | 0 |
4312 | subRule.drawRule(p, opt->rect); never executed (the execution status of this line is deduced): subRule.drawRule(p, opt->rect); | - |
4313 | return; | 0 |
4314 | } | - |
4315 | } | - |
4316 | break; | 0 |
4317 | | - |
4318 | case PE_IndicatorMenuCheckMark: | - |
4319 | pseudoElement = PseudoElement_MenuCheckMark; never executed (the execution status of this line is deduced): pseudoElement = PseudoElement_MenuCheckMark; | - |
4320 | break; | 0 |
4321 | | - |
4322 | case PE_IndicatorArrowLeft: | - |
4323 | pseudoElement = PseudoElement_LeftArrow; never executed (the execution status of this line is deduced): pseudoElement = PseudoElement_LeftArrow; | - |
4324 | break; | 0 |
4325 | | - |
4326 | case PE_IndicatorArrowRight: | - |
4327 | pseudoElement = PseudoElement_RightArrow; never executed (the execution status of this line is deduced): pseudoElement = PseudoElement_RightArrow; | - |
4328 | break; | 0 |
4329 | | - |
4330 | case PE_IndicatorColumnViewArrow: | - |
4331 | if (const QStyleOptionViewItem *viewOpt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) { never evaluated: const QStyleOptionViewItem *viewOpt = qstyleoption_cast<const QStyleOptionViewItem *>(opt) | 0 |
4332 | bool reverse = (viewOpt->direction == Qt::RightToLeft); never executed (the execution status of this line is deduced): bool reverse = (viewOpt->direction == Qt::RightToLeft); | - |
4333 | pseudoElement = reverse ? PseudoElement_LeftArrow : PseudoElement_RightArrow; | 0 |
4334 | } else { | 0 |
4335 | pseudoElement = PseudoElement_RightArrow; never executed (the execution status of this line is deduced): pseudoElement = PseudoElement_RightArrow; | - |
4336 | } | 0 |
4337 | break; | 0 |
4338 | | - |
4339 | case PE_IndicatorBranch: | - |
4340 | if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) { partially evaluated: const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt) yes Evaluation Count:16 | no Evaluation Count:0 |
| 0-16 |
4341 | QRenderRule subRule = renderRule(w, opt, PseudoElement_TreeViewBranch); executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_TreeViewBranch); | - |
4342 | if (subRule.hasDrawable()) { partially evaluated: subRule.hasDrawable() no Evaluation Count:0 | yes Evaluation Count:16 |
| 0-16 |
4343 | if ((vopt->state & QStyle::State_Selected) && vopt->showDecorationSelected) never evaluated: (vopt->state & QStyle::State_Selected) never evaluated: vopt->showDecorationSelected | 0 |
4344 | p->fillRect(vopt->rect, vopt->palette.highlight()); never executed: p->fillRect(vopt->rect, vopt->palette.highlight()); | 0 |
4345 | else if (vopt->features & QStyleOptionViewItem::Alternate) never evaluated: vopt->features & QStyleOptionViewItem::Alternate | 0 |
4346 | p->fillRect(vopt->rect, vopt->palette.alternateBase()); never executed: p->fillRect(vopt->rect, vopt->palette.alternateBase()); | 0 |
4347 | subRule.drawRule(p, opt->rect); never executed (the execution status of this line is deduced): subRule.drawRule(p, opt->rect); | - |
4348 | } else { | 0 |
4349 | baseStyle()->drawPrimitive(pe, vopt, p, w); executed (the execution status of this line is deduced): baseStyle()->drawPrimitive(pe, vopt, p, w); | - |
4350 | } executed: } Execution Count:16 | 16 |
4351 | } | - |
4352 | return; executed: return; Execution Count:16 | 16 |
4353 | | - |
4354 | case PE_PanelTipLabel: | - |
4355 | if (!rule.hasDrawable()) never evaluated: !rule.hasDrawable() | 0 |
4356 | break; | 0 |
4357 | | - |
4358 | if (const QStyleOptionFrame *frmOpt = qstyleoption_cast<const QStyleOptionFrame *>(opt)) { never evaluated: const QStyleOptionFrame *frmOpt = qstyleoption_cast<const QStyleOptionFrame *>(opt) | 0 |
4359 | if (rule.hasNativeBorder()) { never evaluated: rule.hasNativeBorder() | 0 |
4360 | rule.drawBackground(p, opt->rect); never executed (the execution status of this line is deduced): rule.drawBackground(p, opt->rect); | - |
4361 | QStyleOptionFrame optCopy(*frmOpt); never executed (the execution status of this line is deduced): QStyleOptionFrame optCopy(*frmOpt); | - |
4362 | optCopy.rect = rule.borderRect(opt->rect); never executed (the execution status of this line is deduced): optCopy.rect = rule.borderRect(opt->rect); | - |
4363 | 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); | - |
4364 | baseStyle()->drawPrimitive(pe, &optCopy, p, w); never executed (the execution status of this line is deduced): baseStyle()->drawPrimitive(pe, &optCopy, p, w); | - |
4365 | } else { | 0 |
4366 | rule.drawRule(p, opt->rect); never executed (the execution status of this line is deduced): rule.drawRule(p, opt->rect); | - |
4367 | } | 0 |
4368 | } | - |
4369 | return; | 0 |
4370 | | - |
4371 | case PE_FrameGroupBox: | - |
4372 | if (rule.hasNativeBorder()) never evaluated: rule.hasNativeBorder() | 0 |
4373 | break; | 0 |
4374 | rule.drawBorder(p, opt->rect); never executed (the execution status of this line is deduced): rule.drawBorder(p, opt->rect); | - |
4375 | return; | 0 |
4376 | | - |
4377 | #ifndef QT_NO_TABWIDGET | - |
4378 | case PE_FrameTabWidget: | - |
4379 | if (const QStyleOptionTabWidgetFrame *frm = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)) { never evaluated: const QStyleOptionTabWidgetFrame *frm = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt) | 0 |
4380 | QRenderRule subRule = renderRule(w, opt, PseudoElement_TabWidgetPane); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_TabWidgetPane); | - |
4381 | if (subRule.hasNativeBorder()) { never evaluated: subRule.hasNativeBorder() | 0 |
4382 | subRule.drawBackground(p, opt->rect); never executed (the execution status of this line is deduced): subRule.drawBackground(p, opt->rect); | - |
4383 | QStyleOptionTabWidgetFrameV2 frmCopy(*frm); never executed (the execution status of this line is deduced): QStyleOptionTabWidgetFrameV2 frmCopy(*frm); | - |
4384 | 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); | - |
4385 | baseStyle()->drawPrimitive(pe, &frmCopy, p, w); never executed (the execution status of this line is deduced): baseStyle()->drawPrimitive(pe, &frmCopy, p, w); | - |
4386 | } else { | 0 |
4387 | subRule.drawRule(p, opt->rect); never executed (the execution status of this line is deduced): subRule.drawRule(p, opt->rect); | - |
4388 | } | 0 |
4389 | return; | 0 |
4390 | } | - |
4391 | break; | 0 |
4392 | #endif // QT_NO_TABWIDGET | - |
4393 | | - |
4394 | case PE_IndicatorProgressChunk: | - |
4395 | pseudoElement = PseudoElement_ProgressBarChunk; never executed (the execution status of this line is deduced): pseudoElement = PseudoElement_ProgressBarChunk; | - |
4396 | break; | 0 |
4397 | | - |
4398 | case PE_IndicatorTabTear: | - |
4399 | pseudoElement = PseudoElement_TabBarTear; never executed (the execution status of this line is deduced): pseudoElement = PseudoElement_TabBarTear; | - |
4400 | break; | 0 |
4401 | | - |
4402 | case PE_FrameFocusRect: | - |
4403 | if (!rule.hasNativeOutline()) { never evaluated: !rule.hasNativeOutline() | 0 |
4404 | rule.drawOutline(p, opt->rect); never executed (the execution status of this line is deduced): rule.drawOutline(p, opt->rect); | - |
4405 | return; | 0 |
4406 | } | - |
4407 | break; | 0 |
4408 | | - |
4409 | case PE_IndicatorDockWidgetResizeHandle: | - |
4410 | pseudoElement = PseudoElement_DockWidgetSeparator; never executed (the execution status of this line is deduced): pseudoElement = PseudoElement_DockWidgetSeparator; | - |
4411 | break; | 0 |
4412 | | - |
4413 | case PE_PanelItemViewItem: | - |
4414 | pseudoElement = PseudoElement_ViewItem; never executed (the execution status of this line is deduced): pseudoElement = PseudoElement_ViewItem; | - |
4415 | break; | 0 |
4416 | | - |
4417 | case PE_PanelScrollAreaCorner: | - |
4418 | pseudoElement = PseudoElement_ScrollAreaCorner; executed (the execution status of this line is deduced): pseudoElement = PseudoElement_ScrollAreaCorner; | - |
4419 | break; executed: break; Execution Count:288 | 288 |
4420 | | - |
4421 | case PE_IndicatorSpinDown: | - |
4422 | case PE_IndicatorSpinMinus: | - |
4423 | pseudoElement = PseudoElement_SpinBoxDownArrow; never executed (the execution status of this line is deduced): pseudoElement = PseudoElement_SpinBoxDownArrow; | - |
4424 | break; | 0 |
4425 | | - |
4426 | case PE_IndicatorSpinUp: | - |
4427 | case PE_IndicatorSpinPlus: | - |
4428 | pseudoElement = PseudoElement_SpinBoxUpArrow; never executed (the execution status of this line is deduced): pseudoElement = PseudoElement_SpinBoxUpArrow; | - |
4429 | break; | 0 |
4430 | #ifndef QT_NO_TABBAR | - |
4431 | case PE_IndicatorTabClose: | - |
4432 | if (w) | 0 |
4433 | w = w->parentWidget(); //match on the QTabBar instead of the CloseButton never executed: w = w->parentWidget(); | 0 |
4434 | pseudoElement = PseudoElement_TabBarTabCloseButton; executed (the execution status of this line is deduced): pseudoElement = PseudoElement_TabBarTabCloseButton; | - |
4435 | #endif | - |
4436 | | - |
4437 | default: | - |
4438 | break; executed: break; Execution Count:32 | 32 |
4439 | } | - |
4440 | | - |
4441 | if (pseudoElement != PseudoElement_None) { evaluated: pseudoElement != PseudoElement_None yes Evaluation Count:288 | yes Evaluation Count:36 |
| 36-288 |
4442 | QRenderRule subRule = renderRule(w, opt, pseudoElement); executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, pseudoElement); | - |
4443 | if (subRule.hasDrawable()) { partially evaluated: subRule.hasDrawable() no Evaluation Count:0 | yes Evaluation Count:288 |
| 0-288 |
4444 | subRule.drawRule(p, rect); never executed (the execution status of this line is deduced): subRule.drawRule(p, rect); | - |
4445 | } else { | 0 |
4446 | baseStyle()->drawPrimitive(pe, opt, p, w); executed (the execution status of this line is deduced): baseStyle()->drawPrimitive(pe, opt, p, w); | - |
4447 | } executed: } Execution Count:288 | 288 |
4448 | } else { | - |
4449 | baseStyle()->drawPrimitive(pe, opt, p, w); executed (the execution status of this line is deduced): baseStyle()->drawPrimitive(pe, opt, p, w); | - |
4450 | } executed: } Execution Count:36 | 36 |
4451 | } | - |
4452 | | - |
4453 | QPixmap QStyleSheetStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap& pixmap, | - |
4454 | const QStyleOption *option) const | - |
4455 | { | - |
4456 | return baseStyle()->generatedIconPixmap(iconMode, pixmap, option); never executed: return baseStyle()->generatedIconPixmap(iconMode, pixmap, option); | 0 |
4457 | } | - |
4458 | | - |
4459 | QStyle::SubControl QStyleSheetStyle::hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, | - |
4460 | const QPoint &pt, const QWidget *w) const | - |
4461 | { | - |
4462 | 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 |
4463 | switch (cc) { | - |
4464 | case CC_TitleBar: | - |
4465 | if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)) { never evaluated: const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt) | 0 |
4466 | QRenderRule rule = renderRule(w, opt, PseudoElement_TitleBar); never executed (the execution status of this line is deduced): QRenderRule rule = renderRule(w, opt, PseudoElement_TitleBar); | - |
4467 | if (rule.hasDrawable() || rule.hasBox() || rule.hasBorder()) { never evaluated: rule.hasDrawable() never evaluated: rule.hasBox() never evaluated: rule.hasBorder() | 0 |
4468 | 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); | - |
4469 | QRect r; never executed (the execution status of this line is deduced): QRect r; | - |
4470 | QStyle::SubControl sc = QStyle::SC_None; never executed (the execution status of this line is deduced): QStyle::SubControl sc = QStyle::SC_None; | - |
4471 | uint ctrl = SC_TitleBarSysMenu; never executed (the execution status of this line is deduced): uint ctrl = SC_TitleBarSysMenu; | - |
4472 | while (ctrl <= SC_TitleBarLabel) { never evaluated: ctrl <= SC_TitleBarLabel | 0 |
4473 | r = layout[QStyle::SubControl(ctrl)]; never executed (the execution status of this line is deduced): r = layout[QStyle::SubControl(ctrl)]; | - |
4474 | if (r.isValid() && r.contains(pt)) { never evaluated: r.isValid() never evaluated: r.contains(pt) | 0 |
4475 | sc = QStyle::SubControl(ctrl); never executed (the execution status of this line is deduced): sc = QStyle::SubControl(ctrl); | - |
4476 | break; | 0 |
4477 | } | - |
4478 | ctrl <<= 1; never executed (the execution status of this line is deduced): ctrl <<= 1; | - |
4479 | } | 0 |
4480 | return sc; never executed: return sc; | 0 |
4481 | } | - |
4482 | } | 0 |
4483 | break; | 0 |
4484 | | - |
4485 | case CC_MdiControls: | - |
4486 | if (hasStyleRule(w, PseudoElement_MdiCloseButton) never evaluated: hasStyleRule(w, PseudoElement_MdiCloseButton) | 0 |
4487 | || hasStyleRule(w, PseudoElement_MdiNormalButton) never evaluated: hasStyleRule(w, PseudoElement_MdiNormalButton) | 0 |
4488 | || hasStyleRule(w, PseudoElement_MdiMinButton)) never evaluated: hasStyleRule(w, PseudoElement_MdiMinButton) | 0 |
4489 | return QWindowsStyle::hitTestComplexControl(cc, opt, pt, w); never executed: return QWindowsStyle::hitTestComplexControl(cc, opt, pt, w); | 0 |
4490 | break; | 0 |
4491 | | - |
4492 | case CC_ScrollBar: { | - |
4493 | QRenderRule rule = renderRule(w, opt); never executed (the execution status of this line is deduced): QRenderRule rule = renderRule(w, opt); | - |
4494 | if (!rule.hasDrawable() && !rule.hasBox()) never evaluated: !rule.hasDrawable() never evaluated: !rule.hasBox() | 0 |
4495 | break; | 0 |
4496 | } | - |
4497 | // intentionally falls through | - |
4498 | case CC_SpinBox: | - |
4499 | case CC_GroupBox: | - |
4500 | case CC_ComboBox: | - |
4501 | case CC_Slider: | - |
4502 | case CC_ToolButton: | - |
4503 | return QWindowsStyle::hitTestComplexControl(cc, opt, pt, w); never executed: return QWindowsStyle::hitTestComplexControl(cc, opt, pt, w); | 0 |
4504 | default: | - |
4505 | break; | 0 |
4506 | } | - |
4507 | | - |
4508 | return baseStyle()->hitTestComplexControl(cc, opt, pt, w); never executed: return baseStyle()->hitTestComplexControl(cc, opt, pt, w); | 0 |
4509 | } | - |
4510 | | - |
4511 | QRect QStyleSheetStyle::itemPixmapRect(const QRect &rect, int alignment, const QPixmap &pixmap) const | - |
4512 | { | - |
4513 | return baseStyle()->itemPixmapRect(rect, alignment, pixmap); never executed: return baseStyle()->itemPixmapRect(rect, alignment, pixmap); | 0 |
4514 | } | - |
4515 | | - |
4516 | QRect QStyleSheetStyle::itemTextRect(const QFontMetrics &metrics, const QRect& rect, int alignment, | - |
4517 | bool enabled, const QString& text) const | - |
4518 | { | - |
4519 | return baseStyle()->itemTextRect(metrics, rect, alignment, enabled, text); never executed: return baseStyle()->itemTextRect(metrics, rect, alignment, enabled, text); | 0 |
4520 | } | - |
4521 | | - |
4522 | int QStyleSheetStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWidget *w) const | - |
4523 | { | - |
4524 | RECURSION_GUARD(return baseStyle()->pixelMetric(m, opt, w)) never executed: return baseStyle()->pixelMetric(m, opt, w); partially evaluated: globalStyleSheetStyle != 0 no Evaluation Count:0 | yes Evaluation Count:13173 |
never evaluated: globalStyleSheetStyle != this | 0-13173 |
4525 | | - |
4526 | QRenderRule rule = renderRule(w, opt); executed (the execution status of this line is deduced): QRenderRule rule = renderRule(w, opt); | - |
4527 | QRenderRule subRule; executed (the execution status of this line is deduced): QRenderRule subRule; | - |
4528 | | - |
4529 | switch (m) { | - |
4530 | case PM_MenuButtonIndicator: | - |
4531 | #ifndef QT_NO_TOOLBUTTON | - |
4532 | // QToolButton adds this directly to the width | - |
4533 | 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 |
4534 | return 0; never executed: return 0; | 0 |
4535 | #endif | - |
4536 | subRule = renderRule(w, opt, PseudoElement_PushButtonMenuIndicator); never executed (the execution status of this line is deduced): subRule = renderRule(w, opt, PseudoElement_PushButtonMenuIndicator); | - |
4537 | if (subRule.hasContentsSize()) never evaluated: subRule.hasContentsSize() | 0 |
4538 | return subRule.size().width(); never executed: return subRule.size().width(); | 0 |
4539 | break; | 0 |
4540 | | - |
4541 | case PM_ButtonShiftHorizontal: | - |
4542 | case PM_ButtonShiftVertical: | - |
4543 | case PM_ButtonMargin: | - |
4544 | case PM_ButtonDefaultIndicator: | - |
4545 | if (rule.hasBox()) never evaluated: rule.hasBox() | 0 |
4546 | return 0; never executed: return 0; | 0 |
4547 | break; | 0 |
4548 | | - |
4549 | case PM_DefaultFrameWidth: | - |
4550 | if (!rule.hasNativeBorder()) partially evaluated: !rule.hasNativeBorder() no Evaluation Count:0 | yes Evaluation Count:214 |
| 0-214 |
4551 | return rule.border()->borders[LeftEdge]; never executed: return rule.border()->borders[LeftEdge]; | 0 |
4552 | break; executed: break; Execution Count:214 | 214 |
4553 | | - |
4554 | case PM_ExclusiveIndicatorWidth: | - |
4555 | case PM_IndicatorWidth: | - |
4556 | case PM_ExclusiveIndicatorHeight: | - |
4557 | case PM_IndicatorHeight: | - |
4558 | subRule = renderRule(w, opt, PseudoElement_Indicator); never executed (the execution status of this line is deduced): subRule = renderRule(w, opt, PseudoElement_Indicator); | - |
4559 | if (subRule.hasContentsSize()) { never evaluated: subRule.hasContentsSize() | 0 |
4560 | return (m == PM_ExclusiveIndicatorWidth) || (m == PM_IndicatorWidth) never executed: return (m == PM_ExclusiveIndicatorWidth) || (m == PM_IndicatorWidth) ? subRule.size().width() : subRule.size().height(); | 0 |
4561 | ? subRule.size().width() : subRule.size().height(); never executed: return (m == PM_ExclusiveIndicatorWidth) || (m == PM_IndicatorWidth) ? subRule.size().width() : subRule.size().height(); | 0 |
4562 | } | - |
4563 | break; | 0 |
4564 | | - |
4565 | case PM_DockWidgetFrameWidth: | - |
4566 | case PM_ToolTipLabelFrameWidth: // border + margin + padding (support only one width) | - |
4567 | if (!rule.hasDrawable()) never evaluated: !rule.hasDrawable() | 0 |
4568 | break; | 0 |
4569 | | - |
4570 | 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 |
4571 | + (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 |
4572 | | - |
4573 | case PM_ToolBarFrameWidth: | - |
4574 | if (rule.hasBorder() || rule.hasBox()) never evaluated: rule.hasBorder() never evaluated: rule.hasBox() | 0 |
4575 | 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 |
4576 | + (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 |
4577 | break; | 0 |
4578 | | - |
4579 | case PM_MenuPanelWidth: | - |
4580 | case PM_MenuBarPanelWidth: | - |
4581 | if (rule.hasBorder() || rule.hasBox()) never evaluated: rule.hasBorder() never evaluated: rule.hasBox() | 0 |
4582 | 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 |
4583 | + (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 |
4584 | break; | 0 |
4585 | | - |
4586 | | - |
4587 | case PM_MenuHMargin: | - |
4588 | case PM_MenuBarHMargin: | - |
4589 | if (rule.hasBox()) never evaluated: rule.hasBox() | 0 |
4590 | return rule.box()->paddings[LeftEdge]; never executed: return rule.box()->paddings[LeftEdge]; | 0 |
4591 | break; | 0 |
4592 | | - |
4593 | case PM_MenuVMargin: | - |
4594 | case PM_MenuBarVMargin: | - |
4595 | if (rule.hasBox()) never evaluated: rule.hasBox() | 0 |
4596 | return rule.box()->paddings[TopEdge]; never executed: return rule.box()->paddings[TopEdge]; | 0 |
4597 | break; | 0 |
4598 | | - |
4599 | case PM_DockWidgetTitleBarButtonMargin: | - |
4600 | case PM_ToolBarItemMargin: | - |
4601 | if (rule.hasBox()) never evaluated: rule.hasBox() | 0 |
4602 | return rule.box()->margins[TopEdge]; never executed: return rule.box()->margins[TopEdge]; | 0 |
4603 | break; | 0 |
4604 | | - |
4605 | case PM_ToolBarItemSpacing: | - |
4606 | case PM_MenuBarItemSpacing: | - |
4607 | if (rule.hasBox() && rule.box()->spacing != -1) never evaluated: rule.hasBox() never evaluated: rule.box()->spacing != -1 | 0 |
4608 | return rule.box()->spacing; never executed: return rule.box()->spacing; | 0 |
4609 | break; | 0 |
4610 | | - |
4611 | case PM_MenuTearoffHeight: | - |
4612 | case PM_MenuScrollerHeight: { | - |
4613 | PseudoElement ps = m == PM_MenuTearoffHeight ? PseudoElement_MenuTearoff : PseudoElement_MenuScroller; never evaluated: m == PM_MenuTearoffHeight | 0 |
4614 | subRule = renderRule(w, opt, ps); never executed (the execution status of this line is deduced): subRule = renderRule(w, opt, ps); | - |
4615 | if (subRule.hasContentsSize()) never evaluated: subRule.hasContentsSize() | 0 |
4616 | return subRule.size().height(); never executed: return subRule.size().height(); | 0 |
4617 | break; | 0 |
4618 | } | - |
4619 | | - |
4620 | case PM_ToolBarExtensionExtent: | - |
4621 | break; | 0 |
4622 | | - |
4623 | case PM_SplitterWidth: | - |
4624 | case PM_ToolBarSeparatorExtent: | - |
4625 | case PM_ToolBarHandleExtent: { | - |
4626 | PseudoElement ps; never executed (the execution status of this line is deduced): PseudoElement ps; | - |
4627 | if (m == PM_ToolBarHandleExtent) ps = PseudoElement_ToolBarHandle; never executed: ps = PseudoElement_ToolBarHandle; never evaluated: m == PM_ToolBarHandleExtent | 0 |
4628 | else if (m == PM_SplitterWidth) ps = PseudoElement_SplitterHandle; never executed: ps = PseudoElement_SplitterHandle; never evaluated: m == PM_SplitterWidth | 0 |
4629 | else ps = PseudoElement_ToolBarSeparator; never executed: ps = PseudoElement_ToolBarSeparator; | 0 |
4630 | subRule = renderRule(w, opt, ps); never executed (the execution status of this line is deduced): subRule = renderRule(w, opt, ps); | - |
4631 | if (subRule.hasContentsSize()) { never evaluated: subRule.hasContentsSize() | 0 |
4632 | QSize sz = subRule.size(); never executed (the execution status of this line is deduced): QSize sz = subRule.size(); | - |
4633 | 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 |
4634 | } | - |
4635 | break; | 0 |
4636 | } | - |
4637 | | - |
4638 | case PM_RadioButtonLabelSpacing: | - |
4639 | if (rule.hasBox() && rule.box()->spacing != -1) never evaluated: rule.hasBox() never evaluated: rule.box()->spacing != -1 | 0 |
4640 | return rule.box()->spacing; never executed: return rule.box()->spacing; | 0 |
4641 | break; | 0 |
4642 | case PM_CheckBoxLabelSpacing: | - |
4643 | if (qobject_cast<const QCheckBox *>(w)) { never evaluated: qobject_cast<const QCheckBox *>(w) | 0 |
4644 | if (rule.hasBox() && rule.box()->spacing != -1) never evaluated: rule.hasBox() never evaluated: rule.box()->spacing != -1 | 0 |
4645 | return rule.box()->spacing; never executed: return rule.box()->spacing; | 0 |
4646 | } | 0 |
4647 | // assume group box | - |
4648 | subRule = renderRule(w, opt, PseudoElement_GroupBoxTitle); never executed (the execution status of this line is deduced): subRule = renderRule(w, opt, PseudoElement_GroupBoxTitle); | - |
4649 | if (subRule.hasBox() && subRule.box()->spacing != -1) never evaluated: subRule.hasBox() never evaluated: subRule.box()->spacing != -1 | 0 |
4650 | return subRule.box()->spacing; never executed: return subRule.box()->spacing; | 0 |
4651 | break; | 0 |
4652 | | - |
4653 | #ifndef QT_NO_SCROLLBAR | - |
4654 | case PM_ScrollBarExtent: | - |
4655 | if (rule.hasContentsSize()) { partially evaluated: rule.hasContentsSize() no Evaluation Count:0 | yes Evaluation Count:6608 |
| 0-6608 |
4656 | QSize sz = rule.size(); never executed (the execution status of this line is deduced): QSize sz = rule.size(); | - |
4657 | if (const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt)) never evaluated: const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt) | 0 |
4658 | return sb->orientation == Qt::Horizontal ? sz.height() : sz.width(); never executed: return sb->orientation == Qt::Horizontal ? sz.height() : sz.width(); | 0 |
4659 | return sz.width() == -1 ? sz.height() : sz.width(); never executed: return sz.width() == -1 ? sz.height() : sz.width(); | 0 |
4660 | } | - |
4661 | break; executed: break; Execution Count:6608 | 6608 |
4662 | | - |
4663 | case PM_ScrollBarSliderMin: | - |
4664 | if (hasStyleRule(w, PseudoElement_ScrollBarSlider)) { partially evaluated: hasStyleRule(w, PseudoElement_ScrollBarSlider) no Evaluation Count:0 | yes Evaluation Count:5072 |
| 0-5072 |
4665 | subRule = renderRule(w, opt, PseudoElement_ScrollBarSlider); never executed (the execution status of this line is deduced): subRule = renderRule(w, opt, PseudoElement_ScrollBarSlider); | - |
4666 | QSize msz = subRule.minimumSize(); never executed (the execution status of this line is deduced): QSize msz = subRule.minimumSize(); | - |
4667 | if (const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt)) never evaluated: const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt) | 0 |
4668 | return sb->orientation == Qt::Horizontal ? msz.width() : msz.height(); never executed: return sb->orientation == Qt::Horizontal ? msz.width() : msz.height(); | 0 |
4669 | return msz.width() == -1 ? msz.height() : msz.width(); never executed: return msz.width() == -1 ? msz.height() : msz.width(); | 0 |
4670 | } | - |
4671 | break; executed: break; Execution Count:5072 | 5072 |
4672 | | - |
4673 | case PM_ScrollView_ScrollBarSpacing: | - |
4674 | if(!rule.hasNativeBorder() || rule.hasBox()) never evaluated: !rule.hasNativeBorder() never evaluated: rule.hasBox() | 0 |
4675 | return 0; never executed: return 0; | 0 |
4676 | break; | 0 |
4677 | #endif // QT_NO_SCROLLBAR | - |
4678 | | - |
4679 | case PM_ProgressBarChunkWidth: | - |
4680 | subRule = renderRule(w, opt, PseudoElement_ProgressBarChunk); never executed (the execution status of this line is deduced): subRule = renderRule(w, opt, PseudoElement_ProgressBarChunk); | - |
4681 | if (subRule.hasContentsSize()) { never evaluated: subRule.hasContentsSize() | 0 |
4682 | QSize sz = subRule.size(); never executed (the execution status of this line is deduced): QSize sz = subRule.size(); | - |
4683 | return (opt->state & QStyle::State_Horizontal) never executed: return (opt->state & QStyle::State_Horizontal) ? sz.width() : sz.height(); | 0 |
4684 | ? sz.width() : sz.height(); never executed: return (opt->state & QStyle::State_Horizontal) ? sz.width() : sz.height(); | 0 |
4685 | } | - |
4686 | break; | 0 |
4687 | | - |
4688 | #ifndef QT_NO_TABWIDGET | - |
4689 | case PM_TabBarTabHSpace: | - |
4690 | case PM_TabBarTabVSpace: | - |
4691 | subRule = renderRule(w, opt, PseudoElement_TabBarTab); never executed (the execution status of this line is deduced): subRule = renderRule(w, opt, PseudoElement_TabBarTab); | - |
4692 | if (subRule.hasBox() || subRule.hasBorder()) never evaluated: subRule.hasBox() never evaluated: subRule.hasBorder() | 0 |
4693 | return 0; never executed: return 0; | 0 |
4694 | break; | 0 |
4695 | | - |
4696 | case PM_TabBarScrollButtonWidth: { | - |
4697 | subRule = renderRule(w, opt, PseudoElement_TabBarScroller); never executed (the execution status of this line is deduced): subRule = renderRule(w, opt, PseudoElement_TabBarScroller); | - |
4698 | if (subRule.hasContentsSize()) { never evaluated: subRule.hasContentsSize() | 0 |
4699 | QSize sz = subRule.size(); never executed (the execution status of this line is deduced): QSize sz = subRule.size(); | - |
4700 | return sz.width() != -1 ? sz.width() : sz.height(); never executed: return sz.width() != -1 ? sz.width() : sz.height(); | 0 |
4701 | } | - |
4702 | } | - |
4703 | break; | 0 |
4704 | | - |
4705 | case PM_TabBarTabShiftHorizontal: | - |
4706 | case PM_TabBarTabShiftVertical: | - |
4707 | subRule = renderRule(w, opt, PseudoElement_TabBarTab); never executed (the execution status of this line is deduced): subRule = renderRule(w, opt, PseudoElement_TabBarTab); | - |
4708 | if (subRule.hasBox()) never evaluated: subRule.hasBox() | 0 |
4709 | return 0; never executed: return 0; | 0 |
4710 | break; | 0 |
4711 | | - |
4712 | case PM_TabBarBaseOverlap: { | - |
4713 | const QWidget *tabWidget = qobject_cast<const QTabWidget *>(w) ? w : w->parentWidget(); never evaluated: qobject_cast<const QTabWidget *>(w) | 0 |
4714 | if (hasStyleRule(tabWidget, PseudoElement_TabWidgetPane)) { never evaluated: hasStyleRule(tabWidget, PseudoElement_TabWidgetPane) | 0 |
4715 | return 0; never executed: return 0; | 0 |
4716 | } | - |
4717 | break; | 0 |
4718 | } | - |
4719 | #endif // QT_NO_TABWIDGET | - |
4720 | | - |
4721 | case PM_SliderThickness: // horizontal slider's height (sizeHint) | - |
4722 | case PM_SliderLength: // minimum length of slider | - |
4723 | if (rule.hasContentsSize()) { never evaluated: rule.hasContentsSize() | 0 |
4724 | bool horizontal = opt->state & QStyle::State_Horizontal; never executed (the execution status of this line is deduced): bool horizontal = opt->state & QStyle::State_Horizontal; | - |
4725 | if (m == PM_SliderThickness) { never evaluated: m == PM_SliderThickness | 0 |
4726 | QSize sz = rule.size(); never executed (the execution status of this line is deduced): QSize sz = rule.size(); | - |
4727 | return horizontal ? sz.height() : sz.width(); never executed: return horizontal ? sz.height() : sz.width(); | 0 |
4728 | } else { | - |
4729 | QSize msz = rule.minimumContentsSize(); never executed (the execution status of this line is deduced): QSize msz = rule.minimumContentsSize(); | - |
4730 | return horizontal ? msz.width() : msz.height(); never executed: return horizontal ? msz.width() : msz.height(); | 0 |
4731 | } | - |
4732 | } | - |
4733 | break; | 0 |
4734 | | - |
4735 | case PM_SliderControlThickness: { | - |
4736 | QRenderRule subRule = renderRule(w, opt, PseudoElement_SliderHandle); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_SliderHandle); | - |
4737 | if (!subRule.hasContentsSize()) never evaluated: !subRule.hasContentsSize() | 0 |
4738 | break; | 0 |
4739 | QSize size = subRule.size(); never executed (the execution status of this line is deduced): QSize size = subRule.size(); | - |
4740 | return (opt->state & QStyle::State_Horizontal) ? size.height() : size.width(); never executed: return (opt->state & QStyle::State_Horizontal) ? size.height() : size.width(); | 0 |
4741 | } | - |
4742 | | - |
4743 | case PM_ToolBarIconSize: | - |
4744 | case PM_ListViewIconSize: | - |
4745 | case PM_IconViewIconSize: | - |
4746 | case PM_TabBarIconSize: | - |
4747 | case PM_MessageBoxIconSize: | - |
4748 | case PM_ButtonIconSize: | - |
4749 | case PM_SmallIconSize: | - |
4750 | if (rule.hasStyleHint(QLatin1String("icon-size"))) { partially evaluated: rule.hasStyleHint(QLatin1String("icon-size")) no Evaluation Count:0 | yes Evaluation Count:34 |
| 0-34 |
4751 | return rule.styleHint(QLatin1String("icon-size")).toSize().width(); never executed: return rule.styleHint(QLatin1String("icon-size")).toSize().width(); | 0 |
4752 | } | - |
4753 | break; executed: break; Execution Count:34 | 34 |
4754 | | - |
4755 | case PM_DockWidgetTitleMargin: { | - |
4756 | QRenderRule subRule = renderRule(w, opt, PseudoElement_DockWidgetTitle); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_DockWidgetTitle); | - |
4757 | if (!subRule.hasBox()) never evaluated: !subRule.hasBox() | 0 |
4758 | break; | 0 |
4759 | 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 |
4760 | + (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 |
4761 | } | - |
4762 | | - |
4763 | case PM_DockWidgetSeparatorExtent: { | - |
4764 | QRenderRule subRule = renderRule(w, opt, PseudoElement_DockWidgetSeparator); executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_DockWidgetSeparator); | - |
4765 | if (!subRule.hasContentsSize()) partially evaluated: !subRule.hasContentsSize() yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
4766 | break; executed: break; Execution Count:1 | 1 |
4767 | QSize sz = subRule.size(); never executed (the execution status of this line is deduced): QSize sz = subRule.size(); | - |
4768 | return qMax(sz.width(), sz.height()); never executed: return qMax(sz.width(), sz.height()); | 0 |
4769 | } | - |
4770 | | - |
4771 | case PM_TitleBarHeight: { | - |
4772 | QRenderRule subRule = renderRule(w, opt, PseudoElement_TitleBar); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_TitleBar); | - |
4773 | if (subRule.hasContentsSize()) never evaluated: subRule.hasContentsSize() | 0 |
4774 | return subRule.size().height(); never executed: return subRule.size().height(); | 0 |
4775 | else if (subRule.hasBox() || subRule.hasBorder()) { never evaluated: subRule.hasBox() never evaluated: subRule.hasBorder() | 0 |
4776 | QFontMetrics fm = opt ? opt->fontMetrics : w->fontMetrics(); | 0 |
4777 | return subRule.size(QSize(0, fm.height())).height(); never executed: return subRule.size(QSize(0, fm.height())).height(); | 0 |
4778 | } | - |
4779 | break; | 0 |
4780 | } | - |
4781 | | - |
4782 | case PM_MdiSubWindowFrameWidth: | - |
4783 | if (rule.hasBox() || rule.hasBorder()) { never evaluated: rule.hasBox() never evaluated: rule.hasBorder() | 0 |
4784 | 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 |
4785 | + (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 |
4786 | } | - |
4787 | break; | 0 |
4788 | | - |
4789 | case PM_MdiSubWindowMinimizedWidth: { | - |
4790 | 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); | - |
4791 | int width = subRule.size().width(); never executed (the execution status of this line is deduced): int width = subRule.size().width(); | - |
4792 | if (width != -1) never evaluated: width != -1 | 0 |
4793 | return width; never executed: return width; | 0 |
4794 | break; | 0 |
4795 | } | - |
4796 | default: | - |
4797 | break; executed: break; Execution Count:1244 | 1244 |
4798 | } | - |
4799 | | - |
4800 | return baseStyle()->pixelMetric(m, opt, w); executed: return baseStyle()->pixelMetric(m, opt, w); Execution Count:13173 | 13173 |
4801 | } | - |
4802 | | - |
4803 | QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, | - |
4804 | const QSize &csz, const QWidget *w) const | - |
4805 | { | - |
4806 | RECURSION_GUARD(return baseStyle()->sizeFromContents(ct, opt, csz, w)) never executed: return baseStyle()->sizeFromContents(ct, opt, csz, w); partially evaluated: globalStyleSheetStyle != 0 no Evaluation Count:0 | yes Evaluation Count:5091 |
never evaluated: globalStyleSheetStyle != this | 0-5091 |
4807 | | - |
4808 | QRenderRule rule = renderRule(w, opt); executed (the execution status of this line is deduced): QRenderRule rule = renderRule(w, opt); | - |
4809 | QSize sz = rule.adjustSize(csz); executed (the execution status of this line is deduced): QSize sz = rule.adjustSize(csz); | - |
4810 | | - |
4811 | switch (ct) { | - |
4812 | case CT_SpinBox: // ### hopelessly broken QAbstractSpinBox (part 1) | - |
4813 | if (rule.hasBox() || !rule.hasNativeBorder()) never evaluated: rule.hasBox() never evaluated: !rule.hasNativeBorder() | 0 |
4814 | return csz; never executed: return csz; | 0 |
4815 | 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 |
4816 | : QWindowsStyle::sizeFromContents(ct, opt, sz, w); never executed: return rule.baseStyleCanDraw() ? baseStyle()->sizeFromContents(ct, opt, sz, w) : QWindowsStyle::sizeFromContents(ct, opt, sz, w); | 0 |
4817 | case CT_ToolButton: | - |
4818 | if (rule.hasBox() || !rule.hasNativeBorder() || !rule.baseStyleCanDraw()) never evaluated: rule.hasBox() never evaluated: !rule.hasNativeBorder() never evaluated: !rule.baseStyleCanDraw() | 0 |
4819 | sz += QSize(3, 3); // ### broken QToolButton never executed: sz += QSize(3, 3); | 0 |
4820 | //fall thought | - |
4821 | case CT_ComboBox: code before this statement never executed: case CT_ComboBox: | 0 |
4822 | case CT_PushButton: | - |
4823 | if (rule.hasBox() || !rule.hasNativeBorder()) { never evaluated: rule.hasBox() never evaluated: !rule.hasNativeBorder() | 0 |
4824 | if(ct == CT_ComboBox) { never evaluated: ct == CT_ComboBox | 0 |
4825 | //add some space for the drop down. | - |
4826 | QRenderRule subRule = renderRule(w, opt, PseudoElement_ComboBoxDropDown); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_ComboBoxDropDown); | - |
4827 | 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); | - |
4828 | //+2 because there is hardcoded margins in QCommonStyle::drawControl(CE_ComboBoxLabel) | - |
4829 | sz += QSize(comboRect.width() + 2, 0); never executed (the execution status of this line is deduced): sz += QSize(comboRect.width() + 2, 0); | - |
4830 | } | 0 |
4831 | return rule.boxSize(sz); never executed: return rule.boxSize(sz); | 0 |
4832 | } | - |
4833 | sz = rule.baseStyleCanDraw() ? baseStyle()->sizeFromContents(ct, opt, sz, w) never evaluated: rule.baseStyleCanDraw() | 0 |
4834 | : QWindowsStyle::sizeFromContents(ct, opt, sz, w); never executed (the execution status of this line is deduced): : QWindowsStyle::sizeFromContents(ct, opt, sz, w); | - |
4835 | return rule.boxSize(sz, Margin); never executed: return rule.boxSize(sz, Margin); | 0 |
4836 | | - |
4837 | case CT_HeaderSection: { | - |
4838 | if (const QStyleOptionHeader *hdr = qstyleoption_cast<const QStyleOptionHeader *>(opt)) { partially evaluated: const QStyleOptionHeader *hdr = qstyleoption_cast<const QStyleOptionHeader *>(opt) yes Evaluation Count:7 | no Evaluation Count:0 |
| 0-7 |
4839 | QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection); executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection); | - |
4840 | if (subRule.hasGeometry() || subRule.hasBox() || !subRule.hasNativeBorder()) { partially evaluated: subRule.hasGeometry() no Evaluation Count:0 | yes Evaluation Count:7 |
partially evaluated: subRule.hasBox() no Evaluation Count:0 | yes Evaluation Count:7 |
partially evaluated: !subRule.hasNativeBorder() no Evaluation Count:0 | yes Evaluation Count:7 |
| 0-7 |
4841 | sz = subRule.adjustSize(csz); never executed (the execution status of this line is deduced): sz = subRule.adjustSize(csz); | - |
4842 | if (!subRule.hasGeometry()) { never evaluated: !subRule.hasGeometry() | 0 |
4843 | QSize nativeContentsSize; never executed (the execution status of this line is deduced): QSize nativeContentsSize; | - |
4844 | bool nullIcon = hdr->icon.isNull(); never executed (the execution status of this line is deduced): bool nullIcon = hdr->icon.isNull(); | - |
4845 | int iconSize = nullIcon ? 0 : pixelMetric(QStyle::PM_SmallIconSize, hdr, w); never evaluated: nullIcon | 0 |
4846 | 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); | - |
4847 | nativeContentsSize.setHeight(qMax(iconSize, txt.height())); never executed (the execution status of this line is deduced): nativeContentsSize.setHeight(qMax(iconSize, txt.height())); | - |
4848 | nativeContentsSize.setWidth(iconSize + txt.width()); never executed (the execution status of this line is deduced): nativeContentsSize.setWidth(iconSize + txt.width()); | - |
4849 | sz = sz.expandedTo(nativeContentsSize); never executed (the execution status of this line is deduced): sz = sz.expandedTo(nativeContentsSize); | - |
4850 | } | 0 |
4851 | return subRule.size(sz); never executed: return subRule.size(sz); | 0 |
4852 | } | - |
4853 | return subRule.baseStyleCanDraw() ? baseStyle()->sizeFromContents(ct, opt, sz, w) executed: return subRule.baseStyleCanDraw() ? baseStyle()->sizeFromContents(ct, opt, sz, w) : QWindowsStyle::sizeFromContents(ct, opt, sz, w); Execution Count:7 | 7 |
4854 | : QWindowsStyle::sizeFromContents(ct, opt, sz, w); executed: return subRule.baseStyleCanDraw() ? baseStyle()->sizeFromContents(ct, opt, sz, w) : QWindowsStyle::sizeFromContents(ct, opt, sz, w); Execution Count:7 | 7 |
4855 | } | - |
4856 | } | - |
4857 | break; | 0 |
4858 | case CT_GroupBox: | - |
4859 | case CT_LineEdit: | - |
4860 | #ifndef QT_NO_SPINBOX | - |
4861 | // ### hopelessly broken QAbstractSpinBox (part 2) | - |
4862 | if (QAbstractSpinBox *spinBox = qobject_cast<QAbstractSpinBox *>(w ? w->parentWidget() : 0)) { partially evaluated: QAbstractSpinBox *spinBox = qobject_cast<QAbstractSpinBox *>(w ? w->parentWidget() : 0) no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
4863 | QRenderRule rule = renderRule(spinBox, opt); never executed (the execution status of this line is deduced): QRenderRule rule = renderRule(spinBox, opt); | - |
4864 | if (rule.hasBox() || !rule.hasNativeBorder()) never evaluated: rule.hasBox() never evaluated: !rule.hasNativeBorder() | 0 |
4865 | return csz; never executed: return csz; | 0 |
4866 | 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 |
4867 | : QWindowsStyle::sizeFromContents(ct, opt, sz, w); never executed: return rule.baseStyleCanDraw() ? baseStyle()->sizeFromContents(ct, opt, sz, w) : QWindowsStyle::sizeFromContents(ct, opt, sz, w); | 0 |
4868 | } | - |
4869 | #endif | - |
4870 | if (rule.hasBox() || !rule.hasNativeBorder()) { partially evaluated: rule.hasBox() no Evaluation Count:0 | yes Evaluation Count:2 |
partially evaluated: !rule.hasNativeBorder() no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
4871 | return rule.boxSize(sz); never executed: return rule.boxSize(sz); | 0 |
4872 | } | - |
4873 | break; executed: break; Execution Count:2 | 2 |
4874 | | - |
4875 | case CT_CheckBox: | - |
4876 | case CT_RadioButton: | - |
4877 | if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) { never evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt) | 0 |
4878 | if (rule.hasBox() || rule.hasBorder() || hasStyleRule(w, PseudoElement_Indicator)) { never evaluated: rule.hasBox() never evaluated: rule.hasBorder() never evaluated: hasStyleRule(w, PseudoElement_Indicator) | 0 |
4879 | bool isRadio = (ct == CT_RadioButton); never executed (the execution status of this line is deduced): bool isRadio = (ct == CT_RadioButton); | - |
4880 | int iw = pixelMetric(isRadio ? PM_ExclusiveIndicatorWidth never executed (the execution status of this line is deduced): int iw = pixelMetric(isRadio ? PM_ExclusiveIndicatorWidth | - |
4881 | : PM_IndicatorWidth, btn, w); never executed (the execution status of this line is deduced): : PM_IndicatorWidth, btn, w); | - |
4882 | int ih = pixelMetric(isRadio ? PM_ExclusiveIndicatorHeight never executed (the execution status of this line is deduced): int ih = pixelMetric(isRadio ? PM_ExclusiveIndicatorHeight | - |
4883 | : PM_IndicatorHeight, btn, w); never executed (the execution status of this line is deduced): : PM_IndicatorHeight, btn, w); | - |
4884 | | - |
4885 | int spacing = pixelMetric(isRadio ? PM_RadioButtonLabelSpacing never executed (the execution status of this line is deduced): int spacing = pixelMetric(isRadio ? PM_RadioButtonLabelSpacing | - |
4886 | : PM_CheckBoxLabelSpacing, btn, w); never executed (the execution status of this line is deduced): : PM_CheckBoxLabelSpacing, btn, w); | - |
4887 | sz.setWidth(sz.width() + iw + spacing); never executed (the execution status of this line is deduced): sz.setWidth(sz.width() + iw + spacing); | - |
4888 | sz.setHeight(qMax(sz.height(), ih)); never executed (the execution status of this line is deduced): sz.setHeight(qMax(sz.height(), ih)); | - |
4889 | return rule.boxSize(sz); never executed: return rule.boxSize(sz); | 0 |
4890 | } | - |
4891 | } | 0 |
4892 | break; | 0 |
4893 | | - |
4894 | case CT_Menu: | - |
4895 | case CT_MenuBar: // already has everything! | - |
4896 | case CT_ScrollBar: | - |
4897 | if (rule.hasBox() || rule.hasBorder()) partially evaluated: rule.hasBox() no Evaluation Count:0 | yes Evaluation Count:5072 |
evaluated: rule.hasBorder() yes Evaluation Count:64 | yes Evaluation Count:5008 |
| 0-5072 |
4898 | return sz; executed: return sz; Execution Count:64 | 64 |
4899 | break; executed: break; Execution Count:5008 | 5008 |
4900 | | - |
4901 | case CT_MenuItem: | - |
4902 | if (const QStyleOptionMenuItem *mi = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) { never evaluated: const QStyleOptionMenuItem *mi = qstyleoption_cast<const QStyleOptionMenuItem *>(opt) | 0 |
4903 | PseudoElement pe = (mi->menuItemType == QStyleOptionMenuItem::Separator) never evaluated: (mi->menuItemType == QStyleOptionMenuItem::Separator) | 0 |
4904 | ? PseudoElement_MenuSeparator : PseudoElement_Item; never executed (the execution status of this line is deduced): ? PseudoElement_MenuSeparator : PseudoElement_Item; | - |
4905 | QRenderRule subRule = renderRule(w, opt, pe); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, pe); | - |
4906 | if ((pe == PseudoElement_MenuSeparator) && subRule.hasContentsSize()) { never evaluated: (pe == PseudoElement_MenuSeparator) never evaluated: subRule.hasContentsSize() | 0 |
4907 | return QSize(sz.width(), subRule.size().height()); never executed: return QSize(sz.width(), subRule.size().height()); | 0 |
4908 | } else if ((pe == PseudoElement_Item) && (subRule.hasBox() || subRule.hasBorder())) { never evaluated: (pe == PseudoElement_Item) never evaluated: subRule.hasBox() never evaluated: subRule.hasBorder() | 0 |
4909 | int width = csz.width(); never executed (the execution status of this line is deduced): int width = csz.width(); | - |
4910 | if (mi->text.contains(QLatin1Char('\t'))) never evaluated: mi->text.contains(QLatin1Char('\t')) | 0 |
4911 | width += 12; //as in QCommonStyle never executed: width += 12; | 0 |
4912 | return subRule.boxSize(subRule.adjustSize(QSize(width, csz.height()))); never executed: return subRule.boxSize(subRule.adjustSize(QSize(width, csz.height()))); | 0 |
4913 | } | - |
4914 | } | - |
4915 | break; | 0 |
4916 | | - |
4917 | case CT_Splitter: | - |
4918 | case CT_MenuBarItem: { | - |
4919 | PseudoElement pe = (ct == CT_Splitter) ? PseudoElement_SplitterHandle : PseudoElement_Item; never evaluated: (ct == CT_Splitter) | 0 |
4920 | QRenderRule subRule = renderRule(w, opt, pe); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, pe); | - |
4921 | if (subRule.hasBox() || subRule.hasBorder()) never evaluated: subRule.hasBox() never evaluated: subRule.hasBorder() | 0 |
4922 | return subRule.boxSize(sz); never executed: return subRule.boxSize(sz); | 0 |
4923 | break; | 0 |
4924 | } | - |
4925 | | - |
4926 | case CT_ProgressBar: | - |
4927 | case CT_SizeGrip: | - |
4928 | return (rule.hasContentsSize()) never executed: return (rule.hasContentsSize()) ? rule.size(sz) : rule.boxSize(baseStyle()->sizeFromContents(ct, opt, sz, w)); | 0 |
4929 | ? rule.size(sz) never executed: return (rule.hasContentsSize()) ? rule.size(sz) : rule.boxSize(baseStyle()->sizeFromContents(ct, opt, sz, w)); | 0 |
4930 | : 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 |
4931 | break; | - |
4932 | | - |
4933 | case CT_Slider: | - |
4934 | if (rule.hasBorder() || rule.hasBox() || rule.hasGeometry()) never evaluated: rule.hasBorder() never evaluated: rule.hasBox() never evaluated: rule.hasGeometry() | 0 |
4935 | return rule.boxSize(sz); never executed: return rule.boxSize(sz); | 0 |
4936 | break; | 0 |
4937 | | - |
4938 | #ifndef QT_NO_TABBAR | - |
4939 | case CT_TabBarTab: { | - |
4940 | QRenderRule subRule = renderRule(w, opt, PseudoElement_TabBarTab); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_TabBarTab); | - |
4941 | if (subRule.hasBox() || !subRule.hasNativeBorder()) { never evaluated: subRule.hasBox() never evaluated: !subRule.hasNativeBorder() | 0 |
4942 | int spaceForIcon = 0; never executed (the execution status of this line is deduced): int spaceForIcon = 0; | - |
4943 | bool vertical = false; never executed (the execution status of this line is deduced): bool vertical = false; | - |
4944 | if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) { never evaluated: const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt) | 0 |
4945 | if (!tab->icon.isNull()) never evaluated: !tab->icon.isNull() | 0 |
4946 | spaceForIcon = 6 /* icon offset */ + 4 /* spacing */ + 2 /* magic */; // ###: hardcoded to match with common style never executed: spaceForIcon = 6 + 4 + 2 ; | 0 |
4947 | vertical = verticalTabs(tab->shape); never executed (the execution status of this line is deduced): vertical = verticalTabs(tab->shape); | - |
4948 | } | 0 |
4949 | 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); | - |
4950 | return subRule.boxSize(subRule.adjustSize(sz)); never executed: return subRule.boxSize(subRule.adjustSize(sz)); | 0 |
4951 | } | - |
4952 | #ifdef Q_WS_MAC | - |
4953 | if (baseStyle()->inherits("QMacStyle")) { | - |
4954 | //adjust the size after the call to the style because the mac style ignore the size arguments anyway. | - |
4955 | //this might cause the (max-){width,height} property to include the native style border while they should not. | - |
4956 | return subRule.adjustSize(baseStyle()->sizeFromContents(ct, opt, csz, w)); | - |
4957 | } | - |
4958 | #endif | - |
4959 | sz = subRule.adjustSize(csz); never executed (the execution status of this line is deduced): sz = subRule.adjustSize(csz); | - |
4960 | break; | 0 |
4961 | } | - |
4962 | #endif // QT_NO_TABBAR | - |
4963 | | - |
4964 | case CT_MdiControls: | - |
4965 | if (const QStyleOptionComplex *ccOpt = qstyleoption_cast<const QStyleOptionComplex *>(opt)) { never evaluated: const QStyleOptionComplex *ccOpt = qstyleoption_cast<const QStyleOptionComplex *>(opt) | 0 |
4966 | if (!hasStyleRule(w, PseudoElement_MdiCloseButton) never evaluated: !hasStyleRule(w, PseudoElement_MdiCloseButton) | 0 |
4967 | && !hasStyleRule(w, PseudoElement_MdiNormalButton) never evaluated: !hasStyleRule(w, PseudoElement_MdiNormalButton) | 0 |
4968 | && !hasStyleRule(w, PseudoElement_MdiMinButton)) never evaluated: !hasStyleRule(w, PseudoElement_MdiMinButton) | 0 |
4969 | break; | 0 |
4970 | | - |
4971 | 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(); | - |
4972 | if (layout.isEmpty()) never evaluated: layout.isEmpty() | 0 |
4973 | layout = subControlLayout(QLatin1String("mNX")); never executed: layout = subControlLayout(QLatin1String("mNX")); | 0 |
4974 | | - |
4975 | int width = 0, height = 0; never executed (the execution status of this line is deduced): int width = 0, height = 0; | - |
4976 | for (int i = 0; i < layout.count(); i++) { never evaluated: i < layout.count() | 0 |
4977 | int layoutButton = layout[i].toInt(); never executed (the execution status of this line is deduced): int layoutButton = layout[i].toInt(); | - |
4978 | if (layoutButton < PseudoElement_MdiCloseButton never evaluated: layoutButton < PseudoElement_MdiCloseButton | 0 |
4979 | || layoutButton > PseudoElement_MdiNormalButton) never evaluated: layoutButton > PseudoElement_MdiNormalButton | 0 |
4980 | continue; never executed: continue; | 0 |
4981 | QStyle::SubControl sc = knownPseudoElements[layoutButton].subControl; never executed (the execution status of this line is deduced): QStyle::SubControl sc = knownPseudoElements[layoutButton].subControl; | - |
4982 | if (!(ccOpt->subControls & sc)) never evaluated: !(ccOpt->subControls & sc) | 0 |
4983 | continue; never executed: continue; | 0 |
4984 | QRenderRule subRule = renderRule(w, opt, layoutButton); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, layoutButton); | - |
4985 | QSize sz = subRule.size(); never executed (the execution status of this line is deduced): QSize sz = subRule.size(); | - |
4986 | width += sz.width(); never executed (the execution status of this line is deduced): width += sz.width(); | - |
4987 | height = qMax(height, sz.height()); never executed (the execution status of this line is deduced): height = qMax(height, sz.height()); | - |
4988 | } | 0 |
4989 | | - |
4990 | return QSize(width, height); never executed: return QSize(width, height); | 0 |
4991 | } | - |
4992 | break; | 0 |
4993 | | - |
4994 | #ifndef QT_NO_ITEMVIEWS | - |
4995 | case CT_ItemViewItem: { | - |
4996 | QRenderRule subRule = renderRule(w, opt, PseudoElement_ViewItem); executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_ViewItem); | - |
4997 | sz = baseStyle()->sizeFromContents(ct, opt, csz, w); executed (the execution status of this line is deduced): sz = baseStyle()->sizeFromContents(ct, opt, csz, w); | - |
4998 | sz = subRule.adjustSize(sz); executed (the execution status of this line is deduced): sz = subRule.adjustSize(sz); | - |
4999 | if (subRule.hasBox() || subRule.hasBorder()) partially evaluated: subRule.hasBox() no Evaluation Count:0 | yes Evaluation Count:10 |
partially evaluated: subRule.hasBorder() no Evaluation Count:0 | yes Evaluation Count:10 |
| 0-10 |
5000 | sz = subRule.boxSize(sz); never executed: sz = subRule.boxSize(sz); | 0 |
5001 | return sz; executed: return sz; Execution Count:10 | 10 |
5002 | } | - |
5003 | #endif // QT_NO_ITEMVIEWS | - |
5004 | | - |
5005 | default: | - |
5006 | break; | 0 |
5007 | } | - |
5008 | | - |
5009 | return baseStyle()->sizeFromContents(ct, opt, sz, w); executed: return baseStyle()->sizeFromContents(ct, opt, sz, w); Execution Count:5010 | 5010 |
5010 | } | - |
5011 | | - |
5012 | /*! | - |
5013 | \internal | - |
5014 | */ | - |
5015 | static QLatin1String propertyNameForStandardPixmap(QStyle::StandardPixmap sp) | - |
5016 | { | - |
5017 | switch (sp) { | - |
5018 | case QStyle::SP_TitleBarMenuButton: return QLatin1String("titlebar-menu-icon"); never executed: return QLatin1String("titlebar-menu-icon"); | 0 |
5019 | case QStyle::SP_TitleBarMinButton: return QLatin1String("titlebar-minimize-icon"); never executed: return QLatin1String("titlebar-minimize-icon"); | 0 |
5020 | case QStyle::SP_TitleBarMaxButton: return QLatin1String("titlebar-maximize-icon"); never executed: return QLatin1String("titlebar-maximize-icon"); | 0 |
5021 | case QStyle::SP_TitleBarCloseButton: return QLatin1String("titlebar-close-icon"); never executed: return QLatin1String("titlebar-close-icon"); | 0 |
5022 | case QStyle::SP_TitleBarNormalButton: return QLatin1String("titlebar-normal-icon"); never executed: return QLatin1String("titlebar-normal-icon"); | 0 |
5023 | case QStyle::SP_TitleBarShadeButton: return QLatin1String("titlebar-shade-icon"); never executed: return QLatin1String("titlebar-shade-icon"); | 0 |
5024 | case QStyle::SP_TitleBarUnshadeButton: return QLatin1String("titlebar-unshade-icon"); never executed: return QLatin1String("titlebar-unshade-icon"); | 0 |
5025 | case QStyle::SP_TitleBarContextHelpButton: return QLatin1String("titlebar-contexthelp-icon"); never executed: return QLatin1String("titlebar-contexthelp-icon"); | 0 |
5026 | case QStyle::SP_DockWidgetCloseButton: return QLatin1String("dockwidget-close-icon"); never executed: return QLatin1String("dockwidget-close-icon"); | 0 |
5027 | case QStyle::SP_MessageBoxInformation: return QLatin1String("messagebox-information-icon"); never executed: return QLatin1String("messagebox-information-icon"); | 0 |
5028 | case QStyle::SP_MessageBoxWarning: return QLatin1String("messagebox-warning-icon"); never executed: return QLatin1String("messagebox-warning-icon"); | 0 |
5029 | case QStyle::SP_MessageBoxCritical: return QLatin1String("messagebox-critical-icon"); never executed: return QLatin1String("messagebox-critical-icon"); | 0 |
5030 | case QStyle::SP_MessageBoxQuestion: return QLatin1String("messagebox-question-icon"); never executed: return QLatin1String("messagebox-question-icon"); | 0 |
5031 | case QStyle::SP_DesktopIcon: return QLatin1String("desktop-icon"); never executed: return QLatin1String("desktop-icon"); | 0 |
5032 | case QStyle::SP_TrashIcon: return QLatin1String("trash-icon"); never executed: return QLatin1String("trash-icon"); | 0 |
5033 | case QStyle::SP_ComputerIcon: return QLatin1String("computer-icon"); never executed: return QLatin1String("computer-icon"); | 0 |
5034 | case QStyle::SP_DriveFDIcon: return QLatin1String("floppy-icon"); never executed: return QLatin1String("floppy-icon"); | 0 |
5035 | case QStyle::SP_DriveHDIcon: return QLatin1String("harddisk-icon"); never executed: return QLatin1String("harddisk-icon"); | 0 |
5036 | case QStyle::SP_DriveCDIcon: return QLatin1String("cd-icon"); never executed: return QLatin1String("cd-icon"); | 0 |
5037 | case QStyle::SP_DriveDVDIcon: return QLatin1String("dvd-icon"); never executed: return QLatin1String("dvd-icon"); | 0 |
5038 | case QStyle::SP_DriveNetIcon: return QLatin1String("network-icon"); never executed: return QLatin1String("network-icon"); | 0 |
5039 | case QStyle::SP_DirOpenIcon: return QLatin1String("directory-open-icon"); never executed: return QLatin1String("directory-open-icon"); | 0 |
5040 | case QStyle::SP_DirClosedIcon: return QLatin1String("directory-closed-icon"); never executed: return QLatin1String("directory-closed-icon"); | 0 |
5041 | case QStyle::SP_DirLinkIcon: return QLatin1String("directory-link-icon"); never executed: return QLatin1String("directory-link-icon"); | 0 |
5042 | case QStyle::SP_FileIcon: return QLatin1String("file-icon"); never executed: return QLatin1String("file-icon"); | 0 |
5043 | case QStyle::SP_FileLinkIcon: return QLatin1String("file-link-icon"); never executed: return QLatin1String("file-link-icon"); | 0 |
5044 | case QStyle::SP_FileDialogStart: return QLatin1String("filedialog-start-icon"); never executed: return QLatin1String("filedialog-start-icon"); | 0 |
5045 | case QStyle::SP_FileDialogEnd: return QLatin1String("filedialog-end-icon"); never executed: return QLatin1String("filedialog-end-icon"); | 0 |
5046 | case QStyle::SP_FileDialogToParent: return QLatin1String("filedialog-parent-directory-icon"); never executed: return QLatin1String("filedialog-parent-directory-icon"); | 0 |
5047 | case QStyle::SP_FileDialogNewFolder: return QLatin1String("filedialog-new-directory-icon"); never executed: return QLatin1String("filedialog-new-directory-icon"); | 0 |
5048 | case QStyle::SP_FileDialogDetailedView: return QLatin1String("filedialog-detailedview-icon"); never executed: return QLatin1String("filedialog-detailedview-icon"); | 0 |
5049 | case QStyle::SP_FileDialogInfoView: return QLatin1String("filedialog-infoview-icon"); never executed: return QLatin1String("filedialog-infoview-icon"); | 0 |
5050 | case QStyle::SP_FileDialogContentsView: return QLatin1String("filedialog-contentsview-icon"); never executed: return QLatin1String("filedialog-contentsview-icon"); | 0 |
5051 | case QStyle::SP_FileDialogListView: return QLatin1String("filedialog-listview-icon"); never executed: return QLatin1String("filedialog-listview-icon"); | 0 |
5052 | case QStyle::SP_FileDialogBack: return QLatin1String("filedialog-backward-icon"); never executed: return QLatin1String("filedialog-backward-icon"); | 0 |
5053 | case QStyle::SP_DirIcon: return QLatin1String("directory-icon"); never executed: return QLatin1String("directory-icon"); | 0 |
5054 | case QStyle::SP_DialogOkButton: return QLatin1String("dialog-ok-icon"); never executed: return QLatin1String("dialog-ok-icon"); | 0 |
5055 | case QStyle::SP_DialogCancelButton: return QLatin1String("dialog-cancel-icon"); never executed: return QLatin1String("dialog-cancel-icon"); | 0 |
5056 | case QStyle::SP_DialogHelpButton: return QLatin1String("dialog-help-icon"); never executed: return QLatin1String("dialog-help-icon"); | 0 |
5057 | case QStyle::SP_DialogOpenButton: return QLatin1String("dialog-open-icon"); never executed: return QLatin1String("dialog-open-icon"); | 0 |
5058 | case QStyle::SP_DialogSaveButton: return QLatin1String("dialog-save-icon"); never executed: return QLatin1String("dialog-save-icon"); | 0 |
5059 | case QStyle::SP_DialogCloseButton: return QLatin1String("dialog-close-icon"); never executed: return QLatin1String("dialog-close-icon"); | 0 |
5060 | case QStyle::SP_DialogApplyButton: return QLatin1String("dialog-apply-icon"); never executed: return QLatin1String("dialog-apply-icon"); | 0 |
5061 | case QStyle::SP_DialogResetButton: return QLatin1String("dialog-reset-icon"); never executed: return QLatin1String("dialog-reset-icon"); | 0 |
5062 | case QStyle::SP_DialogDiscardButton: return QLatin1String("discard-icon"); never executed: return QLatin1String("discard-icon"); | 0 |
5063 | case QStyle::SP_DialogYesButton: return QLatin1String("dialog-yes-icon"); never executed: return QLatin1String("dialog-yes-icon"); | 0 |
5064 | case QStyle::SP_DialogNoButton: return QLatin1String("dialog-no-icon"); never executed: return QLatin1String("dialog-no-icon"); | 0 |
5065 | case QStyle::SP_ArrowUp: return QLatin1String("uparrow-icon"); never executed: return QLatin1String("uparrow-icon"); | 0 |
5066 | case QStyle::SP_ArrowDown: return QLatin1String("downarrow-icon"); never executed: return QLatin1String("downarrow-icon"); | 0 |
5067 | case QStyle::SP_ArrowLeft: return QLatin1String("leftarrow-icon"); never executed: return QLatin1String("leftarrow-icon"); | 0 |
5068 | case QStyle::SP_ArrowRight: return QLatin1String("rightarrow-icon"); never executed: return QLatin1String("rightarrow-icon"); | 0 |
5069 | case QStyle::SP_ArrowBack: return QLatin1String("backward-icon"); never executed: return QLatin1String("backward-icon"); | 0 |
5070 | case QStyle::SP_ArrowForward: return QLatin1String("forward-icon"); never executed: return QLatin1String("forward-icon"); | 0 |
5071 | case QStyle::SP_DirHomeIcon: return QLatin1String("home-icon"); never executed: return QLatin1String("home-icon"); | 0 |
5072 | default: return QLatin1String(""); executed: return QLatin1String(""); Execution Count:1 | 1 |
5073 | } | - |
5074 | } | 0 |
5075 | | - |
5076 | QIcon QStyleSheetStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption *opt, | - |
5077 | const QWidget *w) const | - |
5078 | { | - |
5079 | RECURSION_GUARD(return baseStyle()->standardIcon(standardIcon, opt, w)) never executed: return baseStyle()->standardIcon(standardIcon, opt, w); partially evaluated: globalStyleSheetStyle != 0 no Evaluation Count:0 | yes Evaluation Count:1 |
never evaluated: globalStyleSheetStyle != this | 0-1 |
5080 | QString s = propertyNameForStandardPixmap(standardIcon); executed (the execution status of this line is deduced): QString s = propertyNameForStandardPixmap(standardIcon); | - |
5081 | if (!s.isEmpty()) { partially evaluated: !s.isEmpty() no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
5082 | QRenderRule rule = renderRule(w, opt); never executed (the execution status of this line is deduced): QRenderRule rule = renderRule(w, opt); | - |
5083 | if (rule.hasStyleHint(s)) never evaluated: rule.hasStyleHint(s) | 0 |
5084 | return qvariant_cast<QIcon>(rule.styleHint(s)); never executed: return qvariant_cast<QIcon>(rule.styleHint(s)); | 0 |
5085 | } | 0 |
5086 | return baseStyle()->standardIcon(standardIcon, opt, w); executed: return baseStyle()->standardIcon(standardIcon, opt, w); Execution Count:1 | 1 |
5087 | } | - |
5088 | | - |
5089 | QPalette QStyleSheetStyle::standardPalette() const | - |
5090 | { | - |
5091 | return baseStyle()->standardPalette(); never executed: return baseStyle()->standardPalette(); | 0 |
5092 | } | - |
5093 | | - |
5094 | QPixmap QStyleSheetStyle::standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, | - |
5095 | const QWidget *w) const | - |
5096 | { | - |
5097 | 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 |
5098 | QString s = propertyNameForStandardPixmap(standardPixmap); never executed (the execution status of this line is deduced): QString s = propertyNameForStandardPixmap(standardPixmap); | - |
5099 | if (!s.isEmpty()) { never evaluated: !s.isEmpty() | 0 |
5100 | QRenderRule rule = renderRule(w, opt); never executed (the execution status of this line is deduced): QRenderRule rule = renderRule(w, opt); | - |
5101 | if (rule.hasStyleHint(s)) { never evaluated: rule.hasStyleHint(s) | 0 |
5102 | 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)); | - |
5103 | return icon.pixmap(16, 16); // ###: unhard-code this if someone complains never executed: return icon.pixmap(16, 16); | 0 |
5104 | } | - |
5105 | } | 0 |
5106 | return baseStyle()->standardPixmap(standardPixmap, opt, w); never executed: return baseStyle()->standardPixmap(standardPixmap, opt, w); | 0 |
5107 | } | - |
5108 | | - |
5109 | int QStyleSheetStyle::layoutSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, | - |
5110 | Qt::Orientation orientation, const QStyleOption *option, | - |
5111 | const QWidget *widget) const | - |
5112 | { | - |
5113 | return baseStyle()->layoutSpacing(control1, control2, orientation, option, widget); never executed: return baseStyle()->layoutSpacing(control1, control2, orientation, option, widget); | 0 |
5114 | } | - |
5115 | | - |
5116 | int QStyleSheetStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w, | - |
5117 | QStyleHintReturn *shret) const | - |
5118 | { | - |
5119 | RECURSION_GUARD(return baseStyle()->styleHint(sh, opt, w, shret)) never executed: return baseStyle()->styleHint(sh, opt, w, shret); evaluated: globalStyleSheetStyle != 0 yes Evaluation Count:2 | yes Evaluation Count:23716 |
partially evaluated: globalStyleSheetStyle != this no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-23716 |
5120 | // Prevent endless loop if somebody use isActiveWindow property as selector. | - |
5121 | // QWidget::isActiveWindow uses this styleHint to determine if the window is active or not | - |
5122 | if (sh == SH_Widget_ShareActivation) evaluated: sh == SH_Widget_ShareActivation yes Evaluation Count:13956 | yes Evaluation Count:9762 |
| 9762-13956 |
5123 | return baseStyle()->styleHint(sh, opt, w, shret); executed: return baseStyle()->styleHint(sh, opt, w, shret); Execution Count:13956 | 13956 |
5124 | | - |
5125 | QRenderRule rule = renderRule(w, opt); executed (the execution status of this line is deduced): QRenderRule rule = renderRule(w, opt); | - |
5126 | QString s; executed (the execution status of this line is deduced): QString s; | - |
5127 | switch (sh) { | - |
5128 | case SH_LineEdit_PasswordCharacter: s = QLatin1String("lineedit-password-character"); break; executed: break; Execution Count:3 | 3 |
5129 | case SH_DitherDisabledText: s = QLatin1String("dither-disabled-text"); break; | 0 |
5130 | case SH_EtchDisabledText: s = QLatin1String("etch-disabled-text"); break; | 0 |
5131 | case SH_ItemView_ActivateItemOnSingleClick: s = QLatin1String("activate-on-singleclick"); break; | 0 |
5132 | case SH_ItemView_ShowDecorationSelected: s = QLatin1String("show-decoration-selected"); break; executed: break; Execution Count:33 | 33 |
5133 | case SH_Table_GridLineColor: s = QLatin1String("gridline-color"); break; executed: break; Execution Count:2 | 2 |
5134 | case SH_DialogButtonLayout: s = QLatin1String("button-layout"); break; | 0 |
5135 | case SH_ToolTipLabel_Opacity: s = QLatin1String("opacity"); break; | 0 |
5136 | case SH_ComboBox_Popup: s = QLatin1String("combobox-popup"); break; | 0 |
5137 | case SH_ComboBox_ListMouseTracking: s = QLatin1String("combobox-list-mousetracking"); break; | 0 |
5138 | case SH_MenuBar_AltKeyNavigation: s = QLatin1String("menubar-altkey-navigation"); break; executed: break; Execution Count:1 | 1 |
5139 | case SH_Menu_Scrollable: s = QLatin1String("menu-scrollable"); break; executed: break; Execution Count:1 | 1 |
5140 | case SH_DrawMenuBarSeparator: s = QLatin1String("menubar-separator"); break; | 0 |
5141 | case SH_MenuBar_MouseTracking: s = QLatin1String("mouse-tracking"); break; executed: break; Execution Count:1 | 1 |
5142 | case SH_SpinBox_ClickAutoRepeatRate: s = QLatin1String("spinbox-click-autorepeat-rate"); break; executed: break; Execution Count:1 | 1 |
5143 | case SH_SpinControls_DisableOnBounds: s = QLatin1String("spincontrol-disable-on-bounds"); break; executed: break; Execution Count:2 | 2 |
5144 | case SH_MessageBox_TextInteractionFlags: s = QLatin1String("messagebox-text-interaction-flags"); break; | 0 |
5145 | case SH_ToolButton_PopupDelay: s = QLatin1String("toolbutton-popup-delay"); break; executed: break; Execution Count:21 | 21 |
5146 | case SH_ToolBox_SelectedPageTitleBold: | - |
5147 | if (renderRule(w, opt, PseudoElement_ToolBoxTab).hasFont) never evaluated: renderRule(w, opt, PseudoElement_ToolBoxTab).hasFont | 0 |
5148 | return 0; never executed: return 0; | 0 |
5149 | break; | 0 |
5150 | case SH_GroupBox_TextLabelColor: | - |
5151 | if (rule.hasPalette() && rule.palette()->foreground.style() != Qt::NoBrush) never evaluated: rule.hasPalette() never evaluated: rule.palette()->foreground.style() != Qt::NoBrush | 0 |
5152 | return rule.palette()->foreground.color().rgba(); never executed: return rule.palette()->foreground.color().rgba(); | 0 |
5153 | break; | 0 |
5154 | case SH_ScrollView_FrameOnlyAroundContents: s = QLatin1String("scrollview-frame-around-contents"); break; executed: break; Execution Count:1954 | 1954 |
5155 | case SH_ScrollBar_ContextMenu: s = QLatin1String("scrollbar-contextmenu"); break; | 0 |
5156 | case SH_ScrollBar_LeftClickAbsolutePosition: s = QLatin1String("scrollbar-leftclick-absolute-position"); break; | 0 |
5157 | case SH_ScrollBar_MiddleClickAbsolutePosition: s = QLatin1String("scrollbar-middleclick-absolute-position"); break; | 0 |
5158 | case SH_ScrollBar_RollBetweenButtons: s = QLatin1String("scrollbar-roll-between-buttons"); break; | 0 |
5159 | case SH_ScrollBar_ScrollWhenPointerLeavesControl: s = QLatin1String("scrollbar-scroll-when-pointer-leaves-control"); break; | 0 |
5160 | case SH_TabBar_Alignment: | - |
5161 | #ifndef QT_NO_TABWIDGET | - |
5162 | if (qobject_cast<const QTabWidget *>(w)) { never evaluated: qobject_cast<const QTabWidget *>(w) | 0 |
5163 | rule = renderRule(w, opt, PseudoElement_TabWidgetTabBar); never executed (the execution status of this line is deduced): rule = renderRule(w, opt, PseudoElement_TabWidgetTabBar); | - |
5164 | if (rule.hasPosition()) never evaluated: rule.hasPosition() | 0 |
5165 | return rule.position()->position; never executed: return rule.position()->position; | 0 |
5166 | } | 0 |
5167 | #endif // QT_NO_TABWIDGET | - |
5168 | s = QLatin1String("alignment"); never executed (the execution status of this line is deduced): s = QLatin1String("alignment"); | - |
5169 | break; | 0 |
5170 | #ifndef QT_NO_TABBAR | - |
5171 | case SH_TabBar_CloseButtonPosition: | - |
5172 | rule = renderRule(w, opt, PseudoElement_TabBarTabCloseButton); never executed (the execution status of this line is deduced): rule = renderRule(w, opt, PseudoElement_TabBarTabCloseButton); | - |
5173 | if (rule.hasPosition()) { never evaluated: rule.hasPosition() | 0 |
5174 | Qt::Alignment align = rule.position()->position; never executed (the execution status of this line is deduced): Qt::Alignment align = rule.position()->position; | - |
5175 | if (align & Qt::AlignLeft || align & Qt::AlignTop) never evaluated: align & Qt::AlignLeft never evaluated: align & Qt::AlignTop | 0 |
5176 | return QTabBar::LeftSide; never executed: return QTabBar::LeftSide; | 0 |
5177 | if (align & Qt::AlignRight || align & Qt::AlignBottom) never evaluated: align & Qt::AlignRight never evaluated: align & Qt::AlignBottom | 0 |
5178 | return QTabBar::RightSide; never executed: return QTabBar::RightSide; | 0 |
5179 | } | 0 |
5180 | break; | 0 |
5181 | #endif | - |
5182 | case SH_TabBar_ElideMode: s = QLatin1String("tabbar-elide-mode"); break; executed: break; Execution Count:5 | 5 |
5183 | case SH_TabBar_PreferNoArrows: s = QLatin1String("tabbar-prefer-no-arrows"); break; executed: break; Execution Count:7 | 7 |
5184 | case SH_ComboBox_PopupFrameStyle: | - |
5185 | #ifndef QT_NO_COMBOBOX | - |
5186 | if (qobject_cast<const QComboBox *>(w)) { never evaluated: qobject_cast<const QComboBox *>(w) | 0 |
5187 | QAbstractItemView *view = w->findChild<QAbstractItemView *>(); never executed (the execution status of this line is deduced): QAbstractItemView *view = w->findChild<QAbstractItemView *>(); | - |
5188 | if (view) { | 0 |
5189 | view->ensurePolished(); never executed (the execution status of this line is deduced): view->ensurePolished(); | - |
5190 | QRenderRule subRule = renderRule(view, PseudoElement_None); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(view, PseudoElement_None); | - |
5191 | if (subRule.hasBox() || !subRule.hasNativeBorder()) never evaluated: subRule.hasBox() never evaluated: !subRule.hasNativeBorder() | 0 |
5192 | return QFrame::NoFrame; never executed: return QFrame::NoFrame; | 0 |
5193 | } | 0 |
5194 | } | 0 |
5195 | #endif // QT_NO_COMBOBOX | - |
5196 | break; | 0 |
5197 | case SH_DialogButtonBox_ButtonsHaveIcons: s = QLatin1String("dialogbuttonbox-buttons-have-icons"); break; | 0 |
5198 | case SH_Workspace_FillSpaceOnMaximize: s = QLatin1String("mdi-fill-space-on-maximize"); break; | 0 |
5199 | case SH_TitleBar_NoBorder: | - |
5200 | if (rule.hasBorder()) never evaluated: rule.hasBorder() | 0 |
5201 | return !rule.border()->borders[LeftEdge]; never executed: return !rule.border()->borders[LeftEdge]; | 0 |
5202 | break; | 0 |
5203 | case SH_TitleBar_AutoRaise: { // plain absurd | - |
5204 | QRenderRule subRule = renderRule(w, opt, PseudoElement_TitleBar); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_TitleBar); | - |
5205 | if (subRule.hasDrawable()) never evaluated: subRule.hasDrawable() | 0 |
5206 | return 1; never executed: return 1; | 0 |
5207 | break; | 0 |
5208 | } | - |
5209 | case SH_ItemView_ArrowKeysNavigateIntoChildren: s = QLatin1String("arrow-keys-navigate-into-children"); break; | 0 |
5210 | case SH_ItemView_PaintAlternatingRowColorsForEmptyArea: s = QLatin1String("paint-alternating-row-colors-for-empty-area"); break; | 0 |
5211 | default: break; executed: break; Execution Count:7731 | 7731 |
5212 | } | - |
5213 | if (!s.isEmpty() && rule.hasStyleHint(s)) { evaluated: !s.isEmpty() yes Evaluation Count:2031 | yes Evaluation Count:7731 |
partially evaluated: rule.hasStyleHint(s) no Evaluation Count:0 | yes Evaluation Count:2031 |
| 0-7731 |
5214 | return rule.styleHint(s).toInt(); never executed: return rule.styleHint(s).toInt(); | 0 |
5215 | } | - |
5216 | | - |
5217 | return baseStyle()->styleHint(sh, opt, w, shret); executed: return baseStyle()->styleHint(sh, opt, w, shret); Execution Count:9762 | 9762 |
5218 | } | - |
5219 | | - |
5220 | QRect QStyleSheetStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, | - |
5221 | const QWidget *w) const | - |
5222 | { | - |
5223 | RECURSION_GUARD(return baseStyle()->subControlRect(cc, opt, sc, w)) never executed: return baseStyle()->subControlRect(cc, opt, sc, w); partially evaluated: globalStyleSheetStyle != 0 no Evaluation Count:0 | yes Evaluation Count:1 |
never evaluated: globalStyleSheetStyle != this | 0-1 |
5224 | | - |
5225 | QRenderRule rule = renderRule(w, opt); executed (the execution status of this line is deduced): QRenderRule rule = renderRule(w, opt); | - |
5226 | switch (cc) { | - |
5227 | case CC_ComboBox: | - |
5228 | if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) { never evaluated: const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt) | 0 |
5229 | if (rule.hasBox() || !rule.hasNativeBorder()) { never evaluated: rule.hasBox() never evaluated: !rule.hasNativeBorder() | 0 |
5230 | switch (sc) { | - |
5231 | case SC_ComboBoxFrame: return rule.borderRect(opt->rect); never executed: return rule.borderRect(opt->rect); | 0 |
5232 | case SC_ComboBoxEditField: | - |
5233 | { | - |
5234 | QRenderRule subRule = renderRule(w, opt, PseudoElement_ComboBoxDropDown); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_ComboBoxDropDown); | - |
5235 | QRect r = rule.contentsRect(opt->rect); never executed (the execution status of this line is deduced): QRect r = rule.contentsRect(opt->rect); | - |
5236 | 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, | - |
5237 | opt->rect, opt->direction); never executed (the execution status of this line is deduced): opt->rect, opt->direction); | - |
5238 | if (subRule.hasPosition() && subRule.position()->position & Qt::AlignLeft) { never evaluated: subRule.hasPosition() never evaluated: subRule.position()->position & Qt::AlignLeft | 0 |
5239 | 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 |
5240 | } else { | - |
5241 | 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 |
5242 | } | - |
5243 | } | - |
5244 | case SC_ComboBoxArrow: { | - |
5245 | QRenderRule subRule = renderRule(w, opt, PseudoElement_ComboBoxDropDown); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_ComboBoxDropDown); | - |
5246 | 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 |
5247 | } | - |
5248 | case SC_ComboBoxListBoxPopup: | - |
5249 | default: | - |
5250 | return baseStyle()->subControlRect(cc, opt, sc, w); never executed: return baseStyle()->subControlRect(cc, opt, sc, w); | 0 |
5251 | } | - |
5252 | } | 0 |
5253 | | - |
5254 | QStyleOptionComboBox comboBox(*cb); never executed (the execution status of this line is deduced): QStyleOptionComboBox comboBox(*cb); | - |
5255 | comboBox.rect = rule.borderRect(opt->rect); never executed (the execution status of this line is deduced): comboBox.rect = rule.borderRect(opt->rect); | - |
5256 | 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 |
5257 | : QWindowsStyle::subControlRect(cc, &comboBox, sc, w); never executed: return rule.baseStyleCanDraw() ? baseStyle()->subControlRect(cc, &comboBox, sc, w) : QWindowsStyle::subControlRect(cc, &comboBox, sc, w); | 0 |
5258 | } | - |
5259 | break; | 0 |
5260 | | - |
5261 | #ifndef QT_NO_SPINBOX | - |
5262 | case CC_SpinBox: | - |
5263 | if (const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) { partially evaluated: const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt) yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
5264 | QRenderRule upRule = renderRule(w, opt, PseudoElement_SpinBoxUpButton); executed (the execution status of this line is deduced): QRenderRule upRule = renderRule(w, opt, PseudoElement_SpinBoxUpButton); | - |
5265 | QRenderRule downRule = renderRule(w, opt, PseudoElement_SpinBoxDownButton); executed (the execution status of this line is deduced): QRenderRule downRule = renderRule(w, opt, PseudoElement_SpinBoxDownButton); | - |
5266 | bool ruleMatch = rule.hasBox() || !rule.hasNativeBorder(); partially evaluated: rule.hasBox() no Evaluation Count:0 | yes Evaluation Count:1 |
partially evaluated: !rule.hasNativeBorder() no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
5267 | bool upRuleMatch = upRule.hasGeometry() || upRule.hasPosition(); partially evaluated: upRule.hasGeometry() no Evaluation Count:0 | yes Evaluation Count:1 |
partially evaluated: upRule.hasPosition() no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
5268 | bool downRuleMatch = downRule.hasGeometry() || upRule.hasPosition(); partially evaluated: downRule.hasGeometry() no Evaluation Count:0 | yes Evaluation Count:1 |
partially evaluated: upRule.hasPosition() no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
5269 | if (ruleMatch || upRuleMatch || downRuleMatch) { partially evaluated: ruleMatch no Evaluation Count:0 | yes Evaluation Count:1 |
partially evaluated: upRuleMatch no Evaluation Count:0 | yes Evaluation Count:1 |
partially evaluated: downRuleMatch no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
5270 | switch (sc) { | - |
5271 | case SC_SpinBoxFrame: | - |
5272 | return rule.borderRect(opt->rect); never executed: return rule.borderRect(opt->rect); | 0 |
5273 | case SC_SpinBoxEditField: | - |
5274 | { | - |
5275 | QRect r = rule.contentsRect(opt->rect); never executed (the execution status of this line is deduced): QRect r = rule.contentsRect(opt->rect); | - |
5276 | // Use the widest button on each side to determine edit field size. | - |
5277 | Qt::Alignment upAlign, downAlign; never executed (the execution status of this line is deduced): Qt::Alignment upAlign, downAlign; | - |
5278 | | - |
5279 | upAlign = upRule.hasPosition() ? upRule.position()->position never evaluated: upRule.hasPosition() | 0 |
5280 | : Qt::Alignment(Qt::AlignRight); never executed (the execution status of this line is deduced): : Qt::Alignment(Qt::AlignRight); | - |
5281 | upAlign = resolveAlignment(opt->direction, upAlign); never executed (the execution status of this line is deduced): upAlign = resolveAlignment(opt->direction, upAlign); | - |
5282 | | - |
5283 | downAlign = downRule.hasPosition() ? downRule.position()->position never evaluated: downRule.hasPosition() | 0 |
5284 | : Qt::Alignment(Qt::AlignRight); never executed (the execution status of this line is deduced): : Qt::Alignment(Qt::AlignRight); | - |
5285 | downAlign = resolveAlignment(opt->direction, downAlign); never executed (the execution status of this line is deduced): downAlign = resolveAlignment(opt->direction, downAlign); | - |
5286 | | - |
5287 | 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(); | - |
5288 | 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(); | - |
5289 | 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, | - |
5290 | (downAlign & Qt::AlignLeft) ? downSize : 0); never executed (the execution status of this line is deduced): (downAlign & Qt::AlignLeft) ? downSize : 0); | - |
5291 | 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, | - |
5292 | (downAlign & Qt::AlignRight) ? downSize : 0); never executed (the execution status of this line is deduced): (downAlign & Qt::AlignRight) ? downSize : 0); | - |
5293 | r.setRight(r.right() - widestR); never executed (the execution status of this line is deduced): r.setRight(r.right() - widestR); | - |
5294 | r.setLeft(r.left() + widestL); never executed (the execution status of this line is deduced): r.setLeft(r.left() + widestL); | - |
5295 | return r; never executed: return r; | 0 |
5296 | } | - |
5297 | case SC_SpinBoxDown: | - |
5298 | if (downRuleMatch) never evaluated: downRuleMatch | 0 |
5299 | return positionRect(w, rule, downRule, PseudoElement_SpinBoxDownButton, never executed: return positionRect(w, rule, downRule, PseudoElement_SpinBoxDownButton, opt->rect, opt->direction); | 0 |
5300 | opt->rect, opt->direction); never executed: return positionRect(w, rule, downRule, PseudoElement_SpinBoxDownButton, opt->rect, opt->direction); | 0 |
5301 | break; | 0 |
5302 | case SC_SpinBoxUp: | - |
5303 | if (upRuleMatch) never evaluated: upRuleMatch | 0 |
5304 | return positionRect(w, rule, upRule, PseudoElement_SpinBoxUpButton, never executed: return positionRect(w, rule, upRule, PseudoElement_SpinBoxUpButton, opt->rect, opt->direction); | 0 |
5305 | opt->rect, opt->direction); never executed: return positionRect(w, rule, upRule, PseudoElement_SpinBoxUpButton, opt->rect, opt->direction); | 0 |
5306 | break; | 0 |
5307 | default: | - |
5308 | break; | 0 |
5309 | } | - |
5310 | | - |
5311 | return baseStyle()->subControlRect(cc, opt, sc, w); never executed: return baseStyle()->subControlRect(cc, opt, sc, w); | 0 |
5312 | } | - |
5313 | | - |
5314 | QStyleOptionSpinBox spinBox(*spin); executed (the execution status of this line is deduced): QStyleOptionSpinBox spinBox(*spin); | - |
5315 | spinBox.rect = rule.borderRect(opt->rect); executed (the execution status of this line is deduced): spinBox.rect = rule.borderRect(opt->rect); | - |
5316 | 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 |
5317 | : 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 |
5318 | } | - |
5319 | break; | 0 |
5320 | #endif // QT_NO_SPINBOX | - |
5321 | | - |
5322 | case CC_GroupBox: | - |
5323 | if (const QStyleOptionGroupBox *gb = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)) { never evaluated: const QStyleOptionGroupBox *gb = qstyleoption_cast<const QStyleOptionGroupBox *>(opt) | 0 |
5324 | switch (sc) { | - |
5325 | case SC_GroupBoxFrame: | - |
5326 | case SC_GroupBoxContents: { | - |
5327 | if (rule.hasBox() || !rule.hasNativeBorder()) { never evaluated: rule.hasBox() never evaluated: !rule.hasNativeBorder() | 0 |
5328 | return sc == SC_GroupBoxFrame ? rule.borderRect(opt->rect) never executed: return sc == SC_GroupBoxFrame ? rule.borderRect(opt->rect) : rule.contentsRect(opt->rect); | 0 |
5329 | : rule.contentsRect(opt->rect); never executed: return sc == SC_GroupBoxFrame ? rule.borderRect(opt->rect) : rule.contentsRect(opt->rect); | 0 |
5330 | } | - |
5331 | QStyleOptionGroupBox groupBox(*gb); never executed (the execution status of this line is deduced): QStyleOptionGroupBox groupBox(*gb); | - |
5332 | groupBox.rect = rule.borderRect(opt->rect); never executed (the execution status of this line is deduced): groupBox.rect = rule.borderRect(opt->rect); | - |
5333 | return baseStyle()->subControlRect(cc, &groupBox, sc, w); never executed: return baseStyle()->subControlRect(cc, &groupBox, sc, w); | 0 |
5334 | } | - |
5335 | default: | - |
5336 | case SC_GroupBoxLabel: | - |
5337 | case SC_GroupBoxCheckBox: { | - |
5338 | QRenderRule indRule = renderRule(w, opt, PseudoElement_GroupBoxIndicator); never executed (the execution status of this line is deduced): QRenderRule indRule = renderRule(w, opt, PseudoElement_GroupBoxIndicator); | - |
5339 | QRenderRule labelRule = renderRule(w, opt, PseudoElement_GroupBoxTitle); never executed (the execution status of this line is deduced): QRenderRule labelRule = renderRule(w, opt, PseudoElement_GroupBoxTitle); | - |
5340 | if (!labelRule.hasPosition() && !labelRule.hasGeometry() && !labelRule.hasBox() never evaluated: !labelRule.hasPosition() never evaluated: !labelRule.hasGeometry() never evaluated: !labelRule.hasBox() | 0 |
5341 | && !labelRule.hasBorder() && !indRule.hasContentsSize()) { never evaluated: !labelRule.hasBorder() never evaluated: !indRule.hasContentsSize() | 0 |
5342 | QStyleOptionGroupBox groupBox(*gb); never executed (the execution status of this line is deduced): QStyleOptionGroupBox groupBox(*gb); | - |
5343 | groupBox.rect = rule.borderRect(opt->rect); never executed (the execution status of this line is deduced): groupBox.rect = rule.borderRect(opt->rect); | - |
5344 | return baseStyle()->subControlRect(cc, &groupBox, sc, w); never executed: return baseStyle()->subControlRect(cc, &groupBox, sc, w); | 0 |
5345 | } | - |
5346 | int tw = opt->fontMetrics.width(gb->text); never executed (the execution status of this line is deduced): int tw = opt->fontMetrics.width(gb->text); | - |
5347 | int th = opt->fontMetrics.height(); never executed (the execution status of this line is deduced): int th = opt->fontMetrics.height(); | - |
5348 | 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); | - |
5349 | 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); | - |
5350 | 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); | - |
5351 | | - |
5352 | if (gb->subControls & QStyle::SC_GroupBoxCheckBox) { never evaluated: gb->subControls & QStyle::SC_GroupBoxCheckBox | 0 |
5353 | tw = tw + iw + spacing; never executed (the execution status of this line is deduced): tw = tw + iw + spacing; | - |
5354 | th = qMax(th, ih); never executed (the execution status of this line is deduced): th = qMax(th, ih); | - |
5355 | } | 0 |
5356 | if (!labelRule.hasGeometry()) { never evaluated: !labelRule.hasGeometry() | 0 |
5357 | 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); | - |
5358 | } else { | 0 |
5359 | labelRule.geo->width = tw; never executed (the execution status of this line is deduced): labelRule.geo->width = tw; | - |
5360 | labelRule.geo->height = th; never executed (the execution status of this line is deduced): labelRule.geo->height = th; | - |
5361 | } | 0 |
5362 | if (!labelRule.hasPosition()) { never evaluated: !labelRule.hasPosition() | 0 |
5363 | 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), | - |
5364 | gb->textAlignment, PositionMode_Static); never executed (the execution status of this line is deduced): gb->textAlignment, PositionMode_Static); | - |
5365 | } | 0 |
5366 | 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, | - |
5367 | opt->rect, opt->direction); never executed (the execution status of this line is deduced): opt->rect, opt->direction); | - |
5368 | if (gb->subControls & SC_GroupBoxCheckBox) { never evaluated: gb->subControls & SC_GroupBoxCheckBox | 0 |
5369 | r = labelRule.contentsRect(r); never executed (the execution status of this line is deduced): r = labelRule.contentsRect(r); | - |
5370 | if (sc == SC_GroupBoxLabel) { never evaluated: sc == SC_GroupBoxLabel | 0 |
5371 | r.setLeft(r.left() + iw + spacing); never executed (the execution status of this line is deduced): r.setLeft(r.left() + iw + spacing); | - |
5372 | r.setTop(r.center().y() - th/2); never executed (the execution status of this line is deduced): r.setTop(r.center().y() - th/2); | - |
5373 | } else { | 0 |
5374 | 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); | - |
5375 | } | 0 |
5376 | return r; never executed: return r; | 0 |
5377 | } else { | - |
5378 | return labelRule.contentsRect(r); never executed: return labelRule.contentsRect(r); | 0 |
5379 | } | - |
5380 | } | - |
5381 | } // switch | - |
5382 | } | 0 |
5383 | break; | 0 |
5384 | | - |
5385 | case CC_ToolButton: | - |
5386 | if (const QStyleOptionToolButton *tb = qstyleoption_cast<const QStyleOptionToolButton *>(opt)) { never evaluated: const QStyleOptionToolButton *tb = qstyleoption_cast<const QStyleOptionToolButton *>(opt) | 0 |
5387 | if (rule.hasBox() || !rule.hasNativeBorder()) { never evaluated: rule.hasBox() never evaluated: !rule.hasNativeBorder() | 0 |
5388 | switch (sc) { | - |
5389 | case SC_ToolButton: return rule.borderRect(opt->rect); never executed: return rule.borderRect(opt->rect); | 0 |
5390 | case SC_ToolButtonMenu: { | - |
5391 | QRenderRule subRule = renderRule(w, opt, PseudoElement_ToolButtonMenu); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_ToolButtonMenu); | - |
5392 | 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 |
5393 | } | - |
5394 | default: | - |
5395 | break; | 0 |
5396 | } | - |
5397 | } | 0 |
5398 | | - |
5399 | QStyleOptionToolButton tool(*tb); never executed (the execution status of this line is deduced): QStyleOptionToolButton tool(*tb); | - |
5400 | tool.rect = rule.borderRect(opt->rect); never executed (the execution status of this line is deduced): tool.rect = rule.borderRect(opt->rect); | - |
5401 | 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 |
5402 | : QWindowsStyle::subControlRect(cc, &tool, sc, w); never executed: return rule.baseStyleCanDraw() ? baseStyle()->subControlRect(cc, &tool, sc, w) : QWindowsStyle::subControlRect(cc, &tool, sc, w); | 0 |
5403 | } | - |
5404 | break; | 0 |
5405 | | - |
5406 | #ifndef QT_NO_SCROLLBAR | - |
5407 | case CC_ScrollBar: | - |
5408 | if (const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt)) { never evaluated: const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt) | 0 |
5409 | QStyleOptionSlider styleOptionSlider(*sb); never executed (the execution status of this line is deduced): QStyleOptionSlider styleOptionSlider(*sb); | - |
5410 | styleOptionSlider.rect = rule.borderRect(opt->rect); never executed (the execution status of this line is deduced): styleOptionSlider.rect = rule.borderRect(opt->rect); | - |
5411 | if (rule.hasDrawable() || rule.hasBox()) { never evaluated: rule.hasDrawable() never evaluated: rule.hasBox() | 0 |
5412 | QRect grooveRect; never executed (the execution status of this line is deduced): QRect grooveRect; | - |
5413 | if (!rule.hasBox()) { never evaluated: !rule.hasBox() | 0 |
5414 | grooveRect = rule.baseStyleCanDraw() ? baseStyle()->subControlRect(cc, sb, SC_ScrollBarGroove, w) never evaluated: rule.baseStyleCanDraw() | 0 |
5415 | : QWindowsStyle::subControlRect(cc, sb, SC_ScrollBarGroove, w); never executed (the execution status of this line is deduced): : QWindowsStyle::subControlRect(cc, sb, SC_ScrollBarGroove, w); | - |
5416 | } else { | 0 |
5417 | grooveRect = rule.contentsRect(opt->rect); never executed (the execution status of this line is deduced): grooveRect = rule.contentsRect(opt->rect); | - |
5418 | } | 0 |
5419 | | - |
5420 | PseudoElement pe = PseudoElement_None; never executed (the execution status of this line is deduced): PseudoElement pe = PseudoElement_None; | - |
5421 | | - |
5422 | switch (sc) { | - |
5423 | case SC_ScrollBarGroove: | - |
5424 | return grooveRect; never executed: return grooveRect; | 0 |
5425 | case SC_ScrollBarAddPage: | - |
5426 | case SC_ScrollBarSubPage: | - |
5427 | case SC_ScrollBarSlider: { | - |
5428 | QRect contentRect = grooveRect; never executed (the execution status of this line is deduced): QRect contentRect = grooveRect; | - |
5429 | if (hasStyleRule(w, PseudoElement_ScrollBarSlider)) { never evaluated: hasStyleRule(w, PseudoElement_ScrollBarSlider) | 0 |
5430 | QRenderRule sliderRule = renderRule(w, opt, PseudoElement_ScrollBarSlider); never executed (the execution status of this line is deduced): QRenderRule sliderRule = renderRule(w, opt, PseudoElement_ScrollBarSlider); | - |
5431 | Origin origin = sliderRule.hasPosition() ? sliderRule.position()->origin : defaultOrigin(PseudoElement_ScrollBarSlider); never evaluated: sliderRule.hasPosition() | 0 |
5432 | contentRect = rule.originRect(opt->rect, origin); never executed (the execution status of this line is deduced): contentRect = rule.originRect(opt->rect, origin); | - |
5433 | } | 0 |
5434 | int maxlen = (styleOptionSlider.orientation == Qt::Horizontal) ? contentRect.width() : contentRect.height(); never evaluated: (styleOptionSlider.orientation == Qt::Horizontal) | 0 |
5435 | int sliderlen; never executed (the execution status of this line is deduced): int sliderlen; | - |
5436 | if (sb->maximum != sb->minimum) { never evaluated: sb->maximum != sb->minimum | 0 |
5437 | uint range = sb->maximum - sb->minimum; never executed (the execution status of this line is deduced): uint range = sb->maximum - sb->minimum; | - |
5438 | 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); | - |
5439 | | - |
5440 | int slidermin = pixelMetric(PM_ScrollBarSliderMin, sb, w); never executed (the execution status of this line is deduced): int slidermin = pixelMetric(PM_ScrollBarSliderMin, sb, w); | - |
5441 | if (sliderlen < slidermin || range > INT_MAX / 2) never evaluated: sliderlen < slidermin never evaluated: range > 2147483647 / 2 | 0 |
5442 | sliderlen = slidermin; never executed: sliderlen = slidermin; | 0 |
5443 | if (sliderlen > maxlen) never evaluated: sliderlen > maxlen | 0 |
5444 | sliderlen = maxlen; never executed: sliderlen = maxlen; | 0 |
5445 | } else { | 0 |
5446 | sliderlen = maxlen; never executed (the execution status of this line is deduced): sliderlen = maxlen; | - |
5447 | } | 0 |
5448 | | - |
5449 | int sliderstart = (styleOptionSlider.orientation == Qt::Horizontal ? contentRect.left() : contentRect.top()) never evaluated: styleOptionSlider.orientation == Qt::Horizontal | 0 |
5450 | + sliderPositionFromValue(sb->minimum, sb->maximum, sb->sliderPosition, never executed (the execution status of this line is deduced): + sliderPositionFromValue(sb->minimum, sb->maximum, sb->sliderPosition, | - |
5451 | maxlen - sliderlen, sb->upsideDown); never executed (the execution status of this line is deduced): maxlen - sliderlen, sb->upsideDown); | - |
5452 | | - |
5453 | QRect sr = (sb->orientation == Qt::Horizontal) never evaluated: (sb->orientation == Qt::Horizontal) | 0 |
5454 | ? QRect(sliderstart, contentRect.top(), sliderlen, contentRect.height()) never executed (the execution status of this line is deduced): ? QRect(sliderstart, contentRect.top(), sliderlen, contentRect.height()) | - |
5455 | : QRect(contentRect.left(), sliderstart, contentRect.width(), sliderlen); never executed (the execution status of this line is deduced): : QRect(contentRect.left(), sliderstart, contentRect.width(), sliderlen); | - |
5456 | if (sc == SC_ScrollBarSlider) { never evaluated: sc == SC_ScrollBarSlider | 0 |
5457 | return sr; never executed: return sr; | 0 |
5458 | } else if (sc == SC_ScrollBarSubPage) { never evaluated: sc == SC_ScrollBarSubPage | 0 |
5459 | 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 |
5460 | } else { // SC_ScrollBarAddPage | - |
5461 | 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 |
5462 | } | - |
5463 | break; | - |
5464 | } | - |
5465 | case SC_ScrollBarAddLine: pe = PseudoElement_ScrollBarAddLine; break; | 0 |
5466 | case SC_ScrollBarSubLine: pe = PseudoElement_ScrollBarSubLine; break; | 0 |
5467 | case SC_ScrollBarFirst: pe = PseudoElement_ScrollBarFirst; break; | 0 |
5468 | case SC_ScrollBarLast: pe = PseudoElement_ScrollBarLast; break; | 0 |
5469 | default: break; | 0 |
5470 | } | - |
5471 | if (hasStyleRule(w,pe)) { never evaluated: hasStyleRule(w,pe) | 0 |
5472 | QRenderRule subRule = renderRule(w, opt, pe); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, pe); | - |
5473 | if (subRule.hasPosition() || subRule.hasGeometry() || subRule.hasBox()) { never evaluated: subRule.hasPosition() never evaluated: subRule.hasGeometry() never evaluated: subRule.hasBox() | 0 |
5474 | const QStyleSheetPositionData *pos = subRule.position(); never executed (the execution status of this line is deduced): const QStyleSheetPositionData *pos = subRule.position(); | - |
5475 | QRect originRect = grooveRect; never executed (the execution status of this line is deduced): QRect originRect = grooveRect; | - |
5476 | if (rule.hasBox()) { never evaluated: rule.hasBox() | 0 |
5477 | Origin origin = (pos && pos->origin != Origin_Unknown) ? pos->origin : defaultOrigin(pe); never evaluated: pos never evaluated: pos->origin != Origin_Unknown | 0 |
5478 | originRect = rule.originRect(opt->rect, origin); never executed (the execution status of this line is deduced): originRect = rule.originRect(opt->rect, origin); | - |
5479 | } | 0 |
5480 | return positionRect(w, subRule, pe, originRect, styleOptionSlider.direction); never executed: return positionRect(w, subRule, pe, originRect, styleOptionSlider.direction); | 0 |
5481 | } | - |
5482 | } | 0 |
5483 | } | 0 |
5484 | 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 |
5485 | : QWindowsStyle::subControlRect(cc, &styleOptionSlider, sc, w); never executed: return rule.baseStyleCanDraw() ? baseStyle()->subControlRect(cc, &styleOptionSlider, sc, w) : QWindowsStyle::subControlRect(cc, &styleOptionSlider, sc, w); | 0 |
5486 | } | - |
5487 | break; | 0 |
5488 | #endif // QT_NO_SCROLLBAR | - |
5489 | | - |
5490 | #ifndef QT_NO_SLIDER | - |
5491 | case CC_Slider: | - |
5492 | if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) { never evaluated: const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt) | 0 |
5493 | QRenderRule subRule = renderRule(w, opt, PseudoElement_SliderGroove); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_SliderGroove); | - |
5494 | if (!subRule.hasDrawable()) never evaluated: !subRule.hasDrawable() | 0 |
5495 | break; | 0 |
5496 | subRule.img = 0; never executed (the execution status of this line is deduced): subRule.img = 0; | - |
5497 | 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); | - |
5498 | switch (sc) { | - |
5499 | case SC_SliderGroove: | - |
5500 | return gr; never executed: return gr; | 0 |
5501 | case SC_SliderHandle: { | - |
5502 | bool horizontal = slider->orientation & Qt::Horizontal; never executed (the execution status of this line is deduced): bool horizontal = slider->orientation & Qt::Horizontal; | - |
5503 | QRect cr = subRule.contentsRect(gr); never executed (the execution status of this line is deduced): QRect cr = subRule.contentsRect(gr); | - |
5504 | QRenderRule subRule2 = renderRule(w, opt, PseudoElement_SliderHandle); never executed (the execution status of this line is deduced): QRenderRule subRule2 = renderRule(w, opt, PseudoElement_SliderHandle); | - |
5505 | int len = horizontal ? subRule2.size().width() : subRule2.size().height(); never evaluated: horizontal | 0 |
5506 | subRule2.img = 0; never executed (the execution status of this line is deduced): subRule2.img = 0; | - |
5507 | subRule2.geo = 0; never executed (the execution status of this line is deduced): subRule2.geo = 0; | - |
5508 | 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); | - |
5509 | int thickness = horizontal ? cr.height() : cr.width(); never evaluated: horizontal | 0 |
5510 | 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, | - |
5511 | (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); | - |
5512 | cr = horizontal ? QRect(cr.x() + sliderPos, cr.y(), len, thickness) never evaluated: horizontal | 0 |
5513 | : 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); | - |
5514 | return subRule2.borderRect(cr); never executed: return subRule2.borderRect(cr); | 0 |
5515 | break; } | - |
5516 | case SC_SliderTickmarks: | - |
5517 | // TODO... | - |
5518 | default: | - |
5519 | break; | 0 |
5520 | } | - |
5521 | } | 0 |
5522 | break; | 0 |
5523 | #endif // QT_NO_SLIDER | - |
5524 | | - |
5525 | case CC_MdiControls: | - |
5526 | if (hasStyleRule(w, PseudoElement_MdiCloseButton) never evaluated: hasStyleRule(w, PseudoElement_MdiCloseButton) | 0 |
5527 | || hasStyleRule(w, PseudoElement_MdiNormalButton) never evaluated: hasStyleRule(w, PseudoElement_MdiNormalButton) | 0 |
5528 | || hasStyleRule(w, PseudoElement_MdiMinButton)) { never evaluated: hasStyleRule(w, PseudoElement_MdiMinButton) | 0 |
5529 | 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(); | - |
5530 | if (layout.isEmpty()) never evaluated: layout.isEmpty() | 0 |
5531 | layout = subControlLayout(QLatin1String("mNX")); never executed: layout = subControlLayout(QLatin1String("mNX")); | 0 |
5532 | | - |
5533 | int x = 0, width = 0; never executed (the execution status of this line is deduced): int x = 0, width = 0; | - |
5534 | QRenderRule subRule; never executed (the execution status of this line is deduced): QRenderRule subRule; | - |
5535 | for (int i = 0; i < layout.count(); i++) { never evaluated: i < layout.count() | 0 |
5536 | int layoutButton = layout[i].toInt(); never executed (the execution status of this line is deduced): int layoutButton = layout[i].toInt(); | - |
5537 | if (layoutButton < PseudoElement_MdiCloseButton never evaluated: layoutButton < PseudoElement_MdiCloseButton | 0 |
5538 | || layoutButton > PseudoElement_MdiNormalButton) never evaluated: layoutButton > PseudoElement_MdiNormalButton | 0 |
5539 | continue; never executed: continue; | 0 |
5540 | QStyle::SubControl control = knownPseudoElements[layoutButton].subControl; never executed (the execution status of this line is deduced): QStyle::SubControl control = knownPseudoElements[layoutButton].subControl; | - |
5541 | if (!(opt->subControls & control)) never evaluated: !(opt->subControls & control) | 0 |
5542 | continue; never executed: continue; | 0 |
5543 | subRule = renderRule(w, opt, layoutButton); never executed (the execution status of this line is deduced): subRule = renderRule(w, opt, layoutButton); | - |
5544 | width = subRule.size().width(); never executed (the execution status of this line is deduced): width = subRule.size().width(); | - |
5545 | if (sc == control) never evaluated: sc == control | 0 |
5546 | break; | 0 |
5547 | x += width; never executed (the execution status of this line is deduced): x += width; | - |
5548 | } | 0 |
5549 | | - |
5550 | 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 |
5551 | } | - |
5552 | break; | 0 |
5553 | | - |
5554 | case CC_TitleBar: | - |
5555 | if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)) { never evaluated: const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt) | 0 |
5556 | QRenderRule subRule = renderRule(w, opt, PseudoElement_TitleBar); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_TitleBar); | - |
5557 | if (!subRule.hasDrawable() && !subRule.hasBox() && !subRule.hasBorder()) never evaluated: !subRule.hasDrawable() never evaluated: !subRule.hasBox() never evaluated: !subRule.hasBorder() | 0 |
5558 | break; | 0 |
5559 | 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); | - |
5560 | return layoutRects.value(sc); never executed: return layoutRects.value(sc); | 0 |
5561 | } | - |
5562 | break; | 0 |
5563 | | - |
5564 | default: | - |
5565 | break; | 0 |
5566 | } | - |
5567 | | - |
5568 | return baseStyle()->subControlRect(cc, opt, sc, w); never executed: return baseStyle()->subControlRect(cc, opt, sc, w); | 0 |
5569 | } | - |
5570 | | - |
5571 | QRect QStyleSheetStyle::subElementRect(SubElement se, const QStyleOption *opt, const QWidget *w) const | - |
5572 | { | - |
5573 | RECURSION_GUARD(return baseStyle()->subElementRect(se, opt, w)) never executed: return baseStyle()->subElementRect(se, opt, w); evaluated: globalStyleSheetStyle != 0 yes Evaluation Count:389 | yes Evaluation Count:1604 |
partially evaluated: globalStyleSheetStyle != this no Evaluation Count:0 | yes Evaluation Count:389 |
| 0-1604 |
5574 | | - |
5575 | QRenderRule rule = renderRule(w, opt); executed (the execution status of this line is deduced): QRenderRule rule = renderRule(w, opt); | - |
5576 | #ifndef QT_NO_TABBAR | - |
5577 | int pe = PseudoElement_None; executed (the execution status of this line is deduced): int pe = PseudoElement_None; | - |
5578 | #endif | - |
5579 | | - |
5580 | switch (se) { | - |
5581 | case SE_PushButtonContents: | - |
5582 | case SE_PushButtonFocusRect: | - |
5583 | if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) { never evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt) | 0 |
5584 | QStyleOptionButton btnOpt(*btn); never executed (the execution status of this line is deduced): QStyleOptionButton btnOpt(*btn); | - |
5585 | if (rule.hasBox() || !rule.hasNativeBorder()) never evaluated: rule.hasBox() never evaluated: !rule.hasNativeBorder() | 0 |
5586 | return visualRect(opt->direction, opt->rect, rule.contentsRect(opt->rect)); never executed: return visualRect(opt->direction, opt->rect, rule.contentsRect(opt->rect)); | 0 |
5587 | return rule.baseStyleCanDraw() ? baseStyle()->subElementRect(se, &btnOpt, w) never executed: return rule.baseStyleCanDraw() ? baseStyle()->subElementRect(se, &btnOpt, w) : QWindowsStyle::subElementRect(se, &btnOpt, w); | 0 |
5588 | : QWindowsStyle::subElementRect(se, &btnOpt, w); never executed: return rule.baseStyleCanDraw() ? baseStyle()->subElementRect(se, &btnOpt, w) : QWindowsStyle::subElementRect(se, &btnOpt, w); | 0 |
5589 | } | - |
5590 | break; | 0 |
5591 | | - |
5592 | case SE_LineEditContents: | - |
5593 | case SE_FrameContents: | - |
5594 | case SE_ShapedFrameContents: | - |
5595 | if (rule.hasBox() || !rule.hasNativeBorder()) { partially evaluated: rule.hasBox() no Evaluation Count:0 | yes Evaluation Count:1187 |
evaluated: !rule.hasNativeBorder() yes Evaluation Count:6 | yes Evaluation Count:1181 |
| 0-1187 |
5596 | return visualRect(opt->direction, opt->rect, rule.contentsRect(opt->rect)); executed: return visualRect(opt->direction, opt->rect, rule.contentsRect(opt->rect)); Execution Count:6 | 6 |
5597 | } | - |
5598 | break; executed: break; Execution Count:1181 | 1181 |
5599 | | - |
5600 | case SE_CheckBoxIndicator: | - |
5601 | case SE_RadioButtonIndicator: | - |
5602 | if (rule.hasBox() || rule.hasBorder() || hasStyleRule(w, PseudoElement_Indicator)) { never evaluated: rule.hasBox() never evaluated: rule.hasBorder() never evaluated: hasStyleRule(w, PseudoElement_Indicator) | 0 |
5603 | PseudoElement pe = se == SE_CheckBoxIndicator ? PseudoElement_Indicator : PseudoElement_ExclusiveIndicator; never evaluated: se == SE_CheckBoxIndicator | 0 |
5604 | QRenderRule subRule = renderRule(w, opt, pe); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, pe); | - |
5605 | return positionRect(w, rule, subRule, pe, opt->rect, opt->direction); never executed: return positionRect(w, rule, subRule, pe, opt->rect, opt->direction); | 0 |
5606 | } | - |
5607 | break; | 0 |
5608 | | - |
5609 | case SE_CheckBoxContents: | - |
5610 | case SE_RadioButtonContents: | - |
5611 | if (rule.hasBox() || rule.hasBorder() || hasStyleRule(w, PseudoElement_Indicator)) { never evaluated: rule.hasBox() never evaluated: rule.hasBorder() never evaluated: hasStyleRule(w, PseudoElement_Indicator) | 0 |
5612 | bool isRadio = se == SE_RadioButtonContents; never executed (the execution status of this line is deduced): bool isRadio = se == SE_RadioButtonContents; | - |
5613 | 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, | - |
5614 | opt, w); never executed (the execution status of this line is deduced): opt, w); | - |
5615 | ir = visualRect(opt->direction, opt->rect, ir); never executed (the execution status of this line is deduced): ir = visualRect(opt->direction, opt->rect, ir); | - |
5616 | 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); | - |
5617 | QRect cr = rule.contentsRect(opt->rect); never executed (the execution status of this line is deduced): QRect cr = rule.contentsRect(opt->rect); | - |
5618 | 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(), | - |
5619 | cr.width() - ir.width() - spacing, cr.height()); never executed (the execution status of this line is deduced): cr.width() - ir.width() - spacing, cr.height()); | - |
5620 | return visualRect(opt->direction, opt->rect, ir); never executed: return visualRect(opt->direction, opt->rect, ir); | 0 |
5621 | } | - |
5622 | break; | 0 |
5623 | | - |
5624 | case SE_ToolBoxTabContents: | - |
5625 | if (w && hasStyleRule(w->parentWidget(), PseudoElement_ToolBoxTab)) { never evaluated: w never evaluated: hasStyleRule(w->parentWidget(), PseudoElement_ToolBoxTab) | 0 |
5626 | 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); | - |
5627 | return visualRect(opt->direction, opt->rect, subRule.contentsRect(opt->rect)); never executed: return visualRect(opt->direction, opt->rect, subRule.contentsRect(opt->rect)); | 0 |
5628 | } | - |
5629 | break; | 0 |
5630 | | - |
5631 | case SE_RadioButtonFocusRect: | - |
5632 | case SE_RadioButtonClickRect: // focusrect | indicator | - |
5633 | if (rule.hasBox() || rule.hasBorder() || hasStyleRule(w, PseudoElement_Indicator)) { never evaluated: rule.hasBox() never evaluated: rule.hasBorder() never evaluated: hasStyleRule(w, PseudoElement_Indicator) | 0 |
5634 | return opt->rect; never executed: return opt->rect; | 0 |
5635 | } | - |
5636 | break; | 0 |
5637 | | - |
5638 | case SE_CheckBoxFocusRect: | - |
5639 | case SE_CheckBoxClickRect: // relies on indicator and contents | - |
5640 | return ParentStyle::subElementRect(se, opt, w); never executed: return ParentStyle::subElementRect(se, opt, w); | 0 |
5641 | | - |
5642 | #ifndef QT_NO_ITEMVIEWS | - |
5643 | case SE_ViewItemCheckIndicator: | - |
5644 | if (!qstyleoption_cast<const QStyleOptionViewItem *>(opt)) { never evaluated: !qstyleoption_cast<const QStyleOptionViewItem *>(opt) | 0 |
5645 | return subElementRect(SE_CheckBoxIndicator, opt, w); never executed: return subElementRect(SE_CheckBoxIndicator, opt, w); | 0 |
5646 | } | - |
5647 | // intentionally falls through | - |
5648 | case SE_ItemViewItemText: code before this statement never executed: case SE_ItemViewItemText: | 0 |
5649 | case SE_ItemViewItemDecoration: | - |
5650 | case SE_ItemViewItemFocusRect: | - |
5651 | if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) { never evaluated: const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt) | 0 |
5652 | QRenderRule subRule = renderRule(w, opt, PseudoElement_ViewItem); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_ViewItem); | - |
5653 | PseudoElement pe = PseudoElement_None; never executed (the execution status of this line is deduced): PseudoElement pe = PseudoElement_None; | - |
5654 | if (se == SE_ItemViewItemText || se == SE_ItemViewItemFocusRect) never evaluated: se == SE_ItemViewItemText never evaluated: se == SE_ItemViewItemFocusRect | 0 |
5655 | pe = PseudoElement_ViewItemText; never executed: pe = PseudoElement_ViewItemText; | 0 |
5656 | else if (se == SE_ItemViewItemDecoration && vopt->features & QStyleOptionViewItem::HasDecoration) never evaluated: se == SE_ItemViewItemDecoration never evaluated: vopt->features & QStyleOptionViewItem::HasDecoration | 0 |
5657 | pe = PseudoElement_ViewItemIcon; never executed: pe = PseudoElement_ViewItemIcon; | 0 |
5658 | else if (se == SE_ItemViewItemCheckIndicator && vopt->features & QStyleOptionViewItem::HasCheckIndicator) never evaluated: se == SE_ItemViewItemCheckIndicator never evaluated: vopt->features & QStyleOptionViewItem::HasCheckIndicator | 0 |
5659 | pe = PseudoElement_ViewItemIndicator; never executed: pe = PseudoElement_ViewItemIndicator; | 0 |
5660 | else | - |
5661 | break; | 0 |
5662 | 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 |
5663 | QRenderRule subRule2 = renderRule(w, opt, pe); never executed (the execution status of this line is deduced): QRenderRule subRule2 = renderRule(w, opt, pe); | - |
5664 | QStyleOptionViewItem optCopy(*vopt); never executed (the execution status of this line is deduced): QStyleOptionViewItem optCopy(*vopt); | - |
5665 | optCopy.rect = subRule.contentsRect(vopt->rect); never executed (the execution status of this line is deduced): optCopy.rect = subRule.contentsRect(vopt->rect); | - |
5666 | QRect rect = ParentStyle::subElementRect(se, &optCopy, w); never executed (the execution status of this line is deduced): QRect rect = ParentStyle::subElementRect(se, &optCopy, w); | - |
5667 | return positionRect(w, subRule2, pe, rect, opt->direction); never executed: return positionRect(w, subRule2, pe, rect, opt->direction); | 0 |
5668 | } | - |
5669 | } | 0 |
5670 | break; | 0 |
5671 | #endif // QT_NO_ITEMVIEWS | - |
5672 | | - |
5673 | case SE_HeaderArrow: { | - |
5674 | QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewUpArrow); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewUpArrow); | - |
5675 | if (subRule.hasPosition() || subRule.hasGeometry()) never evaluated: subRule.hasPosition() never evaluated: subRule.hasGeometry() | 0 |
5676 | 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 |
5677 | } | - |
5678 | break; | 0 |
5679 | | - |
5680 | case SE_HeaderLabel: { | - |
5681 | QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection); | - |
5682 | if (subRule.hasBox() || !subRule.hasNativeBorder()) never evaluated: subRule.hasBox() never evaluated: !subRule.hasNativeBorder() | 0 |
5683 | return subRule.contentsRect(opt->rect); never executed: return subRule.contentsRect(opt->rect); | 0 |
5684 | } | - |
5685 | break; | 0 |
5686 | | - |
5687 | case SE_ProgressBarGroove: | - |
5688 | case SE_ProgressBarContents: | - |
5689 | case SE_ProgressBarLabel: | - |
5690 | if (const QStyleOptionProgressBarV2 *pb = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt)) { never evaluated: const QStyleOptionProgressBarV2 *pb = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt) | 0 |
5691 | 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 |
5692 | if (se == SE_ProgressBarGroove) never evaluated: se == SE_ProgressBarGroove | 0 |
5693 | return rule.borderRect(pb->rect); never executed: return rule.borderRect(pb->rect); | 0 |
5694 | else if (se == SE_ProgressBarContents) never evaluated: se == SE_ProgressBarContents | 0 |
5695 | return rule.contentsRect(pb->rect); never executed: return rule.contentsRect(pb->rect); | 0 |
5696 | | - |
5697 | 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); | - |
5698 | 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 |
5699 | sz, pb->rect); never executed: return QStyle::alignedRect(Qt::LeftToRight, rule.hasPosition() ? rule.position()->textAlignment : pb->textAlignment, sz, pb->rect); | 0 |
5700 | } | - |
5701 | } | 0 |
5702 | break; | 0 |
5703 | | - |
5704 | #ifndef QT_NO_TABBAR | - |
5705 | case SE_TabWidgetLeftCorner: | - |
5706 | pe = PseudoElement_TabWidgetLeftCorner; never executed (the execution status of this line is deduced): pe = PseudoElement_TabWidgetLeftCorner; | - |
5707 | // intentionally falls through | - |
5708 | case SE_TabWidgetRightCorner: code before this statement never executed: case SE_TabWidgetRightCorner: | 0 |
5709 | if (pe == PseudoElement_None) never evaluated: pe == PseudoElement_None | 0 |
5710 | pe = PseudoElement_TabWidgetRightCorner; never executed: pe = PseudoElement_TabWidgetRightCorner; | 0 |
5711 | // intentionally falls through | - |
5712 | case SE_TabWidgetTabBar: code before this statement never executed: case SE_TabWidgetTabBar: | 0 |
5713 | if (pe == PseudoElement_None) never evaluated: pe == PseudoElement_None | 0 |
5714 | pe = PseudoElement_TabWidgetTabBar; never executed: pe = PseudoElement_TabWidgetTabBar; | 0 |
5715 | // intentionally falls through | - |
5716 | case SE_TabWidgetTabPane: code before this statement never executed: case SE_TabWidgetTabPane: | 0 |
5717 | case SE_TabWidgetTabContents: | - |
5718 | if (pe == PseudoElement_None) never evaluated: pe == PseudoElement_None | 0 |
5719 | pe = PseudoElement_TabWidgetPane; never executed: pe = PseudoElement_TabWidgetPane; | 0 |
5720 | | - |
5721 | if (hasStyleRule(w, pe)) { never evaluated: hasStyleRule(w, pe) | 0 |
5722 | 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); | - |
5723 | QRenderRule subRule = renderRule(w, opt, pe); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, pe); | - |
5724 | 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); | - |
5725 | if (pe == PseudoElement_TabWidgetTabBar) { never evaluated: pe == PseudoElement_TabWidgetTabBar | 0 |
5726 | Q_ASSERT(opt); never executed (the execution status of this line is deduced): qt_noop(); | - |
5727 | r = opt->rect.intersected(r); never executed (the execution status of this line is deduced): r = opt->rect.intersected(r); | - |
5728 | } | 0 |
5729 | if (se == SE_TabWidgetTabContents) never evaluated: se == SE_TabWidgetTabContents | 0 |
5730 | r = subRule.contentsRect(r); never executed: r = subRule.contentsRect(r); | 0 |
5731 | return r; never executed: return r; | 0 |
5732 | } | - |
5733 | break; | 0 |
5734 | | - |
5735 | case SE_TabBarTearIndicator: { | - |
5736 | QRenderRule subRule = renderRule(w, opt, PseudoElement_TabBarTear); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_TabBarTear); | - |
5737 | if (subRule.hasContentsSize()) { never evaluated: subRule.hasContentsSize() | 0 |
5738 | QRect r; never executed (the execution status of this line is deduced): QRect r; | - |
5739 | if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) { never evaluated: const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt) | 0 |
5740 | switch (tab->shape) { | - |
5741 | case QTabBar::RoundedNorth: | - |
5742 | case QTabBar::TriangularNorth: | - |
5743 | case QTabBar::RoundedSouth: | - |
5744 | case QTabBar::TriangularSouth: | - |
5745 | 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()); | - |
5746 | break; | 0 |
5747 | case QTabBar::RoundedWest: | - |
5748 | case QTabBar::TriangularWest: | - |
5749 | case QTabBar::RoundedEast: | - |
5750 | case QTabBar::TriangularEast: | - |
5751 | 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()); | - |
5752 | break; | 0 |
5753 | default: | - |
5754 | break; | 0 |
5755 | } | - |
5756 | r = visualRect(opt->direction, opt->rect, r); never executed (the execution status of this line is deduced): r = visualRect(opt->direction, opt->rect, r); | - |
5757 | } | 0 |
5758 | return r; never executed: return r; | 0 |
5759 | } | - |
5760 | break; | 0 |
5761 | } | - |
5762 | case SE_TabBarTabText: | - |
5763 | case SE_TabBarTabLeftButton: | - |
5764 | case SE_TabBarTabRightButton: { | - |
5765 | QRenderRule subRule = renderRule(w, opt, PseudoElement_TabBarTab); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_TabBarTab); | - |
5766 | if (subRule.hasBox() || !subRule.hasNativeBorder()) { never evaluated: subRule.hasBox() never evaluated: !subRule.hasNativeBorder() | 0 |
5767 | return ParentStyle::subElementRect(se, opt, w); never executed: return ParentStyle::subElementRect(se, opt, w); | 0 |
5768 | } | - |
5769 | break; | 0 |
5770 | } | - |
5771 | #endif // QT_NO_TABBAR | - |
5772 | | - |
5773 | case SE_DockWidgetCloseButton: | - |
5774 | case SE_DockWidgetFloatButton: { | - |
5775 | PseudoElement pe = (se == SE_DockWidgetCloseButton) ? PseudoElement_DockWidgetCloseButton : PseudoElement_DockWidgetFloatButton; never evaluated: (se == SE_DockWidgetCloseButton) | 0 |
5776 | QRenderRule subRule2 = renderRule(w, opt, pe); never executed (the execution status of this line is deduced): QRenderRule subRule2 = renderRule(w, opt, pe); | - |
5777 | if (!subRule2.hasPosition()) never evaluated: !subRule2.hasPosition() | 0 |
5778 | break; | 0 |
5779 | QRenderRule subRule = renderRule(w, opt, PseudoElement_DockWidgetTitle); never executed (the execution status of this line is deduced): QRenderRule subRule = renderRule(w, opt, PseudoElement_DockWidgetTitle); | - |
5780 | return positionRect(w, subRule, subRule2, pe, opt->rect, opt->direction); never executed: return positionRect(w, subRule, subRule2, pe, opt->rect, opt->direction); | 0 |
5781 | } | - |
5782 | | - |
5783 | #ifndef QT_NO_TOOLBAR | - |
5784 | case SE_ToolBarHandle: | - |
5785 | if (hasStyleRule(w, PseudoElement_ToolBarHandle)) never evaluated: hasStyleRule(w, PseudoElement_ToolBarHandle) | 0 |
5786 | return ParentStyle::subElementRect(se, opt, w); never executed: return ParentStyle::subElementRect(se, opt, w); | 0 |
5787 | break; | 0 |
5788 | #endif //QT_NO_TOOLBAR | - |
5789 | | - |
5790 | default: | - |
5791 | break; executed: break; Execution Count:806 | 806 |
5792 | } | - |
5793 | | - |
5794 | return baseStyle()->subElementRect(se, opt, w); executed: return baseStyle()->subElementRect(se, opt, w); Execution Count:1987 | 1987 |
5795 | } | - |
5796 | | - |
5797 | bool QStyleSheetStyle::event(QEvent *e) | - |
5798 | { | - |
5799 | return (baseStyle()->event(e) && e->isAccepted()) || ParentStyle::event(e); executed: return (baseStyle()->event(e) && e->isAccepted()) || ParentStyle::event(e); Execution Count:777 | 777 |
5800 | } | - |
5801 | | - |
5802 | void QStyleSheetStyle::updateStyleSheetFont(QWidget* w) const | - |
5803 | { | - |
5804 | QWidget *container = containerWidget(w); executed (the execution status of this line is deduced): QWidget *container = containerWidget(w); | - |
5805 | QRenderRule rule = renderRule(container, PseudoElement_None, executed (the execution status of this line is deduced): QRenderRule rule = renderRule(container, PseudoElement_None, | - |
5806 | PseudoClass_Active | PseudoClass_Enabled | extendedPseudoClass(container)); executed (the execution status of this line is deduced): PseudoClass_Active | PseudoClass_Enabled | extendedPseudoClass(container)); | - |
5807 | QFont font = rule.font.resolve(w->font()); executed (the execution status of this line is deduced): QFont font = rule.font.resolve(w->font()); | - |
5808 | | - |
5809 | if ((!w->isWindow() || w->testAttribute(Qt::WA_WindowPropagation)) evaluated: !w->isWindow() yes Evaluation Count:1959 | yes Evaluation Count:387 |
partially evaluated: w->testAttribute(Qt::WA_WindowPropagation) no Evaluation Count:0 | yes Evaluation Count:387 |
| 0-1959 |
5810 | && isNaturalChild(w) && qobject_cast<QWidget *>(w->parent())) { evaluated: isNaturalChild(w) yes Evaluation Count:783 | yes Evaluation Count:1176 |
partially evaluated: qobject_cast<QWidget *>(w->parent()) yes Evaluation Count:783 | no Evaluation Count:0 |
| 0-1176 |
5811 | | - |
5812 | font = font.resolve(static_cast<QWidget *>(w->parent())->font()); executed (the execution status of this line is deduced): font = font.resolve(static_cast<QWidget *>(w->parent())->font()); | - |
5813 | } executed: } Execution Count:783 | 783 |
5814 | | - |
5815 | if (w->data->fnt == font) evaluated: w->data->fnt == font yes Evaluation Count:2345 | yes Evaluation Count:1 |
| 1-2345 |
5816 | return; executed: return; Execution Count:2345 | 2345 |
5817 | | - |
5818 | w->data->fnt = font; executed (the execution status of this line is deduced): w->data->fnt = font; | - |
5819 | | - |
5820 | QEvent e(QEvent::FontChange); executed (the execution status of this line is deduced): QEvent e(QEvent::FontChange); | - |
5821 | QApplication::sendEvent(w, &e); executed (the execution status of this line is deduced): QApplication::sendEvent(w, &e); | - |
5822 | } executed: } Execution Count:1 | 1 |
5823 | | - |
5824 | void QStyleSheetStyle::saveWidgetFont(QWidget* w, const QFont& font) const | - |
5825 | { | - |
5826 | w->setProperty("_q_styleSheetWidgetFont", font); executed (the execution status of this line is deduced): w->setProperty("_q_styleSheetWidgetFont", font); | - |
5827 | } executed: } Execution Count:1957 | 1957 |
5828 | | - |
5829 | void QStyleSheetStyle::clearWidgetFont(QWidget* w) const | - |
5830 | { | - |
5831 | w->setProperty("_q_styleSheetWidgetFont", QVariant(QVariant::Invalid)); executed (the execution status of this line is deduced): w->setProperty("_q_styleSheetWidgetFont", QVariant(QVariant::Invalid)); | - |
5832 | } executed: } Execution Count:2 | 2 |
5833 | | - |
5834 | // Polish palette that should be used for a particular widget, with particular states | - |
5835 | // (eg. :focus, :hover, ...) | - |
5836 | // this is called by widgets that paint themself in their paint event | - |
5837 | // Returns true if there is a new palette in pal. | - |
5838 | bool QStyleSheetStyle::styleSheetPalette(const QWidget* w, const QStyleOption* opt, QPalette* pal) | - |
5839 | { | - |
5840 | if (!w || !opt || !pal) partially evaluated: !w no Evaluation Count:0 | yes Evaluation Count:7 |
partially evaluated: !opt no Evaluation Count:0 | yes Evaluation Count:7 |
partially evaluated: !pal no Evaluation Count:0 | yes Evaluation Count:7 |
| 0-7 |
5841 | return false; never executed: return false; | 0 |
5842 | | - |
5843 | RECURSION_GUARD(return false) never executed: return false; partially evaluated: globalStyleSheetStyle != 0 no Evaluation Count:0 | yes Evaluation Count:7 |
never evaluated: globalStyleSheetStyle != this | 0-7 |
5844 | | - |
5845 | w = containerWidget(w); executed (the execution status of this line is deduced): w = containerWidget(w); | - |
5846 | | - |
5847 | 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)); | - |
5848 | if (!rule.hasPalette()) partially evaluated: !rule.hasPalette() yes Evaluation Count:7 | no Evaluation Count:0 |
| 0-7 |
5849 | return false; executed: return false; Execution Count:7 | 7 |
5850 | | - |
5851 | rule.configurePalette(pal, QPalette::NoRole, QPalette::NoRole); never executed (the execution status of this line is deduced): rule.configurePalette(pal, QPalette::NoRole, QPalette::NoRole); | - |
5852 | return true; never executed: return true; | 0 |
5853 | } | - |
5854 | | - |
5855 | Qt::Alignment QStyleSheetStyle::resolveAlignment(Qt::LayoutDirection layDir, Qt::Alignment src) | - |
5856 | { | - |
5857 | if (layDir == Qt::LeftToRight || src & Qt::AlignAbsolute) never evaluated: layDir == Qt::LeftToRight never evaluated: src & Qt::AlignAbsolute | 0 |
5858 | return src; never executed: return src; | 0 |
5859 | | - |
5860 | if (src & Qt::AlignLeft) { never evaluated: src & Qt::AlignLeft | 0 |
5861 | src &= ~Qt::AlignLeft; never executed (the execution status of this line is deduced): src &= ~Qt::AlignLeft; | - |
5862 | src |= Qt::AlignRight; never executed (the execution status of this line is deduced): src |= Qt::AlignRight; | - |
5863 | } else if (src & Qt::AlignRight) { never executed: } never evaluated: src & Qt::AlignRight | 0 |
5864 | src &= ~Qt::AlignRight; never executed (the execution status of this line is deduced): src &= ~Qt::AlignRight; | - |
5865 | src |= Qt::AlignLeft; never executed (the execution status of this line is deduced): src |= Qt::AlignLeft; | - |
5866 | } | 0 |
5867 | src |= Qt::AlignAbsolute; never executed (the execution status of this line is deduced): src |= Qt::AlignAbsolute; | - |
5868 | return src; never executed: return src; | 0 |
5869 | } | - |
5870 | | - |
5871 | // Returns whether the given QWidget has a "natural" parent, meaning that | - |
5872 | // the parent contains this child as part of its normal operation. | - |
5873 | // An example is the QTabBar inside a QTabWidget. | - |
5874 | // This does not mean that any QTabBar which is a child of QTabWidget will | - |
5875 | // match, only the one that was created by the QTabWidget initialization | - |
5876 | // (and hence has the correct object name). | - |
5877 | bool QStyleSheetStyle::isNaturalChild(const QObject *obj) | - |
5878 | { | - |
5879 | if (obj->objectName().startsWith(QLatin1String("qt_"))) evaluated: obj->objectName().startsWith(QLatin1String("qt_")) yes Evaluation Count:783 | yes Evaluation Count:1176 |
| 783-1176 |
5880 | return true; executed: return true; Execution Count:783 | 783 |
5881 | | - |
5882 | return false; executed: return false; Execution Count:1176 | 1176 |
5883 | } | - |
5884 | | - |
5885 | QT_END_NAMESPACE | - |
5886 | | - |
5887 | #include "moc_qstylesheetstyle_p.cpp" | - |
5888 | | - |
5889 | #endif // QT_NO_STYLE_STYLESHEET | - |
5890 | | - |
| | |