styles/qproxystyle.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4 -
5void QProxyStylePrivate::ensureBaseStyle() const -
6{ -
7 const QProxyStyle * const q = q_func(); -
8 -
9 if (baseStyle)
evaluated: baseStyle
TRUEFALSE
yes
Evaluation Count:24398
yes
Evaluation Count:5
5-24398
10 return;
executed: return;
Execution Count:24398
24398
11 -
12 if (!baseStyle && !QApplicationPrivate::styleOverride.isEmpty()) {
partially evaluated: !baseStyle
TRUEFALSE
yes
Evaluation Count:5
no
Evaluation Count:0
partially evaluated: !QApplicationPrivate::styleOverride.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5
0-5
13 baseStyle = QStyleFactory::create(QApplicationPrivate::styleOverride); -
14 if (baseStyle) {
never evaluated: baseStyle
0
15 -
16 -
17 if (qstrcmp(baseStyle->metaObject()->className(), 0
18 q->metaObject()->className()) == 0) {
never evaluated: qstrcmp(baseStyle->metaObject()->className(), q->metaObject()->className()) == 0
0
19 delete baseStyle; -
20 baseStyle = 0; -
21 }
never executed: }
0
22 }
never executed: }
0
23 }
never executed: }
0
24 -
25 if (!baseStyle)
partially evaluated: !baseStyle
TRUEFALSE
yes
Evaluation Count:5
no
Evaluation Count:0
0-5
26 baseStyle = QStyleFactory::create(QApplicationPrivate::desktopStyleKey());
executed: baseStyle = QStyleFactory::create(QApplicationPrivate::desktopStyleKey());
Execution Count:5
5
27 -
28 if (!baseStyle)
partially evaluated: !baseStyle
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5
0-5
29 baseStyle = QStyleFactory::create(QLatin1String("windows"));
never executed: baseStyle = QStyleFactory::create(QLatin1String("windows"));
0
30 -
31 baseStyle->setProxy(const_cast<QProxyStyle*>(q)); -
32 baseStyle->setParent(const_cast<QProxyStyle*>(q)); -
33}
executed: }
Execution Count:5
5
34QProxyStyle::QProxyStyle(QStyle *style) : -
35 QCommonStyle(*new QProxyStylePrivate()) -
36{ -
37 QProxyStylePrivate * const d = d_func(); -
38 if (style) {
evaluated: style
TRUEFALSE
yes
Evaluation Count:61
yes
Evaluation Count:4
4-61
39 d->baseStyle = style; -
40 style->setProxy(this); -
41 style->setParent(this); -
42 }
executed: }
Execution Count:61
61
43}
executed: }
Execution Count:65
65
44 -
45 -
46 -
47 -
48QProxyStyle::~QProxyStyle() -
49{ -
50} -
51QStyle *QProxyStyle::baseStyle() const -
52{ -
53 const QProxyStylePrivate * const d = d_func(); -
54 d->ensureBaseStyle(); -
55 return d->baseStyle;
executed: return d->baseStyle;
Execution Count:3
3
56} -
57void QProxyStyle::setBaseStyle(QStyle *style) -
58{ -
59 QProxyStylePrivate * const d = d_func(); -
60 -
61 if (d->baseStyle && d->baseStyle->parent() == this)
evaluated: d->baseStyle
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:2
partially evaluated: d->baseStyle->parent() == this
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
62 d->baseStyle->deleteLater();
executed: d->baseStyle->deleteLater();
Execution Count:2
2
63 -
64 d->baseStyle = style; -
65 -
66 if (d->baseStyle) {
evaluated: d->baseStyle
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:3
1-3
67 d->baseStyle->setProxy(this); -
68 d->baseStyle->setParent(this); -
69 }
executed: }
Execution Count:1
1
70}
executed: }
Execution Count:4
4
71 -
72 -
73 -
74void QProxyStyle::drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const -
75{ -
76 const QProxyStylePrivate * const d = d_func(); -
77 d->ensureBaseStyle(); -
78 d->baseStyle->drawPrimitive(element, option, painter, widget); -
79}
executed: }
Execution Count:238
238
80 -
81 -
82 -
83 -
84void QProxyStyle::drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const -
85{ -
86 const QProxyStylePrivate * const d = d_func(); -
87 d->ensureBaseStyle(); -
88 d->baseStyle->drawControl(element, option, painter, widget); -
89}
executed: }
Execution Count:818
818
90 -
91 -
92 -
93void QProxyStyle::drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget) const -
94{ -
95 const QProxyStylePrivate * const d = d_func(); -
96 d->ensureBaseStyle(); -
97 d->baseStyle->drawComplexControl(control, option, painter, widget); -
98}
executed: }
Execution Count:29
29
99 -
100 -
101 -
102void QProxyStyle::drawItemText(QPainter *painter, const QRect &rect, int flags, const QPalette &pal, bool enabled, -
103 const QString &text, QPalette::ColorRole textRole) const -
104{ -
105 const QProxyStylePrivate * const d = d_func(); -
106 d->ensureBaseStyle(); -
107 d->baseStyle->drawItemText(painter, rect, flags, pal, enabled, text, textRole); -
108}
executed: }
Execution Count:357
357
109 -
110 -
111 -
112void QProxyStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, const QPixmap &pixmap) const -
113{ -
114 const QProxyStylePrivate * const d = d_func(); -
115 d->ensureBaseStyle(); -
116 d->baseStyle->drawItemPixmap(painter, rect, alignment, pixmap); -
117}
executed: }
Execution Count:2
2
118 -
119 -
120 -
121QSize QProxyStyle::sizeFromContents(ContentsType type, const QStyleOption *option, const QSize &size, const QWidget *widget) const -
122{ -
123 const QProxyStylePrivate * const d = d_func(); -
124 d->ensureBaseStyle(); -
125 return d->baseStyle->sizeFromContents(type, option, size, widget);
executed: return d->baseStyle->sizeFromContents(type, option, size, widget);
Execution Count:231
231
126} -
127 -
128 -
129 -
130QRect QProxyStyle::subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const -
131{ -
132 const QProxyStylePrivate * const d = d_func(); -
133 d->ensureBaseStyle(); -
134 return d->baseStyle->subElementRect(element, option, widget);
executed: return d->baseStyle->subElementRect(element, option, widget);
Execution Count:3256
3256
135} -
136 -
137 -
138 -
139QRect QProxyStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *option, SubControl sc, const QWidget *widget) const -
140{ -
141 const QProxyStylePrivate * const d = d_func(); -
142 d->ensureBaseStyle(); -
143 return d->baseStyle->subControlRect(cc, option, sc, widget);
executed: return d->baseStyle->subControlRect(cc, option, sc, widget);
Execution Count:83
83
144} -
145 -
146 -
147 -
148QRect QProxyStyle::itemTextRect(const QFontMetrics &fm, const QRect &r, int flags, bool enabled, const QString &text) const -
149{ -
150 const QProxyStylePrivate * const d = d_func(); -
151 d->ensureBaseStyle(); -
152 return d->baseStyle->itemTextRect(fm, r, flags, enabled, text);
executed: return d->baseStyle->itemTextRect(fm, r, flags, enabled, text);
Execution Count:13
13
153} -
154 -
155 -
156 -
157QRect QProxyStyle::itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const -
158{ -
159 const QProxyStylePrivate * const d = d_func(); -
160 d->ensureBaseStyle(); -
161 return d->baseStyle->itemPixmapRect(r, flags, pixmap);
executed: return d->baseStyle->itemPixmapRect(r, flags, pixmap);
Execution Count:3
3
162} -
163 -
164 -
165 -
166QStyle::SubControl QProxyStyle::hitTestComplexControl(ComplexControl control, const QStyleOptionComplex *option, const QPoint &pos, const QWidget *widget) const -
167{ -
168 const QProxyStylePrivate * const d = d_func(); -
169 d->ensureBaseStyle(); -
170 return d->baseStyle->hitTestComplexControl(control, option, pos, widget);
never executed: return d->baseStyle->hitTestComplexControl(control, option, pos, widget);
0
171} -
172 -
173 -
174 -
175int QProxyStyle::styleHint(StyleHint hint, const QStyleOption *option, const QWidget *widget, QStyleHintReturn *returnData) const -
176{ -
177 const QProxyStylePrivate * const d = d_func(); -
178 d->ensureBaseStyle(); -
179 return d->baseStyle->styleHint(hint, option, widget, returnData);
executed: return d->baseStyle->styleHint(hint, option, widget, returnData);
Execution Count:7337
7337
180} -
181 -
182 -
183 -
184int QProxyStyle::pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const -
185{ -
186 const QProxyStylePrivate * const d = d_func(); -
187 d->ensureBaseStyle(); -
188 return d->baseStyle->pixelMetric(metric, option, widget);
executed: return d->baseStyle->pixelMetric(metric, option, widget);
Execution Count:5300
5300
189} -
190 -
191 -
192 -
193QPixmap QProxyStyle::standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, const QWidget *widget) const -
194{ -
195 const QProxyStylePrivate * const d = d_func(); -
196 d->ensureBaseStyle(); -
197 return d->baseStyle->standardPixmap(standardPixmap, opt, widget);
executed: return d->baseStyle->standardPixmap(standardPixmap, opt, widget);
Execution Count:131
131
198} -
199 -
200 -
201 -
202QPixmap QProxyStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const -
203{ -
204 const QProxyStylePrivate * const d = d_func(); -
205 d->ensureBaseStyle(); -
206 return d->baseStyle->generatedIconPixmap(iconMode, pixmap, opt);
never executed: return d->baseStyle->generatedIconPixmap(iconMode, pixmap, opt);
0
207} -
208 -
209 -
210 -
211QPalette QProxyStyle::standardPalette() const -
212{ -
213 const QProxyStylePrivate * const d = d_func(); -
214 d->ensureBaseStyle(); -
215 return d->baseStyle->standardPalette();
never executed: return d->baseStyle->standardPalette();
0
216} -
217 -
218 -
219 -
220void QProxyStyle::polish(QWidget *widget) -
221{ -
222 QProxyStylePrivate * const d = d_func(); -
223 d->ensureBaseStyle(); -
224 d->baseStyle->polish(widget); -
225}
executed: }
Execution Count:3300
3300
226 -
227 -
228 -
229void QProxyStyle::polish(QPalette &pal) -
230{ -
231 QProxyStylePrivate * const d = d_func(); -
232 d->ensureBaseStyle(); -
233 d->baseStyle->polish(pal); -
234}
executed: }
Execution Count:53
53
235 -
236 -
237 -
238void QProxyStyle::polish(QApplication *app) -
239{ -
240 QProxyStylePrivate * const d = d_func(); -
241 d->ensureBaseStyle(); -
242 d->baseStyle->polish(app); -
243}
executed: }
Execution Count:53
53
244 -
245 -
246 -
247void QProxyStyle::unpolish(QWidget *widget) -
248{ -
249 QProxyStylePrivate * const d = d_func(); -
250 d->ensureBaseStyle(); -
251 d->baseStyle->unpolish(widget); -
252}
executed: }
Execution Count:2922
2922
253 -
254 -
255 -
256void QProxyStyle::unpolish(QApplication *app) -
257{ -
258 QProxyStylePrivate * const d = d_func(); -
259 d->ensureBaseStyle(); -
260 d->baseStyle->unpolish(app); -
261}
executed: }
Execution Count:51
51
262 -
263 -
264 -
265bool QProxyStyle::event(QEvent *e) -
266{ -
267 QProxyStylePrivate * const d = d_func(); -
268 d->ensureBaseStyle(); -
269 return d->baseStyle->event(e);
executed: return d->baseStyle->event(e);
Execution Count:138
138
270} -
271QIcon QProxyStyle::standardIcon(StandardPixmap standardIcon, -
272 const QStyleOption *option, -
273 const QWidget *widget) const -
274{ -
275 const QProxyStylePrivate * const d = d_func(); -
276 d->ensureBaseStyle(); -
277 return d->baseStyle->standardIcon(standardIcon, option, widget);
executed: return d->baseStyle->standardIcon(standardIcon, option, widget);
Execution Count:85
85
278} -
279int QProxyStyle::layoutSpacing(QSizePolicy::ControlType control1, -
280 QSizePolicy::ControlType control2, -
281 Qt::Orientation orientation, -
282 const QStyleOption *option, -
283 const QWidget *widget) const -
284{ -
285 const QProxyStylePrivate * const d = d_func(); -
286 d->ensureBaseStyle(); -
287 return d->baseStyle->layoutSpacing(control1, control2, orientation, option, widget);
never executed: return d->baseStyle->layoutSpacing(control1, control2, orientation, option, widget);
0
288} -
289 -
290 -
291 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial