qstylesheetstyle.cpp

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

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