qproxystyle.cpp

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

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