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