qwindowsstyle.cpp

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

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9