styles/qwindowsstyle.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4 -
5 -
6 -
7 -
8 -
9 -
10 -
11enum QSliderDirection { SlUp, SlDown, SlLeft, SlRight }; -
12 -
13 -
14 -
15 -
16QWindowsStylePrivate::QWindowsStylePrivate() -
17 : alt_down(false), menuBarTimer(0) -
18{ -
19 -
20 -
21 -
22 -
23 -
24 -
25 -
26}
executed: }
Execution Count:897
897
27 -
28 -
29bool QWindowsStylePrivate::hasSeenAlt(const QWidget *widget) const -
30{ -
31 widget = widget->window(); -
32 return seenAlt.contains(widget);
never executed: return seenAlt.contains(widget);
0
33} -
34 -
35 -
36 -
37 -
38bool QWindowsStyle::eventFilter(QObject *o, QEvent *e) -
39{ -
40 -
41 if (!o->isWidgetType())
never evaluated: !o->isWidgetType()
0
42 return QObject::eventFilter(o, e);
never executed: return QObject::eventFilter(o, e);
0
43 -
44 QWidget *widget = qobject_cast<QWidget*>(o); -
45 QWindowsStylePrivate * const d = d_func(); -
46 switch(e->type()) { -
47 case QEvent::KeyPress: -
48 if (static_cast<QKeyEvent *>(e)->key() == Qt::Key_Alt) {
never evaluated: static_cast<QKeyEvent *>(e)->key() == Qt::Key_Alt
0
49 widget = widget->window(); -
50 -
51 -
52 QList<QWidget *> l = widget->findChildren<QWidget *>(); -
53 for (int pos=0 ; pos < l.size() ; ++pos) {
never evaluated: pos < l.size()
0
54 QWidget *w = l.at(pos); -
55 if (w->isWindow() || !w->isVisible() ||
never evaluated: w->isWindow()
never evaluated: !w->isVisible()
0
56 w->style()->styleHint(SH_UnderlineShortcut, 0, w))
never evaluated: w->style()->styleHint(SH_UnderlineShortcut, 0, w)
0
57 l.removeAt(pos);
never executed: l.removeAt(pos);
0
58 }
never executed: }
0
59 -
60 d->seenAlt.append(widget); -
61 d->alt_down = true; -
62 -
63 -
64 for (int pos = 0; pos < l.size(); ++pos)
never evaluated: pos < l.size()
0
65 l.at(pos)->update();
never executed: l.at(pos)->update();
0
66 }
never executed: }
0
67 break;
never executed: break;
0
68 case QEvent::KeyRelease: -
69 if (static_cast<QKeyEvent*>(e)->key() == Qt::Key_Alt) {
never evaluated: static_cast<QKeyEvent*>(e)->key() == Qt::Key_Alt
0
70 widget = widget->window(); -
71 -
72 -
73 d->alt_down = false; -
74 -
75 QList<QMenuBar *> l = widget->findChildren<QMenuBar *>(); -
76 for (int i = 0; i < l.size(); ++i)
never evaluated: i < l.size()
0
77 l.at(i)->update();
never executed: l.at(i)->update();
0
78 -
79 }
never executed: }
0
80 break;
never executed: break;
0
81 case QEvent::Close: -
82 -
83 d->seenAlt.removeAll(widget); -
84 d->seenAlt.removeAll(widget->window()); -
85 break;
never executed: break;
0
86 default: -
87 break;
never executed: break;
0
88 } -
89 return QCommonStyle::eventFilter(o, e);
never executed: return QCommonStyle::eventFilter(o, e);
0
90} -
91QWindowsStyle::QWindowsStyle() : QCommonStyle(*new QWindowsStylePrivate) -
92{ -
93}
executed: }
Execution Count:495
495
94 -
95 -
96 -
97 -
98 -
99 -
100QWindowsStyle::QWindowsStyle(QWindowsStylePrivate &dd) : QCommonStyle(dd) -
101{ -
102}
executed: }
Execution Count:402
402
103 -
104 -
105 -
106QWindowsStyle::~QWindowsStyle() -
107{ -
108} -
109void QWindowsStyle::polish(QApplication *app) -
110{ -
111 QCommonStyle::polish(app); -
112 QWindowsStylePrivate *d = const_cast<QWindowsStylePrivate*>(d_func()); -
113 -
114 if (!proxy()->styleHint(SH_UnderlineShortcut, 0) && app)
partially evaluated: !proxy()->styleHint(SH_UnderlineShortcut, 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:278
never evaluated: app
0-278
115 app->installEventFilter(this);
never executed: app->installEventFilter(this);
0
116 -
117 d->activeCaptionColor = app->palette().highlight().color(); -
118 d->activeGradientCaptionColor = app->palette().highlight() .color(); -
119 d->inactiveCaptionColor = app->palette().dark().color(); -
120 d->inactiveGradientCaptionColor = app->palette().dark().color(); -
121 d->inactiveCaptionText = app->palette().background().color(); -
122}
executed: }
Execution Count:278
278
123 -
124 -
125void QWindowsStyle::unpolish(QApplication *app) -
126{ -
127 QCommonStyle::unpolish(app); -
128 app->removeEventFilter(this); -
129}
executed: }
Execution Count:64
64
130 -
131 -
132void QWindowsStyle::polish(QWidget *widget) -
133{ -
134 QCommonStyle::polish(widget); -
135}
executed: }
Execution Count:39805
39805
136 -
137 -
138void QWindowsStyle::unpolish(QWidget *widget) -
139{ -
140 QCommonStyle::unpolish(widget); -
141}
executed: }
Execution Count:3770
3770
142 -
143 -
144 -
145 -
146void QWindowsStyle::polish(QPalette &pal) -
147{ -
148 QCommonStyle::polish(pal); -
149}
executed: }
Execution Count:283
283
150 -
151 -
152 -
153 -
154int QWindowsStyle::pixelMetric(PixelMetric pm, const QStyleOption *opt, const QWidget *widget) const -
155{ -
156 int ret; -
157 -
158 switch (pm) { -
159 case PM_ButtonDefaultIndicator: -
160 case PM_ButtonShiftHorizontal: -
161 case PM_ButtonShiftVertical: -
162 case PM_MenuHMargin: -
163 case PM_MenuVMargin: -
164 ret = 1; -
165 break;
executed: break;
Execution Count:4446
4446
166 case PM_DockWidgetSeparatorExtent: -
167 ret = int(QStyleHelper::dpiScaled(4.)); -
168 break;
executed: break;
Execution Count:139
139
169 -
170 case PM_TabBarTabShiftHorizontal: -
171 ret = 0; -
172 break;
executed: break;
Execution Count:754
754
173 case PM_TabBarTabShiftVertical: -
174 ret = 2; -
175 break;
executed: break;
Execution Count:754
754
176 -
177 case PM_MaximumDragDistance: -
178 ret = QCommonStyle::pixelMetric(PM_MaximumDragDistance); -
179 if (ret == -1)
partially evaluated: ret == -1
TRUEFALSE
yes
Evaluation Count:6
no
Evaluation Count:0
0-6
180 ret = 60;
executed: ret = 60;
Execution Count:6
6
181 break;
executed: break;
Execution Count:6
6
182 -
183 -
184 case PM_SliderLength: -
185 ret = int(QStyleHelper::dpiScaled(11.)); -
186 break;
executed: break;
Execution Count:28
28
187 -
188 -
189 -
190 -
191 case PM_SliderControlThickness: -
192 if (const QStyleOptionSlider *sl = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
evaluated: const QStyleOptionSlider *sl = qstyleoption_cast<const QStyleOptionSlider *>(opt)
TRUEFALSE
yes
Evaluation Count:48
yes
Evaluation Count:6
6-48
193 int space = (sl->orientation == Qt::Horizontal) ? sl->rect.height() : sl->rect.width();
evaluated: (sl->orientation == Qt::Horizontal)
TRUEFALSE
yes
Evaluation Count:21
yes
Evaluation Count:27
21-27
194 int ticks = sl->tickPosition; -
195 int n = 0; -
196 if (ticks & QSlider::TicksAbove)
partially evaluated: ticks & QSlider::TicksAbove
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:48
0-48
197 ++n;
never executed: ++n;
0
198 if (ticks & QSlider::TicksBelow)
partially evaluated: ticks & QSlider::TicksBelow
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:48
0-48
199 ++n;
never executed: ++n;
0
200 if (!n) {
partially evaluated: !n
TRUEFALSE
yes
Evaluation Count:48
no
Evaluation Count:0
0-48
201 ret = space; -
202 break;
executed: break;
Execution Count:48
48
203 } -
204 -
205 int thick = 6; -
206 if (ticks != QSlider::TicksBothSides && ticks != QSlider::NoTicks)
never evaluated: ticks != QSlider::TicksBothSides
never evaluated: ticks != QSlider::NoTicks
0
207 thick += proxy()->pixelMetric(PM_SliderLength, sl, widget) / 4;
never executed: thick += proxy()->pixelMetric(PM_SliderLength, sl, widget) / 4;
0
208 -
209 space -= thick; -
210 if (space > 0)
never evaluated: space > 0
0
211 thick += (space * 2) / (n + 2);
never executed: thick += (space * 2) / (n + 2);
0
212 ret = thick; -
213 } else {
never executed: }
0
214 ret = 0; -
215 }
executed: }
Execution Count:6
6
216 break;
executed: break;
Execution Count:6
6
217 -
218 -
219 -
220 case PM_MenuBarHMargin: -
221 ret = 0; -
222 break;
executed: break;
Execution Count:548
548
223 -
224 case PM_MenuBarVMargin: -
225 ret = 0; -
226 break;
executed: break;
Execution Count:761
761
227 -
228 case PM_MenuBarPanelWidth: -
229 ret = 0; -
230 break;
executed: break;
Execution Count:1710
1710
231 -
232 case PM_SmallIconSize: -
233 ret = int(QStyleHelper::dpiScaled(16.)); -
234 break;
executed: break;
Execution Count:72990
72990
235 -
236 case PM_LargeIconSize: -
237 ret = int(QStyleHelper::dpiScaled(32.)); -
238 break;
executed: break;
Execution Count:93
93
239 -
240 case PM_IconViewIconSize: -
241 ret = proxy()->pixelMetric(PM_LargeIconSize, opt, widget); -
242 break;
executed: break;
Execution Count:86
86
243 -
244 case PM_DockWidgetTitleMargin: -
245 ret = int(QStyleHelper::dpiScaled(2.)); -
246 break;
executed: break;
Execution Count:2424
2424
247 case PM_DockWidgetTitleBarButtonMargin: -
248 ret = int(QStyleHelper::dpiScaled(4.)); -
249 break;
executed: break;
Execution Count:4803
4803
250 case PM_DockWidgetFrameWidth: -
251 ret = 4; -
252 break;
executed: break;
Execution Count:812
812
253 -
254 break;
dead code: break;
-
255 case PM_SplitterWidth: -
256 ret = qMax(4, QApplication::globalStrut().width()); -
257 break;
executed: break;
Execution Count:7866
7866
258 case PM_ToolBarItemMargin: -
259 ret = 1; -
260 break;
executed: break;
Execution Count:22
22
261 case PM_ToolBarItemSpacing: -
262 ret = 0; -
263 break;
executed: break;
Execution Count:22
22
264 case PM_ToolBarHandleExtent: -
265 ret = int(QStyleHelper::dpiScaled(10.)); -
266 break;
executed: break;
Execution Count:110
110
267 default: -
268 ret = QCommonStyle::pixelMetric(pm, opt, widget); -
269 break;
executed: break;
Execution Count:753122
753122
270 } -
271 -
272 return ret;
executed: return ret;
Execution Count:851550
851550
273} -
274 -
275 -
276 -
277 -
278QPixmap QWindowsStyle::standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, -
279 const QWidget *widget) const -
280{ -
281 return QCommonStyle::standardPixmap(standardPixmap, opt, widget);
executed: return QCommonStyle::standardPixmap(standardPixmap, opt, widget);
Execution Count:2281
2281
282} -
283 -
284 -
285int QWindowsStyle::styleHint(StyleHint hint, const QStyleOption *opt, const QWidget *widget, -
286 QStyleHintReturn *returnData) const -
287{ -
288 int ret = 0; -
289 -
290 switch (hint) { -
291 case SH_EtchDisabledText: -
292 case SH_Slider_SnapToValue: -
293 case SH_PrintDialog_RightAlignButtons: -
294 case SH_FontDialog_SelectAssociatedText: -
295 case SH_Menu_AllowActiveAndDisabled: -
296 case SH_MenuBar_AltKeyNavigation: -
297 case SH_MenuBar_MouseTracking: -
298 case SH_Menu_MouseTracking: -
299 case SH_ComboBox_ListMouseTracking: -
300 case SH_ScrollBar_StopMouseOverSlider: -
301 case SH_MainWindow_SpaceBelowMenuBar: -
302 ret = 1; -
303 -
304 break;
executed: break;
Execution Count:3809
3809
305 case SH_ItemView_ShowDecorationSelected: -
306 -
307 if (qobject_cast<const QListView*>(widget))
evaluated: qobject_cast<const QListView*>(widget)
TRUEFALSE
yes
Evaluation Count:26031
yes
Evaluation Count:16905
16905-26031
308 ret = 1;
executed: ret = 1;
Execution Count:26031
26031
309 -
310 break;
executed: break;
Execution Count:42936
42936
311 case SH_ItemView_ChangeHighlightOnFocus: -
312 ret = 1; -
313 break;
executed: break;
Execution Count:6
6
314 case SH_ToolBox_SelectedPageTitleBold: -
315 ret = 0; -
316 break;
executed: break;
Execution Count:6
6
317 case SH_RubberBand_Mask: -
318 if (const QStyleOptionRubberBand *rbOpt = qstyleoption_cast<const QStyleOptionRubberBand *>(opt)) {
evaluated: const QStyleOptionRubberBand *rbOpt = qstyleoption_cast<const QStyleOptionRubberBand *>(opt)
TRUEFALSE
yes
Evaluation Count:63
yes
Evaluation Count:6
6-63
319 ret = 0; -
320 if (rbOpt->shape == QRubberBand::Rectangle) {
partially evaluated: rbOpt->shape == QRubberBand::Rectangle
TRUEFALSE
yes
Evaluation Count:63
no
Evaluation Count:0
0-63
321 ret = true; -
322 if(QStyleHintReturnMask *mask = qstyleoption_cast<QStyleHintReturnMask*>(returnData)) {
partially evaluated: QStyleHintReturnMask *mask = qstyleoption_cast<QStyleHintReturnMask*>(returnData)
TRUEFALSE
yes
Evaluation Count:63
no
Evaluation Count:0
0-63
323 mask->region = opt->rect; -
324 int size = 1; -
325 if (widget && widget->isWindow())
partially evaluated: widget
TRUEFALSE
yes
Evaluation Count:63
no
Evaluation Count:0
partially evaluated: widget->isWindow()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:63
0-63
326 size = 4;
never executed: size = 4;
0
327 mask->region -= opt->rect.adjusted(size, size, -size, -size); -
328 }
executed: }
Execution Count:63
63
329 }
executed: }
Execution Count:63
63
330 }
executed: }
Execution Count:63
63
331 break;
executed: break;
Execution Count:69
69
332 -
333 case SH_LineEdit_PasswordCharacter: -
334 { -
335 if (!ret)
partially evaluated: !ret
TRUEFALSE
yes
Evaluation Count:1102
no
Evaluation Count:0
0-1102
336 ret = '*';
executed: ret = '*';
Execution Count:1102
1102
337 } -
338 break;
executed: break;
Execution Count:1102
1102
339 -
340 case SH_WizardStyle: -
341 ret = QWizard::ModernStyle; -
342 break;
executed: break;
Execution Count:63
63
343 -
344 case SH_ItemView_ArrowKeysNavigateIntoChildren: -
345 ret = true; -
346 break;
executed: break;
Execution Count:52
52
347 case SH_DialogButtonBox_ButtonsHaveIcons: -
348 ret = 0; -
349 break;
executed: break;
Execution Count:1716
1716
350 default: -
351 ret = QCommonStyle::styleHint(hint, opt, widget, returnData); -
352 break;
executed: break;
Execution Count:612957
612957
353 } -
354 return ret;
executed: return ret;
Execution Count:662716
662716
355} -
356 -
357 -
358void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, -
359 const QWidget *w) const -
360{ -
361 -
362 bool doRestore = false; -
363 -
364 switch (pe) { -
365 -
366 case PE_IndicatorToolBarSeparator: -
367 { -
368 QRect rect = opt->rect; -
369 const int margin = 2; -
370 QPen oldPen = p->pen(); -
371 if(opt->state & State_Horizontal){
never evaluated: opt->state & State_Horizontal
0
372 const int offset = rect.width()/2; -
373 p->setPen(QPen(opt->palette.dark().color())); -
374 p->drawLine(rect.bottomLeft().x() + offset, -
375 rect.bottomLeft().y() - margin, -
376 rect.topLeft().x() + offset, -
377 rect.topLeft().y() + margin); -
378 p->setPen(QPen(opt->palette.light().color())); -
379 p->drawLine(rect.bottomLeft().x() + offset + 1, -
380 rect.bottomLeft().y() - margin, -
381 rect.topLeft().x() + offset + 1, -
382 rect.topLeft().y() + margin); -
383 }
never executed: }
0
384 else{ -
385 const int offset = rect.height()/2; -
386 p->setPen(QPen(opt->palette.dark().color())); -
387 p->drawLine(rect.topLeft().x() + margin , -
388 rect.topLeft().y() + offset, -
389 rect.topRight().x() - margin, -
390 rect.topRight().y() + offset); -
391 p->setPen(QPen(opt->palette.light().color())); -
392 p->drawLine(rect.topLeft().x() + margin , -
393 rect.topLeft().y() + offset + 1, -
394 rect.topRight().x() - margin, -
395 rect.topRight().y() + offset + 1); -
396 }
never executed: }
0
397 p->setPen(oldPen); -
398 } -
399 break;
never executed: break;
0
400 case PE_IndicatorToolBarHandle: -
401 p->save(); -
402 p->translate(opt->rect.x(), opt->rect.y()); -
403 if (opt->state & State_Horizontal) {
partially evaluated: opt->state & State_Horizontal
TRUEFALSE
yes
Evaluation Count:6
no
Evaluation Count:0
0-6
404 int x = opt->rect.width() / 2 - 4; -
405 if (opt->direction == Qt::RightToLeft)
partially evaluated: opt->direction == Qt::RightToLeft
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
0-6
406 x -= 2;
never executed: x -= 2;
0
407 if (opt->rect.height() > 4) {
partially evaluated: opt->rect.height() > 4
TRUEFALSE
yes
Evaluation Count:6
no
Evaluation Count:0
0-6
408 qDrawShadePanel(p, x, 2, 3, opt->rect.height() - 4, -
409 opt->palette, false, 1, 0); -
410 qDrawShadePanel(p, x + 3, 2, 3, opt->rect.height() - 4, -
411 opt->palette, false, 1, 0); -
412 }
executed: }
Execution Count:6
6
413 } else {
executed: }
Execution Count:6
6
414 if (opt->rect.width() > 4) {
never evaluated: opt->rect.width() > 4
0
415 int y = opt->rect.height() / 2 - 4; -
416 qDrawShadePanel(p, 2, y, opt->rect.width() - 4, 3, -
417 opt->palette, false, 1, 0); -
418 qDrawShadePanel(p, 2, y + 3, opt->rect.width() - 4, 3, -
419 opt->palette, false, 1, 0); -
420 }
never executed: }
0
421 }
never executed: }
0
422 p->restore(); -
423 break;
executed: break;
Execution Count:6
6
424 -
425 -
426 case PE_FrameButtonTool: -
427 case PE_PanelButtonTool: { -
428 QPen oldPen = p->pen(); -
429 -
430 if (w && w->inherits("QDockWidgetTitleButton")) {
partially evaluated: w
TRUEFALSE
yes
Evaluation Count:689
no
Evaluation Count:0
evaluated: w->inherits("QDockWidgetTitleButton")
TRUEFALSE
yes
Evaluation Count:58
yes
Evaluation Count:631
0-689
431 if (const QWidget *dw = w->parentWidget())
partially evaluated: const QWidget *dw = w->parentWidget()
TRUEFALSE
yes
Evaluation Count:58
no
Evaluation Count:0
0-58
432 if (dw->isWindow()){
evaluated: dw->isWindow()
TRUEFALSE
yes
Evaluation Count:22
yes
Evaluation Count:36
22-36
433 qDrawWinButton(p, opt->rect.adjusted(1, 1, 0, 0), opt->palette, opt->state & (State_Sunken | State_On), -
434 &opt->palette.button()); -
435 -
436 return;
executed: return;
Execution Count:22
22
437 } -
438 }
executed: }
Execution Count:36
36
439 -
440 QBrush fill; -
441 bool stippled; -
442 bool panel = (pe == PE_PanelButtonTool); -
443 if ((!(opt->state & State_Sunken ))
evaluated: (!(opt->state & State_Sunken ))
TRUEFALSE
yes
Evaluation Count:613
yes
Evaluation Count:54
54-613
444 && (!(opt->state & State_Enabled)
evaluated: !(opt->state & State_Enabled)
TRUEFALSE
yes
Evaluation Count:568
yes
Evaluation Count:45
45-568
445 || !(opt->state & State_MouseOver && opt->state & State_AutoRaise))
evaluated: opt->state & State_MouseOver
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:43
partially evaluated: opt->state & State_AutoRaise
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-43
446 && (opt->state & State_On)) {
partially evaluated: (opt->state & State_On)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:611
0-611
447 fill = QBrush(opt->palette.light().color(), Qt::Dense4Pattern); -
448 stippled = true; -
449 } else {
never executed: }
0
450 fill = opt->palette.brush(QPalette::Button); -
451 stippled = false; -
452 }
executed: }
Execution Count:667
667
453 -
454 if (opt->state & (State_Raised | State_Sunken | State_On)) {
evaluated: opt->state & (State_Raised | State_Sunken | State_On)
TRUEFALSE
yes
Evaluation Count:631
yes
Evaluation Count:36
36-631
455 if (opt->state & State_AutoRaise) {
evaluated: opt->state & State_AutoRaise
TRUEFALSE
yes
Evaluation Count:53
yes
Evaluation Count:578
53-578
456 if(opt->state & (State_Enabled | State_Sunken | State_On)){
partially evaluated: opt->state & (State_Enabled | State_Sunken | State_On)
TRUEFALSE
yes
Evaluation Count:53
no
Evaluation Count:0
0-53
457 if (panel)
partially evaluated: panel
TRUEFALSE
yes
Evaluation Count:53
no
Evaluation Count:0
0-53
458 qDrawShadePanel(p, opt->rect, opt->palette, 53
459 opt->state & (State_Sunken | State_On), 1, &fill);
executed: qDrawShadePanel(p, opt->rect, opt->palette, opt->state & (State_Sunken | State_On), 1, &fill);
Execution Count:53
53
460 else -
461 qDrawShadeRect(p, opt->rect, opt->palette, 0
462 opt->state & (State_Sunken | State_On), 1);
never executed: qDrawShadeRect(p, opt->rect, opt->palette, opt->state & (State_Sunken | State_On), 1);
0
463 } -
464 if (stippled) {
partially evaluated: stippled
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:53
0-53
465 p->setPen(opt->palette.button().color()); -
466 p->drawRect(opt->rect.adjusted(1,1,-2,-2)); -
467 }
never executed: }
0
468 } else {
executed: }
Execution Count:53
53
469 qDrawWinButton(p, opt->rect, opt->palette, -
470 opt->state & (State_Sunken | State_On), panel ? &fill : 0); -
471 }
executed: }
Execution Count:578
578
472 } else { -
473 p->fillRect(opt->rect, fill); -
474 }
executed: }
Execution Count:36
36
475 p->setPen(oldPen); -
476 break; }
executed: break;
Execution Count:667
667
477 case PE_PanelButtonCommand: -
478 if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
partially evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)
TRUEFALSE
yes
Evaluation Count:848
no
Evaluation Count:0
0-848
479 QBrush fill; -
480 State flags = opt->state; -
481 QPalette pal = opt->palette; -
482 QRect r = opt->rect; -
483 if (! (flags & State_Sunken) && (flags & State_On))
evaluated: ! (flags & State_Sunken)
TRUEFALSE
yes
Evaluation Count:776
yes
Evaluation Count:72
partially evaluated: (flags & State_On)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:776
0-776
484 fill = QBrush(pal.light().color(), Qt::Dense4Pattern);
never executed: fill = QBrush(pal.light().color(), Qt::Dense4Pattern);
0
485 else -
486 fill = pal.brush(QPalette::Button);
executed: fill = pal.brush(QPalette::Button);
Execution Count:848
848
487 -
488 if (btn->features & QStyleOptionButton::DefaultButton && flags & State_Sunken) {
evaluated: btn->features & QStyleOptionButton::DefaultButton
TRUEFALSE
yes
Evaluation Count:222
yes
Evaluation Count:626
evaluated: flags & State_Sunken
TRUEFALSE
yes
Evaluation Count:20
yes
Evaluation Count:202
20-626
489 p->setPen(pal.dark().color()); -
490 p->setBrush(fill); -
491 p->drawRect(r.adjusted(0, 0, -1, -1)); -
492 } else if (flags & (State_Raised | State_On | State_Sunken)) {
partially evaluated: flags & (State_Raised | State_On | State_Sunken)
TRUEFALSE
yes
Evaluation Count:828
no
Evaluation Count:0
executed: }
Execution Count:20
0-828
493 qDrawWinButton(p, r, pal, flags & (State_Sunken | State_On), -
494 &fill); -
495 } else {
executed: }
Execution Count:828
828
496 p->fillRect(r, fill); -
497 }
never executed: }
0
498 } -
499 break;
executed: break;
Execution Count:848
848
500 case PE_FrameDefaultButton: { -
501 QPen oldPen = p->pen(); -
502 p->setPen(opt->palette.shadow().color()); -
503 QRect rect = opt->rect; -
504 rect.adjust(0, 0, -1, -1); -
505 p->drawRect(rect); -
506 p->setPen(oldPen); -
507 break;
executed: break;
Execution Count:222
222
508 } -
509 case PE_IndicatorCheckBox: { -
510 QBrush fill; -
511 if (opt->state & State_NoChange)
evaluated: opt->state & State_NoChange
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:18
2-18
512 fill = QBrush(opt->palette.base().color(), Qt::Dense4Pattern);
executed: fill = QBrush(opt->palette.base().color(), Qt::Dense4Pattern);
Execution Count:2
2
513 else if (opt->state & State_Sunken)
evaluated: opt->state & State_Sunken
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:16
2-16
514 fill = opt->palette.button();
executed: fill = opt->palette.button();
Execution Count:2
2
515 else if (opt->state & State_Enabled)
partially evaluated: opt->state & State_Enabled
TRUEFALSE
yes
Evaluation Count:16
no
Evaluation Count:0
0-16
516 fill = opt->palette.base();
executed: fill = opt->palette.base();
Execution Count:16
16
517 else -
518 fill = opt->palette.background();
never executed: fill = opt->palette.background();
0
519 p->save(); -
520 doRestore = true; -
521 qDrawWinPanel(p, opt->rect, opt->palette, true, &fill); -
522 if (opt->state & State_NoChange)
evaluated: opt->state & State_NoChange
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:18
2-18
523 p->setPen(opt->palette.dark().color());
executed: p->setPen(opt->palette.dark().color());
Execution Count:2
2
524 else -
525 p->setPen(opt->palette.text().color());
executed: p->setPen(opt->palette.text().color());
Execution Count:18
18
526 } -
527 case PE_IndicatorViewItemCheck:
code before this statement executed: case PE_IndicatorViewItemCheck:
Execution Count:20
20
528 if (!doRestore) {
evaluated: !doRestore
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:20
20-30
529 p->save(); -
530 doRestore = true; -
531 }
executed: }
Execution Count:30
30
532 if (pe == PE_IndicatorViewItemCheck) {
evaluated: pe == PE_IndicatorViewItemCheck
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:20
20-30
533 const QStyleOptionViewItem *itemViewOpt = qstyleoption_cast<const QStyleOptionViewItem *>(opt); -
534 p->setPen(itemViewOpt -
535 && itemViewOpt->showDecorationSelected -
536 && opt->state & State_Selected -
537 ? opt->palette.highlightedText().color() -
538 : opt->palette.text().color()); -
539 if (opt->state & State_NoChange)
partially evaluated: opt->state & State_NoChange
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:30
0-30
540 p->setBrush(opt->palette.brush(QPalette::Button));
never executed: p->setBrush(opt->palette.brush(QPalette::Button));
0
541 p->drawRect(opt->rect.x() + 1, opt->rect.y() + 1, 11, 11); -
542 }
executed: }
Execution Count:30
30
543 if (!(opt->state & State_Off)) {
evaluated: !(opt->state & State_Off)
TRUEFALSE
yes
Evaluation Count:17
yes
Evaluation Count:33
17-33
544 QLineF lines[7]; -
545 int i, xx, yy; -
546 xx = opt->rect.x() + 3; -
547 yy = opt->rect.y() + 5; -
548 for (i = 0; i < 3; ++i) {
evaluated: i < 3
TRUEFALSE
yes
Evaluation Count:51
yes
Evaluation Count:17
17-51
549 lines[i] = QLineF(xx, yy, xx, yy + 2); -
550 ++xx; -
551 ++yy; -
552 }
executed: }
Execution Count:51
51
553 yy -= 2; -
554 for (i = 3; i < 7; ++i) {
evaluated: i < 7
TRUEFALSE
yes
Evaluation Count:68
yes
Evaluation Count:17
17-68
555 lines[i] = QLineF(xx, yy, xx, yy + 2); -
556 ++xx; -
557 --yy; -
558 }
executed: }
Execution Count:68
68
559 p->drawLines(lines, 7); -
560 }
executed: }
Execution Count:17
17
561 if (doRestore)
partially evaluated: doRestore
TRUEFALSE
yes
Evaluation Count:50
no
Evaluation Count:0
0-50
562 p->restore();
executed: p->restore();
Execution Count:50
50
563 break;
executed: break;
Execution Count:50
50
564 case PE_FrameFocusRect: -
565 if (const QStyleOptionFocusRect *fropt = qstyleoption_cast<const QStyleOptionFocusRect *>(opt)) {
partially evaluated: const QStyleOptionFocusRect *fropt = qstyleoption_cast<const QStyleOptionFocusRect *>(opt)
TRUEFALSE
yes
Evaluation Count:1386
no
Evaluation Count:0
0-1386
566 -
567 if (!(fropt->state & State_KeyboardFocusChange) && !proxy()->styleHint(SH_UnderlineShortcut, opt))
evaluated: !(fropt->state & State_KeyboardFocusChange)
TRUEFALSE
yes
Evaluation Count:277
yes
Evaluation Count:1109
partially evaluated: !proxy()->styleHint(SH_UnderlineShortcut, opt)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:277
0-1109
568 return;
never executed: return;
0
569 QRect r = opt->rect; -
570 p->save(); -
571 p->setBackgroundMode(Qt::TransparentMode); -
572 QColor bg_col = fropt->backgroundColor; -
573 if (!bg_col.isValid())
evaluated: !bg_col.isValid()
TRUEFALSE
yes
Evaluation Count:277
yes
Evaluation Count:1109
277-1109
574 bg_col = p->background().color();
executed: bg_col = p->background().color();
Execution Count:277
277
575 -
576 QColor patternCol((bg_col.red() ^ 0xff) & 0xff, -
577 (bg_col.green() ^ 0xff) & 0xff, -
578 (bg_col.blue() ^ 0xff) & 0xff); -
579 p->setBrush(QBrush(patternCol, Qt::Dense4Pattern)); -
580 p->setBrushOrigin(r.topLeft()); -
581 p->setPen(Qt::NoPen); -
582 p->drawRect(r.left(), r.top(), r.width(), 1); -
583 p->drawRect(r.left(), r.bottom(), r.width(), 1); -
584 p->drawRect(r.left(), r.top(), 1, r.height()); -
585 p->drawRect(r.right(), r.top(), 1, r.height()); -
586 p->restore(); -
587 }
executed: }
Execution Count:1386
1386
588 break;
executed: break;
Execution Count:1386
1386
589 case PE_IndicatorRadioButton: -
590 { -
591 -
592 static const QPoint pts1[] = { -
593 QPoint(1, 9), QPoint(1, 8), QPoint(0, 7), QPoint(0, 4), QPoint(1, 3), QPoint(1, 2), -
594 QPoint(2, 1), QPoint(3, 1), QPoint(4, 0), QPoint(7, 0), QPoint(8, 1), QPoint(9, 1) -
595 }; -
596 static const QPoint pts2[] = { -
597 QPoint(2, 8), QPoint(1, 7), QPoint(1, 4), QPoint(2, 3), QPoint(2, 2), QPoint(3, 2), -
598 QPoint(4, 1), QPoint(7, 1), QPoint(8, 2), QPoint(9, 2) -
599 }; -
600 static const QPoint pts3[] = { -
601 QPoint(2, 9), QPoint(3, 9), QPoint(4, 10), QPoint(7, 10), QPoint(8, 9), QPoint(9, 9), -
602 QPoint(9, 8), QPoint(10, 7), QPoint(10, 4), QPoint(9, 3) -
603 }; -
604 static const QPoint pts4[] = { -
605 QPoint(2, 10), QPoint(3, 10), QPoint(4, 11), QPoint(7, 11), QPoint(8, 10), -
606 QPoint(9, 10), QPoint(10, 9), QPoint(10, 8), QPoint(11, 7), QPoint(11, 4), -
607 QPoint(10, 3), QPoint(10, 2) -
608 }; -
609 static const QPoint pts5[] = { -
610 QPoint(4, 2), QPoint(7, 2), QPoint(9, 4), QPoint(9, 7), QPoint(7, 9), QPoint(4, 9), -
611 QPoint(2, 7), QPoint(2, 4) -
612 }; -
613 -
614 -
615 QRect ir = opt->rect; -
616 -
617 if (opt->rect.width() < opt->rect.height()) {
partially evaluated: opt->rect.width() < opt->rect.height()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:26
0-26
618 ir.setTop(opt->rect.top() + (opt->rect.height() - opt->rect.width()) / 2); -
619 ir.setHeight(opt->rect.width()); -
620 } else if (opt->rect.height() < opt->rect.width()) {
never executed: }
partially evaluated: opt->rect.height() < opt->rect.width()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:26
0-26
621 ir.setLeft(opt->rect.left() + (opt->rect.width() - opt->rect.height()) / 2); -
622 ir.setWidth(opt->rect.height()); -
623 }
never executed: }
0
624 -
625 p->save(); -
626 p->setRenderHint(QPainter::Qt4CompatiblePainting); -
627 bool down = opt->state & State_Sunken; -
628 bool enabled = opt->state & State_Enabled; -
629 bool on = opt->state & State_On; -
630 QPolygon a; -
631 -
632 -
633 int xOffset = 0; -
634 int yOffset = 0; -
635 int indicatorWidth = proxy()->pixelMetric(PM_ExclusiveIndicatorWidth); -
636 int indicatorHeight = proxy()->pixelMetric(PM_ExclusiveIndicatorWidth); -
637 if (ir.width() > indicatorWidth)
partially evaluated: ir.width() > indicatorWidth
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:26
0-26
638 xOffset += (ir.width() - indicatorWidth)/2;
never executed: xOffset += (ir.width() - indicatorWidth)/2;
0
639 if (ir.height() > indicatorHeight)
partially evaluated: ir.height() > indicatorHeight
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:26
0-26
640 yOffset += (ir.height() - indicatorHeight)/2;
never executed: yOffset += (ir.height() - indicatorHeight)/2;
0
641 p->translate(xOffset, yOffset); -
642 -
643 p->translate(ir.x(), ir.y()); -
644 -
645 p->setPen(opt->palette.dark().color()); -
646 p->drawPolyline(pts1, sizeof(pts1)/(sizeof(QPoint))); -
647 -
648 p->setPen(opt->palette.shadow().color()); -
649 p->drawPolyline(pts2, sizeof(pts2)/(sizeof(QPoint))); -
650 -
651 p->setPen(opt->palette.midlight().color()); -
652 p->drawPolyline(pts3, sizeof(pts3)/(sizeof(QPoint))); -
653 -
654 p->setPen(opt->palette.light().color()); -
655 p->drawPolyline(pts4, sizeof(pts4)/(sizeof(QPoint))); -
656 -
657 QColor fillColor = (down || !enabled)
evaluated: down
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:25
partially evaluated: !enabled
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:25
0-25
658 ? opt->palette.button().color() -
659 : opt->palette.base().color(); -
660 p->setPen(fillColor); -
661 p->setBrush(fillColor) ; -
662 p->drawPolygon(pts5, sizeof(pts5)/(sizeof(QPoint))); -
663 -
664 p->translate(-ir.x(), -ir.y()); -
665 -
666 if (on) {
evaluated: on
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:23
3-23
667 p->setPen(Qt::NoPen); -
668 p->setBrush(opt->palette.text()); -
669 p->drawRect(ir.x() + 5, ir.y() + 4, 2, 4); -
670 p->drawRect(ir.x() + 4, ir.y() + 5, 4, 2); -
671 }
executed: }
Execution Count:3
3
672 p->restore(); -
673 break;
executed: break;
Execution Count:26
26
674 } -
675 -
676 case PE_Frame: -
677 case PE_FrameMenu: -
678 if (const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
evaluated: const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(opt)
TRUEFALSE
yes
Evaluation Count:2077
yes
Evaluation Count:1
1-2077
679 if (frame->lineWidth == 2 || pe == PE_Frame) {
evaluated: frame->lineWidth == 2
TRUEFALSE
yes
Evaluation Count:683
yes
Evaluation Count:1394
partially evaluated: pe == PE_Frame
TRUEFALSE
yes
Evaluation Count:1394
no
Evaluation Count:0
0-1394
680 QPalette popupPal = frame->palette; -
681 if (pe == PE_FrameMenu) {
evaluated: pe == PE_FrameMenu
TRUEFALSE
yes
Evaluation Count:39
yes
Evaluation Count:2038
39-2038
682 popupPal.setColor(QPalette::Light, frame->palette.background().color()); -
683 popupPal.setColor(QPalette::Midlight, frame->palette.light().color()); -
684 }
executed: }
Execution Count:39
39
685 if (pe == PE_Frame && (frame->state & State_Raised))
evaluated: pe == PE_Frame
TRUEFALSE
yes
Evaluation Count:2038
yes
Evaluation Count:39
partially evaluated: (frame->state & State_Raised)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2038
0-2038
686 qDrawWinButton(p, frame->rect, popupPal, frame->state & State_Sunken);
never executed: qDrawWinButton(p, frame->rect, popupPal, frame->state & State_Sunken);
0
687 else if (pe == PE_Frame && (frame->state & State_Sunken))
evaluated: pe == PE_Frame
TRUEFALSE
yes
Evaluation Count:2038
yes
Evaluation Count:39
evaluated: (frame->state & State_Sunken)
TRUEFALSE
yes
Evaluation Count:1846
yes
Evaluation Count:192
39-2038
688 { -
689 popupPal.setColor(QPalette::Midlight, frame->palette.background().color()); -
690 qDrawWinPanel(p, frame->rect, popupPal, frame->state & State_Sunken); -
691 }
executed: }
Execution Count:1846
1846
692 else -
693 qDrawWinPanel(p, frame->rect, popupPal, frame->state & State_Sunken);
executed: qDrawWinPanel(p, frame->rect, popupPal, frame->state & State_Sunken);
Execution Count:231
231
694 } else { -
695 QCommonStyle::drawPrimitive(pe, opt, p, w); -
696 }
never executed: }
0
697 } else { -
698 QPalette popupPal = opt->palette; -
699 popupPal.setColor(QPalette::Light, opt->palette.background().color()); -
700 popupPal.setColor(QPalette::Midlight, opt->palette.light().color()); -
701 qDrawWinPanel(p, opt->rect, popupPal, opt->state & State_Sunken); -
702 }
executed: }
Execution Count:1
1
703 break;
executed: break;
Execution Count:2078
2078
704 -
705 case PE_FrameButtonBevel: -
706 case PE_PanelButtonBevel: { -
707 QBrush fill; -
708 bool panel = pe != PE_FrameButtonBevel; -
709 p->setBrushOrigin(opt->rect.topLeft()); -
710 if (!(opt->state & State_Sunken) && (opt->state & State_On))
never evaluated: !(opt->state & State_Sunken)
never evaluated: (opt->state & State_On)
0
711 fill = QBrush(opt->palette.light().color(), Qt::Dense4Pattern);
never executed: fill = QBrush(opt->palette.light().color(), Qt::Dense4Pattern);
0
712 else -
713 fill = opt->palette.brush(QPalette::Button);
never executed: fill = opt->palette.brush(QPalette::Button);
0
714 -
715 if (opt->state & (State_Raised | State_On | State_Sunken)) {
never evaluated: opt->state & (State_Raised | State_On | State_Sunken)
0
716 qDrawWinButton(p, opt->rect, opt->palette, opt->state & (State_Sunken | State_On), -
717 panel ? &fill : 0); -
718 } else {
never executed: }
0
719 if (panel)
never evaluated: panel
0
720 p->fillRect(opt->rect, fill);
never executed: p->fillRect(opt->rect, fill);
0
721 else -
722 p->drawRect(opt->rect);
never executed: p->drawRect(opt->rect);
0
723 } -
724 break; }
never executed: break;
0
725 case PE_FrameWindow: { -
726 QPalette popupPal = opt->palette; -
727 popupPal.setColor(QPalette::Light, opt->palette.background().color()); -
728 popupPal.setColor(QPalette::Midlight, opt->palette.light().color()); -
729 qDrawWinPanel(p, opt->rect, popupPal, opt->state & State_Sunken); -
730 break; }
executed: break;
Execution Count:220
220
731 -
732 case PE_IndicatorDockWidgetResizeHandle: -
733 break;
executed: break;
Execution Count:3
3
734 case PE_FrameDockWidget: -
735 if (qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
partially evaluated: qstyleoption_cast<const QStyleOptionFrame *>(opt)
TRUEFALSE
yes
Evaluation Count:12
no
Evaluation Count:0
0-12
736 proxy()->drawPrimitive(QStyle::PE_FrameWindow, opt, p, w); -
737 }
executed: }
Execution Count:12
12
738 break;
executed: break;
Execution Count:12
12
739 -
740 -
741 case PE_FrameStatusBarItem: -
742 qDrawShadePanel(p, opt->rect, opt->palette, true, 1, 0); -
743 break;
executed: break;
Execution Count:1
1
744 -
745 case PE_IndicatorProgressChunk: -
746 { -
747 bool vertical = false, inverted = false; -
748 if (const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt)) {
partially evaluated: const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt)
TRUEFALSE
yes
Evaluation Count:284
no
Evaluation Count:0
0-284
749 vertical = (pb2->orientation == Qt::Vertical); -
750 inverted = pb2->invertedAppearance; -
751 }
executed: }
Execution Count:284
284
752 -
753 int space = 2; -
754 int chunksize = proxy()->pixelMetric(PM_ProgressBarChunkWidth, opt, w) - space; -
755 if (!vertical) {
partially evaluated: !vertical
TRUEFALSE
yes
Evaluation Count:284
no
Evaluation Count:0
0-284
756 if (opt->rect.width() <= chunksize)
partially evaluated: opt->rect.width() <= chunksize
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:284
0-284
757 space = 0;
never executed: space = 0;
0
758 -
759 if (inverted)
partially evaluated: inverted
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:284
0-284
760 p->fillRect(opt->rect.x() + space, opt->rect.y(), opt->rect.width() - space, opt->rect.height(), 0
761 opt->palette.brush(QPalette::Highlight));
never executed: p->fillRect(opt->rect.x() + space, opt->rect.y(), opt->rect.width() - space, opt->rect.height(), opt->palette.brush(QPalette::Highlight));
0
762 else -
763 p->fillRect(opt->rect.x(), opt->rect.y(), opt->rect.width() - space, opt->rect.height(), 284
764 opt->palette.brush(QPalette::Highlight));
executed: p->fillRect(opt->rect.x(), opt->rect.y(), opt->rect.width() - space, opt->rect.height(), opt->palette.brush(QPalette::Highlight));
Execution Count:284
284
765 } else { -
766 if (opt->rect.height() <= chunksize)
never evaluated: opt->rect.height() <= chunksize
0
767 space = 0;
never executed: space = 0;
0
768 -
769 if (inverted)
never evaluated: inverted
0
770 p->fillRect(opt->rect.x(), opt->rect.y(), opt->rect.width(), opt->rect.height() - space, 0
771 opt->palette.brush(QPalette::Highlight));
never executed: p->fillRect(opt->rect.x(), opt->rect.y(), opt->rect.width(), opt->rect.height() - space, opt->palette.brush(QPalette::Highlight));
0
772 else -
773 p->fillRect(opt->rect.x(), opt->rect.y() + space, opt->rect.width(), opt->rect.height() - space, 0
774 opt->palette.brush(QPalette::Highlight));
never executed: p->fillRect(opt->rect.x(), opt->rect.y() + space, opt->rect.width(), opt->rect.height() - space, opt->palette.brush(QPalette::Highlight));
0
775 } -
776 } -
777 break;
executed: break;
Execution Count:284
284
778 -
779 case PE_FrameTabWidget: { -
780 qDrawWinButton(p, opt->rect, opt->palette, false, 0); -
781 break;
executed: break;
Execution Count:32
32
782 } -
783 default: -
784 QCommonStyle::drawPrimitive(pe, opt, p, w); -
785 }
executed: }
Execution Count:36907
36907
786}
executed: }
Execution Count:42742
42742
787 -
788 -
789void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter *p, -
790 const QWidget *widget) const -
791{ -
792 switch (ce) { -
793 -
794 case CE_RubberBand: -
795 if (qstyleoption_cast<const QStyleOptionRubberBand *>(opt)) {
evaluated: qstyleoption_cast<const QStyleOptionRubberBand *>(opt)
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:3
3
796 -
797 QPixmap tiledPixmap(16, 16); -
798 QPainter pixmapPainter(&tiledPixmap); -
799 pixmapPainter.setPen(Qt::NoPen); -
800 pixmapPainter.setBrush(Qt::Dense4Pattern); -
801 pixmapPainter.setBackground(Qt::white); -
802 pixmapPainter.setBackgroundMode(Qt::OpaqueMode); -
803 pixmapPainter.drawRect(0, 0, tiledPixmap.width(), tiledPixmap.height()); -
804 pixmapPainter.end(); -
805 tiledPixmap = QPixmap::fromImage(tiledPixmap.toImage()); -
806 p->save(); -
807 QRect r = opt->rect; -
808 QStyleHintReturnMask mask; -
809 if (proxy()->styleHint(QStyle::SH_RubberBand_Mask, opt, widget, &mask))
partially evaluated: proxy()->styleHint(QStyle::SH_RubberBand_Mask, opt, widget, &mask)
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
0-3
810 p->setClipRegion(mask.region);
executed: p->setClipRegion(mask.region);
Execution Count:3
3
811 p->drawTiledPixmap(r.x(), r.y(), r.width(), r.height(), tiledPixmap); -
812 p->restore(); -
813 return;
executed: return;
Execution Count:3
3
814 } -
815 break;
executed: break;
Execution Count:3
3
816 -
817 -
818 -
819 case CE_MenuBarEmptyArea: -
820 if (widget && qobject_cast<const QMainWindow *>(widget->parentWidget())) {
evaluated: widget
TRUEFALSE
yes
Evaluation Count:52
yes
Evaluation Count:3
evaluated: qobject_cast<const QMainWindow *>(widget->parentWidget())
TRUEFALSE
yes
Evaluation Count:43
yes
Evaluation Count:9
3-52
821 p->fillRect(opt->rect, opt->palette.button()); -
822 QPen oldPen = p->pen(); -
823 p->setPen(QPen(opt->palette.dark().color())); -
824 p->drawLine(opt->rect.bottomLeft(), opt->rect.bottomRight()); -
825 p->setPen(oldPen); -
826 }
executed: }
Execution Count:43
43
827 break;
executed: break;
Execution Count:55
55
828 -
829 -
830 case CE_MenuItem: -
831 if (const QStyleOptionMenuItem *menuitem = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
evaluated: const QStyleOptionMenuItem *menuitem = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)
TRUEFALSE
yes
Evaluation Count:87
yes
Evaluation Count:3
3-87
832 int x, y, w, h; -
833 menuitem->rect.getRect(&x, &y, &w, &h); -
834 int tab = menuitem->tabWidth; -
835 bool dis = !(menuitem->state & State_Enabled); -
836 bool checked = menuitem->checkType != QStyleOptionMenuItem::NotCheckable
evaluated: menuitem->checkType != QStyleOptionMenuItem::NotCheckable
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:82
5-82
837 ? menuitem->checked : false; -
838 bool act = menuitem->state & State_Selected; -
839 -
840 -
841 int checkcol = qMax<int>(menuitem->maxIconWidth, QWindowsStylePrivate::windowsCheckMarkWidth); -
842 -
843 QBrush fill = menuitem->palette.brush(act ? QPalette::Highlight : QPalette::Button); -
844 p->fillRect(menuitem->rect.adjusted(0, 0, -1, 0), fill); -
845 -
846 if (menuitem->menuItemType == QStyleOptionMenuItem::Separator){
evaluated: menuitem->menuItemType == QStyleOptionMenuItem::Separator
TRUEFALSE
yes
Evaluation Count:9
yes
Evaluation Count:78
9-78
847 int yoff = y-1 + h / 2; -
848 p->setPen(menuitem->palette.dark().color()); -
849 p->drawLine(x + 2, yoff, x + w - 4, yoff); -
850 p->setPen(menuitem->palette.light().color()); -
851 p->drawLine(x + 2, yoff + 1, x + w - 4, yoff + 1); -
852 return;
executed: return;
Execution Count:9
9
853 } -
854 -
855 QRect vCheckRect = visualRect(opt->direction, menuitem->rect, QRect(menuitem->rect.x(), menuitem->rect.y(), checkcol, menuitem->rect.height())); -
856 if (!menuitem->icon.isNull() && checked) {
evaluated: !menuitem->icon.isNull()
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:66
partially evaluated: checked
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12
0-66
857 if (act) {
never evaluated: act
0
858 qDrawShadePanel(p, vCheckRect, -
859 menuitem->palette, true, 1, -
860 &menuitem->palette.brush(QPalette::Button)); -
861 } else {
never executed: }
0
862 QBrush fill(menuitem->palette.light().color(), Qt::Dense4Pattern); -
863 qDrawShadePanel(p, vCheckRect, menuitem->palette, true, 1, &fill); -
864 }
never executed: }
0
865 } else if (!act) {
evaluated: !act
TRUEFALSE
yes
Evaluation Count:74
yes
Evaluation Count:4
4-74
866 p->fillRect(vCheckRect, menuitem->palette.brush(QPalette::Button)); -
867 }
executed: }
Execution Count:74
74
868 -
869 -
870 -
871 -
872 if (!menuitem->icon.isNull()) {
evaluated: !menuitem->icon.isNull()
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:66
12-66
873 QIcon::Mode mode = dis ? QIcon::Disabled : QIcon::Normal;
evaluated: dis
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:10
2-10
874 if (act && !dis)
partially evaluated: act
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12
never evaluated: !dis
0-12
875 mode = QIcon::Active;
never executed: mode = QIcon::Active;
0
876 QPixmap pixmap; -
877 if (checked)
partially evaluated: checked
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12
0-12
878 pixmap = menuitem->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize, opt, widget), mode, QIcon::On);
never executed: pixmap = menuitem->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize, opt, widget), mode, QIcon::On);
0
879 else -
880 pixmap = menuitem->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize, opt, widget), mode);
executed: pixmap = menuitem->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize, opt, widget), mode);
Execution Count:12
12
881 int pixw = pixmap.width(); -
882 int pixh = pixmap.height(); -
883 if (act && !dis && !checked)
partially evaluated: act
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12
never evaluated: !dis
never evaluated: !checked
0-12
884 qDrawShadePanel(p, vCheckRect, menuitem->palette, false, 1, 0
885 &menuitem->palette.brush(QPalette::Button));
never executed: qDrawShadePanel(p, vCheckRect, menuitem->palette, false, 1, &menuitem->palette.brush(QPalette::Button));
0
886 QRect pmr(0, 0, pixw, pixh); -
887 pmr.moveCenter(vCheckRect.center()); -
888 p->setPen(menuitem->palette.text().color()); -
889 p->drawPixmap(pmr.topLeft(), pixmap); -
890 } else if (checked) {
executed: }
Execution Count:12
partially evaluated: checked
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:66
0-66
891 QStyleOptionMenuItem newMi = *menuitem; -
892 newMi.state = State_None; -
893 if (!dis)
never evaluated: !dis
0
894 newMi.state |= State_Enabled;
never executed: newMi.state |= State_Enabled;
0
895 if (act)
never evaluated: act
0
896 newMi.state |= State_On;
never executed: newMi.state |= State_On;
0
897 newMi.rect = visualRect(opt->direction, menuitem->rect, QRect(menuitem->rect.x() + QWindowsStylePrivate::windowsItemFrame, -
898 menuitem->rect.y() + QWindowsStylePrivate::windowsItemFrame, -
899 checkcol - 2 * QWindowsStylePrivate::windowsItemFrame, -
900 menuitem->rect.height() - 2 * QWindowsStylePrivate::windowsItemFrame)); -
901 proxy()->drawPrimitive(PE_IndicatorMenuCheckMark, &newMi, p, widget); -
902 }
never executed: }
0
903 p->setPen(act ? menuitem->palette.highlightedText().color() : menuitem->palette.buttonText().color()); -
904 -
905 QColor discol; -
906 if (dis) {
evaluated: dis
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:66
12-66
907 discol = menuitem->palette.text().color(); -
908 p->setPen(discol); -
909 }
executed: }
Execution Count:12
12
910 -
911 int xm = int(QWindowsStylePrivate::windowsItemFrame) + checkcol + int(QWindowsStylePrivate::windowsItemHMargin); -
912 int xpos = menuitem->rect.x() + xm; -
913 QRect textRect(xpos, y + QWindowsStylePrivate::windowsItemVMargin, -
914 w - xm - QWindowsStylePrivate::windowsRightBorder - tab + 1, h - 2 * QWindowsStylePrivate::windowsItemVMargin); -
915 QRect vTextRect = visualRect(opt->direction, menuitem->rect, textRect); -
916 QString s = menuitem->text; -
917 if (!s.isEmpty()) {
partially evaluated: !s.isEmpty()
TRUEFALSE
yes
Evaluation Count:78
no
Evaluation Count:0
0-78
918 p->save(); -
919 int t = s.indexOf(QLatin1Char('\t')); -
920 int text_flags = Qt::AlignVCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine; -
921 if (!proxy()->styleHint(SH_UnderlineShortcut, menuitem, widget))
partially evaluated: !proxy()->styleHint(SH_UnderlineShortcut, menuitem, widget)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:78
0-78
922 text_flags |= Qt::TextHideMnemonic;
never executed: text_flags |= Qt::TextHideMnemonic;
0
923 text_flags |= Qt::AlignLeft; -
924 if (t >= 0) {
evaluated: t >= 0
TRUEFALSE
yes
Evaluation Count:13
yes
Evaluation Count:65
13-65
925 QRect vShortcutRect = visualRect(opt->direction, menuitem->rect, -
926 QRect(textRect.topRight(), QPoint(menuitem->rect.right(), textRect.bottom()))); -
927 if (dis && !act && proxy()->styleHint(SH_EtchDisabledText, opt, widget)) {
evaluated: dis
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:7
partially evaluated: !act
TRUEFALSE
yes
Evaluation Count:6
no
Evaluation Count:0
partially evaluated: proxy()->styleHint(SH_EtchDisabledText, opt, widget)
TRUEFALSE
yes
Evaluation Count:6
no
Evaluation Count:0
0-7
928 p->setPen(menuitem->palette.light().color()); -
929 p->drawText(vShortcutRect.adjusted(1,1,1,1), text_flags, s.mid(t + 1)); -
930 p->setPen(discol); -
931 }
executed: }
Execution Count:6
6
932 p->drawText(vShortcutRect, text_flags, s.mid(t + 1)); -
933 s = s.left(t); -
934 }
executed: }
Execution Count:13
13
935 QFont font = menuitem->font; -
936 if (menuitem->menuItemType == QStyleOptionMenuItem::DefaultItem)
partially evaluated: menuitem->menuItemType == QStyleOptionMenuItem::DefaultItem
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:78
0-78
937 font.setBold(true);
never executed: font.setBold(true);
0
938 p->setFont(font); -
939 if (dis && !act && proxy()->styleHint(SH_EtchDisabledText, opt, widget)) {
evaluated: dis
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:66
partially evaluated: !act
TRUEFALSE
yes
Evaluation Count:12
no
Evaluation Count:0
partially evaluated: proxy()->styleHint(SH_EtchDisabledText, opt, widget)
TRUEFALSE
yes
Evaluation Count:12
no
Evaluation Count:0
0-66
940 p->setPen(menuitem->palette.light().color()); -
941 p->drawText(vTextRect.adjusted(1,1,1,1), text_flags, s.left(t)); -
942 p->setPen(discol); -
943 }
executed: }
Execution Count:12
12
944 p->drawText(vTextRect, text_flags, s.left(t)); -
945 p->restore(); -
946 }
executed: }
Execution Count:78
78
947 if (menuitem->menuItemType == QStyleOptionMenuItem::SubMenu) {
evaluated: menuitem->menuItemType == QStyleOptionMenuItem::SubMenu
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:68
10-68
948 int dim = (h - 2 * QWindowsStylePrivate::windowsItemFrame) / 2; -
949 PrimitiveElement arrow; -
950 arrow = (opt->direction == Qt::RightToLeft) ? PE_IndicatorArrowLeft : PE_IndicatorArrowRight;
partially evaluated: (opt->direction == Qt::RightToLeft)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
0-10
951 xpos = x + w - QWindowsStylePrivate::windowsArrowHMargin - QWindowsStylePrivate::windowsItemFrame - dim; -
952 QRect vSubMenuRect = visualRect(opt->direction, menuitem->rect, QRect(xpos, y + h / 2 - dim / 2, dim, dim)); -
953 QStyleOptionMenuItem newMI = *menuitem; -
954 newMI.rect = vSubMenuRect; -
955 newMI.state = dis ? State_None : State_Enabled;
partially evaluated: dis
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
0-10
956 if (act)
evaluated: act
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:7
3-7
957 newMI.palette.setColor(QPalette::ButtonText, 3
958 newMI.palette.highlightedText().color());
executed: newMI.palette.setColor(QPalette::ButtonText, newMI.palette.highlightedText().color());
Execution Count:3
3
959 proxy()->drawPrimitive(arrow, &newMI, p, widget); -
960 }
executed: }
Execution Count:10
10
961 -
962 }
executed: }
Execution Count:78
78
963 break;
executed: break;
Execution Count:81
81
964 -
965 -
966 case CE_MenuBarItem: -
967 if (const QStyleOptionMenuItem *mbi = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
evaluated: const QStyleOptionMenuItem *mbi = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)
TRUEFALSE
yes
Evaluation Count:46
yes
Evaluation Count:3
3-46
968 bool active = mbi->state & State_Selected; -
969 bool hasFocus = mbi->state & State_HasFocus; -
970 bool down = mbi->state & State_Sunken; -
971 QStyleOptionMenuItem newMbi = *mbi; -
972 p->fillRect(mbi->rect, mbi->palette.brush(QPalette::Button)); -
973 if (active || hasFocus) {
evaluated: active
TRUEFALSE
yes
Evaluation Count:11
yes
Evaluation Count:35
evaluated: hasFocus
TRUEFALSE
yes
Evaluation Count:14
yes
Evaluation Count:21
11-35
974 QBrush b = mbi->palette.brush(QPalette::Button); -
975 if (active && down)
evaluated: active
TRUEFALSE
yes
Evaluation Count:11
yes
Evaluation Count:14
evaluated: down
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:1
1-14
976 p->setBrushOrigin(p->brushOrigin() + QPoint(1, 1));
executed: p->setBrushOrigin(p->brushOrigin() + QPoint(1, 1));
Execution Count:10
10
977 if (active && hasFocus)
evaluated: active
TRUEFALSE
yes
Evaluation Count:11
yes
Evaluation Count:14
partially evaluated: hasFocus
TRUEFALSE
yes
Evaluation Count:11
no
Evaluation Count:0
0-14
978 qDrawShadeRect(p, mbi->rect.x(), mbi->rect.y(), mbi->rect.width(), 11
979 mbi->rect.height(), mbi->palette, active && down, 1, 0, &b);
executed: qDrawShadeRect(p, mbi->rect.x(), mbi->rect.y(), mbi->rect.width(), mbi->rect.height(), mbi->palette, active && down, 1, 0, &b);
Execution Count:11
11
980 if (active && down) {
evaluated: active
TRUEFALSE
yes
Evaluation Count:11
yes
Evaluation Count:14
evaluated: down
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:1
1-14
981 newMbi.rect.translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, mbi, widget), -
982 proxy()->pixelMetric(PM_ButtonShiftVertical, mbi, widget)); -
983 p->setBrushOrigin(p->brushOrigin() - QPoint(1, 1)); -
984 }
executed: }
Execution Count:10
10
985 }
executed: }
Execution Count:25
25
986 QCommonStyle::drawControl(ce, &newMbi, p, widget); -
987 }
executed: }
Execution Count:46
46
988 break;
executed: break;
Execution Count:49
49
989 -
990 -
991 case CE_TabBarTabShape: -
992 if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
evaluated: const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)
TRUEFALSE
yes
Evaluation Count:39
yes
Evaluation Count:3
3-39
993 bool rtlHorTabs = (tab->direction == Qt::RightToLeft
partially evaluated: tab->direction == Qt::RightToLeft
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:39
0-39
994 && (tab->shape == QTabBar::RoundedNorth
never evaluated: tab->shape == QTabBar::RoundedNorth
0
995 || tab->shape == QTabBar::RoundedSouth));
never evaluated: tab->shape == QTabBar::RoundedSouth
0
996 bool selected = tab->state & State_Selected; -
997 bool lastTab = ((!rtlHorTabs && tab->position == QStyleOptionTab::End)
partially evaluated: !rtlHorTabs
TRUEFALSE
yes
Evaluation Count:39
no
Evaluation Count:0
evaluated: tab->position == QStyleOptionTab::End
TRUEFALSE
yes
Evaluation Count:13
yes
Evaluation Count:26
0-39
998 || (rtlHorTabs
partially evaluated: rtlHorTabs
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:26
0-26
999 && tab->position == QStyleOptionTab::Beginning));
never evaluated: tab->position == QStyleOptionTab::Beginning
0
1000 bool firstTab = ((!rtlHorTabs
partially evaluated: !rtlHorTabs
TRUEFALSE
yes
Evaluation Count:39
no
Evaluation Count:0
0-39
1001 && tab->position == QStyleOptionTab::Beginning)
evaluated: tab->position == QStyleOptionTab::Beginning
TRUEFALSE
yes
Evaluation Count:13
yes
Evaluation Count:26
13-26
1002 || (rtlHorTabs
partially evaluated: rtlHorTabs
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:26
0-26
1003 && tab->position == QStyleOptionTab::End));
never evaluated: tab->position == QStyleOptionTab::End
0
1004 bool onlyOne = tab->position == QStyleOptionTab::OnlyOneTab; -
1005 bool previousSelected = -
1006 ((!rtlHorTabs
partially evaluated: !rtlHorTabs
TRUEFALSE
yes
Evaluation Count:39
no
Evaluation Count:0
0-39
1007 && tab->selectedPosition == QStyleOptionTab::PreviousIsSelected)
evaluated: tab->selectedPosition == QStyleOptionTab::PreviousIsSelected
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:29
10-29
1008 || (rtlHorTabs
partially evaluated: rtlHorTabs
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:29
0-29
1009 && tab->selectedPosition == QStyleOptionTab::NextIsSelected));
never evaluated: tab->selectedPosition == QStyleOptionTab::NextIsSelected
0
1010 bool nextSelected = -
1011 ((!rtlHorTabs
partially evaluated: !rtlHorTabs
TRUEFALSE
yes
Evaluation Count:39
no
Evaluation Count:0
0-39
1012 && tab->selectedPosition == QStyleOptionTab::NextIsSelected)
evaluated: tab->selectedPosition == QStyleOptionTab::NextIsSelected
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:36
3-36
1013 || (rtlHorTabs
partially evaluated: rtlHorTabs
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:36
0-36
1014 && tab->selectedPosition 0
1015 == QStyleOptionTab::PreviousIsSelected));
never evaluated: tab->selectedPosition == QStyleOptionTab::PreviousIsSelected
0
1016 int tabBarAlignment = proxy()->styleHint(SH_TabBar_Alignment, tab, widget); -
1017 bool leftAligned = (!rtlHorTabs && tabBarAlignment == Qt::AlignLeft)
partially evaluated: !rtlHorTabs
TRUEFALSE
yes
Evaluation Count:39
no
Evaluation Count:0
partially evaluated: tabBarAlignment == Qt::AlignLeft
TRUEFALSE
yes
Evaluation Count:39
no
Evaluation Count:0
0-39
1018 || (rtlHorTabs
never evaluated: rtlHorTabs
0
1019 && tabBarAlignment == Qt::AlignRight);
never evaluated: tabBarAlignment == Qt::AlignRight
0
1020 -
1021 bool rightAligned = (!rtlHorTabs && tabBarAlignment == Qt::AlignRight)
partially evaluated: !rtlHorTabs
TRUEFALSE
yes
Evaluation Count:39
no
Evaluation Count:0
partially evaluated: tabBarAlignment == Qt::AlignRight
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:39
0-39
1022 || (rtlHorTabs
partially evaluated: rtlHorTabs
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:39
0-39
1023 && tabBarAlignment == Qt::AlignLeft);
never evaluated: tabBarAlignment == Qt::AlignLeft
0
1024 -
1025 QColor light = tab->palette.light().color(); -
1026 QColor dark = tab->palette.dark().color(); -
1027 QColor shadow = tab->palette.shadow().color(); -
1028 int borderThinkness = proxy()->pixelMetric(PM_TabBarBaseOverlap, tab, widget); -
1029 if (selected)
evaluated: selected
TRUEFALSE
yes
Evaluation Count:26
yes
Evaluation Count:13
13-26
1030 borderThinkness /= 2;
executed: borderThinkness /= 2;
Execution Count:26
26
1031 QRect r2(opt->rect); -
1032 int x1 = r2.left(); -
1033 int x2 = r2.right(); -
1034 int y1 = r2.top(); -
1035 int y2 = r2.bottom(); -
1036 switch (tab->shape) { -
1037 default: -
1038 QCommonStyle::drawControl(ce, tab, p, widget); -
1039 break;
never executed: break;
0
1040 case QTabBar::RoundedNorth: { -
1041 if (!selected) {
evaluated: !selected
TRUEFALSE
yes
Evaluation Count:11
yes
Evaluation Count:18
11-18
1042 y1 += 2; -
1043 x1 += onlyOne || firstTab ? borderThinkness : 0;
partially evaluated: onlyOne
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:11
evaluated: firstTab
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:10
0-11
1044 x2 -= onlyOne || lastTab ? borderThinkness : 0;
partially evaluated: onlyOne
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:11
evaluated: lastTab
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:1
0-11
1045 }
executed: }
Execution Count:11
11
1046 -
1047 p->fillRect(QRect(x1 + 1, y1 + 1, (x2 - x1) - 1, (y2 - y1) - 2), tab->palette.background()); -
1048 -
1049 -
1050 if (selected) {
evaluated: selected
TRUEFALSE
yes
Evaluation Count:18
yes
Evaluation Count:11
11-18
1051 p->fillRect(QRect(x1,y2-1,x2-x1,1), tab->palette.background()); -
1052 p->fillRect(QRect(x1,y2,x2-x1,1), tab->palette.background()); -
1053 }
executed: }
Execution Count:18
18
1054 -
1055 if (firstTab || selected || onlyOne || !previousSelected) {
evaluated: firstTab
TRUEFALSE
yes
Evaluation Count:11
yes
Evaluation Count:18
evaluated: selected
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:10
partially evaluated: onlyOne
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
partially evaluated: !previousSelected
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
0-18
1056 p->setPen(light); -
1057 p->drawLine(x1, y1 + 2, x1, y2 - ((onlyOne || firstTab) && selected && leftAligned ? 0 : borderThinkness)); -
1058 p->drawPoint(x1 + 1, y1 + 1); -
1059 }
executed: }
Execution Count:19
19
1060 -
1061 { -
1062 int beg = x1 + (previousSelected ? 0 : 2);
evaluated: previousSelected
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:19
10-19
1063 int end = x2 - (nextSelected ? 0 : 2);
evaluated: nextSelected
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:28
1-28
1064 p->setPen(light); -
1065 p->drawLine(beg, y1, end, y1); -
1066 } -
1067 -
1068 if (lastTab || selected || onlyOne || !nextSelected) {
evaluated: lastTab
TRUEFALSE
yes
Evaluation Count:11
yes
Evaluation Count:18
evaluated: selected
TRUEFALSE
yes
Evaluation Count:17
yes
Evaluation Count:1
partially evaluated: onlyOne
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
partially evaluated: !nextSelected
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-18
1069 p->setPen(shadow); -
1070 p->drawLine(x2, y1 + 2, x2, y2 - ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness)); -
1071 p->drawPoint(x2 - 1, y1 + 1); -
1072 p->setPen(dark); -
1073 p->drawLine(x2 - 1, y1 + 2, x2 - 1, y2 - ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness)); -
1074 }
executed: }
Execution Count:28
28
1075 break; }
executed: break;
Execution Count:29
29
1076 case QTabBar::RoundedSouth: { -
1077 if (!selected) {
evaluated: !selected
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:4
2-4
1078 y2 -= 2; -
1079 x1 += firstTab ? borderThinkness : 0;
partially evaluated: firstTab
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
1080 x2 -= lastTab ? borderThinkness : 0;
partially evaluated: lastTab
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1081 }
executed: }
Execution Count:2
2
1082 -
1083 p->fillRect(QRect(x1 + 1, y1 + 2, (x2 - x1) - 1, (y2 - y1) - 1), tab->palette.background()); -
1084 -
1085 -
1086 if (selected) {
evaluated: selected
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:2
2-4
1087 p->fillRect(QRect(x1, y1 + 1, (x2 - 1)-x1, 1), tab->palette.background()); -
1088 p->fillRect(QRect(x1, y1, (x2 - 1)-x1, 1), tab->palette.background()); -
1089 }
executed: }
Execution Count:4
4
1090 -
1091 if (firstTab || selected || onlyOne || !previousSelected) {
evaluated: firstTab
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:4
partially evaluated: selected
TRUEFALSE
yes
Evaluation Count:4
no
Evaluation Count:0
never evaluated: onlyOne
never evaluated: !previousSelected
0-4
1092 p->setPen(light); -
1093 p->drawLine(x1, y2 - 2, x1, y1 + ((onlyOne || firstTab) && selected && leftAligned ? 0 : borderThinkness)); -
1094 p->drawPoint(x1 + 1, y2 - 1); -
1095 }
executed: }
Execution Count:6
6
1096 -
1097 { -
1098 int beg = x1 + (previousSelected ? 0 : 2);
partially evaluated: previousSelected
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
0-6
1099 int end = x2 - (nextSelected ? 0 : 2);
evaluated: nextSelected
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:4
2-4
1100 p->setPen(shadow); -
1101 p->drawLine(beg, y2, end, y2); -
1102 p->setPen(dark); -
1103 p->drawLine(beg, y2 - 1, end, y2 - 1); -
1104 } -
1105 -
1106 if (lastTab || selected || onlyOne || !nextSelected) {
evaluated: lastTab
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:4
evaluated: selected
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:2
partially evaluated: onlyOne
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
partially evaluated: !nextSelected
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-4
1107 p->setPen(shadow); -
1108 p->drawLine(x2, y2 - 2, x2, y1 + ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness)); -
1109 p->drawPoint(x2 - 1, y2 - 1); -
1110 p->setPen(dark); -
1111 p->drawLine(x2 - 1, y2 - 2, x2 - 1, y1 + ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness)); -
1112 }
executed: }
Execution Count:4
4
1113 break; }
executed: break;
Execution Count:6
6
1114 case QTabBar::RoundedWest: { -
1115 if (!selected) {
partially evaluated: !selected
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1116 x1 += 2; -
1117 y1 += firstTab ? borderThinkness : 0;
never evaluated: firstTab
0
1118 y2 -= lastTab ? borderThinkness : 0;
never evaluated: lastTab
0
1119 }
never executed: }
0
1120 -
1121 p->fillRect(QRect(x1 + 1, y1 + 1, (x2 - x1) - 2, (y2 - y1) - 1), tab->palette.background()); -
1122 -
1123 -
1124 if (selected) {
partially evaluated: selected
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
1125 p->fillRect(QRect(x2 - 1, y1, 1, y2-y1), tab->palette.background()); -
1126 p->fillRect(QRect(x2, y1, 1, y2-y1), tab->palette.background()); -
1127 }
executed: }
Execution Count:2
2
1128 -
1129 if (firstTab || selected || onlyOne || !previousSelected) {
partially evaluated: firstTab
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
partially evaluated: selected
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
never evaluated: onlyOne
never evaluated: !previousSelected
0-2
1130 p->setPen(light); -
1131 p->drawLine(x1 + 2, y1, x2 - ((onlyOne || firstTab) && selected && leftAligned ? 0 : borderThinkness), y1); -
1132 p->drawPoint(x1 + 1, y1 + 1); -
1133 }
executed: }
Execution Count:2
2
1134 -
1135 { -
1136 int beg = y1 + (previousSelected ? 0 : 2);
partially evaluated: previousSelected
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1137 int end = y2 - (nextSelected ? 0 : 2);
partially evaluated: nextSelected
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1138 p->setPen(light); -
1139 p->drawLine(x1, beg, x1, end); -
1140 } -
1141 -
1142 if (lastTab || selected || onlyOne || !nextSelected) {
partially evaluated: lastTab
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
partially evaluated: selected
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
never evaluated: onlyOne
never evaluated: !nextSelected
0-2
1143 p->setPen(shadow); -
1144 p->drawLine(x1 + 3, y2, x2 - ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness), y2); -
1145 p->drawPoint(x1 + 2, y2 - 1); -
1146 p->setPen(dark); -
1147 p->drawLine(x1 + 3, y2 - 1, x2 - ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness), y2 - 1); -
1148 p->drawPoint(x1 + 1, y2 - 1); -
1149 p->drawPoint(x1 + 2, y2); -
1150 }
executed: }
Execution Count:2
2
1151 break; }
executed: break;
Execution Count:2
2
1152 case QTabBar::RoundedEast: { -
1153 if (!selected) {
partially evaluated: !selected
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1154 x2 -= 2; -
1155 y1 += firstTab ? borderThinkness : 0;
never evaluated: firstTab
0
1156 y2 -= lastTab ? borderThinkness : 0;
never evaluated: lastTab
0
1157 }
never executed: }
0
1158 -
1159 p->fillRect(QRect(x1 + 2, y1 + 1, (x2 - x1) - 1, (y2 - y1) - 1), tab->palette.background()); -
1160 -
1161 -
1162 if (selected) {
partially evaluated: selected
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
1163 p->fillRect(QRect(x1 + 1, y1, 1, (y2 - 1)-y1),tab->palette.background()); -
1164 p->fillRect(QRect(x1, y1, 1, (y2-1)-y1), tab->palette.background()); -
1165 }
executed: }
Execution Count:2
2
1166 -
1167 if (firstTab || selected || onlyOne || !previousSelected) {
partially evaluated: firstTab
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
partially evaluated: selected
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
never evaluated: onlyOne
never evaluated: !previousSelected
0-2
1168 p->setPen(light); -
1169 p->drawLine(x2 - 2, y1, x1 + ((onlyOne || firstTab) && selected && leftAligned ? 0 : borderThinkness), y1); -
1170 p->drawPoint(x2 - 1, y1 + 1); -
1171 }
executed: }
Execution Count:2
2
1172 -
1173 { -
1174 int beg = y1 + (previousSelected ? 0 : 2);
partially evaluated: previousSelected
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1175 int end = y2 - (nextSelected ? 0 : 2);
partially evaluated: nextSelected
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1176 p->setPen(shadow); -
1177 p->drawLine(x2, beg, x2, end); -
1178 p->setPen(dark); -
1179 p->drawLine(x2 - 1, beg, x2 - 1, end); -
1180 } -
1181 -
1182 if (lastTab || selected || onlyOne || !nextSelected) {
partially evaluated: lastTab
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
partially evaluated: selected
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
never evaluated: onlyOne
never evaluated: !nextSelected
0-2
1183 p->setPen(shadow); -
1184 p->drawLine(x2 - 2, y2, x1 + ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness), y2); -
1185 p->drawPoint(x2 - 1, y2 - 1); -
1186 p->setPen(dark); -
1187 p->drawLine(x2 - 2, y2 - 1, x1 + ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness), y2 - 1); -
1188 }
executed: }
Execution Count:2
2
1189 break; }
executed: break;
Execution Count:2
2
1190 } -
1191 }
executed: }
Execution Count:39
39
1192 break;
executed: break;
Execution Count:42
42
1193 -
1194 case CE_ToolBoxTabShape: -
1195 qDrawShadePanel(p, opt->rect, opt->palette, -
1196 opt->state & (State_Sunken | State_On), 1, -
1197 &opt->palette.brush(QPalette::Button)); -
1198 break;
executed: break;
Execution Count:3
3
1199 -
1200 case CE_Splitter: -
1201 p->eraseRect(opt->rect); -
1202 break;
executed: break;
Execution Count:53
53
1203 -
1204 -
1205 case CE_ScrollBarSubLine: -
1206 case CE_ScrollBarAddLine: { -
1207 if ((opt->state & State_Sunken)) {
evaluated: (opt->state & State_Sunken)
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:5887
1-5887
1208 p->setPen(opt->palette.dark().color()); -
1209 p->setBrush(opt->palette.brush(QPalette::Button)); -
1210 p->drawRect(opt->rect.adjusted(0, 0, -1, -1)); -
1211 } else {
executed: }
Execution Count:1
1
1212 QStyleOption buttonOpt = *opt; -
1213 if (!(buttonOpt.state & State_Sunken))
partially evaluated: !(buttonOpt.state & State_Sunken)
TRUEFALSE
yes
Evaluation Count:5887
no
Evaluation Count:0
0-5887
1214 buttonOpt.state |= State_Raised;
executed: buttonOpt.state |= State_Raised;
Execution Count:5887
5887
1215 QPalette pal(opt->palette); -
1216 pal.setColor(QPalette::Button, opt->palette.light().color()); -
1217 pal.setColor(QPalette::Light, opt->palette.button().color()); -
1218 qDrawWinButton(p, opt->rect, pal, opt->state & (State_Sunken | State_On), -
1219 &opt->palette.brush(QPalette::Button)); -
1220 }
executed: }
Execution Count:5887
5887
1221 PrimitiveElement arrow; -
1222 if (opt->state & State_Horizontal) {
evaluated: opt->state & State_Horizontal
TRUEFALSE
yes
Evaluation Count:2656
yes
Evaluation Count:3232
2656-3232
1223 if (ce == CE_ScrollBarAddLine)
evaluated: ce == CE_ScrollBarAddLine
TRUEFALSE
yes
Evaluation Count:1328
yes
Evaluation Count:1328
1328
1224 arrow = opt->direction == Qt::LeftToRight ? PE_IndicatorArrowRight : PE_IndicatorArrowLeft;
executed: arrow = opt->direction == Qt::LeftToRight ? PE_IndicatorArrowRight : PE_IndicatorArrowLeft;
Execution Count:1328
evaluated: opt->direction == Qt::LeftToRight
TRUEFALSE
yes
Evaluation Count:1324
yes
Evaluation Count:4
4-1328
1225 else -
1226 arrow = opt->direction == Qt::LeftToRight ? PE_IndicatorArrowLeft : PE_IndicatorArrowRight;
executed: arrow = opt->direction == Qt::LeftToRight ? PE_IndicatorArrowLeft : PE_IndicatorArrowRight;
Execution Count:1328
evaluated: opt->direction == Qt::LeftToRight
TRUEFALSE
yes
Evaluation Count:1324
yes
Evaluation Count:4
4-1328
1227 } else { -
1228 if (ce == CE_ScrollBarAddLine)
evaluated: ce == CE_ScrollBarAddLine
TRUEFALSE
yes
Evaluation Count:1616
yes
Evaluation Count:1616
1616
1229 arrow = PE_IndicatorArrowDown;
executed: arrow = PE_IndicatorArrowDown;
Execution Count:1616
1616
1230 else -
1231 arrow = PE_IndicatorArrowUp;
executed: arrow = PE_IndicatorArrowUp;
Execution Count:1616
1616
1232 } -
1233 QStyleOption arrowOpt = *opt; -
1234 arrowOpt.rect = opt->rect.adjusted(4, 4, -4, -4); -
1235 proxy()->drawPrimitive(arrow, &arrowOpt, p, widget); -
1236 break; }
executed: break;
Execution Count:5888
5888
1237 case CE_ScrollBarAddPage: -
1238 case CE_ScrollBarSubPage: { -
1239 QBrush br; -
1240 QBrush bg = p->background(); -
1241 Qt::BGMode bg_mode = p->backgroundMode(); -
1242 p->setPen(Qt::NoPen); -
1243 p->setBackgroundMode(Qt::OpaqueMode); -
1244 -
1245 if (opt->state & State_Sunken) {
partially evaluated: opt->state & State_Sunken
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5015
0-5015
1246 br = QBrush(opt->palette.shadow().color(), Qt::Dense4Pattern); -
1247 p->setBackground(opt->palette.dark().color()); -
1248 p->setBrush(br); -
1249 } else {
never executed: }
0
1250 QPixmap pm = opt->palette.brush(QPalette::Light).texture(); -
1251 br = !pm.isNull() ? QBrush(pm) : QBrush(opt->palette.light().color(), Qt::Dense4Pattern);
partially evaluated: !pm.isNull()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5015
0-5015
1252 p->setBackground(opt->palette.background().color()); -
1253 p->setBrush(br); -
1254 }
executed: }
Execution Count:5015
5015
1255 p->drawRect(opt->rect); -
1256 p->setBackground(bg); -
1257 p->setBackgroundMode(bg_mode); -
1258 break; }
executed: break;
Execution Count:5015
5015
1259 case CE_ScrollBarSlider: -
1260 if (!(opt->state & State_Enabled)) {
evaluated: !(opt->state & State_Enabled)
TRUEFALSE
yes
Evaluation Count:147
yes
Evaluation Count:2785
147-2785
1261 QPixmap pm = opt->palette.brush(QPalette::Light).texture(); -
1262 QBrush br = !pm.isNull() ? QBrush(pm) : QBrush(opt->palette.light().color(), Qt::Dense4Pattern);
partially evaluated: !pm.isNull()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:147
0-147
1263 p->setPen(Qt::NoPen); -
1264 p->setBrush(br); -
1265 p->setBackgroundMode(Qt::OpaqueMode); -
1266 p->drawRect(opt->rect); -
1267 } else {
executed: }
Execution Count:147
147
1268 QStyleOptionButton buttonOpt; -
1269 buttonOpt.QStyleOption::operator=(*opt); -
1270 buttonOpt.state = State_Enabled | State_Raised; -
1271 -
1272 QPalette pal(opt->palette); -
1273 pal.setColor(QPalette::Button, opt->palette.light().color()); -
1274 pal.setColor(QPalette::Light, opt->palette.button().color()); -
1275 qDrawWinButton(p, opt->rect, pal, false, &opt->palette.brush(QPalette::Button)); -
1276 }
executed: }
Execution Count:2785
2785
1277 break;
executed: break;
Execution Count:2932
2932
1278 -
1279 case CE_HeaderSection: { -
1280 QBrush fill; -
1281 if (opt->state & State_On)
evaluated: opt->state & State_On
TRUEFALSE
yes
Evaluation Count:475
yes
Evaluation Count:1631
475-1631
1282 fill = QBrush(opt->palette.light().color(), Qt::Dense4Pattern);
executed: fill = QBrush(opt->palette.light().color(), Qt::Dense4Pattern);
Execution Count:475
475
1283 else -
1284 fill = opt->palette.brush(QPalette::Button);
executed: fill = opt->palette.brush(QPalette::Button);
Execution Count:1631
1631
1285 -
1286 if (opt->state & (State_Raised | State_Sunken)) {
evaluated: opt->state & (State_Raised | State_Sunken)
TRUEFALSE
yes
Evaluation Count:2005
yes
Evaluation Count:101
101-2005
1287 qDrawWinButton(p, opt->rect, opt->palette, opt->state & State_Sunken, &fill); -
1288 } else {
executed: }
Execution Count:2005
2005
1289 p->fillRect(opt->rect, fill); -
1290 }
executed: }
Execution Count:101
101
1291 break; }
executed: break;
Execution Count:2106
2106
1292 -
1293 case CE_ToolBar: -
1294 if (const QStyleOptionToolBar *toolbar = qstyleoption_cast<const QStyleOptionToolBar *>(opt)) {
evaluated: const QStyleOptionToolBar *toolbar = qstyleoption_cast<const QStyleOptionToolBar *>(opt)
TRUEFALSE
yes
Evaluation Count:7
yes
Evaluation Count:3
3-7
1295 -
1296 if (!(widget && qobject_cast<const QMainWindow*> (widget->parentWidget())))
partially evaluated: widget
TRUEFALSE
yes
Evaluation Count:7
no
Evaluation Count:0
evaluated: qobject_cast<const QMainWindow*> (widget->parentWidget())
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:1
0-7
1297 break;
executed: break;
Execution Count:1
1
1298 -
1299 QRect rect = opt->rect; -
1300 bool paintLeftBorder = true; -
1301 bool paintRightBorder = true; -
1302 bool paintBottomBorder = true; -
1303 -
1304 switch (toolbar->toolBarArea){ -
1305 case Qt::BottomToolBarArea : -
1306 switch(toolbar->positionOfLine){ -
1307 case QStyleOptionToolBar::Beginning: -
1308 case QStyleOptionToolBar::OnlyOne: -
1309 paintBottomBorder = false; -
1310 default: -
1311 break;
never executed: break;
0
1312 } -
1313 case Qt::TopToolBarArea :
code before this statement never executed: case Qt::TopToolBarArea :
0
1314 switch(toolbar->positionWithinLine){ -
1315 case QStyleOptionToolBar::Beginning: -
1316 paintLeftBorder = false; -
1317 break;
never executed: break;
0
1318 case QStyleOptionToolBar::End: -
1319 paintRightBorder = false; -
1320 break;
never executed: break;
0
1321 case QStyleOptionToolBar::OnlyOne: -
1322 paintRightBorder = false; -
1323 paintLeftBorder = false; -
1324 default: -
1325 break;
executed: break;
Execution Count:6
6
1326 } -
1327 if(opt->direction == Qt::RightToLeft){
partially evaluated: opt->direction == Qt::RightToLeft
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
0-6
1328 bool tmp = paintLeftBorder; -
1329 paintRightBorder=paintLeftBorder; -
1330 paintLeftBorder=tmp; -
1331 }
never executed: }
0
1332 break;
executed: break;
Execution Count:6
6
1333 case Qt::RightToolBarArea : -
1334 switch (toolbar->positionOfLine){ -
1335 case QStyleOptionToolBar::Beginning: -
1336 case QStyleOptionToolBar::OnlyOne: -
1337 paintRightBorder = false; -
1338 break;
never executed: break;
0
1339 default: -
1340 break;
never executed: break;
0
1341 } -
1342 break;
never executed: break;
0
1343 case Qt::LeftToolBarArea : -
1344 switch (toolbar->positionOfLine){ -
1345 case QStyleOptionToolBar::Beginning: -
1346 case QStyleOptionToolBar::OnlyOne: -
1347 paintLeftBorder = false; -
1348 break;
never executed: break;
0
1349 default: -
1350 break;
never executed: break;
0
1351 } -
1352 break;
never executed: break;
0
1353 default: -
1354 break;
never executed: break;
0
1355 } -
1356 -
1357 -
1358 -
1359 p->setPen(QPen(opt->palette.light().color())); -
1360 p->drawLine(rect.topLeft().x(), -
1361 rect.topLeft().y(), -
1362 rect.topRight().x(), -
1363 rect.topRight().y()); -
1364 -
1365 if (paintLeftBorder){
partially evaluated: paintLeftBorder
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
0-6
1366 p->setPen(QPen(opt->palette.light().color())); -
1367 p->drawLine(rect.topLeft().x(), -
1368 rect.topLeft().y(), -
1369 rect.bottomLeft().x(), -
1370 rect.bottomLeft().y()); -
1371 }
never executed: }
0
1372 -
1373 if (paintRightBorder){
partially evaluated: paintRightBorder
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
0-6
1374 p->setPen(QPen(opt->palette.dark().color())); -
1375 p->drawLine(rect.topRight().x(), -
1376 rect.topRight().y(), -
1377 rect.bottomRight().x(), -
1378 rect.bottomRight().y()); -
1379 }
never executed: }
0
1380 -
1381 if (paintBottomBorder){
partially evaluated: paintBottomBorder
TRUEFALSE
yes
Evaluation Count:6
no
Evaluation Count:0
0-6
1382 p->setPen(QPen(opt->palette.dark().color())); -
1383 p->drawLine(rect.bottomLeft().x(), -
1384 rect.bottomLeft().y(), -
1385 rect.bottomRight().x(), -
1386 rect.bottomRight().y()); -
1387 }
executed: }
Execution Count:6
6
1388 }
executed: }
Execution Count:6
6
1389 break;
executed: break;
Execution Count:9
9
1390 -
1391 -
1392 -
1393 -
1394 case CE_ProgressBarContents: -
1395 if (const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(opt)) {
evaluated: const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(opt)
TRUEFALSE
yes
Evaluation Count:61
yes
Evaluation Count:3
3-61
1396 QRect rect = pb->rect; -
1397 if (!rect.isValid())
evaluated: !rect.isValid()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:60
1-60
1398 return;
executed: return;
Execution Count:1
1
1399 -
1400 bool vertical = false; -
1401 bool inverted = false; -
1402 -
1403 -
1404 const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt); -
1405 if (pb2) {
partially evaluated: pb2
TRUEFALSE
yes
Evaluation Count:60
no
Evaluation Count:0
0-60
1406 vertical = (pb2->orientation == Qt::Vertical); -
1407 inverted = pb2->invertedAppearance; -
1408 }
executed: }
Execution Count:60
60
1409 QMatrix m; -
1410 if (vertical) {
partially evaluated: vertical
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:60
0-60
1411 rect = QRect(rect.y(), rect.x(), rect.height(), rect.width()); -
1412 m.rotate(90); -
1413 m.translate(0, -(rect.height() + rect.y()*2)); -
1414 }
never executed: }
0
1415 QPalette pal2 = pb->palette; -
1416 -
1417 if (pal2.highlight() == pal2.background())
partially evaluated: pal2.highlight() == pal2.background()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:60
0-60
1418 pal2.setColor(QPalette::Highlight, pb->palette.color(QPalette::Active, 0
1419 QPalette::Highlight));
never executed: pal2.setColor(QPalette::Highlight, pb->palette.color(QPalette::Active, QPalette::Highlight));
0
1420 bool reverse = ((!vertical && (pb->direction == Qt::RightToLeft)) || vertical);
partially evaluated: !vertical
TRUEFALSE
yes
Evaluation Count:60
no
Evaluation Count:0
partially evaluated: (pb->direction == Qt::RightToLeft)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:60
partially evaluated: vertical
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:60
0-60
1421 if (inverted)
partially evaluated: inverted
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:60
0-60
1422 reverse = !reverse;
never executed: reverse = !reverse;
0
1423 int w = rect.width(); -
1424 const QWindowsStylePrivate * const d = d_func(); -
1425 if (pb->minimum == 0 && pb->maximum == 0) {
evaluated: pb->minimum == 0
TRUEFALSE
yes
Evaluation Count:43
yes
Evaluation Count:17
evaluated: pb->maximum == 0
TRUEFALSE
yes
Evaluation Count:17
yes
Evaluation Count:26
17-43
1426 const int unit_width = proxy()->pixelMetric(PM_ProgressBarChunkWidth, pb, widget); -
1427 QStyleOptionProgressBarV2 pbBits = *pb; -
1428 qt_noop(); -
1429 -
1430 pbBits.rect = rect; -
1431 pbBits.palette = pal2; -
1432 -
1433 int step = 0; -
1434 int chunkCount = w / unit_width + 1; -
1435 if (QProgressStyleAnimation *animation = qobject_cast<QProgressStyleAnimation*>(d->animation(opt->styleObject)))
evaluated: QProgressStyleAnimation *animation = qobject_cast<QProgressStyleAnimation*>(d->animation(opt->styleObject))
TRUEFALSE
yes
Evaluation Count:15
yes
Evaluation Count:2
2-15
1436 step = (animation->animationStep() / 3) % chunkCount;
executed: step = (animation->animationStep() / 3) % chunkCount;
Execution Count:15
15
1437 else -
1438 d->startAnimation(new QProgressStyleAnimation(d->animationFps, opt->styleObject));
executed: d->startAnimation(new QProgressStyleAnimation(d->animationFps, opt->styleObject));
Execution Count:2
2
1439 int chunksInRow = 5; -
1440 int myY = pbBits.rect.y(); -
1441 int myHeight = pbBits.rect.height(); -
1442 int chunksToDraw = chunksInRow; -
1443 -
1444 if(step > chunkCount - 5)chunksToDraw = (chunkCount - step);
never executed: chunksToDraw = (chunkCount - step);
partially evaluated: step > chunkCount - 5
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:17
0-17
1445 p->save(); -
1446 p->setClipRect(m.mapRect(QRectF(rect)).toRect()); -
1447 -
1448 int x0 = reverse ? rect.left() + rect.width() - unit_width*(step) - unit_width : rect.left() + unit_width * step;
partially evaluated: reverse
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:17
0-17
1449 int x = 0; -
1450 -
1451 for (int i = 0; i < chunksToDraw ; ++i) {
evaluated: i < chunksToDraw
TRUEFALSE
yes
Evaluation Count:85
yes
Evaluation Count:17
17-85
1452 pbBits.rect.setRect(x0 + x, myY, unit_width, myHeight); -
1453 pbBits.rect = m.mapRect(QRectF(pbBits.rect)).toRect(); -
1454 proxy()->drawPrimitive(PE_IndicatorProgressChunk, &pbBits, p, widget); -
1455 x += reverse ? -unit_width : unit_width;
partially evaluated: reverse
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:85
0-85
1456 }
executed: }
Execution Count:85
85
1457 -
1458 if( step > chunkCount-5){
partially evaluated: step > chunkCount-5
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:17
0-17
1459 x0 = reverse ? rect.left() + rect.width() - unit_width : rect.left() ;
never evaluated: reverse
0
1460 x = 0; -
1461 int chunksToDraw = step - (chunkCount - chunksInRow); -
1462 for (int i = 0; i < chunksToDraw ; ++i) {
never evaluated: i < chunksToDraw
0
1463 pbBits.rect.setRect(x0 + x, myY, unit_width, myHeight); -
1464 pbBits.rect = m.mapRect(QRectF(pbBits.rect)).toRect(); -
1465 proxy()->drawPrimitive(PE_IndicatorProgressChunk, &pbBits, p, widget); -
1466 x += reverse ? -unit_width : unit_width;
never evaluated: reverse
0
1467 }
never executed: }
0
1468 }
never executed: }
0
1469 p->restore(); -
1470 }
executed: }
Execution Count:17
17
1471 else { -
1472 d->stopAnimation(opt->styleObject); -
1473 QCommonStyle::drawControl(ce, opt, p, widget); -
1474 }
executed: }
Execution Count:43
43
1475 } -
1476 break;
executed: break;
Execution Count:63
63
1477 -
1478 -
1479 case CE_DockWidgetTitle: -
1480 -
1481 if (const QStyleOptionDockWidget *dwOpt = qstyleoption_cast<const QStyleOptionDockWidget *>(opt)) {
evaluated: const QStyleOptionDockWidget *dwOpt = qstyleoption_cast<const QStyleOptionDockWidget *>(opt)
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:3
3-30
1482 const QWindowsStylePrivate * const d = d_func(); -
1483 -
1484 const QStyleOptionDockWidgetV2 *v2 -
1485 = qstyleoption_cast<const QStyleOptionDockWidgetV2*>(opt); -
1486 bool verticalTitleBar = v2 == 0 ? false : v2->verticalTitleBar;
partially evaluated: v2 == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:30
0-30
1487 -
1488 QRect rect = dwOpt->rect; -
1489 QRect r = rect; -
1490 -
1491 if (verticalTitleBar) {
partially evaluated: verticalTitleBar
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:30
0-30
1492 QSize s = r.size(); -
1493 s.transpose(); -
1494 r.setSize(s); -
1495 -
1496 p->save(); -
1497 p->translate(r.left(), r.top() + r.width()); -
1498 p->rotate(-90); -
1499 p->translate(-r.left(), -r.top()); -
1500 }
never executed: }
0
1501 -
1502 bool floating = false; -
1503 bool active = dwOpt->state & State_Active; -
1504 QColor inactiveCaptionTextColor = d->inactiveCaptionText; -
1505 if (dwOpt->movable) {
partially evaluated: dwOpt->movable
TRUEFALSE
yes
Evaluation Count:30
no
Evaluation Count:0
0-30
1506 QColor left, right; -
1507 -
1508 -
1509 if (widget && widget->isWindow()) {
partially evaluated: widget
TRUEFALSE
yes
Evaluation Count:30
no
Evaluation Count:0
evaluated: widget->isWindow()
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:18
0-30
1510 floating = true; -
1511 if (active) {
evaluated: active
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:7
5-7
1512 left = d->activeCaptionColor; -
1513 right = d->activeGradientCaptionColor; -
1514 } else {
executed: }
Execution Count:5
5
1515 left = d->inactiveCaptionColor; -
1516 right = d->inactiveGradientCaptionColor; -
1517 }
executed: }
Execution Count:7
7
1518 QBrush fillBrush(left); -
1519 if (left != right) {
partially evaluated: left != right
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12
0-12
1520 QPoint p1(r.x(), r.top() + r.height()/2); -
1521 QPoint p2(rect.right(), r.top() + r.height()/2); -
1522 QLinearGradient lg(p1, p2); -
1523 lg.setColorAt(0, left); -
1524 lg.setColorAt(1, right); -
1525 fillBrush = lg; -
1526 }
never executed: }
0
1527 p->fillRect(r.adjusted(0, 0, 0, -3), fillBrush); -
1528 }
executed: }
Execution Count:12
12
1529 }
executed: }
Execution Count:30
30
1530 if (!dwOpt->title.isEmpty()) {
evaluated: !dwOpt->title.isEmpty()
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:22
8-22
1531 QFont oldFont = p->font(); -
1532 if (floating) {
evaluated: floating
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:4
4
1533 QFont font = oldFont; -
1534 font.setBold(true); -
1535 p->setFont(font); -
1536 }
executed: }
Execution Count:4
4
1537 QPalette palette = dwOpt->palette; -
1538 palette.setColor(QPalette::Window, inactiveCaptionTextColor); -
1539 QRect titleRect = subElementRect(SE_DockWidgetTitleBarText, opt, widget); -
1540 if (verticalTitleBar) {
partially evaluated: verticalTitleBar
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-8
1541 titleRect = QRect(r.left() + rect.bottom() -
1542 - titleRect.bottom(), -
1543 r.top() + titleRect.left() - rect.left(), -
1544 titleRect.height(), titleRect.width()); -
1545 }
never executed: }
0
1546 proxy()->drawItemText(p, titleRect, -
1547 Qt::AlignLeft | Qt::AlignVCenter | Qt::TextShowMnemonic, palette, -
1548 dwOpt->state & State_Enabled, dwOpt->title, -
1549 floating ? (active ? QPalette::BrightText : QPalette::Window) : QPalette::WindowText); -
1550 p->setFont(oldFont); -
1551 }
executed: }
Execution Count:8
8
1552 if (verticalTitleBar)
partially evaluated: verticalTitleBar
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:30
0-30
1553 p->restore();
never executed: p->restore();
0
1554 }
executed: }
Execution Count:30
30
1555 return;
executed: return;
Execution Count:33
33
1556 -
1557 default: -
1558 QCommonStyle::drawControl(ce, opt, p, widget); -
1559 }
executed: }
Execution Count:23443
23443
1560}
executed: }
Execution Count:39743
39743
1561 -
1562 -
1563QRect QWindowsStyle::subElementRect(SubElement sr, const QStyleOption *opt, const QWidget *w) const -
1564{ -
1565 QRect r; -
1566 switch (sr) { -
1567 case SE_SliderFocusRect: -
1568 case SE_ToolBoxTabContents: -
1569 r = visualRect(opt->direction, opt->rect, opt->rect); -
1570 break;
never executed: break;
0
1571 case SE_DockWidgetTitleBarText: { -
1572 r = QCommonStyle::subElementRect(sr, opt, w); -
1573 const QStyleOptionDockWidgetV2 *v2 -
1574 = qstyleoption_cast<const QStyleOptionDockWidgetV2*>(opt); -
1575 bool verticalTitleBar = v2 == 0 ? false : v2->verticalTitleBar;
partially evaluated: v2 == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-8
1576 int m = proxy()->pixelMetric(PM_DockWidgetTitleMargin, opt, w); -
1577 if (verticalTitleBar) {
partially evaluated: verticalTitleBar
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-8
1578 r.adjust(0, 0, 0, -m); -
1579 } else {
never executed: }
0
1580 if (opt->direction == Qt::LeftToRight)
partially evaluated: opt->direction == Qt::LeftToRight
TRUEFALSE
yes
Evaluation Count:8
no
Evaluation Count:0
0-8
1581 r.adjust(m, 0, 0, 0);
executed: r.adjust(m, 0, 0, 0);
Execution Count:8
8
1582 else -
1583 r.adjust(0, 0, -m, 0);
never executed: r.adjust(0, 0, -m, 0);
0
1584 } -
1585 break;
executed: break;
Execution Count:8
8
1586 } -
1587 case SE_ProgressBarContents: -
1588 r = QCommonStyle::subElementRect(SE_ProgressBarGroove, opt, w); -
1589 r.adjust(3, 3, -3, -3); -
1590 break;
executed: break;
Execution Count:61
61
1591 default: -
1592 r = QCommonStyle::subElementRect(sr, opt, w); -
1593 }
executed: }
Execution Count:113395
113395
1594 return r;
executed: return r;
Execution Count:113464
113464
1595} -
1596 -
1597 -
1598 -
1599void QWindowsStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, -
1600 QPainter *p, const QWidget *widget) const -
1601{ -
1602 switch (cc) { -
1603 -
1604 case CC_Slider: -
1605 if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
partially evaluated: const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)
TRUEFALSE
yes
Evaluation Count:4
no
Evaluation Count:0
0-4
1606 int thickness = proxy()->pixelMetric(PM_SliderControlThickness, slider, widget); -
1607 int len = proxy()->pixelMetric(PM_SliderLength, slider, widget); -
1608 int ticks = slider->tickPosition; -
1609 QRect groove = proxy()->subControlRect(CC_Slider, slider, SC_SliderGroove, widget); -
1610 QRect handle = proxy()->subControlRect(CC_Slider, slider, SC_SliderHandle, widget); -
1611 -
1612 if ((slider->subControls & SC_SliderGroove) && groove.isValid()) {
partially evaluated: (slider->subControls & SC_SliderGroove)
TRUEFALSE
yes
Evaluation Count:4
no
Evaluation Count:0
partially evaluated: groove.isValid()
TRUEFALSE
yes
Evaluation Count:4
no
Evaluation Count:0
0-4
1613 int mid = thickness / 2; -
1614 -
1615 if (ticks & QSlider::TicksAbove)
partially evaluated: ticks & QSlider::TicksAbove
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4
0-4
1616 mid += len / 8;
never executed: mid += len / 8;
0
1617 if (ticks & QSlider::TicksBelow)
partially evaluated: ticks & QSlider::TicksBelow
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4
0-4
1618 mid -= len / 8;
never executed: mid -= len / 8;
0
1619 -
1620 p->setPen(slider->palette.shadow().color()); -
1621 if (slider->orientation == Qt::Horizontal) {
evaluated: slider->orientation == Qt::Horizontal
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:1
1-3
1622 qDrawWinPanel(p, groove.x(), groove.y() + mid - 2, -
1623 groove.width(), 4, slider->palette, true); -
1624 p->drawLine(groove.x() + 1, groove.y() + mid - 1, -
1625 groove.x() + groove.width() - 3, groove.y() + mid - 1); -
1626 } else {
executed: }
Execution Count:3
3
1627 qDrawWinPanel(p, groove.x() + mid - 2, groove.y(), -
1628 4, groove.height(), slider->palette, true); -
1629 p->drawLine(groove.x() + mid - 1, groove.y() + 1, -
1630 groove.x() + mid - 1, groove.y() + groove.height() - 3); -
1631 }
executed: }
Execution Count:1
1
1632 } -
1633 -
1634 if (slider->subControls & SC_SliderTickmarks) {
evaluated: slider->subControls & SC_SliderTickmarks
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:1
1-3
1635 QStyleOptionSlider tmpSlider = *slider; -
1636 tmpSlider.subControls = SC_SliderTickmarks; -
1637 QCommonStyle::drawComplexControl(cc, &tmpSlider, p, widget); -
1638 }
executed: }
Execution Count:3
3
1639 -
1640 if (slider->subControls & SC_SliderHandle) {
partially evaluated: slider->subControls & SC_SliderHandle
TRUEFALSE
yes
Evaluation Count:4
no
Evaluation Count:0
0-4
1641 const QColor c0 = slider->palette.shadow().color(); -
1642 const QColor c1 = slider->palette.dark().color(); -
1643 -
1644 const QColor c3 = slider->palette.midlight().color(); -
1645 const QColor c4 = slider->palette.light().color(); -
1646 QBrush handleBrush; -
1647 -
1648 if (slider->state & State_Enabled) {
partially evaluated: slider->state & State_Enabled
TRUEFALSE
yes
Evaluation Count:4
no
Evaluation Count:0
0-4
1649 handleBrush = slider->palette.color(QPalette::Button); -
1650 } else {
executed: }
Execution Count:4
4
1651 handleBrush = QBrush(slider->palette.color(QPalette::Button), -
1652 Qt::Dense4Pattern); -
1653 }
never executed: }
0
1654 -
1655 -
1656 int x = handle.x(), y = handle.y(), -
1657 wi = handle.width(), he = handle.height(); -
1658 -
1659 int x1 = x; -
1660 int x2 = x+wi-1; -
1661 int y1 = y; -
1662 int y2 = y+he-1; -
1663 -
1664 Qt::Orientation orient = slider->orientation; -
1665 bool tickAbove = slider->tickPosition == QSlider::TicksAbove; -
1666 bool tickBelow = slider->tickPosition == QSlider::TicksBelow; -
1667 -
1668 if (slider->state & State_HasFocus) {
partially evaluated: slider->state & State_HasFocus
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4
0-4
1669 QStyleOptionFocusRect fropt; -
1670 fropt.QStyleOption::operator=(*slider); -
1671 fropt.rect = subElementRect(SE_SliderFocusRect, slider, widget); -
1672 proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, p, widget); -
1673 }
never executed: }
0
1674 -
1675 if ((tickAbove && tickBelow) || (!tickAbove && !tickBelow)) {
partially evaluated: tickAbove
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4
never evaluated: tickBelow
partially evaluated: !tickAbove
TRUEFALSE
yes
Evaluation Count:4
no
Evaluation Count:0
partially evaluated: !tickBelow
TRUEFALSE
yes
Evaluation Count:4
no
Evaluation Count:0
0-4
1676 Qt::BGMode oldMode = p->backgroundMode(); -
1677 p->setBackgroundMode(Qt::OpaqueMode); -
1678 qDrawWinButton(p, QRect(x, y, wi, he), slider->palette, false, -
1679 &handleBrush); -
1680 p->setBackgroundMode(oldMode); -
1681 return;
executed: return;
Execution Count:4
4
1682 } -
1683 -
1684 QSliderDirection dir; -
1685 -
1686 if (orient == Qt::Horizontal)
never evaluated: orient == Qt::Horizontal
0
1687 if (tickAbove)
never evaluated: tickAbove
0
1688 dir = SlUp;
never executed: dir = SlUp;
0
1689 else -
1690 dir = SlDown;
never executed: dir = SlDown;
0
1691 else -
1692 if (tickAbove)
never evaluated: tickAbove
0
1693 dir = SlLeft;
never executed: dir = SlLeft;
0
1694 else -
1695 dir = SlRight;
never executed: dir = SlRight;
0
1696 -
1697 QPolygon a; -
1698 -
1699 int d = 0; -
1700 switch (dir) { -
1701 case SlUp: -
1702 y1 = y1 + wi/2; -
1703 d = (wi + 1) / 2 - 1; -
1704 a.setPoints(5, x1,y1, x1,y2, x2,y2, x2,y1, x1+d,y1-d); -
1705 break;
never executed: break;
0
1706 case SlDown: -
1707 y2 = y2 - wi/2; -
1708 d = (wi + 1) / 2 - 1; -
1709 a.setPoints(5, x1,y1, x1,y2, x1+d,y2+d, x2,y2, x2,y1); -
1710 break;
never executed: break;
0
1711 case SlLeft: -
1712 d = (he + 1) / 2 - 1; -
1713 x1 = x1 + he/2; -
1714 a.setPoints(5, x1,y1, x1-d,y1+d, x1,y2, x2,y2, x2,y1); -
1715 break;
never executed: break;
0
1716 case SlRight: -
1717 d = (he + 1) / 2 - 1; -
1718 x2 = x2 - he/2; -
1719 a.setPoints(5, x1,y1, x1,y2, x2,y2, x2+d,y1+d, x2,y1); -
1720 break;
never executed: break;
0
1721 } -
1722 -
1723 QBrush oldBrush = p->brush(); -
1724 bool oldQt4CompatiblePainting = p->testRenderHint(QPainter::Qt4CompatiblePainting); -
1725 p->setPen(Qt::NoPen); -
1726 p->setBrush(handleBrush); -
1727 p->setRenderHint(QPainter::Qt4CompatiblePainting); -
1728 Qt::BGMode oldMode = p->backgroundMode(); -
1729 p->setBackgroundMode(Qt::OpaqueMode); -
1730 p->drawRect(x1, y1, x2-x1+1, y2-y1+1); -
1731 p->drawPolygon(a); -
1732 p->setBrush(oldBrush); -
1733 p->setBackgroundMode(oldMode); -
1734 -
1735 if (dir != SlUp) {
never evaluated: dir != SlUp
0
1736 p->setPen(c4); -
1737 p->drawLine(x1, y1, x2, y1); -
1738 p->setPen(c3); -
1739 p->drawLine(x1, y1+1, x2, y1+1); -
1740 }
never executed: }
0
1741 if (dir != SlLeft) {
never evaluated: dir != SlLeft
0
1742 p->setPen(c3); -
1743 p->drawLine(x1+1, y1+1, x1+1, y2); -
1744 p->setPen(c4); -
1745 p->drawLine(x1, y1, x1, y2); -
1746 }
never executed: }
0
1747 if (dir != SlRight) {
never evaluated: dir != SlRight
0
1748 p->setPen(c0); -
1749 p->drawLine(x2, y1, x2, y2); -
1750 p->setPen(c1); -
1751 p->drawLine(x2-1, y1+1, x2-1, y2-1); -
1752 }
never executed: }
0
1753 if (dir != SlDown) {
never evaluated: dir != SlDown
0
1754 p->setPen(c0); -
1755 p->drawLine(x1, y2, x2, y2); -
1756 p->setPen(c1); -
1757 p->drawLine(x1+1, y2-1, x2-1, y2-1); -
1758 }
never executed: }
0
1759 -
1760 switch (dir) { -
1761 case SlUp: -
1762 p->setPen(c4); -
1763 p->drawLine(x1, y1, x1+d, y1-d); -
1764 p->setPen(c0); -
1765 d = wi - d - 1; -
1766 p->drawLine(x2, y1, x2-d, y1-d); -
1767 d--; -
1768 p->setPen(c3); -
1769 p->drawLine(x1+1, y1, x1+1+d, y1-d); -
1770 p->setPen(c1); -
1771 p->drawLine(x2-1, y1, x2-1-d, y1-d); -
1772 break;
never executed: break;
0
1773 case SlDown: -
1774 p->setPen(c4); -
1775 p->drawLine(x1, y2, x1+d, y2+d); -
1776 p->setPen(c0); -
1777 d = wi - d - 1; -
1778 p->drawLine(x2, y2, x2-d, y2+d); -
1779 d--; -
1780 p->setPen(c3); -
1781 p->drawLine(x1+1, y2, x1+1+d, y2+d); -
1782 p->setPen(c1); -
1783 p->drawLine(x2-1, y2, x2-1-d, y2+d); -
1784 break;
never executed: break;
0
1785 case SlLeft: -
1786 p->setPen(c4); -
1787 p->drawLine(x1, y1, x1-d, y1+d); -
1788 p->setPen(c0); -
1789 d = he - d - 1; -
1790 p->drawLine(x1, y2, x1-d, y2-d); -
1791 d--; -
1792 p->setPen(c3); -
1793 p->drawLine(x1, y1+1, x1-d, y1+1+d); -
1794 p->setPen(c1); -
1795 p->drawLine(x1, y2-1, x1-d, y2-1-d); -
1796 break;
never executed: break;
0
1797 case SlRight: -
1798 p->setPen(c4); -
1799 p->drawLine(x2, y1, x2+d, y1+d); -
1800 p->setPen(c0); -
1801 d = he - d - 1; -
1802 p->drawLine(x2, y2, x2+d, y2-d); -
1803 d--; -
1804 p->setPen(c3); -
1805 p->drawLine(x2, y1+1, x2+d, y1+1+d); -
1806 p->setPen(c1); -
1807 p->drawLine(x2, y2-1, x2+d, y2-1-d); -
1808 break;
never executed: break;
0
1809 } -
1810 p->setRenderHint(QPainter::Qt4CompatiblePainting, oldQt4CompatiblePainting); -
1811 }
never executed: }
0
1812 }
never executed: }
0
1813 break;
never executed: break;
0
1814 -
1815 -
1816 case CC_ScrollBar: -
1817 if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
partially evaluated: const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(opt)
TRUEFALSE
yes
Evaluation Count:2941
no
Evaluation Count:0
0-2941
1818 QStyleOptionSlider newScrollbar = *scrollbar; -
1819 if (scrollbar->minimum == scrollbar->maximum)
evaluated: scrollbar->minimum == scrollbar->maximum
TRUEFALSE
yes
Evaluation Count:148
yes
Evaluation Count:2793
148-2793
1820 newScrollbar.state &= ~State_Enabled;
executed: newScrollbar.state &= ~State_Enabled;
Execution Count:148
148
1821 QCommonStyle::drawComplexControl(cc, &newScrollbar, p, widget); -
1822 }
executed: }
Execution Count:2941
2941
1823 break;
executed: break;
Execution Count:2941
2941
1824 -
1825 -
1826 case CC_ComboBox: -
1827 if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
partially evaluated: const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)
TRUEFALSE
yes
Evaluation Count:120
no
Evaluation Count:0
0-120
1828 QBrush editBrush = cmb->palette.brush(QPalette::Base); -
1829 if ((cmb->subControls & SC_ComboBoxFrame)) {
partially evaluated: (cmb->subControls & SC_ComboBoxFrame)
TRUEFALSE
yes
Evaluation Count:120
no
Evaluation Count:0
0-120
1830 if (cmb->frame) {
evaluated: cmb->frame
TRUEFALSE
yes
Evaluation Count:117
yes
Evaluation Count:3
3-117
1831 QPalette shadePal = opt->palette; -
1832 shadePal.setColor(QPalette::Midlight, shadePal.button().color()); -
1833 qDrawWinPanel(p, opt->rect, shadePal, true, &editBrush); -
1834 }
executed: }
Execution Count:117
117
1835 else { -
1836 p->fillRect(opt->rect, editBrush); -
1837 }
executed: }
Execution Count:3
3
1838 } -
1839 if (cmb->subControls & SC_ComboBoxArrow) {
partially evaluated: cmb->subControls & SC_ComboBoxArrow
TRUEFALSE
yes
Evaluation Count:120
no
Evaluation Count:0
0-120
1840 State flags = State_None; -
1841 -
1842 QRect ar = proxy()->subControlRect(CC_ComboBox, cmb, SC_ComboBoxArrow, widget); -
1843 bool sunkenArrow = cmb->activeSubControls == SC_ComboBoxArrow
partially evaluated: cmb->activeSubControls == SC_ComboBoxArrow
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:120
0-120
1844 && cmb->state & State_Sunken;
never evaluated: cmb->state & State_Sunken
0
1845 if (sunkenArrow) {
partially evaluated: sunkenArrow
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:120
0-120
1846 p->setPen(cmb->palette.dark().color()); -
1847 p->setBrush(cmb->palette.brush(QPalette::Button)); -
1848 p->drawRect(ar.adjusted(0,0,-1,-1)); -
1849 } else {
never executed: }
0
1850 -
1851 QPalette pal(cmb->palette); -
1852 pal.setColor(QPalette::Button, cmb->palette.light().color()); -
1853 pal.setColor(QPalette::Light, cmb->palette.button().color()); -
1854 qDrawWinButton(p, ar, pal, false, -
1855 &cmb->palette.brush(QPalette::Button)); -
1856 }
executed: }
Execution Count:120
120
1857 -
1858 ar.adjust(2, 2, -2, -2); -
1859 if (opt->state & State_Enabled)
evaluated: opt->state & State_Enabled
TRUEFALSE
yes
Evaluation Count:119
yes
Evaluation Count:1
1-119
1860 flags |= State_Enabled;
executed: flags |= State_Enabled;
Execution Count:119
119
1861 if (opt->state & State_HasFocus)
evaluated: opt->state & State_HasFocus
TRUEFALSE
yes
Evaluation Count:9
yes
Evaluation Count:111
9-111
1862 flags |= State_HasFocus;
executed: flags |= State_HasFocus;
Execution Count:9
9
1863 -
1864 if (sunkenArrow)
partially evaluated: sunkenArrow
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:120
0-120
1865 flags |= State_Sunken;
never executed: flags |= State_Sunken;
0
1866 QStyleOption arrowOpt(0); -
1867 arrowOpt.rect = ar.adjusted(1, 1, -1, -1); -
1868 arrowOpt.palette = cmb->palette; -
1869 arrowOpt.state = flags; -
1870 proxy()->drawPrimitive(PE_IndicatorArrowDown, &arrowOpt, p, widget); -
1871 }
executed: }
Execution Count:120
120
1872 -
1873 if (cmb->subControls & SC_ComboBoxEditField) {
partially evaluated: cmb->subControls & SC_ComboBoxEditField
TRUEFALSE
yes
Evaluation Count:120
no
Evaluation Count:0
0-120
1874 QRect re = proxy()->subControlRect(CC_ComboBox, cmb, SC_ComboBoxEditField, widget); -
1875 if (cmb->state & State_HasFocus && !cmb->editable)
evaluated: cmb->state & State_HasFocus
TRUEFALSE
yes
Evaluation Count:9
yes
Evaluation Count:111
evaluated: !cmb->editable
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:4
4-111
1876 p->fillRect(re.x(), re.y(), re.width(), re.height(), 5
1877 cmb->palette.brush(QPalette::Highlight));
executed: p->fillRect(re.x(), re.y(), re.width(), re.height(), cmb->palette.brush(QPalette::Highlight));
Execution Count:5
5
1878 -
1879 if (cmb->state & State_HasFocus) {
evaluated: cmb->state & State_HasFocus
TRUEFALSE
yes
Evaluation Count:9
yes
Evaluation Count:111
9-111
1880 p->setPen(cmb->palette.highlightedText().color()); -
1881 p->setBackground(cmb->palette.highlight()); -
1882 -
1883 } else {
executed: }
Execution Count:9
9
1884 p->setPen(cmb->palette.text().color()); -
1885 p->setBackground(cmb->palette.background()); -
1886 }
executed: }
Execution Count:111
111
1887 -
1888 if (cmb->state & State_HasFocus && !cmb->editable) {
evaluated: cmb->state & State_HasFocus
TRUEFALSE
yes
Evaluation Count:9
yes
Evaluation Count:111
evaluated: !cmb->editable
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:4
4-111
1889 QStyleOptionFocusRect focus; -
1890 focus.QStyleOption::operator=(*cmb); -
1891 focus.rect = subElementRect(SE_ComboBoxFocusRect, cmb, widget); -
1892 focus.state |= State_FocusAtBorder; -
1893 focus.backgroundColor = cmb->palette.highlight().color(); -
1894 proxy()->drawPrimitive(PE_FrameFocusRect, &focus, p, widget); -
1895 }
executed: }
Execution Count:5
5
1896 }
executed: }
Execution Count:120
120
1897 }
executed: }
Execution Count:120
120
1898 break;
executed: break;
Execution Count:120
120
1899 -
1900 -
1901 case CC_SpinBox: -
1902 if (const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
partially evaluated: const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)
TRUEFALSE
yes
Evaluation Count:197
no
Evaluation Count:0
0-197
1903 QStyleOptionSpinBox copy = *sb; -
1904 PrimitiveElement pe; -
1905 bool enabled = opt->state & State_Enabled; -
1906 if (sb->frame && (sb->subControls & SC_SpinBoxFrame)) {
evaluated: sb->frame
TRUEFALSE
yes
Evaluation Count:184
yes
Evaluation Count:13
partially evaluated: (sb->subControls & SC_SpinBoxFrame)
TRUEFALSE
yes
Evaluation Count:184
no
Evaluation Count:0
0-184
1907 QBrush editBrush = sb->palette.brush(QPalette::Base); -
1908 QRect r = proxy()->subControlRect(CC_SpinBox, sb, SC_SpinBoxFrame, widget); -
1909 QPalette shadePal = sb->palette; -
1910 shadePal.setColor(QPalette::Midlight, shadePal.button().color()); -
1911 qDrawWinPanel(p, r, shadePal, true, &editBrush); -
1912 }
executed: }
Execution Count:184
184
1913 -
1914 QPalette shadePal(opt->palette); -
1915 shadePal.setColor(QPalette::Button, opt->palette.light().color()); -
1916 shadePal.setColor(QPalette::Light, opt->palette.button().color()); -
1917 -
1918 if (sb->subControls & SC_SpinBoxUp) {
partially evaluated: sb->subControls & SC_SpinBoxUp
TRUEFALSE
yes
Evaluation Count:197
no
Evaluation Count:0
0-197
1919 copy.subControls = SC_SpinBoxUp; -
1920 QPalette pal2 = sb->palette; -
1921 if (!(sb->stepEnabled & QAbstractSpinBox::StepUpEnabled)) {
evaluated: !(sb->stepEnabled & QAbstractSpinBox::StepUpEnabled)
TRUEFALSE
yes
Evaluation Count:13
yes
Evaluation Count:184
13-184
1922 pal2.setCurrentColorGroup(QPalette::Disabled); -
1923 copy.state &= ~State_Enabled; -
1924 }
executed: }
Execution Count:13
13
1925 -
1926 copy.palette = pal2; -
1927 -
1928 if (sb->activeSubControls == SC_SpinBoxUp && (sb->state & State_Sunken)) {
partially evaluated: sb->activeSubControls == SC_SpinBoxUp
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:197
never evaluated: (sb->state & State_Sunken)
0-197
1929 copy.state |= State_On; -
1930 copy.state |= State_Sunken; -
1931 } else {
never executed: }
0
1932 copy.state |= State_Raised; -
1933 copy.state &= ~State_Sunken; -
1934 }
executed: }
Execution Count:197
197
1935 pe = (sb->buttonSymbols == QAbstractSpinBox::PlusMinus ? PE_IndicatorSpinPlus
partially evaluated: sb->buttonSymbols == QAbstractSpinBox::PlusMinus
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:197
0-197
1936 : PE_IndicatorSpinUp); -
1937 -
1938 copy.rect = proxy()->subControlRect(CC_SpinBox, sb, SC_SpinBoxUp, widget); -
1939 qDrawWinButton(p, copy.rect, shadePal, copy.state & (State_Sunken | State_On), -
1940 &copy.palette.brush(QPalette::Button)); -
1941 copy.rect.adjust(4, 1, -5, -1); -
1942 if ((!enabled || !(sb->stepEnabled & QAbstractSpinBox::StepUpEnabled))
partially evaluated: !enabled
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:197
evaluated: !(sb->stepEnabled & QAbstractSpinBox::StepUpEnabled)
TRUEFALSE
yes
Evaluation Count:13
yes
Evaluation Count:184
0-197
1943 && proxy()->styleHint(SH_EtchDisabledText, opt, widget) )
partially evaluated: proxy()->styleHint(SH_EtchDisabledText, opt, widget)
TRUEFALSE
yes
Evaluation Count:13
no
Evaluation Count:0
0-13
1944 { -
1945 QStyleOptionSpinBox lightCopy = copy; -
1946 lightCopy.rect.adjust(1, 1, 1, 1); -
1947 lightCopy.palette.setBrush(QPalette::ButtonText, copy.palette.light()); -
1948 proxy()->drawPrimitive(pe, &lightCopy, p, widget); -
1949 }
executed: }
Execution Count:13
13
1950 proxy()->drawPrimitive(pe, &copy, p, widget); -
1951 }
executed: }
Execution Count:197
197
1952 -
1953 if (sb->subControls & SC_SpinBoxDown) {
partially evaluated: sb->subControls & SC_SpinBoxDown
TRUEFALSE
yes
Evaluation Count:197
no
Evaluation Count:0
0-197
1954 copy.subControls = SC_SpinBoxDown; -
1955 copy.state = sb->state; -
1956 QPalette pal2 = sb->palette; -
1957 if (!(sb->stepEnabled & QAbstractSpinBox::StepDownEnabled)) {
evaluated: !(sb->stepEnabled & QAbstractSpinBox::StepDownEnabled)
TRUEFALSE
yes
Evaluation Count:160
yes
Evaluation Count:37
37-160
1958 pal2.setCurrentColorGroup(QPalette::Disabled); -
1959 copy.state &= ~State_Enabled; -
1960 }
executed: }
Execution Count:160
160
1961 copy.palette = pal2; -
1962 -
1963 if (sb->activeSubControls == SC_SpinBoxDown && (sb->state & State_Sunken)) {
partially evaluated: sb->activeSubControls == SC_SpinBoxDown
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:197
never evaluated: (sb->state & State_Sunken)
0-197
1964 copy.state |= State_On; -
1965 copy.state |= State_Sunken; -
1966 } else {
never executed: }
0
1967 copy.state |= State_Raised; -
1968 copy.state &= ~State_Sunken; -
1969 }
executed: }
Execution Count:197
197
1970 pe = (sb->buttonSymbols == QAbstractSpinBox::PlusMinus ? PE_IndicatorSpinMinus
partially evaluated: sb->buttonSymbols == QAbstractSpinBox::PlusMinus
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:197
0-197
1971 : PE_IndicatorSpinDown); -
1972 -
1973 copy.rect = proxy()->subControlRect(CC_SpinBox, sb, SC_SpinBoxDown, widget); -
1974 qDrawWinButton(p, copy.rect, shadePal, copy.state & (State_Sunken | State_On), -
1975 &copy.palette.brush(QPalette::Button)); -
1976 copy.rect.adjust(4, 0, -5, -1); -
1977 if ((!enabled || !(sb->stepEnabled & QAbstractSpinBox::StepDownEnabled))
partially evaluated: !enabled
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:197
evaluated: !(sb->stepEnabled & QAbstractSpinBox::StepDownEnabled)
TRUEFALSE
yes
Evaluation Count:160
yes
Evaluation Count:37
0-197
1978 && proxy()->styleHint(SH_EtchDisabledText, opt, widget) )
partially evaluated: proxy()->styleHint(SH_EtchDisabledText, opt, widget)
TRUEFALSE
yes
Evaluation Count:160
no
Evaluation Count:0
0-160
1979 { -
1980 QStyleOptionSpinBox lightCopy = copy; -
1981 lightCopy.rect.adjust(1, 1, 1, 1); -
1982 lightCopy.palette.setBrush(QPalette::ButtonText, copy.palette.light()); -
1983 proxy()->drawPrimitive(pe, &lightCopy, p, widget); -
1984 }
executed: }
Execution Count:160
160
1985 proxy()->drawPrimitive(pe, &copy, p, widget); -
1986 }
executed: }
Execution Count:197
197
1987 }
executed: }
Execution Count:197
197
1988 break;
executed: break;
Execution Count:197
197
1989 -
1990 -
1991 default: -
1992 QCommonStyle::drawComplexControl(cc, opt, p, widget); -
1993 }
executed: }
Execution Count:723
723
1994}
executed: }
Execution Count:3981
3981
1995 -
1996 -
1997QSize QWindowsStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, -
1998 const QSize &csz, const QWidget *widget) const -
1999{ -
2000 QSize sz(csz); -
2001 switch (ct) { -
2002 case CT_PushButton: -
2003 if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
partially evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)
TRUEFALSE
yes
Evaluation Count:1110
no
Evaluation Count:0
0-1110
2004 sz = QCommonStyle::sizeFromContents(ct, opt, csz, widget); -
2005 int w = sz.width(), -
2006 h = sz.height(); -
2007 int defwidth = 0; -
2008 if (btn->features & QStyleOptionButton::AutoDefaultButton)
evaluated: btn->features & QStyleOptionButton::AutoDefaultButton
TRUEFALSE
yes
Evaluation Count:860
yes
Evaluation Count:250
250-860
2009 defwidth = 2 * proxy()->pixelMetric(PM_ButtonDefaultIndicator, btn, widget);
executed: defwidth = 2 * proxy()->pixelMetric(PM_ButtonDefaultIndicator, btn, widget);
Execution Count:860
860
2010 int minwidth = int(QStyleHelper::dpiScaled(75.)); -
2011 int minheight = int(QStyleHelper::dpiScaled(23.)); -
2012 -
2013 -
2014 if (w < minwidth + defwidth && !btn->text.isEmpty())
evaluated: w < minwidth + defwidth
TRUEFALSE
yes
Evaluation Count:1084
yes
Evaluation Count:26
evaluated: !btn->text.isEmpty()
TRUEFALSE
yes
Evaluation Count:910
yes
Evaluation Count:174
26-1084
2015 w = minwidth + defwidth;
executed: w = minwidth + defwidth;
Execution Count:910
910
2016 if (h < minheight + defwidth)
evaluated: h < minheight + defwidth
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1109
1-1109
2017 h = minheight + defwidth;
executed: h = minheight + defwidth;
Execution Count:1
1
2018 -
2019 sz = QSize(w, h); -
2020 }
executed: }
Execution Count:1110
1110
2021 break;
executed: break;
Execution Count:1110
1110
2022 -
2023 case CT_MenuItem: -
2024 if (const QStyleOptionMenuItem *mi = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
partially evaluated: const QStyleOptionMenuItem *mi = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)
TRUEFALSE
yes
Evaluation Count:1915
no
Evaluation Count:0
0-1915
2025 int w = sz.width(); -
2026 sz = QCommonStyle::sizeFromContents(ct, opt, csz, widget); -
2027 -
2028 if (mi->menuItemType == QStyleOptionMenuItem::Separator) {
evaluated: mi->menuItemType == QStyleOptionMenuItem::Separator
TRUEFALSE
yes
Evaluation Count:50
yes
Evaluation Count:1865
50-1865
2029 sz = QSize(10, QWindowsStylePrivate::windowsSepHeight); -
2030 }
executed: }
Execution Count:50
50
2031 else if (mi->icon.isNull()) {
evaluated: mi->icon.isNull()
TRUEFALSE
yes
Evaluation Count:1837
yes
Evaluation Count:28
28-1837
2032 sz.setHeight(sz.height() - 2); -
2033 w -= 6; -
2034 }
executed: }
Execution Count:1837
1837
2035 -
2036 if (mi->menuItemType != QStyleOptionMenuItem::Separator && !mi->icon.isNull()) {
evaluated: mi->menuItemType != QStyleOptionMenuItem::Separator
TRUEFALSE
yes
Evaluation Count:1865
yes
Evaluation Count:50
evaluated: !mi->icon.isNull()
TRUEFALSE
yes
Evaluation Count:28
yes
Evaluation Count:1837
28-1865
2037 int iconExtent = proxy()->pixelMetric(PM_SmallIconSize, opt, widget); -
2038 sz.setHeight(qMax(sz.height(), -
2039 mi->icon.actualSize(QSize(iconExtent, iconExtent)).height() -
2040 + 2 * QWindowsStylePrivate::windowsItemFrame)); -
2041 }
executed: }
Execution Count:28
28
2042 int maxpmw = mi->maxIconWidth; -
2043 int tabSpacing = 20; -
2044 if (mi->text.contains(QLatin1Char('\t')))
evaluated: mi->text.contains(QLatin1Char('\t'))
TRUEFALSE
yes
Evaluation Count:119
yes
Evaluation Count:1796
119-1796
2045 w += tabSpacing;
executed: w += tabSpacing;
Execution Count:119
119
2046 else if (mi->menuItemType == QStyleOptionMenuItem::SubMenu)
evaluated: mi->menuItemType == QStyleOptionMenuItem::SubMenu
TRUEFALSE
yes
Evaluation Count:95
yes
Evaluation Count:1701
95-1701
2047 w += 2 * QWindowsStylePrivate::windowsArrowHMargin;
executed: w += 2 * QWindowsStylePrivate::windowsArrowHMargin;
Execution Count:95
95
2048 else if (mi->menuItemType == QStyleOptionMenuItem::DefaultItem) {
partially evaluated: mi->menuItemType == QStyleOptionMenuItem::DefaultItem
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1701
0-1701
2049 -
2050 -
2051 QFontMetrics fm(mi->font); -
2052 QFont fontBold = mi->font; -
2053 fontBold.setBold(true); -
2054 QFontMetrics fmBold(fontBold); -
2055 w += fmBold.width(mi->text) - fm.width(mi->text); -
2056 }
never executed: }
0
2057 -
2058 int checkcol = qMax<int>(maxpmw, QWindowsStylePrivate::windowsCheckMarkWidth); -
2059 w += checkcol; -
2060 w += int(QWindowsStylePrivate::windowsRightBorder) + 10; -
2061 sz.setWidth(w); -
2062 }
executed: }
Execution Count:1915
1915
2063 break;
executed: break;
Execution Count:1915
1915
2064 -
2065 -
2066 case CT_MenuBarItem: -
2067 if (!sz.isEmpty())
evaluated: !sz.isEmpty()
TRUEFALSE
yes
Evaluation Count:327
yes
Evaluation Count:1
1-327
2068 sz += QSize(QWindowsStylePrivate::windowsItemHMargin * 4, QWindowsStylePrivate::windowsItemVMargin * 2);
executed: sz += QSize(QWindowsStylePrivate::windowsItemHMargin * 4, QWindowsStylePrivate::windowsItemVMargin * 2);
Execution Count:327
327
2069 break;
executed: break;
Execution Count:328
328
2070 -
2071 -
2072 case CT_ToolButton: -
2073 if (qstyleoption_cast<const QStyleOptionToolButton *>(opt))
partially evaluated: qstyleoption_cast<const QStyleOptionToolButton *>(opt)
TRUEFALSE
yes
Evaluation Count:1252
no
Evaluation Count:0
0-1252
2074 return sz += QSize(7, 6);
executed: return sz += QSize(7, 6);
Execution Count:1252
1252
2075 -
2076 -
2077 default:
code before this statement never executed: default:
0
2078 sz = QCommonStyle::sizeFromContents(ct, opt, csz, widget); -
2079 }
executed: }
Execution Count:281929
281929
2080 return sz;
executed: return sz;
Execution Count:285282
285282
2081} -
2082 -
2083 -
2084 -
2085 -
2086QIcon QWindowsStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption *option, -
2087 const QWidget *widget) const -
2088{ -
2089 return QCommonStyle::standardIcon(standardIcon, option, widget);
executed: return QCommonStyle::standardIcon(standardIcon, option, widget);
Execution Count:3935
3935
2090} -
2091 -
2092 -
2093 -
2094 -
2095 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial