Line | Source Code | Coverage |
---|
1 | /**************************************************************************** | - |
2 | ** | - |
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). | - |
4 | ** Contact: http://www.qt-project.org/legal | - |
5 | ** | - |
6 | ** This file is part of the QtGui module of the Qt Toolkit. | - |
7 | ** | - |
8 | ** $QT_BEGIN_LICENSE:LGPL$ | - |
9 | ** Commercial License Usage | - |
10 | ** Licensees holding valid commercial Qt licenses may use this file in | - |
11 | ** accordance with the commercial license agreement provided with the | - |
12 | ** Software or, alternatively, in accordance with the terms contained in | - |
13 | ** a written agreement between you and Digia. For licensing terms and | - |
14 | ** conditions see http://qt.digia.com/licensing. For further information | - |
15 | ** use the contact form at http://qt.digia.com/contact-us. | - |
16 | ** | - |
17 | ** GNU Lesser General Public License Usage | - |
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | - |
19 | ** General Public License version 2.1 as published by the Free Software | - |
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the | - |
21 | ** packaging of this file. Please review the following information to | - |
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements | - |
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | - |
24 | ** | - |
25 | ** In addition, as a special exception, Digia gives you certain additional | - |
26 | ** rights. These rights are described in the Digia Qt LGPL Exception | - |
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | - |
28 | ** | - |
29 | ** GNU General Public License Usage | - |
30 | ** Alternatively, this file may be used under the terms of the GNU | - |
31 | ** General Public License version 3.0 as published by the Free Software | - |
32 | ** Foundation and appearing in the file LICENSE.GPL included in the | - |
33 | ** packaging of this file. Please review the following information to | - |
34 | ** ensure the GNU General Public License version 3.0 requirements will be | - |
35 | ** met: http://www.gnu.org/copyleft/gpl.html. | - |
36 | ** | - |
37 | ** | - |
38 | ** $QT_END_LICENSE$ | - |
39 | ** | - |
40 | ****************************************************************************/ | - |
41 | | - |
42 | #include "qfusionstyle_p.h" | - |
43 | #include "qfusionstyle_p_p.h" | - |
44 | | - |
45 | #if !defined(QT_NO_STYLE_FUSION) || defined(QT_PLUGIN) | - |
46 | #include "qcommonstyle_p.h" | - |
47 | #include <qcombobox.h> | - |
48 | #include <qpushbutton.h> | - |
49 | #include <qpainter.h> | - |
50 | #include <qdir.h> | - |
51 | #include <qhash.h> | - |
52 | #include <qstyleoption.h> | - |
53 | #include <qapplication.h> | - |
54 | #include <qmainwindow.h> | - |
55 | #include <qfont.h> | - |
56 | #include <qgroupbox.h> | - |
57 | #include <qprocess.h> | - |
58 | #include <qpixmapcache.h> | - |
59 | #include <qdialogbuttonbox.h> | - |
60 | #include <qscrollbar.h> | - |
61 | #include <qspinbox.h> | - |
62 | #include <qslider.h> | - |
63 | #include <qsplitter.h> | - |
64 | #include <qprogressbar.h> | - |
65 | #include <qwizard.h> | - |
66 | #include <qlibrary.h> | - |
67 | #include <qdrawutil.h> | - |
68 | #include <private/qstylehelper_p.h> | - |
69 | #include <private/qdrawhelper_p.h> | - |
70 | #include <private/qapplication_p.h> | - |
71 | | - |
72 | QT_BEGIN_NAMESPACE | - |
73 | | - |
74 | using namespace QStyleHelper; | - |
75 | | - |
76 | enum Direction { | - |
77 | TopDown, | - |
78 | FromLeft, | - |
79 | BottomUp, | - |
80 | FromRight | - |
81 | }; | - |
82 | | - |
83 | // from windows style | - |
84 | static const int windowsItemFrame = 2; // menu item frame width | - |
85 | static const int windowsItemHMargin = 3; // menu item hor text margin | - |
86 | static const int windowsItemVMargin = 8; // menu item ver text margin | - |
87 | static const int windowsRightBorder = 15; // right border on windows | - |
88 | | - |
89 | static const int groupBoxBottomMargin = 0; // space below the groupbox | - |
90 | static const int groupBoxTopMargin = 3; | - |
91 | | - |
92 | | - |
93 | /* XPM */ | - |
94 | static const char * const dock_widget_close_xpm[] = { | - |
95 | "11 13 7 1", | - |
96 | " c None", | - |
97 | ". c #D5CFCB", | - |
98 | "+ c #8F8B88", | - |
99 | "@ c #6C6A67", | - |
100 | "# c #ABA6A3", | - |
101 | "$ c #B5B0AC", | - |
102 | "% c #A4A09D", | - |
103 | " ", | - |
104 | " +@@@@@@@+ ", | - |
105 | "+# #+", | - |
106 | "@ $@ @$ @", | - |
107 | "@ @@@ @@@ @", | - |
108 | "@ @@@@@ @", | - |
109 | "@ @@@ @", | - |
110 | "@ @@@@@ @", | - |
111 | "@ @@@ @@@ @", | - |
112 | "@ $@ @$ @", | - |
113 | "+% #+", | - |
114 | " +@@@@@@@+ ", | - |
115 | " "}; | - |
116 | | - |
117 | static const char * const dock_widget_restore_xpm[] = { | - |
118 | "11 13 7 1", | - |
119 | " c None", | - |
120 | ". c #D5CFCB", | - |
121 | "+ c #8F8B88", | - |
122 | "@ c #6C6A67", | - |
123 | "# c #ABA6A3", | - |
124 | "$ c #B5B0AC", | - |
125 | "% c #A4A09D", | - |
126 | " ", | - |
127 | " +@@@@@@@+ ", | - |
128 | "+# #+", | - |
129 | "@ #@@@# @", | - |
130 | "@ @ @ @", | - |
131 | "@ #@@@# @ @", | - |
132 | "@ @ @ @ @", | - |
133 | "@ @ @@@ @", | - |
134 | "@ @ @ @", | - |
135 | "@ #@@@# @", | - |
136 | "+% #+", | - |
137 | " +@@@@@@@+ ", | - |
138 | " "}; | - |
139 | | - |
140 | static const char * const workspace_minimize[] = { | - |
141 | "11 13 7 1", | - |
142 | " c None", | - |
143 | ". c #D5CFCB", | - |
144 | "+ c #8F8B88", | - |
145 | "@ c #6C6A67", | - |
146 | "# c #ABA6A3", | - |
147 | "$ c #B5B0AC", | - |
148 | "% c #A4A09D", | - |
149 | " ", | - |
150 | " +@@@@@@@+ ", | - |
151 | "+# #+", | - |
152 | "@ @", | - |
153 | "@ @", | - |
154 | "@ @", | - |
155 | "@ @@@@@@@ @", | - |
156 | "@ @@@@@@@ @", | - |
157 | "@ @", | - |
158 | "@ @", | - |
159 | "+% #+", | - |
160 | " +@@@@@@@+ ", | - |
161 | " "}; | - |
162 | | - |
163 | | - |
164 | static const char * const qt_titlebar_context_help[] = { | - |
165 | "10 10 3 1", | - |
166 | " c None", | - |
167 | "# c #000000", | - |
168 | "+ c #444444", | - |
169 | " +####+ ", | - |
170 | " ### ### ", | - |
171 | " ## ## ", | - |
172 | " +##+ ", | - |
173 | " +## ", | - |
174 | " ## ", | - |
175 | " ## ", | - |
176 | " ", | - |
177 | " ## ", | - |
178 | " ## "}; | - |
179 | | - |
180 | | - |
181 | static QColor mergedColors(const QColor &colorA, const QColor &colorB, int factor = 50) | - |
182 | { | - |
183 | const int maxFactor = 100; executed (the execution status of this line is deduced): const int maxFactor = 100; | - |
184 | QColor tmp = colorA; executed (the execution status of this line is deduced): QColor tmp = colorA; | - |
185 | tmp.setRed((tmp.red() * factor) / maxFactor + (colorB.red() * (maxFactor - factor)) / maxFactor); executed (the execution status of this line is deduced): tmp.setRed((tmp.red() * factor) / maxFactor + (colorB.red() * (maxFactor - factor)) / maxFactor); | - |
186 | tmp.setGreen((tmp.green() * factor) / maxFactor + (colorB.green() * (maxFactor - factor)) / maxFactor); executed (the execution status of this line is deduced): tmp.setGreen((tmp.green() * factor) / maxFactor + (colorB.green() * (maxFactor - factor)) / maxFactor); | - |
187 | tmp.setBlue((tmp.blue() * factor) / maxFactor + (colorB.blue() * (maxFactor - factor)) / maxFactor); executed (the execution status of this line is deduced): tmp.setBlue((tmp.blue() * factor) / maxFactor + (colorB.blue() * (maxFactor - factor)) / maxFactor); | - |
188 | return tmp; executed: return tmp; Execution Count:309 | 309 |
189 | } | - |
190 | | - |
191 | static QPixmap colorizedImage(const QString &fileName, const QColor &color, int rotation = 0) { | - |
192 | | - |
193 | QString pixmapName = QLatin1String("$qt_ia-") % fileName % HexString<uint>(color.rgba()) % QString::number(rotation); executed (the execution status of this line is deduced): QString pixmapName = QLatin1String("$qt_ia-") % fileName % HexString<uint>(color.rgba()) % QString::number(rotation); | - |
194 | QPixmap pixmap; executed (the execution status of this line is deduced): QPixmap pixmap; | - |
195 | if (!QPixmapCache::find(pixmapName, pixmap)) { evaluated: !QPixmapCache::find(pixmapName, pixmap) yes Evaluation Count:10 | yes Evaluation Count:290 |
| 10-290 |
196 | QImage image(fileName); executed (the execution status of this line is deduced): QImage image(fileName); | - |
197 | | - |
198 | if (image.format() != QImage::Format_ARGB32_Premultiplied) partially evaluated: image.format() != QImage::Format_ARGB32_Premultiplied yes Evaluation Count:10 | no Evaluation Count:0 |
| 0-10 |
199 | image = image.convertToFormat( QImage::Format_ARGB32_Premultiplied); executed: image = image.convertToFormat( QImage::Format_ARGB32_Premultiplied); Execution Count:10 | 10 |
200 | | - |
201 | int width = image.width(); executed (the execution status of this line is deduced): int width = image.width(); | - |
202 | int height = image.height(); executed (the execution status of this line is deduced): int height = image.height(); | - |
203 | int source = color.rgba(); executed (the execution status of this line is deduced): int source = color.rgba(); | - |
204 | | - |
205 | unsigned char sourceRed = qRed(source); executed (the execution status of this line is deduced): unsigned char sourceRed = qRed(source); | - |
206 | unsigned char sourceGreen = qGreen(source); executed (the execution status of this line is deduced): unsigned char sourceGreen = qGreen(source); | - |
207 | unsigned char sourceBlue = qBlue(source); executed (the execution status of this line is deduced): unsigned char sourceBlue = qBlue(source); | - |
208 | | - |
209 | for (int y = 0; y < height; ++y) evaluated: y < height yes Evaluation Count:90 | yes Evaluation Count:10 |
| 10-90 |
210 | { | - |
211 | QRgb *data = (QRgb*) image.scanLine(y); executed (the execution status of this line is deduced): QRgb *data = (QRgb*) image.scanLine(y); | - |
212 | for (int x = 0 ; x < width ; x++) { evaluated: x < width yes Evaluation Count:1350 | yes Evaluation Count:90 |
| 90-1350 |
213 | QRgb col = data[x]; executed (the execution status of this line is deduced): QRgb col = data[x]; | - |
214 | unsigned int colorDiff = (qBlue(col) - qRed(col)); executed (the execution status of this line is deduced): unsigned int colorDiff = (qBlue(col) - qRed(col)); | - |
215 | unsigned char gray = qGreen(col); executed (the execution status of this line is deduced): unsigned char gray = qGreen(col); | - |
216 | unsigned char red = gray + qt_div_255(sourceRed * colorDiff); executed (the execution status of this line is deduced): unsigned char red = gray + qt_div_255(sourceRed * colorDiff); | - |
217 | unsigned char green = gray + qt_div_255(sourceGreen * colorDiff); executed (the execution status of this line is deduced): unsigned char green = gray + qt_div_255(sourceGreen * colorDiff); | - |
218 | unsigned char blue = gray + qt_div_255(sourceBlue * colorDiff); executed (the execution status of this line is deduced): unsigned char blue = gray + qt_div_255(sourceBlue * colorDiff); | - |
219 | unsigned char alpha = qt_div_255(qAlpha(col) * qAlpha(source)); executed (the execution status of this line is deduced): unsigned char alpha = qt_div_255(qAlpha(col) * qAlpha(source)); | - |
220 | data[x] = qRgba(red, green, blue, alpha); executed (the execution status of this line is deduced): data[x] = qRgba(red, green, blue, alpha); | - |
221 | } executed: } Execution Count:1350 | 1350 |
222 | } executed: } Execution Count:90 | 90 |
223 | if (rotation != 0) { evaluated: rotation != 0 yes Evaluation Count:6 | yes Evaluation Count:4 |
| 4-6 |
224 | QTransform transform; executed (the execution status of this line is deduced): QTransform transform; | - |
225 | transform.translate(-image.width()/2, -image.height()/2); executed (the execution status of this line is deduced): transform.translate(-image.width()/2, -image.height()/2); | - |
226 | transform.rotate(rotation); executed (the execution status of this line is deduced): transform.rotate(rotation); | - |
227 | transform.translate(image.width()/2, image.height()/2); executed (the execution status of this line is deduced): transform.translate(image.width()/2, image.height()/2); | - |
228 | image = image.transformed(transform); executed (the execution status of this line is deduced): image = image.transformed(transform); | - |
229 | } executed: } Execution Count:6 | 6 |
230 | | - |
231 | pixmap = QPixmap::fromImage(image); executed (the execution status of this line is deduced): pixmap = QPixmap::fromImage(image); | - |
232 | QPixmapCache::insert(pixmapName, pixmap); executed (the execution status of this line is deduced): QPixmapCache::insert(pixmapName, pixmap); | - |
233 | } executed: } Execution Count:10 | 10 |
234 | return pixmap; executed: return pixmap; Execution Count:300 | 300 |
235 | } | - |
236 | | - |
237 | // The default button and handle gradient | - |
238 | static QLinearGradient qt_fusion_gradient(const QRect &rect, const QBrush &baseColor, Direction direction = TopDown) | - |
239 | { | - |
240 | int x = rect.center().x(); executed (the execution status of this line is deduced): int x = rect.center().x(); | - |
241 | int y = rect.center().y(); executed (the execution status of this line is deduced): int y = rect.center().y(); | - |
242 | QLinearGradient gradient; executed (the execution status of this line is deduced): QLinearGradient gradient; | - |
243 | switch (direction) { | - |
244 | case FromLeft: | - |
245 | gradient = QLinearGradient(rect.left(), y, rect.right(), y); never executed (the execution status of this line is deduced): gradient = QLinearGradient(rect.left(), y, rect.right(), y); | - |
246 | break; | 0 |
247 | case FromRight: | - |
248 | gradient = QLinearGradient(rect.right(), y, rect.left(), y); never executed (the execution status of this line is deduced): gradient = QLinearGradient(rect.right(), y, rect.left(), y); | - |
249 | break; | 0 |
250 | case BottomUp: | - |
251 | gradient = QLinearGradient(x, rect.bottom(), x, rect.top()); never executed (the execution status of this line is deduced): gradient = QLinearGradient(x, rect.bottom(), x, rect.top()); | - |
252 | break; | 0 |
253 | case TopDown: | - |
254 | default: | - |
255 | gradient = QLinearGradient(x, rect.top(), x, rect.bottom()); executed (the execution status of this line is deduced): gradient = QLinearGradient(x, rect.top(), x, rect.bottom()); | - |
256 | break; executed: break; Execution Count:16 | 16 |
257 | } | - |
258 | if (baseColor.gradient()) partially evaluated: baseColor.gradient() no Evaluation Count:0 | yes Evaluation Count:16 |
| 0-16 |
259 | gradient.setStops(baseColor.gradient()->stops()); never executed: gradient.setStops(baseColor.gradient()->stops()); | 0 |
260 | else { | - |
261 | QColor gradientStartColor = baseColor.color().lighter(124); executed (the execution status of this line is deduced): QColor gradientStartColor = baseColor.color().lighter(124); | - |
262 | QColor gradientStopColor = baseColor.color().lighter(102); executed (the execution status of this line is deduced): QColor gradientStopColor = baseColor.color().lighter(102); | - |
263 | gradient.setColorAt(0, gradientStartColor); executed (the execution status of this line is deduced): gradient.setColorAt(0, gradientStartColor); | - |
264 | gradient.setColorAt(1, gradientStopColor); executed (the execution status of this line is deduced): gradient.setColorAt(1, gradientStopColor); | - |
265 | // Uncomment for adding shiny shading | - |
266 | // QColor midColor1 = mergedColors(gradientStartColor, gradientStopColor, 55); | - |
267 | // QColor midColor2 = mergedColors(gradientStartColor, gradientStopColor, 45); | - |
268 | // gradient.setColorAt(0.5, midColor1); | - |
269 | // gradient.setColorAt(0.501, midColor2); | - |
270 | } executed: } Execution Count:16 | 16 |
271 | return gradient; executed: return gradient; Execution Count:16 | 16 |
272 | } | - |
273 | | - |
274 | | - |
275 | static void qt_fusion_draw_mdibutton(QPainter *painter, const QStyleOptionTitleBar *option, const QRect &tmp, bool hover, bool sunken) | - |
276 | { | - |
277 | QColor dark; never executed (the execution status of this line is deduced): QColor dark; | - |
278 | dark.setHsv(option->palette.button().color().hue(), never executed (the execution status of this line is deduced): dark.setHsv(option->palette.button().color().hue(), | - |
279 | qMin(255, (int)(option->palette.button().color().saturation())), never executed (the execution status of this line is deduced): qMin(255, (int)(option->palette.button().color().saturation())), | - |
280 | qMin(255, (int)(option->palette.button().color().value()*0.7))); never executed (the execution status of this line is deduced): qMin(255, (int)(option->palette.button().color().value()*0.7))); | - |
281 | | - |
282 | QColor highlight = option->palette.highlight().color(); never executed (the execution status of this line is deduced): QColor highlight = option->palette.highlight().color(); | - |
283 | | - |
284 | bool active = (option->titleBarState & QStyle::State_Active); never executed (the execution status of this line is deduced): bool active = (option->titleBarState & QStyle::State_Active); | - |
285 | QColor titleBarHighlight(255, 255, 255, 60); never executed (the execution status of this line is deduced): QColor titleBarHighlight(255, 255, 255, 60); | - |
286 | | - |
287 | if (sunken) | 0 |
288 | painter->fillRect(tmp.adjusted(1, 1, -1, -1), option->palette.highlight().color().darker(120)); never executed: painter->fillRect(tmp.adjusted(1, 1, -1, -1), option->palette.highlight().color().darker(120)); | 0 |
289 | else if (hover) | 0 |
290 | painter->fillRect(tmp.adjusted(1, 1, -1, -1), QColor(255, 255, 255, 20)); never executed: painter->fillRect(tmp.adjusted(1, 1, -1, -1), QColor(255, 255, 255, 20)); | 0 |
291 | | - |
292 | QColor mdiButtonGradientStartColor; never executed (the execution status of this line is deduced): QColor mdiButtonGradientStartColor; | - |
293 | QColor mdiButtonGradientStopColor; never executed (the execution status of this line is deduced): QColor mdiButtonGradientStopColor; | - |
294 | | - |
295 | mdiButtonGradientStartColor = QColor(0, 0, 0, 40); never executed (the execution status of this line is deduced): mdiButtonGradientStartColor = QColor(0, 0, 0, 40); | - |
296 | mdiButtonGradientStopColor = QColor(255, 255, 255, 60); never executed (the execution status of this line is deduced): mdiButtonGradientStopColor = QColor(255, 255, 255, 60); | - |
297 | | - |
298 | if (sunken) | 0 |
299 | titleBarHighlight = highlight.darker(130); never executed: titleBarHighlight = highlight.darker(130); | 0 |
300 | | - |
301 | QLinearGradient gradient(tmp.center().x(), tmp.top(), tmp.center().x(), tmp.bottom()); never executed (the execution status of this line is deduced): QLinearGradient gradient(tmp.center().x(), tmp.top(), tmp.center().x(), tmp.bottom()); | - |
302 | gradient.setColorAt(0, mdiButtonGradientStartColor); never executed (the execution status of this line is deduced): gradient.setColorAt(0, mdiButtonGradientStartColor); | - |
303 | gradient.setColorAt(1, mdiButtonGradientStopColor); never executed (the execution status of this line is deduced): gradient.setColorAt(1, mdiButtonGradientStopColor); | - |
304 | QColor mdiButtonBorderColor(active ? option->palette.highlight().color().darker(180): dark.darker(110)); never executed (the execution status of this line is deduced): QColor mdiButtonBorderColor(active ? option->palette.highlight().color().darker(180): dark.darker(110)); | - |
305 | | - |
306 | painter->setPen(QPen(mdiButtonBorderColor)); never executed (the execution status of this line is deduced): painter->setPen(QPen(mdiButtonBorderColor)); | - |
307 | const QLine lines[4] = { never executed (the execution status of this line is deduced): const QLine lines[4] = { | - |
308 | QLine(tmp.left() + 2, tmp.top(), tmp.right() - 2, tmp.top()), never executed (the execution status of this line is deduced): QLine(tmp.left() + 2, tmp.top(), tmp.right() - 2, tmp.top()), | - |
309 | QLine(tmp.left() + 2, tmp.bottom(), tmp.right() - 2, tmp.bottom()), never executed (the execution status of this line is deduced): QLine(tmp.left() + 2, tmp.bottom(), tmp.right() - 2, tmp.bottom()), | - |
310 | QLine(tmp.left(), tmp.top() + 2, tmp.left(), tmp.bottom() - 2), never executed (the execution status of this line is deduced): QLine(tmp.left(), tmp.top() + 2, tmp.left(), tmp.bottom() - 2), | - |
311 | QLine(tmp.right(), tmp.top() + 2, tmp.right(), tmp.bottom() - 2) never executed (the execution status of this line is deduced): QLine(tmp.right(), tmp.top() + 2, tmp.right(), tmp.bottom() - 2) | - |
312 | }; never executed (the execution status of this line is deduced): }; | - |
313 | painter->drawLines(lines, 4); never executed (the execution status of this line is deduced): painter->drawLines(lines, 4); | - |
314 | const QPoint points[4] = { never executed (the execution status of this line is deduced): const QPoint points[4] = { | - |
315 | QPoint(tmp.left() + 1, tmp.top() + 1), never executed (the execution status of this line is deduced): QPoint(tmp.left() + 1, tmp.top() + 1), | - |
316 | QPoint(tmp.right() - 1, tmp.top() + 1), never executed (the execution status of this line is deduced): QPoint(tmp.right() - 1, tmp.top() + 1), | - |
317 | QPoint(tmp.left() + 1, tmp.bottom() - 1), never executed (the execution status of this line is deduced): QPoint(tmp.left() + 1, tmp.bottom() - 1), | - |
318 | QPoint(tmp.right() - 1, tmp.bottom() - 1) never executed (the execution status of this line is deduced): QPoint(tmp.right() - 1, tmp.bottom() - 1) | - |
319 | }; never executed (the execution status of this line is deduced): }; | - |
320 | painter->drawPoints(points, 4); never executed (the execution status of this line is deduced): painter->drawPoints(points, 4); | - |
321 | | - |
322 | painter->setPen(titleBarHighlight); never executed (the execution status of this line is deduced): painter->setPen(titleBarHighlight); | - |
323 | painter->drawLine(tmp.left() + 2, tmp.top() + 1, tmp.right() - 2, tmp.top() + 1); never executed (the execution status of this line is deduced): painter->drawLine(tmp.left() + 2, tmp.top() + 1, tmp.right() - 2, tmp.top() + 1); | - |
324 | painter->drawLine(tmp.left() + 1, tmp.top() + 2, tmp.left() + 1, tmp.bottom() - 2); never executed (the execution status of this line is deduced): painter->drawLine(tmp.left() + 1, tmp.top() + 2, tmp.left() + 1, tmp.bottom() - 2); | - |
325 | | - |
326 | painter->setPen(QPen(gradient, 1)); never executed (the execution status of this line is deduced): painter->setPen(QPen(gradient, 1)); | - |
327 | painter->drawLine(tmp.right() + 1, tmp.top() + 2, tmp.right() + 1, tmp.bottom() - 2); never executed (the execution status of this line is deduced): painter->drawLine(tmp.right() + 1, tmp.top() + 2, tmp.right() + 1, tmp.bottom() - 2); | - |
328 | painter->drawPoint(tmp.right() , tmp.top() + 1); never executed (the execution status of this line is deduced): painter->drawPoint(tmp.right() , tmp.top() + 1); | - |
329 | | - |
330 | painter->drawLine(tmp.left() + 2, tmp.bottom() + 1, tmp.right() - 2, tmp.bottom() + 1); never executed (the execution status of this line is deduced): painter->drawLine(tmp.left() + 2, tmp.bottom() + 1, tmp.right() - 2, tmp.bottom() + 1); | - |
331 | painter->drawPoint(tmp.left() + 1, tmp.bottom()); never executed (the execution status of this line is deduced): painter->drawPoint(tmp.left() + 1, tmp.bottom()); | - |
332 | painter->drawPoint(tmp.right() - 1, tmp.bottom()); never executed (the execution status of this line is deduced): painter->drawPoint(tmp.right() - 1, tmp.bottom()); | - |
333 | painter->drawPoint(tmp.right() , tmp.bottom() - 1); never executed (the execution status of this line is deduced): painter->drawPoint(tmp.right() , tmp.bottom() - 1); | - |
334 | } | 0 |
335 | | - |
336 | /* | - |
337 | \internal | - |
338 | */ | - |
339 | QFusionStylePrivate::QFusionStylePrivate() | - |
340 | { | - |
341 | animationFps = 60; executed (the execution status of this line is deduced): animationFps = 60; | - |
342 | } executed: } Execution Count:198 | 198 |
343 | | - |
344 | /*! | - |
345 | \class QFusionStyle | - |
346 | \brief The QFusionStyle class provides a custom widget style | - |
347 | | - |
348 | \inmodule QtWidgets | - |
349 | \internal | - |
350 | | - |
351 | The Fusion style provides a custom look and feel that is not | - |
352 | tied to a particular platform. | - |
353 | //{Fusion Style Widget Gallery} | - |
354 | \sa QWindowsStyle, QWindowsVistaStyle, QMacStyle, QCommonStyle | - |
355 | */ | - |
356 | | - |
357 | /*! | - |
358 | Constructs a QFusionStyle object. | - |
359 | */ | - |
360 | QFusionStyle::QFusionStyle() : QCommonStyle(*new QFusionStylePrivate) | - |
361 | { | - |
362 | setObjectName(QLatin1String("Fusion")); executed (the execution status of this line is deduced): setObjectName(QLatin1String("Fusion")); | - |
363 | } executed: } Execution Count:198 | 198 |
364 | | - |
365 | /*! | - |
366 | \internal | - |
367 | | - |
368 | Constructs a QFusionStyle object. | - |
369 | */ | - |
370 | QFusionStyle::QFusionStyle(QFusionStylePrivate &dd) : QCommonStyle(dd) | - |
371 | { | - |
372 | } | 0 |
373 | | - |
374 | /*! | - |
375 | Destroys the QFusionStyle object. | - |
376 | */ | - |
377 | QFusionStyle::~QFusionStyle() | - |
378 | { | - |
379 | } | - |
380 | | - |
381 | /*! | - |
382 | \fn void QFusionStyle::drawItemText(QPainter *painter, const QRect &rectangle, int alignment, const QPalette &palette, | - |
383 | bool enabled, const QString& text, QPalette::ColorRole textRole) const | - |
384 | | - |
385 | Draws the given \a text in the specified \a rectangle using the | - |
386 | provided \a painter and \a palette. | - |
387 | | - |
388 | Text is drawn using the painter's pen. If an explicit \a textRole | - |
389 | is specified, then the text is drawn using the \a palette's color | - |
390 | for the specified role. The \a enabled value indicates whether or | - |
391 | not the item is enabled; when reimplementing, this value should | - |
392 | influence how the item is drawn. | - |
393 | | - |
394 | The text is aligned and wrapped according to the specified \a | - |
395 | alignment. | - |
396 | | - |
397 | \sa Qt::Alignment | - |
398 | */ | - |
399 | void QFusionStyle::drawItemText(QPainter *painter, const QRect &rect, int alignment, const QPalette &pal, | - |
400 | bool enabled, const QString& text, QPalette::ColorRole textRole) const | - |
401 | { | - |
402 | if (text.isEmpty()) partially evaluated: text.isEmpty() no Evaluation Count:0 | yes Evaluation Count:34 |
| 0-34 |
403 | return; | 0 |
404 | | - |
405 | QPen savedPen = painter->pen(); executed (the execution status of this line is deduced): QPen savedPen = painter->pen(); | - |
406 | if (textRole != QPalette::NoRole) { partially evaluated: textRole != QPalette::NoRole yes Evaluation Count:34 | no Evaluation Count:0 |
| 0-34 |
407 | painter->setPen(QPen(pal.brush(textRole), savedPen.widthF())); executed (the execution status of this line is deduced): painter->setPen(QPen(pal.brush(textRole), savedPen.widthF())); | - |
408 | } executed: } Execution Count:34 | 34 |
409 | if (!enabled) { partially evaluated: !enabled no Evaluation Count:0 | yes Evaluation Count:34 |
| 0-34 |
410 | QPen pen = painter->pen(); never executed (the execution status of this line is deduced): QPen pen = painter->pen(); | - |
411 | painter->setPen(pen); never executed (the execution status of this line is deduced): painter->setPen(pen); | - |
412 | } | 0 |
413 | painter->drawText(rect, alignment, text); executed (the execution status of this line is deduced): painter->drawText(rect, alignment, text); | - |
414 | painter->setPen(savedPen); executed (the execution status of this line is deduced): painter->setPen(savedPen); | - |
415 | } executed: } Execution Count:34 | 34 |
416 | | - |
417 | | - |
418 | /*! | - |
419 | \reimp | - |
420 | */ | - |
421 | void QFusionStyle::drawPrimitive(PrimitiveElement elem, | - |
422 | const QStyleOption *option, | - |
423 | QPainter *painter, const QWidget *widget) const | - |
424 | { | - |
425 | Q_ASSERT(option); executed (the execution status of this line is deduced): qt_noop(); | - |
426 | Q_D (const QFusionStyle); executed (the execution status of this line is deduced): const QFusionStylePrivate * const d = d_func(); | - |
427 | | - |
428 | QRect rect = option->rect; executed (the execution status of this line is deduced): QRect rect = option->rect; | - |
429 | int state = option->state; executed (the execution status of this line is deduced): int state = option->state; | - |
430 | | - |
431 | QColor outline = d->outline(option->palette); executed (the execution status of this line is deduced): QColor outline = d->outline(option->palette); | - |
432 | QColor highlightedOutline = d->highlightedOutline(option->palette); executed (the execution status of this line is deduced): QColor highlightedOutline = d->highlightedOutline(option->palette); | - |
433 | | - |
434 | QColor tabFrameColor = d->tabFrameColor(option->palette); executed (the execution status of this line is deduced): QColor tabFrameColor = d->tabFrameColor(option->palette); | - |
435 | | - |
436 | switch (elem) { | - |
437 | | - |
438 | // No frame drawn | - |
439 | case PE_FrameGroupBox: | - |
440 | { | - |
441 | QPixmap pixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_groupbox.png")); executed (the execution status of this line is deduced): QPixmap pixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_groupbox.png")); | - |
442 | int topMargin = qMax(pixelMetric(PM_ExclusiveIndicatorHeight), option->fontMetrics.height()) + groupBoxTopMargin; executed (the execution status of this line is deduced): int topMargin = qMax(pixelMetric(PM_ExclusiveIndicatorHeight), option->fontMetrics.height()) + groupBoxTopMargin; | - |
443 | QRect frame = option->rect.adjusted(0, topMargin, 0, 0); executed (the execution status of this line is deduced): QRect frame = option->rect.adjusted(0, topMargin, 0, 0); | - |
444 | qDrawBorderPixmap(painter, frame, QMargins(6, 6, 6, 6), pixmap); executed (the execution status of this line is deduced): qDrawBorderPixmap(painter, frame, QMargins(6, 6, 6, 6), pixmap); | - |
445 | break; executed: break; Execution Count:1 | 1 |
446 | } | - |
447 | case PE_IndicatorBranch: { | - |
448 | if (!(option->state & State_Children)) never evaluated: !(option->state & State_Children) | 0 |
449 | break; | 0 |
450 | if (option->state & State_Open) never evaluated: option->state & State_Open | 0 |
451 | drawPrimitive(PE_IndicatorArrowDown, option, painter, widget); never executed: drawPrimitive(PE_IndicatorArrowDown, option, painter, widget); | 0 |
452 | else | - |
453 | drawPrimitive(PE_IndicatorArrowRight, option, painter, widget); never executed: drawPrimitive(PE_IndicatorArrowRight, option, painter, widget); | 0 |
454 | break; | 0 |
455 | } | - |
456 | case PE_FrameTabBarBase: | - |
457 | if (const QStyleOptionTabBarBase *tbb never evaluated: const QStyleOptionTabBarBase *tbb = qstyleoption_cast<const QStyleOptionTabBarBase *>(option) | 0 |
458 | = qstyleoption_cast<const QStyleOptionTabBarBase *>(option)) { never evaluated: const QStyleOptionTabBarBase *tbb = qstyleoption_cast<const QStyleOptionTabBarBase *>(option) | 0 |
459 | painter->save(); never executed (the execution status of this line is deduced): painter->save(); | - |
460 | painter->setPen(QPen(outline.lighter(110))); never executed (the execution status of this line is deduced): painter->setPen(QPen(outline.lighter(110))); | - |
461 | switch (tbb->shape) { | - |
462 | case QTabBar::RoundedNorth: { | - |
463 | QRegion region(tbb->rect); never executed (the execution status of this line is deduced): QRegion region(tbb->rect); | - |
464 | region -= tbb->selectedTabRect; never executed (the execution status of this line is deduced): region -= tbb->selectedTabRect; | - |
465 | painter->drawLine(tbb->rect.topLeft(), tbb->rect.topRight()); never executed (the execution status of this line is deduced): painter->drawLine(tbb->rect.topLeft(), tbb->rect.topRight()); | - |
466 | painter->setClipRegion(region); never executed (the execution status of this line is deduced): painter->setClipRegion(region); | - |
467 | painter->setPen(option->palette.light().color()); never executed (the execution status of this line is deduced): painter->setPen(option->palette.light().color()); | - |
468 | painter->drawLine(tbb->rect.topLeft() + QPoint(0, 1), tbb->rect.topRight() + QPoint(0, 1)); never executed (the execution status of this line is deduced): painter->drawLine(tbb->rect.topLeft() + QPoint(0, 1), tbb->rect.topRight() + QPoint(0, 1)); | - |
469 | } | - |
470 | break; | 0 |
471 | case QTabBar::RoundedWest: | - |
472 | painter->drawLine(tbb->rect.left(), tbb->rect.top(), tbb->rect.left(), tbb->rect.bottom()); never executed (the execution status of this line is deduced): painter->drawLine(tbb->rect.left(), tbb->rect.top(), tbb->rect.left(), tbb->rect.bottom()); | - |
473 | break; | 0 |
474 | case QTabBar::RoundedSouth: | - |
475 | painter->drawLine(tbb->rect.left(), tbb->rect.bottom(), never executed (the execution status of this line is deduced): painter->drawLine(tbb->rect.left(), tbb->rect.bottom(), | - |
476 | tbb->rect.right(), tbb->rect.bottom()); never executed (the execution status of this line is deduced): tbb->rect.right(), tbb->rect.bottom()); | - |
477 | break; | 0 |
478 | case QTabBar::RoundedEast: | - |
479 | painter->drawLine(tbb->rect.topRight(), tbb->rect.bottomRight()); never executed (the execution status of this line is deduced): painter->drawLine(tbb->rect.topRight(), tbb->rect.bottomRight()); | - |
480 | break; | 0 |
481 | case QTabBar::TriangularNorth: | - |
482 | case QTabBar::TriangularEast: | - |
483 | case QTabBar::TriangularWest: | - |
484 | case QTabBar::TriangularSouth: | - |
485 | painter->restore(); never executed (the execution status of this line is deduced): painter->restore(); | - |
486 | QCommonStyle::drawPrimitive(elem, option, painter, widget); never executed (the execution status of this line is deduced): QCommonStyle::drawPrimitive(elem, option, painter, widget); | - |
487 | return; | 0 |
488 | } | - |
489 | painter->restore(); never executed (the execution status of this line is deduced): painter->restore(); | - |
490 | } | 0 |
491 | return; | 0 |
492 | case PE_PanelScrollAreaCorner: { | - |
493 | painter->save(); executed (the execution status of this line is deduced): painter->save(); | - |
494 | QColor alphaOutline = outline; executed (the execution status of this line is deduced): QColor alphaOutline = outline; | - |
495 | alphaOutline.setAlpha(180); executed (the execution status of this line is deduced): alphaOutline.setAlpha(180); | - |
496 | painter->setPen(alphaOutline); executed (the execution status of this line is deduced): painter->setPen(alphaOutline); | - |
497 | painter->setBrush(option->palette.brush(QPalette::Window)); executed (the execution status of this line is deduced): painter->setBrush(option->palette.brush(QPalette::Window)); | - |
498 | painter->drawRect(option->rect); executed (the execution status of this line is deduced): painter->drawRect(option->rect); | - |
499 | painter->restore(); executed (the execution status of this line is deduced): painter->restore(); | - |
500 | } break; executed: break; Execution Count:144 | 144 |
501 | case PE_IndicatorArrowUp: | - |
502 | case PE_IndicatorArrowDown: | - |
503 | case PE_IndicatorArrowRight: | - |
504 | case PE_IndicatorArrowLeft: | - |
505 | { | - |
506 | if (option->rect.width() <= 1 || option->rect.height() <= 1) partially evaluated: option->rect.width() <= 1 no Evaluation Count:0 | yes Evaluation Count:2 |
partially evaluated: option->rect.height() <= 1 no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
507 | break; | 0 |
508 | QColor arrowColor = option->palette.foreground().color(); executed (the execution status of this line is deduced): QColor arrowColor = option->palette.foreground().color(); | - |
509 | QPixmap arrow; executed (the execution status of this line is deduced): QPixmap arrow; | - |
510 | int rotation = 0; executed (the execution status of this line is deduced): int rotation = 0; | - |
511 | switch (elem) { | - |
512 | case PE_IndicatorArrowDown: | - |
513 | rotation = 180; executed (the execution status of this line is deduced): rotation = 180; | - |
514 | break; executed: break; Execution Count:1 | 1 |
515 | case PE_IndicatorArrowRight: | - |
516 | rotation = 90; never executed (the execution status of this line is deduced): rotation = 90; | - |
517 | break; | 0 |
518 | case PE_IndicatorArrowLeft: | - |
519 | rotation = -90; never executed (the execution status of this line is deduced): rotation = -90; | - |
520 | break; | 0 |
521 | default: | - |
522 | break; executed: break; Execution Count:1 | 1 |
523 | } | - |
524 | arrow = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), arrowColor, rotation); executed (the execution status of this line is deduced): arrow = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), arrowColor, rotation); | - |
525 | QRect rect = option->rect; executed (the execution status of this line is deduced): QRect rect = option->rect; | - |
526 | QRect arrowRect; executed (the execution status of this line is deduced): QRect arrowRect; | - |
527 | int imageMax = qMin(arrow.height(), arrow.width()); executed (the execution status of this line is deduced): int imageMax = qMin(arrow.height(), arrow.width()); | - |
528 | int rectMax = qMin(rect.height(), rect.width()); executed (the execution status of this line is deduced): int rectMax = qMin(rect.height(), rect.width()); | - |
529 | int size = qMin(imageMax, rectMax); executed (the execution status of this line is deduced): int size = qMin(imageMax, rectMax); | - |
530 | | - |
531 | arrowRect.setWidth(size); executed (the execution status of this line is deduced): arrowRect.setWidth(size); | - |
532 | arrowRect.setHeight(size); executed (the execution status of this line is deduced): arrowRect.setHeight(size); | - |
533 | if (arrow.width() > arrow.height()) partially evaluated: arrow.width() > arrow.height() yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
534 | arrowRect.setHeight(arrow.height() * size / arrow.width()); executed: arrowRect.setHeight(arrow.height() * size / arrow.width()); Execution Count:2 | 2 |
535 | else | - |
536 | arrowRect.setWidth(arrow.width() * size / arrow.height()); never executed: arrowRect.setWidth(arrow.width() * size / arrow.height()); | 0 |
537 | | - |
538 | arrowRect.moveTopLeft(rect.center() - arrowRect.center()); executed (the execution status of this line is deduced): arrowRect.moveTopLeft(rect.center() - arrowRect.center()); | - |
539 | painter->save(); executed (the execution status of this line is deduced): painter->save(); | - |
540 | painter->setRenderHint(QPainter::SmoothPixmapTransform); executed (the execution status of this line is deduced): painter->setRenderHint(QPainter::SmoothPixmapTransform); | - |
541 | painter->drawPixmap(arrowRect, arrow); executed (the execution status of this line is deduced): painter->drawPixmap(arrowRect, arrow); | - |
542 | painter->restore(); executed (the execution status of this line is deduced): painter->restore(); | - |
543 | } | - |
544 | break; executed: break; Execution Count:2 | 2 |
545 | case PE_IndicatorViewItemCheck: | - |
546 | { | - |
547 | QStyleOptionButton button; never executed (the execution status of this line is deduced): QStyleOptionButton button; | - |
548 | button.QStyleOption::operator=(*option); never executed (the execution status of this line is deduced): button.QStyleOption::operator=(*option); | - |
549 | button.state &= ~State_MouseOver; never executed (the execution status of this line is deduced): button.state &= ~State_MouseOver; | - |
550 | proxy()->drawPrimitive(PE_IndicatorCheckBox, &button, painter, widget); never executed (the execution status of this line is deduced): proxy()->drawPrimitive(PE_IndicatorCheckBox, &button, painter, widget); | - |
551 | } | - |
552 | return; | 0 |
553 | case PE_IndicatorHeaderArrow: | - |
554 | if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option)) { never evaluated: const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option) | 0 |
555 | QRect r = header->rect; never executed (the execution status of this line is deduced): QRect r = header->rect; | - |
556 | QPixmap arrow; never executed (the execution status of this line is deduced): QPixmap arrow; | - |
557 | QColor arrowColor = header->palette.foreground().color(); never executed (the execution status of this line is deduced): QColor arrowColor = header->palette.foreground().color(); | - |
558 | QPoint offset = QPoint(0, -1); never executed (the execution status of this line is deduced): QPoint offset = QPoint(0, -1); | - |
559 | | - |
560 | if (header->sortIndicator & QStyleOptionHeader::SortUp) { never evaluated: header->sortIndicator & QStyleOptionHeader::SortUp | 0 |
561 | arrow = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), arrowColor); never executed (the execution status of this line is deduced): arrow = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), arrowColor); | - |
562 | } else if (header->sortIndicator & QStyleOptionHeader::SortDown) { never executed: } never evaluated: header->sortIndicator & QStyleOptionHeader::SortDown | 0 |
563 | arrow = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), arrowColor, 180); never executed (the execution status of this line is deduced): arrow = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), arrowColor, 180); | - |
564 | } if (!arrow.isNull()) { never executed: } never evaluated: !arrow.isNull() | 0 |
565 | r.setSize(QSize(arrow.width()/2, arrow.height()/2)); never executed (the execution status of this line is deduced): r.setSize(QSize(arrow.width()/2, arrow.height()/2)); | - |
566 | r.moveCenter(header->rect.center()); never executed (the execution status of this line is deduced): r.moveCenter(header->rect.center()); | - |
567 | painter->drawPixmap(r.translated(offset), arrow); never executed (the execution status of this line is deduced): painter->drawPixmap(r.translated(offset), arrow); | - |
568 | } | 0 |
569 | } | 0 |
570 | break; | 0 |
571 | case PE_IndicatorButtonDropDown: | - |
572 | proxy()->drawPrimitive(PE_PanelButtonCommand, option, painter, widget); never executed (the execution status of this line is deduced): proxy()->drawPrimitive(PE_PanelButtonCommand, option, painter, widget); | - |
573 | break; | 0 |
574 | | - |
575 | case PE_IndicatorToolBarSeparator: | - |
576 | { | - |
577 | QRect rect = option->rect; never executed (the execution status of this line is deduced): QRect rect = option->rect; | - |
578 | const int margin = 6; never executed (the execution status of this line is deduced): const int margin = 6; | - |
579 | if (option->state & State_Horizontal) { never evaluated: option->state & State_Horizontal | 0 |
580 | const int offset = rect.width()/2; never executed (the execution status of this line is deduced): const int offset = rect.width()/2; | - |
581 | painter->setPen(QPen(option->palette.background().color().darker(110))); never executed (the execution status of this line is deduced): painter->setPen(QPen(option->palette.background().color().darker(110))); | - |
582 | painter->drawLine(rect.bottomLeft().x() + offset, never executed (the execution status of this line is deduced): painter->drawLine(rect.bottomLeft().x() + offset, | - |
583 | rect.bottomLeft().y() - margin, never executed (the execution status of this line is deduced): rect.bottomLeft().y() - margin, | - |
584 | rect.topLeft().x() + offset, never executed (the execution status of this line is deduced): rect.topLeft().x() + offset, | - |
585 | rect.topLeft().y() + margin); never executed (the execution status of this line is deduced): rect.topLeft().y() + margin); | - |
586 | painter->setPen(QPen(option->palette.background().color().lighter(110))); never executed (the execution status of this line is deduced): painter->setPen(QPen(option->palette.background().color().lighter(110))); | - |
587 | painter->drawLine(rect.bottomLeft().x() + offset + 1, never executed (the execution status of this line is deduced): painter->drawLine(rect.bottomLeft().x() + offset + 1, | - |
588 | rect.bottomLeft().y() - margin, never executed (the execution status of this line is deduced): rect.bottomLeft().y() - margin, | - |
589 | rect.topLeft().x() + offset + 1, never executed (the execution status of this line is deduced): rect.topLeft().x() + offset + 1, | - |
590 | rect.topLeft().y() + margin); never executed (the execution status of this line is deduced): rect.topLeft().y() + margin); | - |
591 | } else { //Draw vertical separator | 0 |
592 | const int offset = rect.height()/2; never executed (the execution status of this line is deduced): const int offset = rect.height()/2; | - |
593 | painter->setPen(QPen(option->palette.background().color().darker(110))); never executed (the execution status of this line is deduced): painter->setPen(QPen(option->palette.background().color().darker(110))); | - |
594 | painter->drawLine(rect.topLeft().x() + margin , never executed (the execution status of this line is deduced): painter->drawLine(rect.topLeft().x() + margin , | - |
595 | rect.topLeft().y() + offset, never executed (the execution status of this line is deduced): rect.topLeft().y() + offset, | - |
596 | rect.topRight().x() - margin, never executed (the execution status of this line is deduced): rect.topRight().x() - margin, | - |
597 | rect.topRight().y() + offset); never executed (the execution status of this line is deduced): rect.topRight().y() + offset); | - |
598 | painter->setPen(QPen(option->palette.background().color().lighter(110))); never executed (the execution status of this line is deduced): painter->setPen(QPen(option->palette.background().color().lighter(110))); | - |
599 | painter->drawLine(rect.topLeft().x() + margin , never executed (the execution status of this line is deduced): painter->drawLine(rect.topLeft().x() + margin , | - |
600 | rect.topLeft().y() + offset + 1, never executed (the execution status of this line is deduced): rect.topLeft().y() + offset + 1, | - |
601 | rect.topRight().x() - margin, never executed (the execution status of this line is deduced): rect.topRight().x() - margin, | - |
602 | rect.topRight().y() + offset + 1); never executed (the execution status of this line is deduced): rect.topRight().y() + offset + 1); | - |
603 | } | 0 |
604 | } | - |
605 | break; | 0 |
606 | case PE_Frame: { | - |
607 | if (widget && widget->inherits("QComboBoxPrivateContainer")){ partially evaluated: widget yes Evaluation Count:192 | no Evaluation Count:0 |
partially evaluated: widget->inherits("QComboBoxPrivateContainer") no Evaluation Count:0 | yes Evaluation Count:192 |
| 0-192 |
608 | QStyleOption copy = *option; never executed (the execution status of this line is deduced): QStyleOption copy = *option; | - |
609 | copy.state |= State_Raised; never executed (the execution status of this line is deduced): copy.state |= State_Raised; | - |
610 | proxy()->drawPrimitive(PE_PanelMenu, ©, painter, widget); never executed (the execution status of this line is deduced): proxy()->drawPrimitive(PE_PanelMenu, ©, painter, widget); | - |
611 | break; | 0 |
612 | } | - |
613 | painter->save(); executed (the execution status of this line is deduced): painter->save(); | - |
614 | QPen thePen(outline.lighter(108)); executed (the execution status of this line is deduced): QPen thePen(outline.lighter(108)); | - |
615 | thePen.setCosmetic(false); executed (the execution status of this line is deduced): thePen.setCosmetic(false); | - |
616 | painter->setPen(thePen); executed (the execution status of this line is deduced): painter->setPen(thePen); | - |
617 | painter->drawRect(option->rect.adjusted(0, 0, -1, -1)); executed (the execution status of this line is deduced): painter->drawRect(option->rect.adjusted(0, 0, -1, -1)); | - |
618 | painter->restore(); } executed (the execution status of this line is deduced): painter->restore(); } | - |
619 | break; executed: break; Execution Count:192 | 192 |
620 | case PE_FrameMenu: | - |
621 | painter->save(); never executed (the execution status of this line is deduced): painter->save(); | - |
622 | { | - |
623 | painter->setPen(QPen(outline)); never executed (the execution status of this line is deduced): painter->setPen(QPen(outline)); | - |
624 | painter->drawRect(option->rect.adjusted(0, 0, -1, -1)); never executed (the execution status of this line is deduced): painter->drawRect(option->rect.adjusted(0, 0, -1, -1)); | - |
625 | QColor frameLight = option->palette.background().color().lighter(160); never executed (the execution status of this line is deduced): QColor frameLight = option->palette.background().color().lighter(160); | - |
626 | QColor frameShadow = option->palette.background().color().darker(110); never executed (the execution status of this line is deduced): QColor frameShadow = option->palette.background().color().darker(110); | - |
627 | | - |
628 | //paint beveleffect | - |
629 | QRect frame = option->rect.adjusted(1, 1, -1, -1); never executed (the execution status of this line is deduced): QRect frame = option->rect.adjusted(1, 1, -1, -1); | - |
630 | painter->setPen(frameLight); never executed (the execution status of this line is deduced): painter->setPen(frameLight); | - |
631 | painter->drawLine(frame.topLeft(), frame.bottomLeft()); never executed (the execution status of this line is deduced): painter->drawLine(frame.topLeft(), frame.bottomLeft()); | - |
632 | painter->drawLine(frame.topLeft(), frame.topRight()); never executed (the execution status of this line is deduced): painter->drawLine(frame.topLeft(), frame.topRight()); | - |
633 | | - |
634 | painter->setPen(frameShadow); never executed (the execution status of this line is deduced): painter->setPen(frameShadow); | - |
635 | painter->drawLine(frame.topRight(), frame.bottomRight()); never executed (the execution status of this line is deduced): painter->drawLine(frame.topRight(), frame.bottomRight()); | - |
636 | painter->drawLine(frame.bottomLeft(), frame.bottomRight()); never executed (the execution status of this line is deduced): painter->drawLine(frame.bottomLeft(), frame.bottomRight()); | - |
637 | } | - |
638 | painter->restore(); never executed (the execution status of this line is deduced): painter->restore(); | - |
639 | break; | 0 |
640 | case PE_FrameDockWidget: | - |
641 | | - |
642 | painter->save(); never executed (the execution status of this line is deduced): painter->save(); | - |
643 | { | - |
644 | QColor softshadow = option->palette.background().color().darker(120); never executed (the execution status of this line is deduced): QColor softshadow = option->palette.background().color().darker(120); | - |
645 | | - |
646 | QRect rect= option->rect; never executed (the execution status of this line is deduced): QRect rect= option->rect; | - |
647 | painter->setPen(softshadow); never executed (the execution status of this line is deduced): painter->setPen(softshadow); | - |
648 | painter->drawRect(option->rect.adjusted(0, 0, -1, -1)); never executed (the execution status of this line is deduced): painter->drawRect(option->rect.adjusted(0, 0, -1, -1)); | - |
649 | painter->setPen(QPen(option->palette.light(), 1)); never executed (the execution status of this line is deduced): painter->setPen(QPen(option->palette.light(), 1)); | - |
650 | painter->drawLine(QPoint(rect.left() + 1, rect.top() + 1), QPoint(rect.left() + 1, rect.bottom() - 1)); never executed (the execution status of this line is deduced): painter->drawLine(QPoint(rect.left() + 1, rect.top() + 1), QPoint(rect.left() + 1, rect.bottom() - 1)); | - |
651 | painter->setPen(QPen(option->palette.background().color().darker(120))); never executed (the execution status of this line is deduced): painter->setPen(QPen(option->palette.background().color().darker(120))); | - |
652 | painter->drawLine(QPoint(rect.left() + 1, rect.bottom() - 1), QPoint(rect.right() - 2, rect.bottom() - 1)); never executed (the execution status of this line is deduced): painter->drawLine(QPoint(rect.left() + 1, rect.bottom() - 1), QPoint(rect.right() - 2, rect.bottom() - 1)); | - |
653 | painter->drawLine(QPoint(rect.right() - 1, rect.top() + 1), QPoint(rect.right() - 1, rect.bottom() - 1)); never executed (the execution status of this line is deduced): painter->drawLine(QPoint(rect.right() - 1, rect.top() + 1), QPoint(rect.right() - 1, rect.bottom() - 1)); | - |
654 | | - |
655 | } | - |
656 | painter->restore(); never executed (the execution status of this line is deduced): painter->restore(); | - |
657 | break; | 0 |
658 | case PE_PanelButtonTool: | - |
659 | painter->save(); never executed (the execution status of this line is deduced): painter->save(); | - |
660 | if ((option->state & State_Enabled || option->state & State_On) || !(option->state & State_AutoRaise)) { never evaluated: option->state & State_Enabled never evaluated: option->state & State_On never evaluated: !(option->state & State_AutoRaise) | 0 |
661 | if (widget && widget->inherits("QDockWidgetTitleButton")) { never evaluated: widget never evaluated: widget->inherits("QDockWidgetTitleButton") | 0 |
662 | if (option->state & State_MouseOver) never evaluated: option->state & State_MouseOver | 0 |
663 | proxy()->drawPrimitive(PE_PanelButtonCommand, option, painter, widget); never executed: proxy()->drawPrimitive(PE_PanelButtonCommand, option, painter, widget); | 0 |
664 | } else { | 0 |
665 | proxy()->drawPrimitive(PE_PanelButtonCommand, option, painter, widget); never executed (the execution status of this line is deduced): proxy()->drawPrimitive(PE_PanelButtonCommand, option, painter, widget); | - |
666 | } | 0 |
667 | } | - |
668 | painter->restore(); never executed (the execution status of this line is deduced): painter->restore(); | - |
669 | break; | 0 |
670 | case PE_IndicatorDockWidgetResizeHandle: | - |
671 | { | - |
672 | QStyleOption dockWidgetHandle = *option; never executed (the execution status of this line is deduced): QStyleOption dockWidgetHandle = *option; | - |
673 | bool horizontal = option->state & State_Horizontal; never executed (the execution status of this line is deduced): bool horizontal = option->state & State_Horizontal; | - |
674 | if (horizontal) never evaluated: horizontal | 0 |
675 | dockWidgetHandle.state &= ~State_Horizontal; never executed: dockWidgetHandle.state &= ~State_Horizontal; | 0 |
676 | else | - |
677 | dockWidgetHandle.state |= State_Horizontal; never executed: dockWidgetHandle.state |= State_Horizontal; | 0 |
678 | proxy()->drawControl(CE_Splitter, &dockWidgetHandle, painter, widget); never executed (the execution status of this line is deduced): proxy()->drawControl(CE_Splitter, &dockWidgetHandle, painter, widget); | - |
679 | } | - |
680 | break; | 0 |
681 | case PE_FrameWindow: | - |
682 | painter->save(); never executed (the execution status of this line is deduced): painter->save(); | - |
683 | { | - |
684 | QRect rect= option->rect; never executed (the execution status of this line is deduced): QRect rect= option->rect; | - |
685 | painter->setPen(QPen(outline.darker(150))); never executed (the execution status of this line is deduced): painter->setPen(QPen(outline.darker(150))); | - |
686 | painter->drawRect(option->rect.adjusted(0, 0, -1, -1)); never executed (the execution status of this line is deduced): painter->drawRect(option->rect.adjusted(0, 0, -1, -1)); | - |
687 | painter->setPen(QPen(option->palette.light(), 1)); never executed (the execution status of this line is deduced): painter->setPen(QPen(option->palette.light(), 1)); | - |
688 | painter->drawLine(QPoint(rect.left() + 1, rect.top() + 1), never executed (the execution status of this line is deduced): painter->drawLine(QPoint(rect.left() + 1, rect.top() + 1), | - |
689 | QPoint(rect.left() + 1, rect.bottom() - 1)); never executed (the execution status of this line is deduced): QPoint(rect.left() + 1, rect.bottom() - 1)); | - |
690 | painter->setPen(QPen(option->palette.background().color().darker(120))); never executed (the execution status of this line is deduced): painter->setPen(QPen(option->palette.background().color().darker(120))); | - |
691 | painter->drawLine(QPoint(rect.left() + 1, rect.bottom() - 1), never executed (the execution status of this line is deduced): painter->drawLine(QPoint(rect.left() + 1, rect.bottom() - 1), | - |
692 | QPoint(rect.right() - 2, rect.bottom() - 1)); never executed (the execution status of this line is deduced): QPoint(rect.right() - 2, rect.bottom() - 1)); | - |
693 | painter->drawLine(QPoint(rect.right() - 1, rect.top() + 1), never executed (the execution status of this line is deduced): painter->drawLine(QPoint(rect.right() - 1, rect.top() + 1), | - |
694 | QPoint(rect.right() - 1, rect.bottom() - 1)); never executed (the execution status of this line is deduced): QPoint(rect.right() - 1, rect.bottom() - 1)); | - |
695 | } | - |
696 | painter->restore(); never executed (the execution status of this line is deduced): painter->restore(); | - |
697 | break; | 0 |
698 | case PE_FrameLineEdit: | - |
699 | { | - |
700 | QRect r = rect; executed (the execution status of this line is deduced): QRect r = rect; | - |
701 | bool hasFocus = option->state & State_HasFocus; executed (the execution status of this line is deduced): bool hasFocus = option->state & State_HasFocus; | - |
702 | | - |
703 | painter->save(); executed (the execution status of this line is deduced): painter->save(); | - |
704 | | - |
705 | painter->setRenderHint(QPainter::Antialiasing, true); executed (the execution status of this line is deduced): painter->setRenderHint(QPainter::Antialiasing, true); | - |
706 | // ### highdpi painter bug. | - |
707 | painter->translate(0.5, 0.5); executed (the execution status of this line is deduced): painter->translate(0.5, 0.5); | - |
708 | | - |
709 | // Draw Outline | - |
710 | painter->setPen( QPen(hasFocus ? highlightedOutline : outline)); executed (the execution status of this line is deduced): painter->setPen( QPen(hasFocus ? highlightedOutline : outline)); | - |
711 | painter->setBrush(option->palette.base()); executed (the execution status of this line is deduced): painter->setBrush(option->palette.base()); | - |
712 | painter->drawRoundedRect(r.adjusted(0, 0, -1, -1), 2, 2); executed (the execution status of this line is deduced): painter->drawRoundedRect(r.adjusted(0, 0, -1, -1), 2, 2); | - |
713 | | - |
714 | if (hasFocus) { partially evaluated: hasFocus no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
715 | QColor softHighlight = highlightedOutline; never executed (the execution status of this line is deduced): QColor softHighlight = highlightedOutline; | - |
716 | softHighlight.setAlpha(40); never executed (the execution status of this line is deduced): softHighlight.setAlpha(40); | - |
717 | painter->setPen(softHighlight); never executed (the execution status of this line is deduced): painter->setPen(softHighlight); | - |
718 | painter->drawRoundedRect(r.adjusted(1, 1, -2, -2), 1.7, 1.7); never executed (the execution status of this line is deduced): painter->drawRoundedRect(r.adjusted(1, 1, -2, -2), 1.7, 1.7); | - |
719 | } | 0 |
720 | // Draw inner shadow | - |
721 | painter->setPen(d->topShadow()); executed (the execution status of this line is deduced): painter->setPen(d->topShadow()); | - |
722 | painter->drawLine(QPoint(r.left() + 2, r.top() + 1), QPoint(r.right() - 2, r.top() + 1)); executed (the execution status of this line is deduced): painter->drawLine(QPoint(r.left() + 2, r.top() + 1), QPoint(r.right() - 2, r.top() + 1)); | - |
723 | | - |
724 | painter->restore(); executed (the execution status of this line is deduced): painter->restore(); | - |
725 | | - |
726 | } | - |
727 | break; executed: break; Execution Count:2 | 2 |
728 | case PE_IndicatorCheckBox: | - |
729 | painter->save(); executed (the execution status of this line is deduced): painter->save(); | - |
730 | if (const QStyleOptionButton *checkbox = qstyleoption_cast<const QStyleOptionButton*>(option)) { partially evaluated: const QStyleOptionButton *checkbox = qstyleoption_cast<const QStyleOptionButton*>(option) yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
731 | painter->setRenderHint(QPainter::Antialiasing, true); executed (the execution status of this line is deduced): painter->setRenderHint(QPainter::Antialiasing, true); | - |
732 | painter->translate(0.5, 0.5); executed (the execution status of this line is deduced): painter->translate(0.5, 0.5); | - |
733 | rect = rect.adjusted(0, 0, -1, -1); executed (the execution status of this line is deduced): rect = rect.adjusted(0, 0, -1, -1); | - |
734 | | - |
735 | QColor pressedColor = mergedColors(option->palette.base().color(), option->palette.foreground().color(), 85); executed (the execution status of this line is deduced): QColor pressedColor = mergedColors(option->palette.base().color(), option->palette.foreground().color(), 85); | - |
736 | painter->setBrush(Qt::NoBrush); executed (the execution status of this line is deduced): painter->setBrush(Qt::NoBrush); | - |
737 | | - |
738 | // Gradient fill | - |
739 | QLinearGradient gradient(rect.topLeft(), rect.bottomLeft()); executed (the execution status of this line is deduced): QLinearGradient gradient(rect.topLeft(), rect.bottomLeft()); | - |
740 | gradient.setColorAt(0, (state & State_Sunken) ? pressedColor : option->palette.base().color().darker(115)); executed (the execution status of this line is deduced): gradient.setColorAt(0, (state & State_Sunken) ? pressedColor : option->palette.base().color().darker(115)); | - |
741 | gradient.setColorAt(0.15, (state & State_Sunken) ? pressedColor : option->palette.base().color()); executed (the execution status of this line is deduced): gradient.setColorAt(0.15, (state & State_Sunken) ? pressedColor : option->palette.base().color()); | - |
742 | gradient.setColorAt(1, (state & State_Sunken) ? pressedColor : option->palette.base().color()); executed (the execution status of this line is deduced): gradient.setColorAt(1, (state & State_Sunken) ? pressedColor : option->palette.base().color()); | - |
743 | | - |
744 | painter->setBrush((state & State_Sunken) ? QBrush(pressedColor) : gradient); executed (the execution status of this line is deduced): painter->setBrush((state & State_Sunken) ? QBrush(pressedColor) : gradient); | - |
745 | painter->setPen(QPen(outline.lighter(110))); executed (the execution status of this line is deduced): painter->setPen(QPen(outline.lighter(110))); | - |
746 | | - |
747 | if (option->state & State_HasFocus && option->state & State_KeyboardFocusChange) partially evaluated: option->state & State_HasFocus no Evaluation Count:0 | yes Evaluation Count:1 |
never evaluated: option->state & State_KeyboardFocusChange | 0-1 |
748 | painter->setPen(QPen(highlightedOutline)); never executed: painter->setPen(QPen(highlightedOutline)); | 0 |
749 | painter->drawRect(rect); executed (the execution status of this line is deduced): painter->drawRect(rect); | - |
750 | | - |
751 | QColor checkMarkColor = option->palette.text().color().darker(120); executed (the execution status of this line is deduced): QColor checkMarkColor = option->palette.text().color().darker(120); | - |
752 | | - |
753 | if (checkbox->state & State_NoChange) { partially evaluated: checkbox->state & State_NoChange no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
754 | gradient = QLinearGradient(rect.topLeft(), rect.bottomLeft()); never executed (the execution status of this line is deduced): gradient = QLinearGradient(rect.topLeft(), rect.bottomLeft()); | - |
755 | checkMarkColor.setAlpha(80); never executed (the execution status of this line is deduced): checkMarkColor.setAlpha(80); | - |
756 | gradient.setColorAt(0, checkMarkColor); never executed (the execution status of this line is deduced): gradient.setColorAt(0, checkMarkColor); | - |
757 | checkMarkColor.setAlpha(140); never executed (the execution status of this line is deduced): checkMarkColor.setAlpha(140); | - |
758 | gradient.setColorAt(1, checkMarkColor); never executed (the execution status of this line is deduced): gradient.setColorAt(1, checkMarkColor); | - |
759 | checkMarkColor.setAlpha(180); never executed (the execution status of this line is deduced): checkMarkColor.setAlpha(180); | - |
760 | painter->setPen(QPen(checkMarkColor, 1)); never executed (the execution status of this line is deduced): painter->setPen(QPen(checkMarkColor, 1)); | - |
761 | painter->setBrush(gradient); never executed (the execution status of this line is deduced): painter->setBrush(gradient); | - |
762 | painter->drawRect(rect.adjusted(3, 3, -3, -3)); never executed (the execution status of this line is deduced): painter->drawRect(rect.adjusted(3, 3, -3, -3)); | - |
763 | | - |
764 | } else if (checkbox->state & (State_On)) { never executed: } partially evaluated: checkbox->state & (State_On) no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
765 | QPen checkPen = QPen(checkMarkColor, 1.8); never executed (the execution status of this line is deduced): QPen checkPen = QPen(checkMarkColor, 1.8); | - |
766 | checkMarkColor.setAlpha(210); never executed (the execution status of this line is deduced): checkMarkColor.setAlpha(210); | - |
767 | painter->translate(-1, 0.5); never executed (the execution status of this line is deduced): painter->translate(-1, 0.5); | - |
768 | painter->setPen(checkPen); never executed (the execution status of this line is deduced): painter->setPen(checkPen); | - |
769 | painter->setBrush(Qt::NoBrush); never executed (the execution status of this line is deduced): painter->setBrush(Qt::NoBrush); | - |
770 | painter->translate(0.2, 0.0); never executed (the execution status of this line is deduced): painter->translate(0.2, 0.0); | - |
771 | | - |
772 | // Draw checkmark | - |
773 | QPainterPath path; never executed (the execution status of this line is deduced): QPainterPath path; | - |
774 | path.moveTo(5, rect.height() / 2.0); never executed (the execution status of this line is deduced): path.moveTo(5, rect.height() / 2.0); | - |
775 | path.lineTo(rect.width() / 2.0 - 0, rect.height() - 3); never executed (the execution status of this line is deduced): path.lineTo(rect.width() / 2.0 - 0, rect.height() - 3); | - |
776 | path.lineTo(rect.width() - 2.5, 3); never executed (the execution status of this line is deduced): path.lineTo(rect.width() - 2.5, 3); | - |
777 | painter->drawPath(path.translated(rect.topLeft())); never executed (the execution status of this line is deduced): painter->drawPath(path.translated(rect.topLeft())); | - |
778 | } | 0 |
779 | } | - |
780 | painter->restore(); executed (the execution status of this line is deduced): painter->restore(); | - |
781 | break; executed: break; Execution Count:1 | 1 |
782 | case PE_IndicatorRadioButton: | - |
783 | painter->save(); never executed (the execution status of this line is deduced): painter->save(); | - |
784 | { | - |
785 | QColor pressedColor = mergedColors(option->palette.base().color(), option->palette.foreground().color(), 85); never executed (the execution status of this line is deduced): QColor pressedColor = mergedColors(option->palette.base().color(), option->palette.foreground().color(), 85); | - |
786 | painter->setBrush((state & State_Sunken) ? pressedColor : option->palette.base().color()); never executed (the execution status of this line is deduced): painter->setBrush((state & State_Sunken) ? pressedColor : option->palette.base().color()); | - |
787 | painter->setRenderHint(QPainter::Antialiasing, true); never executed (the execution status of this line is deduced): painter->setRenderHint(QPainter::Antialiasing, true); | - |
788 | QPainterPath circle; never executed (the execution status of this line is deduced): QPainterPath circle; | - |
789 | circle.addEllipse(rect.center() + QPoint(1.0, 1.0), 6.5, 6.5); never executed (the execution status of this line is deduced): circle.addEllipse(rect.center() + QPoint(1.0, 1.0), 6.5, 6.5); | - |
790 | painter->setPen(QPen(option->palette.background().color().darker(150))); never executed (the execution status of this line is deduced): painter->setPen(QPen(option->palette.background().color().darker(150))); | - |
791 | if (option->state & State_HasFocus && option->state & State_KeyboardFocusChange) never evaluated: option->state & State_HasFocus never evaluated: option->state & State_KeyboardFocusChange | 0 |
792 | painter->setPen(QPen(highlightedOutline)); never executed: painter->setPen(QPen(highlightedOutline)); | 0 |
793 | painter->drawPath(circle); never executed (the execution status of this line is deduced): painter->drawPath(circle); | - |
794 | | - |
795 | if (state & (State_On )) { never evaluated: state & (State_On ) | 0 |
796 | circle = QPainterPath(); never executed (the execution status of this line is deduced): circle = QPainterPath(); | - |
797 | circle.addEllipse(rect.center() + QPoint(1, 1), 2.8, 2.8); never executed (the execution status of this line is deduced): circle.addEllipse(rect.center() + QPoint(1, 1), 2.8, 2.8); | - |
798 | QColor checkMarkColor = option->palette.text().color().darker(120); never executed (the execution status of this line is deduced): QColor checkMarkColor = option->palette.text().color().darker(120); | - |
799 | checkMarkColor.setAlpha(200); never executed (the execution status of this line is deduced): checkMarkColor.setAlpha(200); | - |
800 | painter->setPen(checkMarkColor); never executed (the execution status of this line is deduced): painter->setPen(checkMarkColor); | - |
801 | checkMarkColor.setAlpha(180); never executed (the execution status of this line is deduced): checkMarkColor.setAlpha(180); | - |
802 | painter->setBrush(checkMarkColor); never executed (the execution status of this line is deduced): painter->setBrush(checkMarkColor); | - |
803 | painter->drawPath(circle); never executed (the execution status of this line is deduced): painter->drawPath(circle); | - |
804 | } | 0 |
805 | } | - |
806 | painter->restore(); never executed (the execution status of this line is deduced): painter->restore(); | - |
807 | break; | 0 |
808 | case PE_IndicatorToolBarHandle: | - |
809 | { | - |
810 | //draw grips | - |
811 | if (option->state & State_Horizontal) { never evaluated: option->state & State_Horizontal | 0 |
812 | for (int i = -3 ; i < 2 ; i += 3) { | 0 |
813 | for (int j = -8 ; j < 10 ; j += 3) { | 0 |
814 | painter->fillRect(rect.center().x() + i, rect.center().y() + j, 2, 2, d->lightShade()); never executed (the execution status of this line is deduced): painter->fillRect(rect.center().x() + i, rect.center().y() + j, 2, 2, d->lightShade()); | - |
815 | painter->fillRect(rect.center().x() + i, rect.center().y() + j, 1, 1, d->darkShade()); never executed (the execution status of this line is deduced): painter->fillRect(rect.center().x() + i, rect.center().y() + j, 1, 1, d->darkShade()); | - |
816 | } | 0 |
817 | } | 0 |
818 | } else { //vertical toolbar | 0 |
819 | for (int i = -6 ; i < 12 ; i += 3) { | 0 |
820 | for (int j = -3 ; j < 2 ; j += 3) { | 0 |
821 | painter->fillRect(rect.center().x() + i, rect.center().y() + j, 2, 2, d->lightShade()); never executed (the execution status of this line is deduced): painter->fillRect(rect.center().x() + i, rect.center().y() + j, 2, 2, d->lightShade()); | - |
822 | painter->fillRect(rect.center().x() + i, rect.center().y() + j, 1, 1, d->darkShade()); never executed (the execution status of this line is deduced): painter->fillRect(rect.center().x() + i, rect.center().y() + j, 1, 1, d->darkShade()); | - |
823 | } | 0 |
824 | } | 0 |
825 | } | 0 |
826 | break; | 0 |
827 | } | - |
828 | case PE_FrameDefaultButton: | - |
829 | break; executed: break; Execution Count:12 | 12 |
830 | case PE_FrameFocusRect: | - |
831 | if (const QStyleOptionFocusRect *fropt = qstyleoption_cast<const QStyleOptionFocusRect *>(option)) { partially evaluated: const QStyleOptionFocusRect *fropt = qstyleoption_cast<const QStyleOptionFocusRect *>(option) yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-3 |
832 | //### check for d->alt_down | - |
833 | if (!(fropt->state & State_KeyboardFocusChange)) partially evaluated: !(fropt->state & State_KeyboardFocusChange) yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-3 |
834 | return; executed: return; Execution Count:3 | 3 |
835 | QRect rect = option->rect; never executed (the execution status of this line is deduced): QRect rect = option->rect; | - |
836 | | - |
837 | painter->save(); never executed (the execution status of this line is deduced): painter->save(); | - |
838 | painter->setRenderHint(QPainter::Antialiasing, true); never executed (the execution status of this line is deduced): painter->setRenderHint(QPainter::Antialiasing, true); | - |
839 | painter->translate(0.5, 0.5); never executed (the execution status of this line is deduced): painter->translate(0.5, 0.5); | - |
840 | QColor fillcolor = highlightedOutline; never executed (the execution status of this line is deduced): QColor fillcolor = highlightedOutline; | - |
841 | fillcolor.setAlpha(80); never executed (the execution status of this line is deduced): fillcolor.setAlpha(80); | - |
842 | painter->setPen(fillcolor.darker(120)); never executed (the execution status of this line is deduced): painter->setPen(fillcolor.darker(120)); | - |
843 | fillcolor.setAlpha(30); never executed (the execution status of this line is deduced): fillcolor.setAlpha(30); | - |
844 | QLinearGradient gradient(rect.topLeft(), rect.bottomLeft()); never executed (the execution status of this line is deduced): QLinearGradient gradient(rect.topLeft(), rect.bottomLeft()); | - |
845 | gradient.setColorAt(0, fillcolor.lighter(160)); never executed (the execution status of this line is deduced): gradient.setColorAt(0, fillcolor.lighter(160)); | - |
846 | gradient.setColorAt(1, fillcolor); never executed (the execution status of this line is deduced): gradient.setColorAt(1, fillcolor); | - |
847 | painter->setBrush(gradient); never executed (the execution status of this line is deduced): painter->setBrush(gradient); | - |
848 | painter->drawRoundedRect(option->rect.adjusted(0, 0, -1, -1), 1, 1); never executed (the execution status of this line is deduced): painter->drawRoundedRect(option->rect.adjusted(0, 0, -1, -1), 1, 1); | - |
849 | painter->restore(); never executed (the execution status of this line is deduced): painter->restore(); | - |
850 | } | 0 |
851 | break; | 0 |
852 | case PE_PanelButtonCommand: | - |
853 | { | - |
854 | bool isDefault = false; executed (the execution status of this line is deduced): bool isDefault = false; | - |
855 | bool isFlat = false; executed (the execution status of this line is deduced): bool isFlat = false; | - |
856 | bool isDown = (option->state & State_Sunken) || (option->state & State_On); evaluated: (option->state & State_Sunken) yes Evaluation Count:5 | yes Evaluation Count:19 |
partially evaluated: (option->state & State_On) no Evaluation Count:0 | yes Evaluation Count:19 |
| 0-19 |
857 | QRect r; executed (the execution status of this line is deduced): QRect r; | - |
858 | | - |
859 | if (const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton*>(option)) { evaluated: const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton*>(option) yes Evaluation Count:23 | yes Evaluation Count:1 |
| 1-23 |
860 | isDefault = (button->features & QStyleOptionButton::DefaultButton) && (button->state & State_Enabled); evaluated: (button->features & QStyleOptionButton::DefaultButton) yes Evaluation Count:12 | yes Evaluation Count:11 |
partially evaluated: (button->state & State_Enabled) yes Evaluation Count:12 | no Evaluation Count:0 |
| 0-12 |
861 | isFlat = (button->features & QStyleOptionButton::Flat); executed (the execution status of this line is deduced): isFlat = (button->features & QStyleOptionButton::Flat); | - |
862 | } executed: } Execution Count:23 | 23 |
863 | | - |
864 | if (isFlat && !isDown) { partially evaluated: isFlat no Evaluation Count:0 | yes Evaluation Count:24 |
never evaluated: !isDown | 0-24 |
865 | if (isDefault) { never evaluated: isDefault | 0 |
866 | r = option->rect.adjusted(0, 1, 0, -1); never executed (the execution status of this line is deduced): r = option->rect.adjusted(0, 1, 0, -1); | - |
867 | painter->setPen(QPen(Qt::black)); never executed (the execution status of this line is deduced): painter->setPen(QPen(Qt::black)); | - |
868 | const QLine lines[4] = { never executed (the execution status of this line is deduced): const QLine lines[4] = { | - |
869 | QLine(QPoint(r.left() + 2, r.top()), never executed (the execution status of this line is deduced): QLine(QPoint(r.left() + 2, r.top()), | - |
870 | QPoint(r.right() - 2, r.top())), never executed (the execution status of this line is deduced): QPoint(r.right() - 2, r.top())), | - |
871 | QLine(QPoint(r.left(), r.top() + 2), never executed (the execution status of this line is deduced): QLine(QPoint(r.left(), r.top() + 2), | - |
872 | QPoint(r.left(), r.bottom() - 2)), never executed (the execution status of this line is deduced): QPoint(r.left(), r.bottom() - 2)), | - |
873 | QLine(QPoint(r.right(), r.top() + 2), never executed (the execution status of this line is deduced): QLine(QPoint(r.right(), r.top() + 2), | - |
874 | QPoint(r.right(), r.bottom() - 2)), never executed (the execution status of this line is deduced): QPoint(r.right(), r.bottom() - 2)), | - |
875 | QLine(QPoint(r.left() + 2, r.bottom()), never executed (the execution status of this line is deduced): QLine(QPoint(r.left() + 2, r.bottom()), | - |
876 | QPoint(r.right() - 2, r.bottom())) never executed (the execution status of this line is deduced): QPoint(r.right() - 2, r.bottom())) | - |
877 | }; never executed (the execution status of this line is deduced): }; | - |
878 | painter->drawLines(lines, 4); never executed (the execution status of this line is deduced): painter->drawLines(lines, 4); | - |
879 | const QPoint points[4] = { never executed (the execution status of this line is deduced): const QPoint points[4] = { | - |
880 | QPoint(r.right() - 1, r.bottom() - 1), never executed (the execution status of this line is deduced): QPoint(r.right() - 1, r.bottom() - 1), | - |
881 | QPoint(r.right() - 1, r.top() + 1), never executed (the execution status of this line is deduced): QPoint(r.right() - 1, r.top() + 1), | - |
882 | QPoint(r.left() + 1, r.bottom() - 1), never executed (the execution status of this line is deduced): QPoint(r.left() + 1, r.bottom() - 1), | - |
883 | QPoint(r.left() + 1, r.top() + 1) never executed (the execution status of this line is deduced): QPoint(r.left() + 1, r.top() + 1) | - |
884 | }; never executed (the execution status of this line is deduced): }; | - |
885 | painter->drawPoints(points, 4); never executed (the execution status of this line is deduced): painter->drawPoints(points, 4); | - |
886 | } | 0 |
887 | return; | 0 |
888 | } | - |
889 | | - |
890 | BEGIN_STYLE_PIXMAPCACHE(QString::fromLatin1("pushbutton-%1").arg(isDefault)) executed: } Execution Count:11 executed: } Execution Count:13 partially evaluated: doPixmapCache yes Evaluation Count:13 | no Evaluation Count:0 |
partially evaluated: (txType <= QTransform::TxTranslate) yes Evaluation Count:24 | no Evaluation Count:0 |
never evaluated: (painter->deviceTransform().type() == QTransform::TxScale) partially evaluated: doPixmapCache yes Evaluation Count:24 | no Evaluation Count:0 |
evaluated: QPixmapCache::find(unique, internalPixmapCache) yes Evaluation Count:11 | yes Evaluation Count:13 |
| 0-24 |
891 | r = rect.adjusted(0, 1, -1, 0); executed (the execution status of this line is deduced): r = rect.adjusted(0, 1, -1, 0); | - |
892 | | - |
893 | bool isEnabled = option->state & State_Enabled; executed (the execution status of this line is deduced): bool isEnabled = option->state & State_Enabled; | - |
894 | bool hasFocus = (option->state & State_HasFocus && option->state & State_KeyboardFocusChange); evaluated: option->state & State_HasFocus yes Evaluation Count:2 | yes Evaluation Count:11 |
partially evaluated: option->state & State_KeyboardFocusChange no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-11 |
895 | QColor buttonColor = d->buttonColor(option->palette); executed (the execution status of this line is deduced): QColor buttonColor = d->buttonColor(option->palette); | - |
896 | | - |
897 | QColor darkOutline = outline; executed (the execution status of this line is deduced): QColor darkOutline = outline; | - |
898 | if (hasFocus | isDefault) { evaluated: hasFocus | isDefault yes Evaluation Count:5 | yes Evaluation Count:8 |
| 5-8 |
899 | darkOutline = highlightedOutline; executed (the execution status of this line is deduced): darkOutline = highlightedOutline; | - |
900 | } executed: } Execution Count:5 | 5 |
901 | | - |
902 | if (isDefault) evaluated: isDefault yes Evaluation Count:5 | yes Evaluation Count:8 |
| 5-8 |
903 | buttonColor = mergedColors(buttonColor, highlightedOutline.lighter(130), 90); executed: buttonColor = mergedColors(buttonColor, highlightedOutline.lighter(130), 90); Execution Count:5 | 5 |
904 | | - |
905 | p->setRenderHint(QPainter::Antialiasing, true); executed (the execution status of this line is deduced): p->setRenderHint(QPainter::Antialiasing, true); | - |
906 | p->translate(0.5, -0.5); executed (the execution status of this line is deduced): p->translate(0.5, -0.5); | - |
907 | | - |
908 | QLinearGradient gradient = qt_fusion_gradient(rect, (isEnabled && option->state & State_MouseOver ) ? buttonColor : buttonColor.darker(104)); executed (the execution status of this line is deduced): QLinearGradient gradient = qt_fusion_gradient(rect, (isEnabled && option->state & State_MouseOver ) ? buttonColor : buttonColor.darker(104)); | - |
909 | p->setPen(Qt::transparent); executed (the execution status of this line is deduced): p->setPen(Qt::transparent); | - |
910 | p->setBrush(isDown ? QBrush(buttonColor.darker(110)) : gradient); executed (the execution status of this line is deduced): p->setBrush(isDown ? QBrush(buttonColor.darker(110)) : gradient); | - |
911 | p->drawRoundedRect(r, 2.0, 2.0); executed (the execution status of this line is deduced): p->drawRoundedRect(r, 2.0, 2.0); | - |
912 | p->setBrush(Qt::NoBrush); executed (the execution status of this line is deduced): p->setBrush(Qt::NoBrush); | - |
913 | | - |
914 | // Outline | - |
915 | p->setPen(!isEnabled ? QPen(darkOutline.lighter(115)) : QPen(darkOutline)); executed (the execution status of this line is deduced): p->setPen(!isEnabled ? QPen(darkOutline.lighter(115)) : QPen(darkOutline)); | - |
916 | p->drawRoundedRect(r, 2.0, 2.0); executed (the execution status of this line is deduced): p->drawRoundedRect(r, 2.0, 2.0); | - |
917 | | - |
918 | p->setPen(d->innerContrastLine()); executed (the execution status of this line is deduced): p->setPen(d->innerContrastLine()); | - |
919 | p->drawRoundedRect(r.adjusted(1, 1, -1, -1), 2.0, 2.0); executed (the execution status of this line is deduced): p->drawRoundedRect(r.adjusted(1, 1, -1, -1), 2.0, 2.0); | - |
920 | | - |
921 | END_STYLE_PIXMAPCACHE executed: } Execution Count:13 executed: } Execution Count:13 partially evaluated: doPixmapCache yes Evaluation Count:13 | no Evaluation Count:0 |
| 0-13 |
922 | } | - |
923 | break; executed: break; Execution Count:24 | 24 |
924 | case PE_FrameTabWidget: | - |
925 | painter->save(); executed (the execution status of this line is deduced): painter->save(); | - |
926 | painter->fillRect(option->rect.adjusted(0, 0, -1, -1), tabFrameColor); executed (the execution status of this line is deduced): painter->fillRect(option->rect.adjusted(0, 0, -1, -1), tabFrameColor); | - |
927 | if (const QStyleOptionTabWidgetFrame *twf = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(option)) { partially evaluated: const QStyleOptionTabWidgetFrame *twf = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(option) yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
928 | QColor borderColor = outline.lighter(110); executed (the execution status of this line is deduced): QColor borderColor = outline.lighter(110); | - |
929 | QRect rect = option->rect.adjusted(0, 0, -1, -1); executed (the execution status of this line is deduced): QRect rect = option->rect.adjusted(0, 0, -1, -1); | - |
930 | | - |
931 | // Shadow outline | - |
932 | if (twf->shape != QTabBar::RoundedSouth) { partially evaluated: twf->shape != QTabBar::RoundedSouth yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
933 | rect.adjust(0, 0, 0, -1); executed (the execution status of this line is deduced): rect.adjust(0, 0, 0, -1); | - |
934 | QColor alphaShadow(Qt::black); executed (the execution status of this line is deduced): QColor alphaShadow(Qt::black); | - |
935 | alphaShadow.setAlpha(15); executed (the execution status of this line is deduced): alphaShadow.setAlpha(15); | - |
936 | painter->setPen(alphaShadow); executed (the execution status of this line is deduced): painter->setPen(alphaShadow); | - |
937 | painter->drawLine(option->rect.bottomLeft(), option->rect.bottomRight()); painter->setPen(borderColor); executed (the execution status of this line is deduced): painter->drawLine(option->rect.bottomLeft(), option->rect.bottomRight()); painter->setPen(borderColor); | - |
938 | } executed: } Execution Count:6 | 6 |
939 | | - |
940 | // outline | - |
941 | painter->setPen(outline); executed (the execution status of this line is deduced): painter->setPen(outline); | - |
942 | painter->drawRect(rect); executed (the execution status of this line is deduced): painter->drawRect(rect); | - |
943 | | - |
944 | // Inner frame highlight | - |
945 | painter->setPen(d->innerContrastLine()); executed (the execution status of this line is deduced): painter->setPen(d->innerContrastLine()); | - |
946 | painter->drawRect(rect.adjusted(1, 1, -1, -1)); executed (the execution status of this line is deduced): painter->drawRect(rect.adjusted(1, 1, -1, -1)); | - |
947 | | - |
948 | } executed: } Execution Count:6 | 6 |
949 | painter->restore(); executed (the execution status of this line is deduced): painter->restore(); | - |
950 | break ; executed: break ; Execution Count:6 | 6 |
951 | | - |
952 | case PE_FrameStatusBarItem: | - |
953 | break; | 0 |
954 | case PE_IndicatorTabClose: | - |
955 | { | - |
956 | Q_D(const QFusionStyle); never executed (the execution status of this line is deduced): const QFusionStylePrivate * const d = d_func(); | - |
957 | if (d->tabBarcloseButtonIcon.isNull()) never evaluated: d->tabBarcloseButtonIcon.isNull() | 0 |
958 | d->tabBarcloseButtonIcon = standardIcon(SP_DialogCloseButton, option, widget); never executed: d->tabBarcloseButtonIcon = standardIcon(SP_DialogCloseButton, option, widget); | 0 |
959 | if ((option->state & State_Enabled) && (option->state & State_MouseOver)) never evaluated: (option->state & State_Enabled) never evaluated: (option->state & State_MouseOver) | 0 |
960 | proxy()->drawPrimitive(PE_PanelButtonCommand, option, painter, widget); never executed: proxy()->drawPrimitive(PE_PanelButtonCommand, option, painter, widget); | 0 |
961 | QPixmap pixmap = d->tabBarcloseButtonIcon.pixmap(QSize(16, 16), QIcon::Normal, QIcon::On); never executed (the execution status of this line is deduced): QPixmap pixmap = d->tabBarcloseButtonIcon.pixmap(QSize(16, 16), QIcon::Normal, QIcon::On); | - |
962 | proxy()->drawItemPixmap(painter, option->rect, Qt::AlignCenter, pixmap); never executed (the execution status of this line is deduced): proxy()->drawItemPixmap(painter, option->rect, Qt::AlignCenter, pixmap); | - |
963 | } | - |
964 | break; | 0 |
965 | case PE_PanelMenu: { | - |
966 | painter->save(); never executed (the execution status of this line is deduced): painter->save(); | - |
967 | QColor menuBackground = option->palette.base().color().lighter(108); never executed (the execution status of this line is deduced): QColor menuBackground = option->palette.base().color().lighter(108); | - |
968 | QColor borderColor = option->palette.background().color().darker(160); never executed (the execution status of this line is deduced): QColor borderColor = option->palette.background().color().darker(160); | - |
969 | painter->setPen(borderColor); never executed (the execution status of this line is deduced): painter->setPen(borderColor); | - |
970 | painter->setBrush(menuBackground); never executed (the execution status of this line is deduced): painter->setBrush(menuBackground); | - |
971 | painter->drawRect(option->rect.adjusted(0, 0, -1, -1)); never executed (the execution status of this line is deduced): painter->drawRect(option->rect.adjusted(0, 0, -1, -1)); | - |
972 | painter->restore(); never executed (the execution status of this line is deduced): painter->restore(); | - |
973 | } | - |
974 | break; | 0 |
975 | | - |
976 | default: | - |
977 | QCommonStyle::drawPrimitive(elem, option, painter, widget); executed (the execution status of this line is deduced): QCommonStyle::drawPrimitive(elem, option, painter, widget); | - |
978 | break; executed: break; Execution Count:4 | 4 |
979 | } | - |
980 | } executed: } Execution Count:388 | 388 |
981 | | - |
982 | /*! | - |
983 | \reimp | - |
984 | */ | - |
985 | void QFusionStyle::drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, | - |
986 | const QWidget *widget) const | - |
987 | { | - |
988 | Q_D (const QFusionStyle); executed (the execution status of this line is deduced): const QFusionStylePrivate * const d = d_func(); | - |
989 | QRect rect = option->rect; executed (the execution status of this line is deduced): QRect rect = option->rect; | - |
990 | QColor outline = d->outline(option->palette); executed (the execution status of this line is deduced): QColor outline = d->outline(option->palette); | - |
991 | QColor highlightedOutline = d->highlightedOutline(option->palette); executed (the execution status of this line is deduced): QColor highlightedOutline = d->highlightedOutline(option->palette); | - |
992 | QColor shadow = d->darkShade(); executed (the execution status of this line is deduced): QColor shadow = d->darkShade(); | - |
993 | | - |
994 | switch (element) { | - |
995 | case CE_ComboBoxLabel: | - |
996 | if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(option)) { evaluated: const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(option) yes Evaluation Count:1 | yes Evaluation Count:1 |
| 1 |
997 | QRect editRect = proxy()->subControlRect(CC_ComboBox, cb, SC_ComboBoxEditField, widget); executed (the execution status of this line is deduced): QRect editRect = proxy()->subControlRect(CC_ComboBox, cb, SC_ComboBoxEditField, widget); | - |
998 | painter->save(); executed (the execution status of this line is deduced): painter->save(); | - |
999 | painter->setClipRect(editRect); executed (the execution status of this line is deduced): painter->setClipRect(editRect); | - |
1000 | if (!cb->currentIcon.isNull()) { partially evaluated: !cb->currentIcon.isNull() no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
1001 | QIcon::Mode mode = cb->state & State_Enabled ? QIcon::Normal never evaluated: cb->state & State_Enabled | 0 |
1002 | : QIcon::Disabled; never executed (the execution status of this line is deduced): : QIcon::Disabled; | - |
1003 | QPixmap pixmap = cb->currentIcon.pixmap(cb->iconSize, mode); never executed (the execution status of this line is deduced): QPixmap pixmap = cb->currentIcon.pixmap(cb->iconSize, mode); | - |
1004 | QRect iconRect(editRect); never executed (the execution status of this line is deduced): QRect iconRect(editRect); | - |
1005 | iconRect.setWidth(cb->iconSize.width() + 4); never executed (the execution status of this line is deduced): iconRect.setWidth(cb->iconSize.width() + 4); | - |
1006 | iconRect = alignedRect(cb->direction, never executed (the execution status of this line is deduced): iconRect = alignedRect(cb->direction, | - |
1007 | Qt::AlignLeft | Qt::AlignVCenter, never executed (the execution status of this line is deduced): Qt::AlignLeft | Qt::AlignVCenter, | - |
1008 | iconRect.size(), editRect); never executed (the execution status of this line is deduced): iconRect.size(), editRect); | - |
1009 | if (cb->editable) never evaluated: cb->editable | 0 |
1010 | painter->fillRect(iconRect, cb->palette.brush(QPalette::Base)); never executed: painter->fillRect(iconRect, cb->palette.brush(QPalette::Base)); | 0 |
1011 | proxy()->drawItemPixmap(painter, iconRect, Qt::AlignCenter, pixmap); never executed (the execution status of this line is deduced): proxy()->drawItemPixmap(painter, iconRect, Qt::AlignCenter, pixmap); | - |
1012 | | - |
1013 | if (cb->direction == Qt::RightToLeft) never evaluated: cb->direction == Qt::RightToLeft | 0 |
1014 | editRect.translate(-4 - cb->iconSize.width(), 0); never executed: editRect.translate(-4 - cb->iconSize.width(), 0); | 0 |
1015 | else | - |
1016 | editRect.translate(cb->iconSize.width() + 4, 0); never executed: editRect.translate(cb->iconSize.width() + 4, 0); | 0 |
1017 | } | - |
1018 | if (!cb->currentText.isEmpty() && !cb->editable) { partially evaluated: !cb->currentText.isEmpty() no Evaluation Count:0 | yes Evaluation Count:1 |
never evaluated: !cb->editable | 0-1 |
1019 | proxy()->drawItemText(painter, editRect.adjusted(1, 0, -1, 0), never executed (the execution status of this line is deduced): proxy()->drawItemText(painter, editRect.adjusted(1, 0, -1, 0), | - |
1020 | visualAlignment(cb->direction, Qt::AlignLeft | Qt::AlignVCenter), never executed (the execution status of this line is deduced): visualAlignment(cb->direction, Qt::AlignLeft | Qt::AlignVCenter), | - |
1021 | cb->palette, cb->state & State_Enabled, cb->currentText, never executed (the execution status of this line is deduced): cb->palette, cb->state & State_Enabled, cb->currentText, | - |
1022 | cb->editable ? QPalette::Text : QPalette::ButtonText); never executed (the execution status of this line is deduced): cb->editable ? QPalette::Text : QPalette::ButtonText); | - |
1023 | } | 0 |
1024 | painter->restore(); executed (the execution status of this line is deduced): painter->restore(); | - |
1025 | } executed: } Execution Count:1 | 1 |
1026 | break; executed: break; Execution Count:2 | 2 |
1027 | case CE_Splitter: | - |
1028 | { | - |
1029 | // Dont draw handle for single pixel splitters | - |
1030 | if (option->rect.width() > 1 && option->rect.height() > 1) { partially evaluated: option->rect.width() > 1 yes Evaluation Count:1 | no Evaluation Count:0 |
partially evaluated: option->rect.height() > 1 yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
1031 | //draw grips | - |
1032 | if (option->state & State_Horizontal) { partially evaluated: option->state & State_Horizontal no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
1033 | for (int j = -6 ; j< 12 ; j += 3) { | 0 |
1034 | painter->fillRect(rect.center().x() + 1, rect.center().y() + j, 2, 2, d->lightShade()); never executed (the execution status of this line is deduced): painter->fillRect(rect.center().x() + 1, rect.center().y() + j, 2, 2, d->lightShade()); | - |
1035 | painter->fillRect(rect.center().x() + 1, rect.center().y() + j, 1, 1, d->darkShade()); never executed (the execution status of this line is deduced): painter->fillRect(rect.center().x() + 1, rect.center().y() + j, 1, 1, d->darkShade()); | - |
1036 | } | 0 |
1037 | } else { | 0 |
1038 | for (int i = -6; i< 12 ; i += 3) { evaluated: i< 12 yes Evaluation Count:6 | yes Evaluation Count:1 |
| 1-6 |
1039 | painter->fillRect(rect.center().x() + i, rect.center().y(), 2, 2, d->lightShade()); executed (the execution status of this line is deduced): painter->fillRect(rect.center().x() + i, rect.center().y(), 2, 2, d->lightShade()); | - |
1040 | painter->fillRect(rect.center().x() + i, rect.center().y(), 1, 1, d->darkShade()); executed (the execution status of this line is deduced): painter->fillRect(rect.center().x() + i, rect.center().y(), 1, 1, d->darkShade()); | - |
1041 | } executed: } Execution Count:6 | 6 |
1042 | } executed: } Execution Count:1 | 1 |
1043 | } | - |
1044 | break; executed: break; Execution Count:1 | 1 |
1045 | } | - |
1046 | case CE_RubberBand: | - |
1047 | if (qstyleoption_cast<const QStyleOptionRubberBand *>(option)) { partially evaluated: qstyleoption_cast<const QStyleOptionRubberBand *>(option) no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
1048 | QColor highlight = option->palette.color(QPalette::Active, QPalette::Highlight); never executed (the execution status of this line is deduced): QColor highlight = option->palette.color(QPalette::Active, QPalette::Highlight); | - |
1049 | painter->save(); never executed (the execution status of this line is deduced): painter->save(); | - |
1050 | QColor penColor = highlight.darker(120); never executed (the execution status of this line is deduced): QColor penColor = highlight.darker(120); | - |
1051 | penColor.setAlpha(180); never executed (the execution status of this line is deduced): penColor.setAlpha(180); | - |
1052 | painter->setPen(penColor); never executed (the execution status of this line is deduced): painter->setPen(penColor); | - |
1053 | QColor dimHighlight(qMin(highlight.red()/2 + 110, 255), never executed (the execution status of this line is deduced): QColor dimHighlight(qMin(highlight.red()/2 + 110, 255), | - |
1054 | qMin(highlight.green()/2 + 110, 255), never executed (the execution status of this line is deduced): qMin(highlight.green()/2 + 110, 255), | - |
1055 | qMin(highlight.blue()/2 + 110, 255)); never executed (the execution status of this line is deduced): qMin(highlight.blue()/2 + 110, 255)); | - |
1056 | dimHighlight.setAlpha(widget && widget->isTopLevel() ? 255 : 80); never executed (the execution status of this line is deduced): dimHighlight.setAlpha(widget && widget->isTopLevel() ? 255 : 80); | - |
1057 | QLinearGradient gradient(rect.topLeft(), QPoint(rect.bottomLeft().x(), rect.bottomLeft().y())); never executed (the execution status of this line is deduced): QLinearGradient gradient(rect.topLeft(), QPoint(rect.bottomLeft().x(), rect.bottomLeft().y())); | - |
1058 | gradient.setColorAt(0, dimHighlight.lighter(120)); never executed (the execution status of this line is deduced): gradient.setColorAt(0, dimHighlight.lighter(120)); | - |
1059 | gradient.setColorAt(1, dimHighlight); never executed (the execution status of this line is deduced): gradient.setColorAt(1, dimHighlight); | - |
1060 | painter->setRenderHint(QPainter::Antialiasing, true); never executed (the execution status of this line is deduced): painter->setRenderHint(QPainter::Antialiasing, true); | - |
1061 | painter->translate(0.5, 0.5); never executed (the execution status of this line is deduced): painter->translate(0.5, 0.5); | - |
1062 | painter->setBrush(dimHighlight); never executed (the execution status of this line is deduced): painter->setBrush(dimHighlight); | - |
1063 | painter->drawRoundedRect(option->rect.adjusted(0, 0, -1, -1), 1, 1); never executed (the execution status of this line is deduced): painter->drawRoundedRect(option->rect.adjusted(0, 0, -1, -1), 1, 1); | - |
1064 | QColor innerLine = Qt::white; never executed (the execution status of this line is deduced): QColor innerLine = Qt::white; | - |
1065 | innerLine.setAlpha(40); never executed (the execution status of this line is deduced): innerLine.setAlpha(40); | - |
1066 | painter->setPen(innerLine); never executed (the execution status of this line is deduced): painter->setPen(innerLine); | - |
1067 | painter->drawRoundedRect(option->rect.adjusted(1, 1, -2, -2), 1, 1); never executed (the execution status of this line is deduced): painter->drawRoundedRect(option->rect.adjusted(1, 1, -2, -2), 1, 1); | - |
1068 | painter->restore(); never executed (the execution status of this line is deduced): painter->restore(); | - |
1069 | return; | 0 |
1070 | } | - |
1071 | case CE_SizeGrip: code before this statement executed: case CE_SizeGrip: Execution Count:1 | 1 |
1072 | painter->save(); executed (the execution status of this line is deduced): painter->save(); | - |
1073 | { | - |
1074 | //draw grips | - |
1075 | for (int i = -6; i< 12 ; i += 3) { evaluated: i< 12 yes Evaluation Count:12 | yes Evaluation Count:2 |
| 2-12 |
1076 | for (int j = -6 ; j< 12 ; j += 3) { evaluated: j< 12 yes Evaluation Count:72 | yes Evaluation Count:12 |
| 12-72 |
1077 | if ((option->direction == Qt::LeftToRight && i > -j) || (option->direction == Qt::RightToLeft && j > i) ) { partially evaluated: option->direction == Qt::LeftToRight yes Evaluation Count:72 | no Evaluation Count:0 |
evaluated: i > -j yes Evaluation Count:42 | yes Evaluation Count:30 |
partially evaluated: option->direction == Qt::RightToLeft no Evaluation Count:0 | yes Evaluation Count:30 |
never evaluated: j > i | 0-72 |
1078 | painter->fillRect(rect.center().x() + i, rect.center().y() + j, 2, 2, d->lightShade()); executed (the execution status of this line is deduced): painter->fillRect(rect.center().x() + i, rect.center().y() + j, 2, 2, d->lightShade()); | - |
1079 | painter->fillRect(rect.center().x() + i, rect.center().y() + j, 1, 1, d->darkShade()); executed (the execution status of this line is deduced): painter->fillRect(rect.center().x() + i, rect.center().y() + j, 1, 1, d->darkShade()); | - |
1080 | } executed: } Execution Count:42 | 42 |
1081 | } executed: } Execution Count:72 | 72 |
1082 | } executed: } Execution Count:12 | 12 |
1083 | } | - |
1084 | painter->restore(); executed (the execution status of this line is deduced): painter->restore(); | - |
1085 | break; executed: break; Execution Count:2 | 2 |
1086 | case CE_ToolBar: | - |
1087 | if (const QStyleOptionToolBar *toolBar = qstyleoption_cast<const QStyleOptionToolBar *>(option)) { partially evaluated: const QStyleOptionToolBar *toolBar = qstyleoption_cast<const QStyleOptionToolBar *>(option) no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
1088 | // Reserve the beveled appearance only for mainwindow toolbars | - |
1089 | if (!(widget && qobject_cast<const QMainWindow*> (widget->parentWidget()))) never evaluated: widget never evaluated: qobject_cast<const QMainWindow*> (widget->parentWidget()) | 0 |
1090 | break; | 0 |
1091 | | - |
1092 | // Draws the light line above and the dark line below menu bars and | - |
1093 | // tool bars. | - |
1094 | QLinearGradient gradient(option->rect.topLeft(), option->rect.bottomLeft()); never executed (the execution status of this line is deduced): QLinearGradient gradient(option->rect.topLeft(), option->rect.bottomLeft()); | - |
1095 | if (!(option->state & State_Horizontal)) never evaluated: !(option->state & State_Horizontal) | 0 |
1096 | gradient = QLinearGradient(rect.left(), rect.center().y(), never executed: gradient = QLinearGradient(rect.left(), rect.center().y(), rect.right(), rect.center().y()); | 0 |
1097 | rect.right(), rect.center().y()); never executed: gradient = QLinearGradient(rect.left(), rect.center().y(), rect.right(), rect.center().y()); | 0 |
1098 | gradient.setColorAt(0, option->palette.window().color().lighter(104)); never executed (the execution status of this line is deduced): gradient.setColorAt(0, option->palette.window().color().lighter(104)); | - |
1099 | gradient.setColorAt(1, option->palette.window().color()); never executed (the execution status of this line is deduced): gradient.setColorAt(1, option->palette.window().color()); | - |
1100 | painter->fillRect(option->rect, gradient); never executed (the execution status of this line is deduced): painter->fillRect(option->rect, gradient); | - |
1101 | | - |
1102 | QColor light = d->lightShade(); never executed (the execution status of this line is deduced): QColor light = d->lightShade(); | - |
1103 | QColor shadow = d->darkShade(); never executed (the execution status of this line is deduced): QColor shadow = d->darkShade(); | - |
1104 | | - |
1105 | QPen oldPen = painter->pen(); never executed (the execution status of this line is deduced): QPen oldPen = painter->pen(); | - |
1106 | if (toolBar->toolBarArea == Qt::TopToolBarArea) { never evaluated: toolBar->toolBarArea == Qt::TopToolBarArea | 0 |
1107 | if (toolBar->positionOfLine == QStyleOptionToolBar::End never evaluated: toolBar->positionOfLine == QStyleOptionToolBar::End | 0 |
1108 | || toolBar->positionOfLine == QStyleOptionToolBar::OnlyOne) { never evaluated: toolBar->positionOfLine == QStyleOptionToolBar::OnlyOne | 0 |
1109 | // The end and onlyone top toolbar lines draw a double | - |
1110 | // line at the bottom to blend with the central | - |
1111 | // widget. | - |
1112 | painter->setPen(light); never executed (the execution status of this line is deduced): painter->setPen(light); | - |
1113 | painter->drawLine(option->rect.bottomLeft(), option->rect.bottomRight()); never executed (the execution status of this line is deduced): painter->drawLine(option->rect.bottomLeft(), option->rect.bottomRight()); | - |
1114 | painter->setPen(shadow); never executed (the execution status of this line is deduced): painter->setPen(shadow); | - |
1115 | painter->drawLine(option->rect.left(), option->rect.bottom() - 1, never executed (the execution status of this line is deduced): painter->drawLine(option->rect.left(), option->rect.bottom() - 1, | - |
1116 | option->rect.right(), option->rect.bottom() - 1); never executed (the execution status of this line is deduced): option->rect.right(), option->rect.bottom() - 1); | - |
1117 | } else { | 0 |
1118 | // All others draw a single dark line at the bottom. | - |
1119 | painter->setPen(shadow); never executed (the execution status of this line is deduced): painter->setPen(shadow); | - |
1120 | painter->drawLine(option->rect.bottomLeft(), option->rect.bottomRight()); never executed (the execution status of this line is deduced): painter->drawLine(option->rect.bottomLeft(), option->rect.bottomRight()); | - |
1121 | } | 0 |
1122 | // All top toolbar lines draw a light line at the top. | - |
1123 | painter->setPen(light); never executed (the execution status of this line is deduced): painter->setPen(light); | - |
1124 | painter->drawLine(option->rect.topLeft(), option->rect.topRight()); never executed (the execution status of this line is deduced): painter->drawLine(option->rect.topLeft(), option->rect.topRight()); | - |
1125 | } else if (toolBar->toolBarArea == Qt::BottomToolBarArea) { never executed: } never evaluated: toolBar->toolBarArea == Qt::BottomToolBarArea | 0 |
1126 | if (toolBar->positionOfLine == QStyleOptionToolBar::End never evaluated: toolBar->positionOfLine == QStyleOptionToolBar::End | 0 |
1127 | || toolBar->positionOfLine == QStyleOptionToolBar::Middle) { never evaluated: toolBar->positionOfLine == QStyleOptionToolBar::Middle | 0 |
1128 | // The end and middle bottom tool bar lines draw a dark | - |
1129 | // line at the bottom. | - |
1130 | painter->setPen(shadow); never executed (the execution status of this line is deduced): painter->setPen(shadow); | - |
1131 | painter->drawLine(option->rect.bottomLeft(), option->rect.bottomRight()); never executed (the execution status of this line is deduced): painter->drawLine(option->rect.bottomLeft(), option->rect.bottomRight()); | - |
1132 | } | 0 |
1133 | if (toolBar->positionOfLine == QStyleOptionToolBar::Beginning never evaluated: toolBar->positionOfLine == QStyleOptionToolBar::Beginning | 0 |
1134 | || toolBar->positionOfLine == QStyleOptionToolBar::OnlyOne) { never evaluated: toolBar->positionOfLine == QStyleOptionToolBar::OnlyOne | 0 |
1135 | // The beginning and only one tool bar lines draw a | - |
1136 | // double line at the bottom to blend with the | - |
1137 | // status bar. | - |
1138 | // ### The styleoption could contain whether the | - |
1139 | // main window has a menu bar and a status bar, and | - |
1140 | // possibly dock widgets. | - |
1141 | painter->setPen(shadow); never executed (the execution status of this line is deduced): painter->setPen(shadow); | - |
1142 | painter->drawLine(option->rect.left(), option->rect.bottom() - 1, never executed (the execution status of this line is deduced): painter->drawLine(option->rect.left(), option->rect.bottom() - 1, | - |
1143 | option->rect.right(), option->rect.bottom() - 1); never executed (the execution status of this line is deduced): option->rect.right(), option->rect.bottom() - 1); | - |
1144 | painter->setPen(light); never executed (the execution status of this line is deduced): painter->setPen(light); | - |
1145 | painter->drawLine(option->rect.bottomLeft(), option->rect.bottomRight()); never executed (the execution status of this line is deduced): painter->drawLine(option->rect.bottomLeft(), option->rect.bottomRight()); | - |
1146 | } | 0 |
1147 | if (toolBar->positionOfLine == QStyleOptionToolBar::End) { never evaluated: toolBar->positionOfLine == QStyleOptionToolBar::End | 0 |
1148 | painter->setPen(shadow); never executed (the execution status of this line is deduced): painter->setPen(shadow); | - |
1149 | painter->drawLine(option->rect.topLeft(), option->rect.topRight()); never executed (the execution status of this line is deduced): painter->drawLine(option->rect.topLeft(), option->rect.topRight()); | - |
1150 | painter->setPen(light); never executed (the execution status of this line is deduced): painter->setPen(light); | - |
1151 | painter->drawLine(option->rect.left(), option->rect.top() + 1, never executed (the execution status of this line is deduced): painter->drawLine(option->rect.left(), option->rect.top() + 1, | - |
1152 | option->rect.right(), option->rect.top() + 1); never executed (the execution status of this line is deduced): option->rect.right(), option->rect.top() + 1); | - |
1153 | | - |
1154 | } else { | 0 |
1155 | // All other bottom toolbars draw a light line at the top. | - |
1156 | painter->setPen(light); never executed (the execution status of this line is deduced): painter->setPen(light); | - |
1157 | painter->drawLine(option->rect.topLeft(), option->rect.topRight()); never executed (the execution status of this line is deduced): painter->drawLine(option->rect.topLeft(), option->rect.topRight()); | - |
1158 | } | 0 |
1159 | } | - |
1160 | if (toolBar->toolBarArea == Qt::LeftToolBarArea) { never evaluated: toolBar->toolBarArea == Qt::LeftToolBarArea | 0 |
1161 | if (toolBar->positionOfLine == QStyleOptionToolBar::Middle never evaluated: toolBar->positionOfLine == QStyleOptionToolBar::Middle | 0 |
1162 | || toolBar->positionOfLine == QStyleOptionToolBar::End) { never evaluated: toolBar->positionOfLine == QStyleOptionToolBar::End | 0 |
1163 | // The middle and left end toolbar lines draw a light | - |
1164 | // line to the left. | - |
1165 | painter->setPen(light); never executed (the execution status of this line is deduced): painter->setPen(light); | - |
1166 | painter->drawLine(option->rect.topLeft(), option->rect.bottomLeft()); never executed (the execution status of this line is deduced): painter->drawLine(option->rect.topLeft(), option->rect.bottomLeft()); | - |
1167 | } | 0 |
1168 | if (toolBar->positionOfLine == QStyleOptionToolBar::End) { never evaluated: toolBar->positionOfLine == QStyleOptionToolBar::End | 0 |
1169 | // All other left toolbar lines draw a dark line to the right | - |
1170 | painter->setPen(shadow); never executed (the execution status of this line is deduced): painter->setPen(shadow); | - |
1171 | painter->drawLine(option->rect.right() - 1, option->rect.top(), never executed (the execution status of this line is deduced): painter->drawLine(option->rect.right() - 1, option->rect.top(), | - |
1172 | option->rect.right() - 1, option->rect.bottom()); never executed (the execution status of this line is deduced): option->rect.right() - 1, option->rect.bottom()); | - |
1173 | painter->setPen(light); never executed (the execution status of this line is deduced): painter->setPen(light); | - |
1174 | painter->drawLine(option->rect.topRight(), option->rect.bottomRight()); never executed (the execution status of this line is deduced): painter->drawLine(option->rect.topRight(), option->rect.bottomRight()); | - |
1175 | } else { | 0 |
1176 | // All other left toolbar lines draw a dark line to the right | - |
1177 | painter->setPen(shadow); never executed (the execution status of this line is deduced): painter->setPen(shadow); | - |
1178 | painter->drawLine(option->rect.topRight(), option->rect.bottomRight()); never executed (the execution status of this line is deduced): painter->drawLine(option->rect.topRight(), option->rect.bottomRight()); | - |
1179 | } | 0 |
1180 | } else if (toolBar->toolBarArea == Qt::RightToolBarArea) { never evaluated: toolBar->toolBarArea == Qt::RightToolBarArea | 0 |
1181 | if (toolBar->positionOfLine == QStyleOptionToolBar::Middle never evaluated: toolBar->positionOfLine == QStyleOptionToolBar::Middle | 0 |
1182 | || toolBar->positionOfLine == QStyleOptionToolBar::End) { never evaluated: toolBar->positionOfLine == QStyleOptionToolBar::End | 0 |
1183 | // Right middle and end toolbar lines draw the dark right line | - |
1184 | painter->setPen(shadow); never executed (the execution status of this line is deduced): painter->setPen(shadow); | - |
1185 | painter->drawLine(option->rect.topRight(), option->rect.bottomRight()); never executed (the execution status of this line is deduced): painter->drawLine(option->rect.topRight(), option->rect.bottomRight()); | - |
1186 | } | 0 |
1187 | if (toolBar->positionOfLine == QStyleOptionToolBar::End never evaluated: toolBar->positionOfLine == QStyleOptionToolBar::End | 0 |
1188 | || toolBar->positionOfLine == QStyleOptionToolBar::OnlyOne) { never evaluated: toolBar->positionOfLine == QStyleOptionToolBar::OnlyOne | 0 |
1189 | // The right end and single toolbar draws the dark | - |
1190 | // line on its left edge | - |
1191 | painter->setPen(shadow); never executed (the execution status of this line is deduced): painter->setPen(shadow); | - |
1192 | painter->drawLine(option->rect.topLeft(), option->rect.bottomLeft()); never executed (the execution status of this line is deduced): painter->drawLine(option->rect.topLeft(), option->rect.bottomLeft()); | - |
1193 | // And a light line next to it | - |
1194 | painter->setPen(light); never executed (the execution status of this line is deduced): painter->setPen(light); | - |
1195 | painter->drawLine(option->rect.left() + 1, option->rect.top(), never executed (the execution status of this line is deduced): painter->drawLine(option->rect.left() + 1, option->rect.top(), | - |
1196 | option->rect.left() + 1, option->rect.bottom()); never executed (the execution status of this line is deduced): option->rect.left() + 1, option->rect.bottom()); | - |
1197 | } else { | 0 |
1198 | // Other right toolbars draw a light line on its left edge | - |
1199 | painter->setPen(light); never executed (the execution status of this line is deduced): painter->setPen(light); | - |
1200 | painter->drawLine(option->rect.topLeft(), option->rect.bottomLeft()); never executed (the execution status of this line is deduced): painter->drawLine(option->rect.topLeft(), option->rect.bottomLeft()); | - |
1201 | } | 0 |
1202 | } | - |
1203 | painter->setPen(oldPen); never executed (the execution status of this line is deduced): painter->setPen(oldPen); | - |
1204 | } | 0 |
1205 | break; executed: break; Execution Count:1 | 1 |
1206 | case CE_DockWidgetTitle: | - |
1207 | painter->save(); executed (the execution status of this line is deduced): painter->save(); | - |
1208 | if (const QStyleOptionDockWidget *dwOpt = qstyleoption_cast<const QStyleOptionDockWidget *>(option)) { partially evaluated: const QStyleOptionDockWidget *dwOpt = qstyleoption_cast<const QStyleOptionDockWidget *>(option) no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
1209 | bool verticalTitleBar = dwOpt->verticalTitleBar; never executed (the execution status of this line is deduced): bool verticalTitleBar = dwOpt->verticalTitleBar; | - |
1210 | | - |
1211 | QRect titleRect = subElementRect(SE_DockWidgetTitleBarText, option, widget); never executed (the execution status of this line is deduced): QRect titleRect = subElementRect(SE_DockWidgetTitleBarText, option, widget); | - |
1212 | if (verticalTitleBar) { never evaluated: verticalTitleBar | 0 |
1213 | QRect rect = dwOpt->rect; never executed (the execution status of this line is deduced): QRect rect = dwOpt->rect; | - |
1214 | QRect r = rect; never executed (the execution status of this line is deduced): QRect r = rect; | - |
1215 | QSize s = r.size(); never executed (the execution status of this line is deduced): QSize s = r.size(); | - |
1216 | s.transpose(); never executed (the execution status of this line is deduced): s.transpose(); | - |
1217 | r.setSize(s); never executed (the execution status of this line is deduced): r.setSize(s); | - |
1218 | titleRect = QRect(r.left() + rect.bottom() never executed (the execution status of this line is deduced): titleRect = QRect(r.left() + rect.bottom() | - |
1219 | - titleRect.bottom(), never executed (the execution status of this line is deduced): - titleRect.bottom(), | - |
1220 | r.top() + titleRect.left() - rect.left(), never executed (the execution status of this line is deduced): r.top() + titleRect.left() - rect.left(), | - |
1221 | titleRect.height(), titleRect.width()); never executed (the execution status of this line is deduced): titleRect.height(), titleRect.width()); | - |
1222 | } | 0 |
1223 | | - |
1224 | if (!dwOpt->title.isEmpty()) { never evaluated: !dwOpt->title.isEmpty() | 0 |
1225 | QString titleText never executed (the execution status of this line is deduced): QString titleText | - |
1226 | = painter->fontMetrics().elidedText(dwOpt->title, never executed (the execution status of this line is deduced): = painter->fontMetrics().elidedText(dwOpt->title, | - |
1227 | Qt::ElideRight, titleRect.width()); never executed (the execution status of this line is deduced): Qt::ElideRight, titleRect.width()); | - |
1228 | proxy()->drawItemText(painter, never executed (the execution status of this line is deduced): proxy()->drawItemText(painter, | - |
1229 | titleRect, never executed (the execution status of this line is deduced): titleRect, | - |
1230 | Qt::AlignLeft | Qt::AlignVCenter | Qt::TextShowMnemonic, dwOpt->palette, never executed (the execution status of this line is deduced): Qt::AlignLeft | Qt::AlignVCenter | Qt::TextShowMnemonic, dwOpt->palette, | - |
1231 | dwOpt->state & State_Enabled, titleText, never executed (the execution status of this line is deduced): dwOpt->state & State_Enabled, titleText, | - |
1232 | QPalette::WindowText); never executed (the execution status of this line is deduced): QPalette::WindowText); | - |
1233 | } | 0 |
1234 | } | 0 |
1235 | painter->restore(); executed (the execution status of this line is deduced): painter->restore(); | - |
1236 | break; executed: break; Execution Count:1 | 1 |
1237 | case CE_HeaderSection: | - |
1238 | painter->save(); executed (the execution status of this line is deduced): painter->save(); | - |
1239 | // Draws the header in tables. | - |
1240 | if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option)) { partially evaluated: const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option) no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
1241 | QString pixmapName = QStyleHelper::uniqueName(QLatin1String("headersection"), option, option->rect.size()); never executed (the execution status of this line is deduced): QString pixmapName = QStyleHelper::uniqueName(QLatin1String("headersection"), option, option->rect.size()); | - |
1242 | pixmapName += QString::number(- int(header->position)); never executed (the execution status of this line is deduced): pixmapName += QString::number(- int(header->position)); | - |
1243 | pixmapName += QString::number(- int(header->orientation)); never executed (the execution status of this line is deduced): pixmapName += QString::number(- int(header->orientation)); | - |
1244 | | - |
1245 | QPixmap cache; never executed (the execution status of this line is deduced): QPixmap cache; | - |
1246 | if (!QPixmapCache::find(pixmapName, cache)) { never evaluated: !QPixmapCache::find(pixmapName, cache) | 0 |
1247 | cache = styleCachePixmap(rect.size()); never executed (the execution status of this line is deduced): cache = styleCachePixmap(rect.size()); | - |
1248 | cache.fill(Qt::transparent); never executed (the execution status of this line is deduced): cache.fill(Qt::transparent); | - |
1249 | QRect pixmapRect(0, 0, rect.width(), rect.height()); never executed (the execution status of this line is deduced): QRect pixmapRect(0, 0, rect.width(), rect.height()); | - |
1250 | QPainter cachePainter(&cache); never executed (the execution status of this line is deduced): QPainter cachePainter(&cache); | - |
1251 | QColor buttonColor = d->buttonColor(option->palette); never executed (the execution status of this line is deduced): QColor buttonColor = d->buttonColor(option->palette); | - |
1252 | QColor gradientStopColor; never executed (the execution status of this line is deduced): QColor gradientStopColor; | - |
1253 | QColor gradientStartColor = buttonColor.lighter(104); never executed (the execution status of this line is deduced): QColor gradientStartColor = buttonColor.lighter(104); | - |
1254 | gradientStopColor = buttonColor.darker(102); never executed (the execution status of this line is deduced): gradientStopColor = buttonColor.darker(102); | - |
1255 | QLinearGradient gradient(pixmapRect.topLeft(), pixmapRect.bottomLeft()); never executed (the execution status of this line is deduced): QLinearGradient gradient(pixmapRect.topLeft(), pixmapRect.bottomLeft()); | - |
1256 | | - |
1257 | if (option->palette.background().gradient()) { never evaluated: option->palette.background().gradient() | 0 |
1258 | gradient.setStops(option->palette.background().gradient()->stops()); never executed (the execution status of this line is deduced): gradient.setStops(option->palette.background().gradient()->stops()); | - |
1259 | } else { | 0 |
1260 | QColor midColor1 = mergedColors(gradientStartColor, gradientStopColor, 60); never executed (the execution status of this line is deduced): QColor midColor1 = mergedColors(gradientStartColor, gradientStopColor, 60); | - |
1261 | QColor midColor2 = mergedColors(gradientStartColor, gradientStopColor, 40); never executed (the execution status of this line is deduced): QColor midColor2 = mergedColors(gradientStartColor, gradientStopColor, 40); | - |
1262 | gradient.setColorAt(0, gradientStartColor); never executed (the execution status of this line is deduced): gradient.setColorAt(0, gradientStartColor); | - |
1263 | gradient.setColorAt(0.5, midColor1); never executed (the execution status of this line is deduced): gradient.setColorAt(0.5, midColor1); | - |
1264 | gradient.setColorAt(0.501, midColor2); never executed (the execution status of this line is deduced): gradient.setColorAt(0.501, midColor2); | - |
1265 | gradient.setColorAt(0.92, gradientStopColor); never executed (the execution status of this line is deduced): gradient.setColorAt(0.92, gradientStopColor); | - |
1266 | gradient.setColorAt(1, gradientStopColor.darker(104)); never executed (the execution status of this line is deduced): gradient.setColorAt(1, gradientStopColor.darker(104)); | - |
1267 | } | 0 |
1268 | cachePainter.fillRect(pixmapRect, gradient); never executed (the execution status of this line is deduced): cachePainter.fillRect(pixmapRect, gradient); | - |
1269 | cachePainter.setPen(d->innerContrastLine()); never executed (the execution status of this line is deduced): cachePainter.setPen(d->innerContrastLine()); | - |
1270 | cachePainter.setBrush(Qt::NoBrush); never executed (the execution status of this line is deduced): cachePainter.setBrush(Qt::NoBrush); | - |
1271 | cachePainter.drawLine(pixmapRect.topLeft(), pixmapRect.topRight()); never executed (the execution status of this line is deduced): cachePainter.drawLine(pixmapRect.topLeft(), pixmapRect.topRight()); | - |
1272 | cachePainter.setPen(d->outline(option->palette)); never executed (the execution status of this line is deduced): cachePainter.setPen(d->outline(option->palette)); | - |
1273 | cachePainter.drawLine(pixmapRect.bottomLeft(), pixmapRect.bottomRight()); never executed (the execution status of this line is deduced): cachePainter.drawLine(pixmapRect.bottomLeft(), pixmapRect.bottomRight()); | - |
1274 | | - |
1275 | if (header->orientation == Qt::Horizontal && never evaluated: header->orientation == Qt::Horizontal | 0 |
1276 | header->position != QStyleOptionHeader::End && never evaluated: header->position != QStyleOptionHeader::End | 0 |
1277 | header->position != QStyleOptionHeader::OnlyOneSection) { never evaluated: header->position != QStyleOptionHeader::OnlyOneSection | 0 |
1278 | cachePainter.setPen(QColor(0, 0, 0, 40)); never executed (the execution status of this line is deduced): cachePainter.setPen(QColor(0, 0, 0, 40)); | - |
1279 | cachePainter.drawLine(pixmapRect.topRight(), pixmapRect.bottomRight() + QPoint(0, -1)); never executed (the execution status of this line is deduced): cachePainter.drawLine(pixmapRect.topRight(), pixmapRect.bottomRight() + QPoint(0, -1)); | - |
1280 | cachePainter.setPen(d->innerContrastLine()); never executed (the execution status of this line is deduced): cachePainter.setPen(d->innerContrastLine()); | - |
1281 | cachePainter.drawLine(pixmapRect.topRight() + QPoint(-1, 0), pixmapRect.bottomRight() + QPoint(-1, -1)); never executed (the execution status of this line is deduced): cachePainter.drawLine(pixmapRect.topRight() + QPoint(-1, 0), pixmapRect.bottomRight() + QPoint(-1, -1)); | - |
1282 | } else if (header->orientation == Qt::Vertical) { never executed: } never evaluated: header->orientation == Qt::Vertical | 0 |
1283 | cachePainter.setPen(d->outline(option->palette)); never executed (the execution status of this line is deduced): cachePainter.setPen(d->outline(option->palette)); | - |
1284 | cachePainter.drawLine(pixmapRect.topRight(), pixmapRect.bottomRight()); never executed (the execution status of this line is deduced): cachePainter.drawLine(pixmapRect.topRight(), pixmapRect.bottomRight()); | - |
1285 | } | 0 |
1286 | cachePainter.end(); never executed (the execution status of this line is deduced): cachePainter.end(); | - |
1287 | QPixmapCache::insert(pixmapName, cache); never executed (the execution status of this line is deduced): QPixmapCache::insert(pixmapName, cache); | - |
1288 | } | 0 |
1289 | painter->drawPixmap(rect.topLeft(), cache); never executed (the execution status of this line is deduced): painter->drawPixmap(rect.topLeft(), cache); | - |
1290 | } | 0 |
1291 | painter->restore(); executed (the execution status of this line is deduced): painter->restore(); | - |
1292 | break; executed: break; Execution Count:1 | 1 |
1293 | case CE_ProgressBarGroove: | - |
1294 | painter->save(); executed (the execution status of this line is deduced): painter->save(); | - |
1295 | { | - |
1296 | painter->setRenderHint(QPainter::Antialiasing, true); executed (the execution status of this line is deduced): painter->setRenderHint(QPainter::Antialiasing, true); | - |
1297 | painter->translate(0.5, 0.5); executed (the execution status of this line is deduced): painter->translate(0.5, 0.5); | - |
1298 | | - |
1299 | QColor shadowAlpha = Qt::black; executed (the execution status of this line is deduced): QColor shadowAlpha = Qt::black; | - |
1300 | shadowAlpha.setAlpha(16); executed (the execution status of this line is deduced): shadowAlpha.setAlpha(16); | - |
1301 | painter->setPen(shadowAlpha); executed (the execution status of this line is deduced): painter->setPen(shadowAlpha); | - |
1302 | painter->drawLine(rect.topLeft() - QPoint(0, 1), rect.topRight() - QPoint(0, 1)); executed (the execution status of this line is deduced): painter->drawLine(rect.topLeft() - QPoint(0, 1), rect.topRight() - QPoint(0, 1)); | - |
1303 | | - |
1304 | painter->setBrush(option->palette.base()); executed (the execution status of this line is deduced): painter->setBrush(option->palette.base()); | - |
1305 | painter->setPen(QPen(outline)); executed (the execution status of this line is deduced): painter->setPen(QPen(outline)); | - |
1306 | painter->drawRoundedRect(rect.adjusted(0, 0, -1, -1), 2, 2); executed (the execution status of this line is deduced): painter->drawRoundedRect(rect.adjusted(0, 0, -1, -1), 2, 2); | - |
1307 | | - |
1308 | // Inner shadow | - |
1309 | painter->setPen(d->topShadow()); executed (the execution status of this line is deduced): painter->setPen(d->topShadow()); | - |
1310 | painter->drawLine(QPoint(rect.left() + 1, rect.top() + 1), executed (the execution status of this line is deduced): painter->drawLine(QPoint(rect.left() + 1, rect.top() + 1), | - |
1311 | QPoint(rect.right() - 1, rect.top() + 1)); executed (the execution status of this line is deduced): QPoint(rect.right() - 1, rect.top() + 1)); | - |
1312 | } | - |
1313 | painter->restore(); executed (the execution status of this line is deduced): painter->restore(); | - |
1314 | break; executed: break; Execution Count:3 | 3 |
1315 | case CE_ProgressBarContents: | - |
1316 | painter->save(); executed (the execution status of this line is deduced): painter->save(); | - |
1317 | painter->setRenderHint(QPainter::Antialiasing, true); executed (the execution status of this line is deduced): painter->setRenderHint(QPainter::Antialiasing, true); | - |
1318 | painter->translate(0.5, 0.5); executed (the execution status of this line is deduced): painter->translate(0.5, 0.5); | - |
1319 | if (const QStyleOptionProgressBar *bar = qstyleoption_cast<const QStyleOptionProgressBar *>(option)) { evaluated: const QStyleOptionProgressBar *bar = qstyleoption_cast<const QStyleOptionProgressBar *>(option) yes Evaluation Count:2 | yes Evaluation Count:1 |
| 1-2 |
1320 | bool vertical = false; executed (the execution status of this line is deduced): bool vertical = false; | - |
1321 | bool inverted = false; executed (the execution status of this line is deduced): bool inverted = false; | - |
1322 | bool indeterminate = (bar->minimum == 0 && bar->maximum == 0); partially evaluated: bar->minimum == 0 yes Evaluation Count:2 | no Evaluation Count:0 |
partially evaluated: bar->maximum == 0 no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
1323 | bool complete = bar->progress == bar->maximum; executed (the execution status of this line is deduced): bool complete = bar->progress == bar->maximum; | - |
1324 | | - |
1325 | // Get extra style options if version 2 | - |
1326 | vertical = (bar->orientation == Qt::Vertical); executed (the execution status of this line is deduced): vertical = (bar->orientation == Qt::Vertical); | - |
1327 | inverted = bar->invertedAppearance; executed (the execution status of this line is deduced): inverted = bar->invertedAppearance; | - |
1328 | | - |
1329 | // If the orientation is vertical, we use a transform to rotate | - |
1330 | // the progress bar 90 degrees clockwise. This way we can use the | - |
1331 | // same rendering code for both orientations. | - |
1332 | if (vertical) { partially evaluated: vertical no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
1333 | rect = QRect(rect.left(), rect.top(), rect.height(), rect.width()); // flip width and height never executed (the execution status of this line is deduced): rect = QRect(rect.left(), rect.top(), rect.height(), rect.width()); | - |
1334 | QTransform m = QTransform::fromTranslate(rect.height()-1, -1.0); never executed (the execution status of this line is deduced): QTransform m = QTransform::fromTranslate(rect.height()-1, -1.0); | - |
1335 | m.rotate(90.0); never executed (the execution status of this line is deduced): m.rotate(90.0); | - |
1336 | painter->setTransform(m, true); never executed (the execution status of this line is deduced): painter->setTransform(m, true); | - |
1337 | } | 0 |
1338 | | - |
1339 | int maxWidth = rect.width(); executed (the execution status of this line is deduced): int maxWidth = rect.width(); | - |
1340 | int minWidth = 0; executed (the execution status of this line is deduced): int minWidth = 0; | - |
1341 | qreal progress = qMax(bar->progress, bar->minimum); // workaround for bug in QProgressBar executed (the execution status of this line is deduced): qreal progress = qMax(bar->progress, bar->minimum); | - |
1342 | int progressBarWidth = (progress - bar->minimum) * qreal(maxWidth) / qMax(qreal(1.0), qreal(bar->maximum) - bar->minimum); executed (the execution status of this line is deduced): int progressBarWidth = (progress - bar->minimum) * qreal(maxWidth) / qMax(qreal(1.0), qreal(bar->maximum) - bar->minimum); | - |
1343 | int width = indeterminate ? maxWidth : qMax(minWidth, progressBarWidth); partially evaluated: indeterminate no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
1344 | | - |
1345 | bool reverse = (!vertical && (bar->direction == Qt::RightToLeft)) || vertical; partially evaluated: !vertical yes Evaluation Count:2 | no Evaluation Count:0 |
partially evaluated: (bar->direction == Qt::RightToLeft) no Evaluation Count:0 | yes Evaluation Count:2 |
partially evaluated: vertical no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
1346 | if (inverted) partially evaluated: inverted no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
1347 | reverse = !reverse; never executed: reverse = !reverse; | 0 |
1348 | | - |
1349 | int step = 0; executed (the execution status of this line is deduced): int step = 0; | - |
1350 | QRect progressBar; executed (the execution status of this line is deduced): QRect progressBar; | - |
1351 | QColor highlight = d->highlight(option->palette); executed (the execution status of this line is deduced): QColor highlight = d->highlight(option->palette); | - |
1352 | QColor highlightedoutline = highlight.darker(140); executed (the execution status of this line is deduced): QColor highlightedoutline = highlight.darker(140); | - |
1353 | if (qGray(outline.rgb()) > qGray(highlightedoutline.rgb())) partially evaluated: qGray(outline.rgb()) > qGray(highlightedoutline.rgb()) yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
1354 | outline = highlightedoutline; executed: outline = highlightedoutline; Execution Count:2 | 2 |
1355 | | - |
1356 | if (!indeterminate) { partially evaluated: !indeterminate yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
1357 | QColor innerShadow(Qt::black); executed (the execution status of this line is deduced): QColor innerShadow(Qt::black); | - |
1358 | innerShadow.setAlpha(35); executed (the execution status of this line is deduced): innerShadow.setAlpha(35); | - |
1359 | painter->setPen(innerShadow); executed (the execution status of this line is deduced): painter->setPen(innerShadow); | - |
1360 | if (!reverse) { partially evaluated: !reverse yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
1361 | progressBar.setRect(rect.left(), rect.top(), width - 1, rect.height() - 1); executed (the execution status of this line is deduced): progressBar.setRect(rect.left(), rect.top(), width - 1, rect.height() - 1); | - |
1362 | if (!complete) { partially evaluated: !complete yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
1363 | painter->drawLine(progressBar.topRight() + QPoint(2, 1), progressBar.bottomRight() + QPoint(2, 0)); executed (the execution status of this line is deduced): painter->drawLine(progressBar.topRight() + QPoint(2, 1), progressBar.bottomRight() + QPoint(2, 0)); | - |
1364 | painter->setPen(QPen(highlight.darker(140))); executed (the execution status of this line is deduced): painter->setPen(QPen(highlight.darker(140))); | - |
1365 | painter->drawLine(progressBar.topRight() + QPoint(1, 1), progressBar.bottomRight() + QPoint(1, 0)); executed (the execution status of this line is deduced): painter->drawLine(progressBar.topRight() + QPoint(1, 1), progressBar.bottomRight() + QPoint(1, 0)); | - |
1366 | } executed: } Execution Count:2 | 2 |
1367 | } else { executed: } Execution Count:2 | 2 |
1368 | progressBar.setRect(rect.right() - width - 1, rect.top(), width + 2, rect.height() - 1); never executed (the execution status of this line is deduced): progressBar.setRect(rect.right() - width - 1, rect.top(), width + 2, rect.height() - 1); | - |
1369 | if (!complete) { never evaluated: !complete | 0 |
1370 | painter->drawLine(progressBar.topLeft() + QPoint(-2, 1), progressBar.bottomLeft() + QPoint(-2, 0)); never executed (the execution status of this line is deduced): painter->drawLine(progressBar.topLeft() + QPoint(-2, 1), progressBar.bottomLeft() + QPoint(-2, 0)); | - |
1371 | painter->setPen(QPen(highlight.darker(140))); never executed (the execution status of this line is deduced): painter->setPen(QPen(highlight.darker(140))); | - |
1372 | painter->drawLine(progressBar.topLeft() + QPoint(-1, 1), progressBar.bottomLeft() + QPoint(-1, 0)); never executed (the execution status of this line is deduced): painter->drawLine(progressBar.topLeft() + QPoint(-1, 1), progressBar.bottomLeft() + QPoint(-1, 0)); | - |
1373 | } | 0 |
1374 | } | 0 |
1375 | } else { | - |
1376 | progressBar.setRect(rect.left(), rect.top(), rect.width() - 1, rect.height() - 1); never executed (the execution status of this line is deduced): progressBar.setRect(rect.left(), rect.top(), rect.width() - 1, rect.height() - 1); | - |
1377 | } | 0 |
1378 | | - |
1379 | if (indeterminate || bar->progress > bar->minimum) { partially evaluated: indeterminate no Evaluation Count:0 | yes Evaluation Count:2 |
partially evaluated: bar->progress > bar->minimum no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
1380 | | - |
1381 | painter->setPen(QPen(outline)); never executed (the execution status of this line is deduced): painter->setPen(QPen(outline)); | - |
1382 | | - |
1383 | QColor highlightedGradientStartColor = highlight.lighter(120); never executed (the execution status of this line is deduced): QColor highlightedGradientStartColor = highlight.lighter(120); | - |
1384 | QColor highlightedGradientStopColor = highlight; never executed (the execution status of this line is deduced): QColor highlightedGradientStopColor = highlight; | - |
1385 | QLinearGradient gradient(rect.topLeft(), QPoint(rect.bottomLeft().x(), rect.bottomLeft().y())); never executed (the execution status of this line is deduced): QLinearGradient gradient(rect.topLeft(), QPoint(rect.bottomLeft().x(), rect.bottomLeft().y())); | - |
1386 | gradient.setColorAt(0, highlightedGradientStartColor); never executed (the execution status of this line is deduced): gradient.setColorAt(0, highlightedGradientStartColor); | - |
1387 | gradient.setColorAt(1, highlightedGradientStopColor); never executed (the execution status of this line is deduced): gradient.setColorAt(1, highlightedGradientStopColor); | - |
1388 | | - |
1389 | painter->setBrush(gradient); never executed (the execution status of this line is deduced): painter->setBrush(gradient); | - |
1390 | | - |
1391 | painter->save(); never executed (the execution status of this line is deduced): painter->save(); | - |
1392 | if (!complete && !indeterminate) never evaluated: !complete never evaluated: !indeterminate | 0 |
1393 | painter->setClipRect(progressBar.adjusted(-1, -1, -1, 1)); never executed: painter->setClipRect(progressBar.adjusted(-1, -1, -1, 1)); | 0 |
1394 | QRect fillRect = progressBar.adjusted( !indeterminate && !complete && reverse ? -2 : 0, 0, never executed (the execution status of this line is deduced): QRect fillRect = progressBar.adjusted( !indeterminate && !complete && reverse ? -2 : 0, 0, | - |
1395 | indeterminate || complete || reverse ? 0 : 2, 0); never executed (the execution status of this line is deduced): indeterminate || complete || reverse ? 0 : 2, 0); | - |
1396 | painter->drawRoundedRect(fillRect, 2, 2); never executed (the execution status of this line is deduced): painter->drawRoundedRect(fillRect, 2, 2); | - |
1397 | painter->restore(); never executed (the execution status of this line is deduced): painter->restore(); | - |
1398 | | - |
1399 | painter->setBrush(Qt::NoBrush); never executed (the execution status of this line is deduced): painter->setBrush(Qt::NoBrush); | - |
1400 | painter->setPen(QColor(255, 255, 255, 50)); never executed (the execution status of this line is deduced): painter->setPen(QColor(255, 255, 255, 50)); | - |
1401 | painter->drawRoundedRect(progressBar.adjusted(1, 1, -1, -1), 1, 1); never executed (the execution status of this line is deduced): painter->drawRoundedRect(progressBar.adjusted(1, 1, -1, -1), 1, 1); | - |
1402 | | - |
1403 | if (!indeterminate) { never evaluated: !indeterminate | 0 |
1404 | (const_cast<QFusionStylePrivate*>(d))->stopAnimation(option->styleObject); never executed (the execution status of this line is deduced): (const_cast<QFusionStylePrivate*>(d))->stopAnimation(option->styleObject); | - |
1405 | } else { | 0 |
1406 | highlightedGradientStartColor.setAlpha(120); never executed (the execution status of this line is deduced): highlightedGradientStartColor.setAlpha(120); | - |
1407 | painter->setPen(QPen(highlightedGradientStartColor, 9.0)); never executed (the execution status of this line is deduced): painter->setPen(QPen(highlightedGradientStartColor, 9.0)); | - |
1408 | painter->setClipRect(progressBar.adjusted(1, 1, -1, -1)); never executed (the execution status of this line is deduced): painter->setClipRect(progressBar.adjusted(1, 1, -1, -1)); | - |
1409 | #ifndef QT_NO_ANIMATION | - |
1410 | if (QProgressStyleAnimation *animation = qobject_cast<QProgressStyleAnimation*>(d->animation(option->styleObject))) never evaluated: QProgressStyleAnimation *animation = qobject_cast<QProgressStyleAnimation*>(d->animation(option->styleObject)) | 0 |
1411 | step = animation->animationStep() % 22; never executed: step = animation->animationStep() % 22; | 0 |
1412 | else | - |
1413 | (const_cast<QFusionStylePrivate*>(d))->startAnimation(new QProgressStyleAnimation(d->animationFps, option->styleObject)); never executed: (const_cast<QFusionStylePrivate*>(d))->startAnimation(new QProgressStyleAnimation(d->animationFps, option->styleObject)); | 0 |
1414 | #endif | - |
1415 | for (int x = progressBar.left() - rect.height(); x < rect.right() ; x += 22) never evaluated: x < rect.right() | 0 |
1416 | painter->drawLine(x + step, progressBar.bottom() + 1, never executed: painter->drawLine(x + step, progressBar.bottom() + 1, x + rect.height() + step, progressBar.top() - 2); | 0 |
1417 | x + rect.height() + step, progressBar.top() - 2); never executed: painter->drawLine(x + step, progressBar.bottom() + 1, x + rect.height() + step, progressBar.top() - 2); | 0 |
1418 | } | 0 |
1419 | } | - |
1420 | } executed: } Execution Count:2 | 2 |
1421 | painter->restore(); executed (the execution status of this line is deduced): painter->restore(); | - |
1422 | break; executed: break; Execution Count:3 | 3 |
1423 | case CE_ProgressBarLabel: | - |
1424 | if (const QStyleOptionProgressBar *bar = qstyleoption_cast<const QStyleOptionProgressBar *>(option)) { evaluated: const QStyleOptionProgressBar *bar = qstyleoption_cast<const QStyleOptionProgressBar *>(option) yes Evaluation Count:2 | yes Evaluation Count:1 |
| 1-2 |
1425 | QRect leftRect; executed (the execution status of this line is deduced): QRect leftRect; | - |
1426 | QRect rect = bar->rect; executed (the execution status of this line is deduced): QRect rect = bar->rect; | - |
1427 | QColor textColor = option->palette.text().color(); executed (the execution status of this line is deduced): QColor textColor = option->palette.text().color(); | - |
1428 | QColor alternateTextColor = d->highlightedText(option->palette); executed (the execution status of this line is deduced): QColor alternateTextColor = d->highlightedText(option->palette); | - |
1429 | | - |
1430 | painter->save(); executed (the execution status of this line is deduced): painter->save(); | - |
1431 | bool vertical = false, inverted = false; executed (the execution status of this line is deduced): bool vertical = false, inverted = false; | - |
1432 | vertical = (bar->orientation == Qt::Vertical); executed (the execution status of this line is deduced): vertical = (bar->orientation == Qt::Vertical); | - |
1433 | inverted = bar->invertedAppearance; executed (the execution status of this line is deduced): inverted = bar->invertedAppearance; | - |
1434 | if (vertical) partially evaluated: vertical no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
1435 | rect = QRect(rect.left(), rect.top(), rect.height(), rect.width()); // flip width and height never executed: rect = QRect(rect.left(), rect.top(), rect.height(), rect.width()); | 0 |
1436 | const int progressIndicatorPos = (bar->progress - qreal(bar->minimum)) * rect.width() / executed (the execution status of this line is deduced): const int progressIndicatorPos = (bar->progress - qreal(bar->minimum)) * rect.width() / | - |
1437 | qMax(qreal(1.0), qreal(bar->maximum) - bar->minimum); executed (the execution status of this line is deduced): qMax(qreal(1.0), qreal(bar->maximum) - bar->minimum); | - |
1438 | if (progressIndicatorPos >= 0 && progressIndicatorPos <= rect.width()) partially evaluated: progressIndicatorPos >= 0 no Evaluation Count:0 | yes Evaluation Count:2 |
never evaluated: progressIndicatorPos <= rect.width() | 0-2 |
1439 | leftRect = QRect(rect.left(), rect.top(), progressIndicatorPos, rect.height()); never executed: leftRect = QRect(rect.left(), rect.top(), progressIndicatorPos, rect.height()); | 0 |
1440 | if (vertical) partially evaluated: vertical no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
1441 | leftRect.translate(rect.width() - progressIndicatorPos, 0); never executed: leftRect.translate(rect.width() - progressIndicatorPos, 0); | 0 |
1442 | | - |
1443 | bool flip = (!vertical && (((bar->direction == Qt::RightToLeft) && !inverted) || partially evaluated: !vertical yes Evaluation Count:2 | no Evaluation Count:0 |
partially evaluated: (bar->direction == Qt::RightToLeft) no Evaluation Count:0 | yes Evaluation Count:2 |
never evaluated: !inverted | 0-2 |
1444 | ((bar->direction == Qt::LeftToRight) && inverted))); partially evaluated: (bar->direction == Qt::LeftToRight) yes Evaluation Count:2 | no Evaluation Count:0 |
partially evaluated: inverted no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
1445 | | - |
1446 | QRegion rightRect = rect; executed (the execution status of this line is deduced): QRegion rightRect = rect; | - |
1447 | rightRect = rightRect.subtracted(leftRect); executed (the execution status of this line is deduced): rightRect = rightRect.subtracted(leftRect); | - |
1448 | painter->setClipRegion(rightRect); executed (the execution status of this line is deduced): painter->setClipRegion(rightRect); | - |
1449 | painter->setPen(flip ? alternateTextColor : textColor); executed (the execution status of this line is deduced): painter->setPen(flip ? alternateTextColor : textColor); | - |
1450 | painter->drawText(rect, bar->text, QTextOption(Qt::AlignAbsolute | Qt::AlignHCenter | Qt::AlignVCenter)); executed (the execution status of this line is deduced): painter->drawText(rect, bar->text, QTextOption(Qt::AlignAbsolute | Qt::AlignHCenter | Qt::AlignVCenter)); | - |
1451 | if (!leftRect.isNull()) { partially evaluated: !leftRect.isNull() no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
1452 | painter->setPen(flip ? textColor : alternateTextColor); never executed (the execution status of this line is deduced): painter->setPen(flip ? textColor : alternateTextColor); | - |
1453 | painter->setClipRect(leftRect); never executed (the execution status of this line is deduced): painter->setClipRect(leftRect); | - |
1454 | painter->drawText(rect, bar->text, QTextOption(Qt::AlignAbsolute | Qt::AlignHCenter | Qt::AlignVCenter)); never executed (the execution status of this line is deduced): painter->drawText(rect, bar->text, QTextOption(Qt::AlignAbsolute | Qt::AlignHCenter | Qt::AlignVCenter)); | - |
1455 | } | 0 |
1456 | painter->restore(); executed (the execution status of this line is deduced): painter->restore(); | - |
1457 | } executed: } Execution Count:2 | 2 |
1458 | break; executed: break; Execution Count:3 | 3 |
1459 | case CE_MenuBarItem: | - |
1460 | painter->save(); executed (the execution status of this line is deduced): painter->save(); | - |
1461 | if (const QStyleOptionMenuItem *mbi = qstyleoption_cast<const QStyleOptionMenuItem *>(option)) partially evaluated: const QStyleOptionMenuItem *mbi = qstyleoption_cast<const QStyleOptionMenuItem *>(option) no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
1462 | { | - |
1463 | QStyleOptionMenuItem item = *mbi; never executed (the execution status of this line is deduced): QStyleOptionMenuItem item = *mbi; | - |
1464 | item.rect = mbi->rect.adjusted(0, 1, 0, -3); never executed (the execution status of this line is deduced): item.rect = mbi->rect.adjusted(0, 1, 0, -3); | - |
1465 | QColor highlightOutline = option->palette.highlight().color().darker(125); never executed (the execution status of this line is deduced): QColor highlightOutline = option->palette.highlight().color().darker(125); | - |
1466 | painter->fillRect(rect, option->palette.window()); never executed (the execution status of this line is deduced): painter->fillRect(rect, option->palette.window()); | - |
1467 | | - |
1468 | QCommonStyle::drawControl(element, &item, painter, widget); never executed (the execution status of this line is deduced): QCommonStyle::drawControl(element, &item, painter, widget); | - |
1469 | | - |
1470 | bool act = mbi->state & State_Selected && mbi->state & State_Sunken; never evaluated: mbi->state & State_Selected never evaluated: mbi->state & State_Sunken | 0 |
1471 | bool dis = !(mbi->state & State_Enabled); never executed (the execution status of this line is deduced): bool dis = !(mbi->state & State_Enabled); | - |
1472 | | - |
1473 | QRect r = option->rect; never executed (the execution status of this line is deduced): QRect r = option->rect; | - |
1474 | if (act) { | 0 |
1475 | painter->setBrush(option->palette.highlight().color()); never executed (the execution status of this line is deduced): painter->setBrush(option->palette.highlight().color()); | - |
1476 | painter->setPen(QPen(highlightOutline)); never executed (the execution status of this line is deduced): painter->setPen(QPen(highlightOutline)); | - |
1477 | painter->drawRect(r.adjusted(0, 0, -1, -1)); never executed (the execution status of this line is deduced): painter->drawRect(r.adjusted(0, 0, -1, -1)); | - |
1478 | | - |
1479 | // painter->drawRoundedRect(r.adjusted(1, 1, -1, -1), 2, 2); | - |
1480 | | - |
1481 | //draw text | - |
1482 | QPalette::ColorRole textRole = dis ? QPalette::Text : QPalette::HighlightedText; | 0 |
1483 | uint alignment = Qt::AlignCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine; never executed (the execution status of this line is deduced): uint alignment = Qt::AlignCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine; | - |
1484 | if (!styleHint(SH_UnderlineShortcut, mbi, widget)) never evaluated: !styleHint(SH_UnderlineShortcut, mbi, widget) | 0 |
1485 | alignment |= Qt::TextHideMnemonic; never executed: alignment |= Qt::TextHideMnemonic; | 0 |
1486 | proxy()->drawItemText(painter, item.rect, alignment, mbi->palette, mbi->state & State_Enabled, mbi->text, textRole); never executed (the execution status of this line is deduced): proxy()->drawItemText(painter, item.rect, alignment, mbi->palette, mbi->state & State_Enabled, mbi->text, textRole); | - |
1487 | } else { | 0 |
1488 | | - |
1489 | QColor shadow = mergedColors(option->palette.background().color().darker(120), never executed (the execution status of this line is deduced): QColor shadow = mergedColors(option->palette.background().color().darker(120), | - |
1490 | outline.lighter(140), 60); never executed (the execution status of this line is deduced): outline.lighter(140), 60); | - |
1491 | painter->setPen(QPen(shadow)); never executed (the execution status of this line is deduced): painter->setPen(QPen(shadow)); | - |
1492 | painter->drawLine(option->rect.bottomLeft(), option->rect.bottomRight()); never executed (the execution status of this line is deduced): painter->drawLine(option->rect.bottomLeft(), option->rect.bottomRight()); | - |
1493 | } | 0 |
1494 | } | - |
1495 | painter->restore(); executed (the execution status of this line is deduced): painter->restore(); | - |
1496 | break; executed: break; Execution Count:1 | 1 |
1497 | case CE_MenuItem: | - |
1498 | painter->save(); executed (the execution status of this line is deduced): painter->save(); | - |
1499 | // Draws one item in a popup menu. | - |
1500 | if (const QStyleOptionMenuItem *menuItem = qstyleoption_cast<const QStyleOptionMenuItem *>(option)) { partially evaluated: const QStyleOptionMenuItem *menuItem = qstyleoption_cast<const QStyleOptionMenuItem *>(option) no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
1501 | QColor highlightOutline = highlightedOutline; never executed (the execution status of this line is deduced): QColor highlightOutline = highlightedOutline; | - |
1502 | QColor highlight = option->palette.highlight().color(); never executed (the execution status of this line is deduced): QColor highlight = option->palette.highlight().color(); | - |
1503 | if (menuItem->menuItemType == QStyleOptionMenuItem::Separator) { never evaluated: menuItem->menuItemType == QStyleOptionMenuItem::Separator | 0 |
1504 | int w = 0; never executed (the execution status of this line is deduced): int w = 0; | - |
1505 | if (!menuItem->text.isEmpty()) { never evaluated: !menuItem->text.isEmpty() | 0 |
1506 | painter->setFont(menuItem->font); never executed (the execution status of this line is deduced): painter->setFont(menuItem->font); | - |
1507 | proxy()->drawItemText(painter, menuItem->rect.adjusted(5, 0, -5, 0), Qt::AlignLeft | Qt::AlignVCenter, never executed (the execution status of this line is deduced): proxy()->drawItemText(painter, menuItem->rect.adjusted(5, 0, -5, 0), Qt::AlignLeft | Qt::AlignVCenter, | - |
1508 | menuItem->palette, menuItem->state & State_Enabled, menuItem->text, never executed (the execution status of this line is deduced): menuItem->palette, menuItem->state & State_Enabled, menuItem->text, | - |
1509 | QPalette::Text); never executed (the execution status of this line is deduced): QPalette::Text); | - |
1510 | w = menuItem->fontMetrics.width(menuItem->text) + 5; never executed (the execution status of this line is deduced): w = menuItem->fontMetrics.width(menuItem->text) + 5; | - |
1511 | } | 0 |
1512 | painter->setPen(shadow.lighter(106)); never executed (the execution status of this line is deduced): painter->setPen(shadow.lighter(106)); | - |
1513 | bool reverse = menuItem->direction == Qt::RightToLeft; never executed (the execution status of this line is deduced): bool reverse = menuItem->direction == Qt::RightToLeft; | - |
1514 | painter->drawLine(menuItem->rect.left() + 5 + (reverse ? 0 : w), menuItem->rect.center().y(), never executed (the execution status of this line is deduced): painter->drawLine(menuItem->rect.left() + 5 + (reverse ? 0 : w), menuItem->rect.center().y(), | - |
1515 | menuItem->rect.right() - 5 - (reverse ? w : 0), menuItem->rect.center().y()); never executed (the execution status of this line is deduced): menuItem->rect.right() - 5 - (reverse ? w : 0), menuItem->rect.center().y()); | - |
1516 | painter->restore(); never executed (the execution status of this line is deduced): painter->restore(); | - |
1517 | break; | 0 |
1518 | } | - |
1519 | bool selected = menuItem->state & State_Selected && menuItem->state & State_Enabled; never evaluated: menuItem->state & State_Selected never evaluated: menuItem->state & State_Enabled | 0 |
1520 | if (selected) { never evaluated: selected | 0 |
1521 | QRect r = option->rect; never executed (the execution status of this line is deduced): QRect r = option->rect; | - |
1522 | painter->fillRect(r, highlight); never executed (the execution status of this line is deduced): painter->fillRect(r, highlight); | - |
1523 | painter->setPen(QPen(highlightOutline)); never executed (the execution status of this line is deduced): painter->setPen(QPen(highlightOutline)); | - |
1524 | const QLine lines[4] = { never executed (the execution status of this line is deduced): const QLine lines[4] = { | - |
1525 | QLine(QPoint(r.left() + 1, r.bottom()), QPoint(r.right() - 1, r.bottom())), never executed (the execution status of this line is deduced): QLine(QPoint(r.left() + 1, r.bottom()), QPoint(r.right() - 1, r.bottom())), | - |
1526 | QLine(QPoint(r.left() + 1, r.top()), QPoint(r.right() - 1, r.top())), never executed (the execution status of this line is deduced): QLine(QPoint(r.left() + 1, r.top()), QPoint(r.right() - 1, r.top())), | - |
1527 | QLine(QPoint(r.left(), r.top()), QPoint(r.left(), r.bottom())), never executed (the execution status of this line is deduced): QLine(QPoint(r.left(), r.top()), QPoint(r.left(), r.bottom())), | - |
1528 | QLine(QPoint(r.right() , r.top()), QPoint(r.right(), r.bottom())), never executed (the execution status of this line is deduced): QLine(QPoint(r.right() , r.top()), QPoint(r.right(), r.bottom())), | - |
1529 | }; never executed (the execution status of this line is deduced): }; | - |
1530 | painter->drawLines(lines, 4); never executed (the execution status of this line is deduced): painter->drawLines(lines, 4); | - |
1531 | } | 0 |
1532 | bool checkable = menuItem->checkType != QStyleOptionMenuItem::NotCheckable; never executed (the execution status of this line is deduced): bool checkable = menuItem->checkType != QStyleOptionMenuItem::NotCheckable; | - |
1533 | bool checked = menuItem->checked; never executed (the execution status of this line is deduced): bool checked = menuItem->checked; | - |
1534 | bool sunken = menuItem->state & State_Sunken; never executed (the execution status of this line is deduced): bool sunken = menuItem->state & State_Sunken; | - |
1535 | bool enabled = menuItem->state & State_Enabled; never executed (the execution status of this line is deduced): bool enabled = menuItem->state & State_Enabled; | - |
1536 | | - |
1537 | bool ignoreCheckMark = false; never executed (the execution status of this line is deduced): bool ignoreCheckMark = false; | - |
1538 | int checkcol = qMax(menuItem->maxIconWidth, 20); never executed (the execution status of this line is deduced): int checkcol = qMax(menuItem->maxIconWidth, 20); | - |
1539 | | - |
1540 | if (qobject_cast<const QComboBox*>(widget)) never evaluated: qobject_cast<const QComboBox*>(widget) | 0 |
1541 | ignoreCheckMark = true; //ignore the checkmarks provided by the QComboMenuDelegate never executed: ignoreCheckMark = true; | 0 |
1542 | | - |
1543 | if (!ignoreCheckMark) { never evaluated: !ignoreCheckMark | 0 |
1544 | // Check | - |
1545 | QRect checkRect(option->rect.left() + 7, option->rect.center().y() - 6, 14, 14); never executed (the execution status of this line is deduced): QRect checkRect(option->rect.left() + 7, option->rect.center().y() - 6, 14, 14); | - |
1546 | checkRect = visualRect(menuItem->direction, menuItem->rect, checkRect); never executed (the execution status of this line is deduced): checkRect = visualRect(menuItem->direction, menuItem->rect, checkRect); | - |
1547 | if (checkable) { never evaluated: checkable | 0 |
1548 | if (menuItem->checkType & QStyleOptionMenuItem::Exclusive) { never evaluated: menuItem->checkType & QStyleOptionMenuItem::Exclusive | 0 |
1549 | // Radio button | - |
1550 | if (checked || sunken) { never evaluated: checked never evaluated: sunken | 0 |
1551 | painter->setRenderHint(QPainter::Antialiasing); never executed (the execution status of this line is deduced): painter->setRenderHint(QPainter::Antialiasing); | - |
1552 | painter->setPen(Qt::NoPen); never executed (the execution status of this line is deduced): painter->setPen(Qt::NoPen); | - |
1553 | | - |
1554 | QPalette::ColorRole textRole = !enabled ? QPalette::Text: never evaluated: !enabled | 0 |
1555 | selected ? QPalette::HighlightedText : QPalette::ButtonText; never executed (the execution status of this line is deduced): selected ? QPalette::HighlightedText : QPalette::ButtonText; | - |
1556 | painter->setBrush(option->palette.brush( option->palette.currentColorGroup(), textRole)); never executed (the execution status of this line is deduced): painter->setBrush(option->palette.brush( option->palette.currentColorGroup(), textRole)); | - |
1557 | painter->drawEllipse(checkRect.adjusted(4, 4, -4, -4)); never executed (the execution status of this line is deduced): painter->drawEllipse(checkRect.adjusted(4, 4, -4, -4)); | - |
1558 | } | 0 |
1559 | } else { | 0 |
1560 | // Check box | - |
1561 | if (menuItem->icon.isNull()) { never evaluated: menuItem->icon.isNull() | 0 |
1562 | QStyleOptionButton box; never executed (the execution status of this line is deduced): QStyleOptionButton box; | - |
1563 | box.QStyleOption::operator=(*option); never executed (the execution status of this line is deduced): box.QStyleOption::operator=(*option); | - |
1564 | box.rect = checkRect; never executed (the execution status of this line is deduced): box.rect = checkRect; | - |
1565 | if (checked) | 0 |
1566 | box.state |= State_On; never executed: box.state |= State_On; | 0 |
1567 | proxy()->drawPrimitive(PE_IndicatorCheckBox, &box, painter, widget); never executed (the execution status of this line is deduced): proxy()->drawPrimitive(PE_IndicatorCheckBox, &box, painter, widget); | - |
1568 | } | 0 |
1569 | } | 0 |
1570 | } | - |
1571 | } else { //ignore checkmark | 0 |
1572 | if (menuItem->icon.isNull()) never evaluated: menuItem->icon.isNull() | 0 |
1573 | checkcol = 0; never executed: checkcol = 0; | 0 |
1574 | else | - |
1575 | checkcol = menuItem->maxIconWidth; never executed: checkcol = menuItem->maxIconWidth; | 0 |
1576 | } | - |
1577 | | - |
1578 | // Text and icon, ripped from windows style | - |
1579 | bool dis = !(menuItem->state & State_Enabled); never executed (the execution status of this line is deduced): bool dis = !(menuItem->state & State_Enabled); | - |
1580 | bool act = menuItem->state & State_Selected; never executed (the execution status of this line is deduced): bool act = menuItem->state & State_Selected; | - |
1581 | const QStyleOption *opt = option; never executed (the execution status of this line is deduced): const QStyleOption *opt = option; | - |
1582 | const QStyleOptionMenuItem *menuitem = menuItem; never executed (the execution status of this line is deduced): const QStyleOptionMenuItem *menuitem = menuItem; | - |
1583 | | - |
1584 | QPainter *p = painter; never executed (the execution status of this line is deduced): QPainter *p = painter; | - |
1585 | QRect vCheckRect = visualRect(opt->direction, menuitem->rect, never executed (the execution status of this line is deduced): QRect vCheckRect = visualRect(opt->direction, menuitem->rect, | - |
1586 | QRect(menuitem->rect.x() + 4, menuitem->rect.y(), never executed (the execution status of this line is deduced): QRect(menuitem->rect.x() + 4, menuitem->rect.y(), | - |
1587 | checkcol, menuitem->rect.height())); never executed (the execution status of this line is deduced): checkcol, menuitem->rect.height())); | - |
1588 | if (!menuItem->icon.isNull()) { never evaluated: !menuItem->icon.isNull() | 0 |
1589 | QIcon::Mode mode = dis ? QIcon::Disabled : QIcon::Normal; | 0 |
1590 | if (act && !dis) never evaluated: act never evaluated: !dis | 0 |
1591 | mode = QIcon::Active; never executed: mode = QIcon::Active; | 0 |
1592 | QPixmap pixmap; never executed (the execution status of this line is deduced): QPixmap pixmap; | - |
1593 | | - |
1594 | int smallIconSize = proxy()->pixelMetric(PM_SmallIconSize, option, widget); never executed (the execution status of this line is deduced): int smallIconSize = proxy()->pixelMetric(PM_SmallIconSize, option, widget); | - |
1595 | QSize iconSize(smallIconSize, smallIconSize); never executed (the execution status of this line is deduced): QSize iconSize(smallIconSize, smallIconSize); | - |
1596 | if (const QComboBox *combo = qobject_cast<const QComboBox*>(widget)) never evaluated: const QComboBox *combo = qobject_cast<const QComboBox*>(widget) | 0 |
1597 | iconSize = combo->iconSize(); never executed: iconSize = combo->iconSize(); | 0 |
1598 | if (checked) | 0 |
1599 | pixmap = menuItem->icon.pixmap(iconSize, mode, QIcon::On); never executed: pixmap = menuItem->icon.pixmap(iconSize, mode, QIcon::On); | 0 |
1600 | else | - |
1601 | pixmap = menuItem->icon.pixmap(iconSize, mode); never executed: pixmap = menuItem->icon.pixmap(iconSize, mode); | 0 |
1602 | | - |
1603 | int pixw = pixmap.width(); never executed (the execution status of this line is deduced): int pixw = pixmap.width(); | - |
1604 | int pixh = pixmap.height(); never executed (the execution status of this line is deduced): int pixh = pixmap.height(); | - |
1605 | | - |
1606 | QRect pmr(0, 0, pixw, pixh); never executed (the execution status of this line is deduced): QRect pmr(0, 0, pixw, pixh); | - |
1607 | pmr.moveCenter(vCheckRect.center()); never executed (the execution status of this line is deduced): pmr.moveCenter(vCheckRect.center()); | - |
1608 | painter->setPen(menuItem->palette.text().color()); never executed (the execution status of this line is deduced): painter->setPen(menuItem->palette.text().color()); | - |
1609 | if (checkable && checked) { never evaluated: checkable never evaluated: checked | 0 |
1610 | QStyleOption opt = *option; never executed (the execution status of this line is deduced): QStyleOption opt = *option; | - |
1611 | if (act) { | 0 |
1612 | QColor activeColor = mergedColors(option->palette.background().color(), never executed (the execution status of this line is deduced): QColor activeColor = mergedColors(option->palette.background().color(), | - |
1613 | option->palette.highlight().color()); never executed (the execution status of this line is deduced): option->palette.highlight().color()); | - |
1614 | opt.palette.setBrush(QPalette::Button, activeColor); never executed (the execution status of this line is deduced): opt.palette.setBrush(QPalette::Button, activeColor); | - |
1615 | } | 0 |
1616 | opt.state |= State_Sunken; never executed (the execution status of this line is deduced): opt.state |= State_Sunken; | - |
1617 | opt.rect = vCheckRect; never executed (the execution status of this line is deduced): opt.rect = vCheckRect; | - |
1618 | proxy()->drawPrimitive(PE_PanelButtonCommand, &opt, painter, widget); never executed (the execution status of this line is deduced): proxy()->drawPrimitive(PE_PanelButtonCommand, &opt, painter, widget); | - |
1619 | } | 0 |
1620 | painter->drawPixmap(pmr.topLeft(), pixmap); never executed (the execution status of this line is deduced): painter->drawPixmap(pmr.topLeft(), pixmap); | - |
1621 | } | 0 |
1622 | if (selected) { never evaluated: selected | 0 |
1623 | painter->setPen(menuItem->palette.highlightedText().color()); never executed (the execution status of this line is deduced): painter->setPen(menuItem->palette.highlightedText().color()); | - |
1624 | } else { | 0 |
1625 | painter->setPen(menuItem->palette.text().color()); never executed (the execution status of this line is deduced): painter->setPen(menuItem->palette.text().color()); | - |
1626 | } | 0 |
1627 | int x, y, w, h; never executed (the execution status of this line is deduced): int x, y, w, h; | - |
1628 | menuitem->rect.getRect(&x, &y, &w, &h); never executed (the execution status of this line is deduced): menuitem->rect.getRect(&x, &y, &w, &h); | - |
1629 | int tab = menuitem->tabWidth; never executed (the execution status of this line is deduced): int tab = menuitem->tabWidth; | - |
1630 | QColor discol; never executed (the execution status of this line is deduced): QColor discol; | - |
1631 | if (dis) { | 0 |
1632 | discol = menuitem->palette.text().color(); never executed (the execution status of this line is deduced): discol = menuitem->palette.text().color(); | - |
1633 | p->setPen(discol); never executed (the execution status of this line is deduced): p->setPen(discol); | - |
1634 | } | 0 |
1635 | int xm = windowsItemFrame + checkcol + windowsItemHMargin + 2; never executed (the execution status of this line is deduced): int xm = windowsItemFrame + checkcol + windowsItemHMargin + 2; | - |
1636 | int xpos = menuitem->rect.x() + xm; never executed (the execution status of this line is deduced): int xpos = menuitem->rect.x() + xm; | - |
1637 | | - |
1638 | QRect textRect(xpos, y + windowsItemVMargin, w - xm - windowsRightBorder - tab + 1, h - 2 * windowsItemVMargin); never executed (the execution status of this line is deduced): QRect textRect(xpos, y + windowsItemVMargin, w - xm - windowsRightBorder - tab + 1, h - 2 * windowsItemVMargin); | - |
1639 | QRect vTextRect = visualRect(opt->direction, menuitem->rect, textRect); never executed (the execution status of this line is deduced): QRect vTextRect = visualRect(opt->direction, menuitem->rect, textRect); | - |
1640 | QString s = menuitem->text; never executed (the execution status of this line is deduced): QString s = menuitem->text; | - |
1641 | if (!s.isEmpty()) { // draw text never evaluated: !s.isEmpty() | 0 |
1642 | p->save(); never executed (the execution status of this line is deduced): p->save(); | - |
1643 | int t = s.indexOf(QLatin1Char('\t')); never executed (the execution status of this line is deduced): int t = s.indexOf(QLatin1Char('\t')); | - |
1644 | int text_flags = Qt::AlignVCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine; never executed (the execution status of this line is deduced): int text_flags = Qt::AlignVCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine; | - |
1645 | if (!styleHint(SH_UnderlineShortcut, menuitem, widget)) never evaluated: !styleHint(SH_UnderlineShortcut, menuitem, widget) | 0 |
1646 | text_flags |= Qt::TextHideMnemonic; never executed: text_flags |= Qt::TextHideMnemonic; | 0 |
1647 | text_flags |= Qt::AlignLeft; never executed (the execution status of this line is deduced): text_flags |= Qt::AlignLeft; | - |
1648 | if (t >= 0) { | 0 |
1649 | QRect vShortcutRect = visualRect(opt->direction, menuitem->rect, never executed (the execution status of this line is deduced): QRect vShortcutRect = visualRect(opt->direction, menuitem->rect, | - |
1650 | QRect(textRect.topRight(), QPoint(menuitem->rect.right(), textRect.bottom()))); never executed (the execution status of this line is deduced): QRect(textRect.topRight(), QPoint(menuitem->rect.right(), textRect.bottom()))); | - |
1651 | if (dis && !act && proxy()->styleHint(SH_EtchDisabledText, option, widget)) { never evaluated: dis never evaluated: !act never evaluated: proxy()->styleHint(SH_EtchDisabledText, option, widget) | 0 |
1652 | p->setPen(menuitem->palette.light().color()); never executed (the execution status of this line is deduced): p->setPen(menuitem->palette.light().color()); | - |
1653 | p->drawText(vShortcutRect.adjusted(1, 1, 1, 1), text_flags, s.mid(t + 1)); never executed (the execution status of this line is deduced): p->drawText(vShortcutRect.adjusted(1, 1, 1, 1), text_flags, s.mid(t + 1)); | - |
1654 | p->setPen(discol); never executed (the execution status of this line is deduced): p->setPen(discol); | - |
1655 | } | 0 |
1656 | p->drawText(vShortcutRect, text_flags, s.mid(t + 1)); never executed (the execution status of this line is deduced): p->drawText(vShortcutRect, text_flags, s.mid(t + 1)); | - |
1657 | s = s.left(t); never executed (the execution status of this line is deduced): s = s.left(t); | - |
1658 | } | 0 |
1659 | QFont font = menuitem->font; never executed (the execution status of this line is deduced): QFont font = menuitem->font; | - |
1660 | // font may not have any "hard" flags set. We override | - |
1661 | // the point size so that when it is resolved against the device, this font will win. | - |
1662 | // This is mainly to handle cases where someone sets the font on the window | - |
1663 | // and then the combo inherits it and passes it onward. At that point the resolve mask | - |
1664 | // is very, very weak. This makes it stonger. | - |
1665 | font.setPointSizeF(QFontInfo(menuItem->font).pointSizeF()); never executed (the execution status of this line is deduced): font.setPointSizeF(QFontInfo(menuItem->font).pointSizeF()); | - |
1666 | | - |
1667 | if (menuitem->menuItemType == QStyleOptionMenuItem::DefaultItem) never evaluated: menuitem->menuItemType == QStyleOptionMenuItem::DefaultItem | 0 |
1668 | font.setBold(true); never executed: font.setBold(true); | 0 |
1669 | | - |
1670 | p->setFont(font); never executed (the execution status of this line is deduced): p->setFont(font); | - |
1671 | if (dis && !act && proxy()->styleHint(SH_EtchDisabledText, option, widget)) { never evaluated: dis never evaluated: !act never evaluated: proxy()->styleHint(SH_EtchDisabledText, option, widget) | 0 |
1672 | p->setPen(menuitem->palette.light().color()); never executed (the execution status of this line is deduced): p->setPen(menuitem->palette.light().color()); | - |
1673 | p->drawText(vTextRect.adjusted(1, 1, 1, 1), text_flags, s.left(t)); never executed (the execution status of this line is deduced): p->drawText(vTextRect.adjusted(1, 1, 1, 1), text_flags, s.left(t)); | - |
1674 | p->setPen(discol); never executed (the execution status of this line is deduced): p->setPen(discol); | - |
1675 | } | 0 |
1676 | p->drawText(vTextRect, text_flags, s.left(t)); never executed (the execution status of this line is deduced): p->drawText(vTextRect, text_flags, s.left(t)); | - |
1677 | p->restore(); never executed (the execution status of this line is deduced): p->restore(); | - |
1678 | } | 0 |
1679 | | - |
1680 | // Arrow | - |
1681 | if (menuItem->menuItemType == QStyleOptionMenuItem::SubMenu) {// draw sub menu arrow never evaluated: menuItem->menuItemType == QStyleOptionMenuItem::SubMenu | 0 |
1682 | int dim = (menuItem->rect.height() - 4) / 2; never executed (the execution status of this line is deduced): int dim = (menuItem->rect.height() - 4) / 2; | - |
1683 | PrimitiveElement arrow; never executed (the execution status of this line is deduced): PrimitiveElement arrow; | - |
1684 | arrow = QApplication::isRightToLeft() ? PE_IndicatorArrowLeft : PE_IndicatorArrowRight; never evaluated: QApplication::isRightToLeft() | 0 |
1685 | int xpos = menuItem->rect.left() + menuItem->rect.width() - 3 - dim; never executed (the execution status of this line is deduced): int xpos = menuItem->rect.left() + menuItem->rect.width() - 3 - dim; | - |
1686 | QRect vSubMenuRect = visualRect(option->direction, menuItem->rect, never executed (the execution status of this line is deduced): QRect vSubMenuRect = visualRect(option->direction, menuItem->rect, | - |
1687 | QRect(xpos, menuItem->rect.top() + menuItem->rect.height() / 2 - dim / 2, dim, dim)); never executed (the execution status of this line is deduced): QRect(xpos, menuItem->rect.top() + menuItem->rect.height() / 2 - dim / 2, dim, dim)); | - |
1688 | QStyleOptionMenuItem newMI = *menuItem; never executed (the execution status of this line is deduced): QStyleOptionMenuItem newMI = *menuItem; | - |
1689 | newMI.rect = vSubMenuRect; never executed (the execution status of this line is deduced): newMI.rect = vSubMenuRect; | - |
1690 | newMI.state = !enabled ? State_None : State_Enabled; never evaluated: !enabled | 0 |
1691 | if (selected) never evaluated: selected | 0 |
1692 | newMI.palette.setColor(QPalette::Foreground, never executed: newMI.palette.setColor(QPalette::Foreground, newMI.palette.highlightedText().color()); | 0 |
1693 | newMI.palette.highlightedText().color()); never executed: newMI.palette.setColor(QPalette::Foreground, newMI.palette.highlightedText().color()); | 0 |
1694 | proxy()->drawPrimitive(arrow, &newMI, painter, widget); never executed (the execution status of this line is deduced): proxy()->drawPrimitive(arrow, &newMI, painter, widget); | - |
1695 | } | 0 |
1696 | } | 0 |
1697 | painter->restore(); executed (the execution status of this line is deduced): painter->restore(); | - |
1698 | break; executed: break; Execution Count:1 | 1 |
1699 | case CE_MenuHMargin: | - |
1700 | case CE_MenuVMargin: | - |
1701 | break; executed: break; Execution Count:2 | 2 |
1702 | case CE_MenuEmptyArea: | - |
1703 | break; executed: break; Execution Count:1 | 1 |
1704 | case CE_PushButton: | - |
1705 | if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(option)) { evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(option) yes Evaluation Count:22 | yes Evaluation Count:1 |
| 1-22 |
1706 | proxy()->drawControl(CE_PushButtonBevel, btn, painter, widget); executed (the execution status of this line is deduced): proxy()->drawControl(CE_PushButtonBevel, btn, painter, widget); | - |
1707 | QStyleOptionButton subopt = *btn; executed (the execution status of this line is deduced): QStyleOptionButton subopt = *btn; | - |
1708 | subopt.rect = subElementRect(SE_PushButtonContents, btn, widget); executed (the execution status of this line is deduced): subopt.rect = subElementRect(SE_PushButtonContents, btn, widget); | - |
1709 | proxy()->drawControl(CE_PushButtonLabel, &subopt, painter, widget); executed (the execution status of this line is deduced): proxy()->drawControl(CE_PushButtonLabel, &subopt, painter, widget); | - |
1710 | } executed: } Execution Count:22 | 22 |
1711 | break; executed: break; Execution Count:23 | 23 |
1712 | case CE_PushButtonLabel: | - |
1713 | if (const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton *>(option)) { evaluated: const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton *>(option) yes Evaluation Count:22 | yes Evaluation Count:1 |
| 1-22 |
1714 | QRect ir = button->rect; executed (the execution status of this line is deduced): QRect ir = button->rect; | - |
1715 | uint tf = Qt::AlignVCenter; executed (the execution status of this line is deduced): uint tf = Qt::AlignVCenter; | - |
1716 | if (styleHint(SH_UnderlineShortcut, button, widget)) partially evaluated: styleHint(SH_UnderlineShortcut, button, widget) yes Evaluation Count:22 | no Evaluation Count:0 |
| 0-22 |
1717 | tf |= Qt::TextShowMnemonic; executed: tf |= Qt::TextShowMnemonic; Execution Count:22 | 22 |
1718 | else | - |
1719 | tf |= Qt::TextHideMnemonic; never executed: tf |= Qt::TextHideMnemonic; | 0 |
1720 | | - |
1721 | if (!button->icon.isNull()) { partially evaluated: !button->icon.isNull() no Evaluation Count:0 | yes Evaluation Count:22 |
| 0-22 |
1722 | //Center both icon and text | - |
1723 | QPoint point; never executed (the execution status of this line is deduced): QPoint point; | - |
1724 | | - |
1725 | QIcon::Mode mode = button->state & State_Enabled ? QIcon::Normal never evaluated: button->state & State_Enabled | 0 |
1726 | : QIcon::Disabled; never executed (the execution status of this line is deduced): : QIcon::Disabled; | - |
1727 | if (mode == QIcon::Normal && button->state & State_HasFocus) never evaluated: mode == QIcon::Normal never evaluated: button->state & State_HasFocus | 0 |
1728 | mode = QIcon::Active; never executed: mode = QIcon::Active; | 0 |
1729 | QIcon::State state = QIcon::Off; never executed (the execution status of this line is deduced): QIcon::State state = QIcon::Off; | - |
1730 | if (button->state & State_On) never evaluated: button->state & State_On | 0 |
1731 | state = QIcon::On; never executed: state = QIcon::On; | 0 |
1732 | | - |
1733 | QPixmap pixmap = button->icon.pixmap(button->iconSize, mode, state); never executed (the execution status of this line is deduced): QPixmap pixmap = button->icon.pixmap(button->iconSize, mode, state); | - |
1734 | int w = pixmap.width(); never executed (the execution status of this line is deduced): int w = pixmap.width(); | - |
1735 | int h = pixmap.height(); never executed (the execution status of this line is deduced): int h = pixmap.height(); | - |
1736 | | - |
1737 | if (!button->text.isEmpty()) never evaluated: !button->text.isEmpty() | 0 |
1738 | w += button->fontMetrics.boundingRect(option->rect, tf, button->text).width() + 2; never executed: w += button->fontMetrics.boundingRect(option->rect, tf, button->text).width() + 2; | 0 |
1739 | | - |
1740 | point = QPoint(ir.x() + ir.width() / 2 - w / 2, never executed (the execution status of this line is deduced): point = QPoint(ir.x() + ir.width() / 2 - w / 2, | - |
1741 | ir.y() + ir.height() / 2 - h / 2); never executed (the execution status of this line is deduced): ir.y() + ir.height() / 2 - h / 2); | - |
1742 | | - |
1743 | if (button->direction == Qt::RightToLeft) never evaluated: button->direction == Qt::RightToLeft | 0 |
1744 | point.rx() += pixmap.width(); never executed: point.rx() += pixmap.width(); | 0 |
1745 | | - |
1746 | painter->drawPixmap(visualPos(button->direction, button->rect, point), pixmap); never executed (the execution status of this line is deduced): painter->drawPixmap(visualPos(button->direction, button->rect, point), pixmap); | - |
1747 | | - |
1748 | if (button->direction == Qt::RightToLeft) never evaluated: button->direction == Qt::RightToLeft | 0 |
1749 | ir.translate(-point.x() - 2, 0); never executed: ir.translate(-point.x() - 2, 0); | 0 |
1750 | else | - |
1751 | ir.translate(point.x() + pixmap.width(), 0); never executed: ir.translate(point.x() + pixmap.width(), 0); | 0 |
1752 | | - |
1753 | // left-align text if there is | - |
1754 | if (!button->text.isEmpty()) never evaluated: !button->text.isEmpty() | 0 |
1755 | tf |= Qt::AlignLeft; never executed: tf |= Qt::AlignLeft; | 0 |
1756 | | - |
1757 | } else { | 0 |
1758 | tf |= Qt::AlignHCenter; executed (the execution status of this line is deduced): tf |= Qt::AlignHCenter; | - |
1759 | } executed: } Execution Count:22 | 22 |
1760 | | - |
1761 | if (button->features & QStyleOptionButton::HasMenu) partially evaluated: button->features & QStyleOptionButton::HasMenu no Evaluation Count:0 | yes Evaluation Count:22 |
| 0-22 |
1762 | ir = ir.adjusted(0, 0, -proxy()->pixelMetric(PM_MenuButtonIndicator, button, widget), 0); never executed: ir = ir.adjusted(0, 0, -proxy()->pixelMetric(PM_MenuButtonIndicator, button, widget), 0); | 0 |
1763 | proxy()->drawItemText(painter, ir, tf, button->palette, (button->state & State_Enabled), executed (the execution status of this line is deduced): proxy()->drawItemText(painter, ir, tf, button->palette, (button->state & State_Enabled), | - |
1764 | button->text, QPalette::ButtonText); executed (the execution status of this line is deduced): button->text, QPalette::ButtonText); | - |
1765 | } executed: } Execution Count:22 | 22 |
1766 | break; executed: break; Execution Count:23 | 23 |
1767 | case CE_MenuBarEmptyArea: | - |
1768 | painter->save(); executed (the execution status of this line is deduced): painter->save(); | - |
1769 | { | - |
1770 | painter->fillRect(rect, option->palette.window()); executed (the execution status of this line is deduced): painter->fillRect(rect, option->palette.window()); | - |
1771 | if (widget && qobject_cast<const QMainWindow *>(widget->parentWidget())) { partially evaluated: widget no Evaluation Count:0 | yes Evaluation Count:1 |
never evaluated: qobject_cast<const QMainWindow *>(widget->parentWidget()) | 0-1 |
1772 | QColor shadow = mergedColors(option->palette.background().color().darker(120), never executed (the execution status of this line is deduced): QColor shadow = mergedColors(option->palette.background().color().darker(120), | - |
1773 | outline.lighter(140), 60); never executed (the execution status of this line is deduced): outline.lighter(140), 60); | - |
1774 | painter->setPen(QPen(shadow)); never executed (the execution status of this line is deduced): painter->setPen(QPen(shadow)); | - |
1775 | painter->drawLine(option->rect.bottomLeft(), option->rect.bottomRight()); never executed (the execution status of this line is deduced): painter->drawLine(option->rect.bottomLeft(), option->rect.bottomRight()); | - |
1776 | } | 0 |
1777 | } | - |
1778 | painter->restore(); executed (the execution status of this line is deduced): painter->restore(); | - |
1779 | break; executed: break; Execution Count:1 | 1 |
1780 | case CE_TabBarTabShape: | - |
1781 | painter->save(); executed (the execution status of this line is deduced): painter->save(); | - |
1782 | if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(option)) { evaluated: const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(option) yes Evaluation Count:12 | yes Evaluation Count:1 |
| 1-12 |
1783 | | - |
1784 | bool rtlHorTabs = (tab->direction == Qt::RightToLeft partially evaluated: tab->direction == Qt::RightToLeft no Evaluation Count:0 | yes Evaluation Count:12 |
| 0-12 |
1785 | && (tab->shape == QTabBar::RoundedNorth never evaluated: tab->shape == QTabBar::RoundedNorth | 0 |
1786 | || tab->shape == QTabBar::RoundedSouth)); never evaluated: tab->shape == QTabBar::RoundedSouth | 0 |
1787 | bool selected = tab->state & State_Selected; executed (the execution status of this line is deduced): bool selected = tab->state & State_Selected; | - |
1788 | bool lastTab = ((!rtlHorTabs && tab->position == QStyleOptionTab::End) partially evaluated: !rtlHorTabs yes Evaluation Count:12 | no Evaluation Count:0 |
evaluated: tab->position == QStyleOptionTab::End yes Evaluation Count:6 | yes Evaluation Count:6 |
| 0-12 |
1789 | || (rtlHorTabs partially evaluated: rtlHorTabs no Evaluation Count:0 | yes Evaluation Count:6 |
| 0-6 |
1790 | && tab->position == QStyleOptionTab::Beginning)); never evaluated: tab->position == QStyleOptionTab::Beginning | 0 |
1791 | bool onlyOne = tab->position == QStyleOptionTab::OnlyOneTab; executed (the execution status of this line is deduced): bool onlyOne = tab->position == QStyleOptionTab::OnlyOneTab; | - |
1792 | int tabOverlap = pixelMetric(PM_TabBarTabOverlap, option, widget); executed (the execution status of this line is deduced): int tabOverlap = pixelMetric(PM_TabBarTabOverlap, option, widget); | - |
1793 | rect = option->rect.adjusted(0, 0, (onlyOne || lastTab) ? 0 : tabOverlap, 0); executed (the execution status of this line is deduced): rect = option->rect.adjusted(0, 0, (onlyOne || lastTab) ? 0 : tabOverlap, 0); | - |
1794 | | - |
1795 | QRect r2(rect); executed (the execution status of this line is deduced): QRect r2(rect); | - |
1796 | int x1 = r2.left(); executed (the execution status of this line is deduced): int x1 = r2.left(); | - |
1797 | int x2 = r2.right(); executed (the execution status of this line is deduced): int x2 = r2.right(); | - |
1798 | int y1 = r2.top(); executed (the execution status of this line is deduced): int y1 = r2.top(); | - |
1799 | int y2 = r2.bottom(); executed (the execution status of this line is deduced): int y2 = r2.bottom(); | - |
1800 | | - |
1801 | painter->setPen(d->innerContrastLine()); executed (the execution status of this line is deduced): painter->setPen(d->innerContrastLine()); | - |
1802 | | - |
1803 | QTransform rotMatrix; executed (the execution status of this line is deduced): QTransform rotMatrix; | - |
1804 | bool flip = false; executed (the execution status of this line is deduced): bool flip = false; | - |
1805 | painter->setPen(shadow); executed (the execution status of this line is deduced): painter->setPen(shadow); | - |
1806 | | - |
1807 | switch (tab->shape) { | - |
1808 | case QTabBar::RoundedNorth: | - |
1809 | break; executed: break; Execution Count:12 | 12 |
1810 | case QTabBar::RoundedSouth: | - |
1811 | rotMatrix.rotate(180); never executed (the execution status of this line is deduced): rotMatrix.rotate(180); | - |
1812 | rotMatrix.translate(0, -rect.height() + 1); never executed (the execution status of this line is deduced): rotMatrix.translate(0, -rect.height() + 1); | - |
1813 | rotMatrix.scale(-1, 1); never executed (the execution status of this line is deduced): rotMatrix.scale(-1, 1); | - |
1814 | painter->setTransform(rotMatrix, true); never executed (the execution status of this line is deduced): painter->setTransform(rotMatrix, true); | - |
1815 | break; | 0 |
1816 | case QTabBar::RoundedWest: | - |
1817 | rotMatrix.rotate(180 + 90); never executed (the execution status of this line is deduced): rotMatrix.rotate(180 + 90); | - |
1818 | rotMatrix.scale(-1, 1); never executed (the execution status of this line is deduced): rotMatrix.scale(-1, 1); | - |
1819 | flip = true; never executed (the execution status of this line is deduced): flip = true; | - |
1820 | painter->setTransform(rotMatrix, true); never executed (the execution status of this line is deduced): painter->setTransform(rotMatrix, true); | - |
1821 | break; | 0 |
1822 | case QTabBar::RoundedEast: | - |
1823 | rotMatrix.rotate(90); never executed (the execution status of this line is deduced): rotMatrix.rotate(90); | - |
1824 | rotMatrix.translate(0, - rect.width() + 1); never executed (the execution status of this line is deduced): rotMatrix.translate(0, - rect.width() + 1); | - |
1825 | flip = true; never executed (the execution status of this line is deduced): flip = true; | - |
1826 | painter->setTransform(rotMatrix, true); never executed (the execution status of this line is deduced): painter->setTransform(rotMatrix, true); | - |
1827 | break; | 0 |
1828 | default: | - |
1829 | painter->restore(); never executed (the execution status of this line is deduced): painter->restore(); | - |
1830 | QCommonStyle::drawControl(element, tab, painter, widget); never executed (the execution status of this line is deduced): QCommonStyle::drawControl(element, tab, painter, widget); | - |
1831 | return; | 0 |
1832 | } | - |
1833 | | - |
1834 | if (flip) { partially evaluated: flip no Evaluation Count:0 | yes Evaluation Count:12 |
| 0-12 |
1835 | QRect tmp = rect; never executed (the execution status of this line is deduced): QRect tmp = rect; | - |
1836 | rect = QRect(tmp.y(), tmp.x(), tmp.height(), tmp.width()); never executed (the execution status of this line is deduced): rect = QRect(tmp.y(), tmp.x(), tmp.height(), tmp.width()); | - |
1837 | int temp = x1; never executed (the execution status of this line is deduced): int temp = x1; | - |
1838 | x1 = y1; never executed (the execution status of this line is deduced): x1 = y1; | - |
1839 | y1 = temp; never executed (the execution status of this line is deduced): y1 = temp; | - |
1840 | temp = x2; never executed (the execution status of this line is deduced): temp = x2; | - |
1841 | x2 = y2; never executed (the execution status of this line is deduced): x2 = y2; | - |
1842 | y2 = temp; never executed (the execution status of this line is deduced): y2 = temp; | - |
1843 | } | 0 |
1844 | | - |
1845 | painter->setRenderHint(QPainter::Antialiasing, true); executed (the execution status of this line is deduced): painter->setRenderHint(QPainter::Antialiasing, true); | - |
1846 | painter->translate(0.5, 0.5); executed (the execution status of this line is deduced): painter->translate(0.5, 0.5); | - |
1847 | | - |
1848 | QColor tabFrameColor = tab->features & QStyleOptionTab::HasFrame ? partially evaluated: tab->features & QStyleOptionTab::HasFrame yes Evaluation Count:12 | no Evaluation Count:0 |
| 0-12 |
1849 | d->tabFrameColor(option->palette) : executed (the execution status of this line is deduced): d->tabFrameColor(option->palette) : | - |
1850 | option->palette.window().color(); executed (the execution status of this line is deduced): option->palette.window().color(); | - |
1851 | | - |
1852 | QLinearGradient fillGradient(rect.topLeft(), rect.bottomLeft()); executed (the execution status of this line is deduced): QLinearGradient fillGradient(rect.topLeft(), rect.bottomLeft()); | - |
1853 | QLinearGradient outlineGradient(rect.topLeft(), rect.bottomLeft()); executed (the execution status of this line is deduced): QLinearGradient outlineGradient(rect.topLeft(), rect.bottomLeft()); | - |
1854 | QPen outlinePen = outline.lighter(110); executed (the execution status of this line is deduced): QPen outlinePen = outline.lighter(110); | - |
1855 | if (selected) { evaluated: selected yes Evaluation Count:6 | yes Evaluation Count:6 |
| 6 |
1856 | fillGradient.setColorAt(0, tabFrameColor.lighter(104)); executed (the execution status of this line is deduced): fillGradient.setColorAt(0, tabFrameColor.lighter(104)); | - |
1857 | // QColor highlight = option->palette.highlight().color(); | - |
1858 | // if (option->state & State_HasFocus && option->state & State_KeyboardFocusChange) { | - |
1859 | // fillGradient.setColorAt(0, highlight.lighter(130)); | - |
1860 | // outlineGradient.setColorAt(0, highlight.darker(130)); | - |
1861 | // fillGradient.setColorAt(0.14, highlight); | - |
1862 | // outlineGradient.setColorAt(0.14, highlight.darker(130)); | - |
1863 | // fillGradient.setColorAt(0.1401, tabFrameColor); | - |
1864 | // outlineGradient.setColorAt(0.1401, highlight.darker(130)); | - |
1865 | // } | - |
1866 | fillGradient.setColorAt(1, tabFrameColor); executed (the execution status of this line is deduced): fillGradient.setColorAt(1, tabFrameColor); | - |
1867 | outlineGradient.setColorAt(1, outline); executed (the execution status of this line is deduced): outlineGradient.setColorAt(1, outline); | - |
1868 | outlinePen = QPen(outlineGradient, 1); executed (the execution status of this line is deduced): outlinePen = QPen(outlineGradient, 1); | - |
1869 | } else { executed: } Execution Count:6 | 6 |
1870 | fillGradient.setColorAt(0, tabFrameColor.darker(108)); executed (the execution status of this line is deduced): fillGradient.setColorAt(0, tabFrameColor.darker(108)); | - |
1871 | fillGradient.setColorAt(0.85, tabFrameColor.darker(108)); executed (the execution status of this line is deduced): fillGradient.setColorAt(0.85, tabFrameColor.darker(108)); | - |
1872 | fillGradient.setColorAt(1, tabFrameColor.darker(116)); executed (the execution status of this line is deduced): fillGradient.setColorAt(1, tabFrameColor.darker(116)); | - |
1873 | } executed: } Execution Count:6 | 6 |
1874 | | - |
1875 | QRect drawRect = rect.adjusted(0, selected ? 0 : 2, 0, 3); executed (the execution status of this line is deduced): QRect drawRect = rect.adjusted(0, selected ? 0 : 2, 0, 3); | - |
1876 | painter->setPen(outlinePen); executed (the execution status of this line is deduced): painter->setPen(outlinePen); | - |
1877 | painter->save(); executed (the execution status of this line is deduced): painter->save(); | - |
1878 | painter->setClipRect(rect.adjusted(-1, -1, 1, selected ? -2 : -3)); executed (the execution status of this line is deduced): painter->setClipRect(rect.adjusted(-1, -1, 1, selected ? -2 : -3)); | - |
1879 | painter->setBrush(fillGradient); executed (the execution status of this line is deduced): painter->setBrush(fillGradient); | - |
1880 | painter->drawRoundedRect(drawRect.adjusted(0, 0, -1, -1), 2.0, 2.0); executed (the execution status of this line is deduced): painter->drawRoundedRect(drawRect.adjusted(0, 0, -1, -1), 2.0, 2.0); | - |
1881 | painter->setBrush(Qt::NoBrush); executed (the execution status of this line is deduced): painter->setBrush(Qt::NoBrush); | - |
1882 | painter->setPen(d->innerContrastLine()); executed (the execution status of this line is deduced): painter->setPen(d->innerContrastLine()); | - |
1883 | painter->drawRoundedRect(drawRect.adjusted(1, 1, -2, -1), 2.0, 2.0); executed (the execution status of this line is deduced): painter->drawRoundedRect(drawRect.adjusted(1, 1, -2, -1), 2.0, 2.0); | - |
1884 | painter->restore(); executed (the execution status of this line is deduced): painter->restore(); | - |
1885 | | - |
1886 | if (selected) { evaluated: selected yes Evaluation Count:6 | yes Evaluation Count:6 |
| 6 |
1887 | painter->fillRect(rect.left() + 1, rect.bottom() - 1, rect.width() - 2, rect.bottom() - 1, tabFrameColor); executed (the execution status of this line is deduced): painter->fillRect(rect.left() + 1, rect.bottom() - 1, rect.width() - 2, rect.bottom() - 1, tabFrameColor); | - |
1888 | painter->fillRect(QRect(rect.bottomRight() + QPoint(-2, -1), QSize(1, 1)), d->innerContrastLine()); executed (the execution status of this line is deduced): painter->fillRect(QRect(rect.bottomRight() + QPoint(-2, -1), QSize(1, 1)), d->innerContrastLine()); | - |
1889 | painter->fillRect(QRect(rect.bottomLeft() + QPoint(0, -1), QSize(1, 1)), d->innerContrastLine()); executed (the execution status of this line is deduced): painter->fillRect(QRect(rect.bottomLeft() + QPoint(0, -1), QSize(1, 1)), d->innerContrastLine()); | - |
1890 | painter->fillRect(QRect(rect.bottomRight() + QPoint(-1, -1), QSize(1, 1)), d->innerContrastLine()); executed (the execution status of this line is deduced): painter->fillRect(QRect(rect.bottomRight() + QPoint(-1, -1), QSize(1, 1)), d->innerContrastLine()); | - |
1891 | } executed: } Execution Count:6 | 6 |
1892 | } executed: } Execution Count:12 | 12 |
1893 | painter->restore(); executed (the execution status of this line is deduced): painter->restore(); | - |
1894 | break; executed: break; Execution Count:13 | 13 |
1895 | default: | - |
1896 | QCommonStyle::drawControl(element,option,painter,widget); executed (the execution status of this line is deduced): QCommonStyle::drawControl(element,option,painter,widget); | - |
1897 | break; executed: break; Execution Count:318 | 318 |
1898 | } | - |
1899 | } executed: } Execution Count:400 | 400 |
1900 | | - |
1901 | /*! | - |
1902 | \reimp | - |
1903 | */ | - |
1904 | QPalette QFusionStyle::standardPalette () const | - |
1905 | { | - |
1906 | QPalette palette = QCommonStyle::standardPalette(); never executed (the execution status of this line is deduced): QPalette palette = QCommonStyle::standardPalette(); | - |
1907 | palette.setBrush(QPalette::Active, QPalette::Highlight, QColor(48, 140, 198)); never executed (the execution status of this line is deduced): palette.setBrush(QPalette::Active, QPalette::Highlight, QColor(48, 140, 198)); | - |
1908 | palette.setBrush(QPalette::Inactive, QPalette::Highlight, QColor(145, 141, 126)); never executed (the execution status of this line is deduced): palette.setBrush(QPalette::Inactive, QPalette::Highlight, QColor(145, 141, 126)); | - |
1909 | palette.setBrush(QPalette::Disabled, QPalette::Highlight, QColor(145, 141, 126)); never executed (the execution status of this line is deduced): palette.setBrush(QPalette::Disabled, QPalette::Highlight, QColor(145, 141, 126)); | - |
1910 | | - |
1911 | QColor backGround(239, 235, 231); never executed (the execution status of this line is deduced): QColor backGround(239, 235, 231); | - |
1912 | | - |
1913 | QColor light = backGround.lighter(150); never executed (the execution status of this line is deduced): QColor light = backGround.lighter(150); | - |
1914 | QColor base = Qt::white; never executed (the execution status of this line is deduced): QColor base = Qt::white; | - |
1915 | QColor dark = QColor(170, 156, 143).darker(110); never executed (the execution status of this line is deduced): QColor dark = QColor(170, 156, 143).darker(110); | - |
1916 | dark = backGround.darker(150); never executed (the execution status of this line is deduced): dark = backGround.darker(150); | - |
1917 | QColor darkDisabled = QColor(209, 200, 191).darker(110); never executed (the execution status of this line is deduced): QColor darkDisabled = QColor(209, 200, 191).darker(110); | - |
1918 | | - |
1919 | //### Find the correct disabled text color | - |
1920 | palette.setBrush(QPalette::Disabled, QPalette::Text, QColor(190, 190, 190)); never executed (the execution status of this line is deduced): palette.setBrush(QPalette::Disabled, QPalette::Text, QColor(190, 190, 190)); | - |
1921 | | - |
1922 | palette.setBrush(QPalette::Window, backGround); never executed (the execution status of this line is deduced): palette.setBrush(QPalette::Window, backGround); | - |
1923 | palette.setBrush(QPalette::Mid, backGround.darker(130)); never executed (the execution status of this line is deduced): palette.setBrush(QPalette::Mid, backGround.darker(130)); | - |
1924 | palette.setBrush(QPalette::Light, light); never executed (the execution status of this line is deduced): palette.setBrush(QPalette::Light, light); | - |
1925 | | - |
1926 | palette.setBrush(QPalette::Active, QPalette::Base, base); never executed (the execution status of this line is deduced): palette.setBrush(QPalette::Active, QPalette::Base, base); | - |
1927 | palette.setBrush(QPalette::Inactive, QPalette::Base, base); never executed (the execution status of this line is deduced): palette.setBrush(QPalette::Inactive, QPalette::Base, base); | - |
1928 | palette.setBrush(QPalette::Disabled, QPalette::Base, backGround); never executed (the execution status of this line is deduced): palette.setBrush(QPalette::Disabled, QPalette::Base, backGround); | - |
1929 | | - |
1930 | palette.setBrush(QPalette::Midlight, palette.mid().color().lighter(110)); never executed (the execution status of this line is deduced): palette.setBrush(QPalette::Midlight, palette.mid().color().lighter(110)); | - |
1931 | | - |
1932 | palette.setBrush(QPalette::All, QPalette::Dark, dark); never executed (the execution status of this line is deduced): palette.setBrush(QPalette::All, QPalette::Dark, dark); | - |
1933 | palette.setBrush(QPalette::Disabled, QPalette::Dark, darkDisabled); never executed (the execution status of this line is deduced): palette.setBrush(QPalette::Disabled, QPalette::Dark, darkDisabled); | - |
1934 | | - |
1935 | QColor button = backGround; never executed (the execution status of this line is deduced): QColor button = backGround; | - |
1936 | | - |
1937 | palette.setBrush(QPalette::Button, button); never executed (the execution status of this line is deduced): palette.setBrush(QPalette::Button, button); | - |
1938 | | - |
1939 | QColor shadow = dark.darker(135); never executed (the execution status of this line is deduced): QColor shadow = dark.darker(135); | - |
1940 | palette.setBrush(QPalette::Shadow, shadow); never executed (the execution status of this line is deduced): palette.setBrush(QPalette::Shadow, shadow); | - |
1941 | palette.setBrush(QPalette::Disabled, QPalette::Shadow, shadow.lighter(150)); never executed (the execution status of this line is deduced): palette.setBrush(QPalette::Disabled, QPalette::Shadow, shadow.lighter(150)); | - |
1942 | palette.setBrush(QPalette::HighlightedText, QColor(QRgb(0xffffffff))); never executed (the execution status of this line is deduced): palette.setBrush(QPalette::HighlightedText, QColor(QRgb(0xffffffff))); | - |
1943 | | - |
1944 | return palette; never executed: return palette; | 0 |
1945 | } | - |
1946 | | - |
1947 | /*! | - |
1948 | \reimp | - |
1949 | */ | - |
1950 | void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, | - |
1951 | QPainter *painter, const QWidget *widget) const | - |
1952 | { | - |
1953 | | - |
1954 | Q_D (const QFusionStyle); executed (the execution status of this line is deduced): const QFusionStylePrivate * const d = d_func(); | - |
1955 | | - |
1956 | QColor buttonColor = d->buttonColor(option->palette); executed (the execution status of this line is deduced): QColor buttonColor = d->buttonColor(option->palette); | - |
1957 | QColor gradientStartColor = buttonColor.lighter(118); executed (the execution status of this line is deduced): QColor gradientStartColor = buttonColor.lighter(118); | - |
1958 | QColor gradientStopColor = buttonColor; executed (the execution status of this line is deduced): QColor gradientStopColor = buttonColor; | - |
1959 | QColor outline = d->outline(option->palette); executed (the execution status of this line is deduced): QColor outline = d->outline(option->palette); | - |
1960 | | - |
1961 | QColor alphaCornerColor; executed (the execution status of this line is deduced): QColor alphaCornerColor; | - |
1962 | if (widget) { evaluated: widget yes Evaluation Count:147 | yes Evaluation Count:8 |
| 8-147 |
1963 | // ### backgroundrole/foregroundrole should be part of the style option | - |
1964 | alphaCornerColor = mergedColors(option->palette.color(widget->backgroundRole()), outline); executed (the execution status of this line is deduced): alphaCornerColor = mergedColors(option->palette.color(widget->backgroundRole()), outline); | - |
1965 | } else { executed: } Execution Count:147 | 147 |
1966 | alphaCornerColor = mergedColors(option->palette.background().color(), outline); executed (the execution status of this line is deduced): alphaCornerColor = mergedColors(option->palette.background().color(), outline); | - |
1967 | } executed: } Execution Count:8 | 8 |
1968 | | - |
1969 | switch (control) { | - |
1970 | case CC_GroupBox: | - |
1971 | painter->save(); executed (the execution status of this line is deduced): painter->save(); | - |
1972 | if (const QStyleOptionGroupBox *groupBox = qstyleoption_cast<const QStyleOptionGroupBox *>(option)) { partially evaluated: const QStyleOptionGroupBox *groupBox = qstyleoption_cast<const QStyleOptionGroupBox *>(option) yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
1973 | // Draw frame | - |
1974 | QRect textRect = proxy()->subControlRect(CC_GroupBox, option, SC_GroupBoxLabel, widget); executed (the execution status of this line is deduced): QRect textRect = proxy()->subControlRect(CC_GroupBox, option, SC_GroupBoxLabel, widget); | - |
1975 | QRect checkBoxRect = proxy()->subControlRect(CC_GroupBox, option, SC_GroupBoxCheckBox, widget); executed (the execution status of this line is deduced): QRect checkBoxRect = proxy()->subControlRect(CC_GroupBox, option, SC_GroupBoxCheckBox, widget); | - |
1976 | | - |
1977 | if (groupBox->subControls & QStyle::SC_GroupBoxFrame) { partially evaluated: groupBox->subControls & QStyle::SC_GroupBoxFrame yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
1978 | QStyleOptionFrame frame; executed (the execution status of this line is deduced): QStyleOptionFrame frame; | - |
1979 | frame.QStyleOption::operator=(*groupBox); executed (the execution status of this line is deduced): frame.QStyleOption::operator=(*groupBox); | - |
1980 | frame.features = groupBox->features; executed (the execution status of this line is deduced): frame.features = groupBox->features; | - |
1981 | frame.lineWidth = groupBox->lineWidth; executed (the execution status of this line is deduced): frame.lineWidth = groupBox->lineWidth; | - |
1982 | frame.midLineWidth = groupBox->midLineWidth; executed (the execution status of this line is deduced): frame.midLineWidth = groupBox->midLineWidth; | - |
1983 | frame.rect = proxy()->subControlRect(CC_GroupBox, option, SC_GroupBoxFrame, widget); executed (the execution status of this line is deduced): frame.rect = proxy()->subControlRect(CC_GroupBox, option, SC_GroupBoxFrame, widget); | - |
1984 | proxy()->drawPrimitive(PE_FrameGroupBox, &frame, painter, widget); executed (the execution status of this line is deduced): proxy()->drawPrimitive(PE_FrameGroupBox, &frame, painter, widget); | - |
1985 | } executed: } Execution Count:1 | 1 |
1986 | | - |
1987 | // Draw title | - |
1988 | if ((groupBox->subControls & QStyle::SC_GroupBoxLabel) && !groupBox->text.isEmpty()) { partially evaluated: (groupBox->subControls & QStyle::SC_GroupBoxLabel) yes Evaluation Count:1 | no Evaluation Count:0 |
partially evaluated: !groupBox->text.isEmpty() no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
1989 | // groupBox->textColor gets the incorrect palette here | - |
1990 | painter->setPen(QPen(option->palette.windowText(), 1)); never executed (the execution status of this line is deduced): painter->setPen(QPen(option->palette.windowText(), 1)); | - |
1991 | int alignment = int(groupBox->textAlignment); never executed (the execution status of this line is deduced): int alignment = int(groupBox->textAlignment); | - |
1992 | if (!proxy()->styleHint(QStyle::SH_UnderlineShortcut, option, widget)) never evaluated: !proxy()->styleHint(QStyle::SH_UnderlineShortcut, option, widget) | 0 |
1993 | alignment |= Qt::TextHideMnemonic; never executed: alignment |= Qt::TextHideMnemonic; | 0 |
1994 | | - |
1995 | proxy()->drawItemText(painter, textRect, Qt::TextShowMnemonic | Qt::AlignLeft | alignment, never executed (the execution status of this line is deduced): proxy()->drawItemText(painter, textRect, Qt::TextShowMnemonic | Qt::AlignLeft | alignment, | - |
1996 | groupBox->palette, groupBox->state & State_Enabled, groupBox->text, QPalette::NoRole); never executed (the execution status of this line is deduced): groupBox->palette, groupBox->state & State_Enabled, groupBox->text, QPalette::NoRole); | - |
1997 | | - |
1998 | if (groupBox->state & State_HasFocus) { never evaluated: groupBox->state & State_HasFocus | 0 |
1999 | QStyleOptionFocusRect fropt; never executed (the execution status of this line is deduced): QStyleOptionFocusRect fropt; | - |
2000 | fropt.QStyleOption::operator=(*groupBox); never executed (the execution status of this line is deduced): fropt.QStyleOption::operator=(*groupBox); | - |
2001 | fropt.rect = textRect.adjusted(-2, -1, 2, 1); never executed (the execution status of this line is deduced): fropt.rect = textRect.adjusted(-2, -1, 2, 1); | - |
2002 | proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget); never executed (the execution status of this line is deduced): proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget); | - |
2003 | } | 0 |
2004 | } | 0 |
2005 | | - |
2006 | // Draw checkbox | - |
2007 | if (groupBox->subControls & SC_GroupBoxCheckBox) { partially evaluated: groupBox->subControls & SC_GroupBoxCheckBox yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
2008 | QStyleOptionButton box; executed (the execution status of this line is deduced): QStyleOptionButton box; | - |
2009 | box.QStyleOption::operator=(*groupBox); executed (the execution status of this line is deduced): box.QStyleOption::operator=(*groupBox); | - |
2010 | box.rect = checkBoxRect; executed (the execution status of this line is deduced): box.rect = checkBoxRect; | - |
2011 | proxy()->drawPrimitive(PE_IndicatorCheckBox, &box, painter, widget); executed (the execution status of this line is deduced): proxy()->drawPrimitive(PE_IndicatorCheckBox, &box, painter, widget); | - |
2012 | } executed: } Execution Count:1 | 1 |
2013 | } executed: } Execution Count:1 | 1 |
2014 | painter->restore(); executed (the execution status of this line is deduced): painter->restore(); | - |
2015 | break; executed: break; Execution Count:1 | 1 |
2016 | case CC_SpinBox: | - |
2017 | if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) { partially evaluated: const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option) yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-3 |
2018 | QPixmap cache; executed (the execution status of this line is deduced): QPixmap cache; | - |
2019 | QString pixmapName = QStyleHelper::uniqueName(QLatin1String("spinbox"), spinBox, spinBox->rect.size()); executed (the execution status of this line is deduced): QString pixmapName = QStyleHelper::uniqueName(QLatin1String("spinbox"), spinBox, spinBox->rect.size()); | - |
2020 | if (!QPixmapCache::find(pixmapName, cache)) { partially evaluated: !QPixmapCache::find(pixmapName, cache) yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-3 |
2021 | | - |
2022 | cache = styleCachePixmap(spinBox->rect.size()); executed (the execution status of this line is deduced): cache = styleCachePixmap(spinBox->rect.size()); | - |
2023 | cache.fill(Qt::transparent); executed (the execution status of this line is deduced): cache.fill(Qt::transparent); | - |
2024 | | - |
2025 | QRect pixmapRect(0, 0, spinBox->rect.width(), spinBox->rect.height()); executed (the execution status of this line is deduced): QRect pixmapRect(0, 0, spinBox->rect.width(), spinBox->rect.height()); | - |
2026 | QRect rect = pixmapRect; executed (the execution status of this line is deduced): QRect rect = pixmapRect; | - |
2027 | QRect r = rect.adjusted(0, 1, 0, -1); executed (the execution status of this line is deduced): QRect r = rect.adjusted(0, 1, 0, -1); | - |
2028 | QPainter cachePainter(&cache); executed (the execution status of this line is deduced): QPainter cachePainter(&cache); | - |
2029 | QColor arrowColor = spinBox->palette.foreground().color(); executed (the execution status of this line is deduced): QColor arrowColor = spinBox->palette.foreground().color(); | - |
2030 | arrowColor.setAlpha(220); executed (the execution status of this line is deduced): arrowColor.setAlpha(220); | - |
2031 | | - |
2032 | bool isEnabled = (spinBox->state & State_Enabled); executed (the execution status of this line is deduced): bool isEnabled = (spinBox->state & State_Enabled); | - |
2033 | bool hover = isEnabled && (spinBox->state & State_MouseOver); partially evaluated: isEnabled yes Evaluation Count:3 | no Evaluation Count:0 |
partially evaluated: (spinBox->state & State_MouseOver) no Evaluation Count:0 | yes Evaluation Count:3 |
| 0-3 |
2034 | bool sunken = (spinBox->state & State_Sunken); executed (the execution status of this line is deduced): bool sunken = (spinBox->state & State_Sunken); | - |
2035 | bool upIsActive = (spinBox->activeSubControls == SC_SpinBoxUp); executed (the execution status of this line is deduced): bool upIsActive = (spinBox->activeSubControls == SC_SpinBoxUp); | - |
2036 | bool downIsActive = (spinBox->activeSubControls == SC_SpinBoxDown); executed (the execution status of this line is deduced): bool downIsActive = (spinBox->activeSubControls == SC_SpinBoxDown); | - |
2037 | bool hasFocus = (option->state & State_HasFocus); executed (the execution status of this line is deduced): bool hasFocus = (option->state & State_HasFocus); | - |
2038 | | - |
2039 | QStyleOptionSpinBox spinBoxCopy = *spinBox; executed (the execution status of this line is deduced): QStyleOptionSpinBox spinBoxCopy = *spinBox; | - |
2040 | spinBoxCopy.rect = pixmapRect; executed (the execution status of this line is deduced): spinBoxCopy.rect = pixmapRect; | - |
2041 | QRect upRect = proxy()->subControlRect(CC_SpinBox, &spinBoxCopy, SC_SpinBoxUp, widget); executed (the execution status of this line is deduced): QRect upRect = proxy()->subControlRect(CC_SpinBox, &spinBoxCopy, SC_SpinBoxUp, widget); | - |
2042 | QRect downRect = proxy()->subControlRect(CC_SpinBox, &spinBoxCopy, SC_SpinBoxDown, widget); executed (the execution status of this line is deduced): QRect downRect = proxy()->subControlRect(CC_SpinBox, &spinBoxCopy, SC_SpinBoxDown, widget); | - |
2043 | | - |
2044 | if (spinBox->frame) { evaluated: spinBox->frame yes Evaluation Count:2 | yes Evaluation Count:1 |
| 1-2 |
2045 | cachePainter.save(); executed (the execution status of this line is deduced): cachePainter.save(); | - |
2046 | cachePainter.setRenderHint(QPainter::Antialiasing, true); executed (the execution status of this line is deduced): cachePainter.setRenderHint(QPainter::Antialiasing, true); | - |
2047 | cachePainter.translate(0.5, 0.5); executed (the execution status of this line is deduced): cachePainter.translate(0.5, 0.5); | - |
2048 | | - |
2049 | // Fill background | - |
2050 | cachePainter.setPen(Qt::NoPen); executed (the execution status of this line is deduced): cachePainter.setPen(Qt::NoPen); | - |
2051 | cachePainter.setBrush(option->palette.base()); executed (the execution status of this line is deduced): cachePainter.setBrush(option->palette.base()); | - |
2052 | cachePainter.drawRoundedRect(r.adjusted(0, 0, -1, -1), 2, 2); executed (the execution status of this line is deduced): cachePainter.drawRoundedRect(r.adjusted(0, 0, -1, -1), 2, 2); | - |
2053 | | - |
2054 | // Draw inner shadow | - |
2055 | cachePainter.setPen(d->topShadow()); executed (the execution status of this line is deduced): cachePainter.setPen(d->topShadow()); | - |
2056 | cachePainter.drawLine(QPoint(r.left() + 2, r.top() + 1), QPoint(r.right() - 2, r.top() + 1)); executed (the execution status of this line is deduced): cachePainter.drawLine(QPoint(r.left() + 2, r.top() + 1), QPoint(r.right() - 2, r.top() + 1)); | - |
2057 | | - |
2058 | // Draw button gradient | - |
2059 | QColor buttonColor = d->buttonColor(option->palette); executed (the execution status of this line is deduced): QColor buttonColor = d->buttonColor(option->palette); | - |
2060 | QRect updownRect = upRect.adjusted(0, -2, 0, downRect.height() + 2); executed (the execution status of this line is deduced): QRect updownRect = upRect.adjusted(0, -2, 0, downRect.height() + 2); | - |
2061 | QLinearGradient gradient = qt_fusion_gradient(updownRect, (isEnabled && option->state & State_MouseOver ) ? buttonColor : buttonColor.darker(104)); executed (the execution status of this line is deduced): QLinearGradient gradient = qt_fusion_gradient(updownRect, (isEnabled && option->state & State_MouseOver ) ? buttonColor : buttonColor.darker(104)); | - |
2062 | | - |
2063 | // Draw button gradient | - |
2064 | cachePainter.setPen(Qt::NoPen); executed (the execution status of this line is deduced): cachePainter.setPen(Qt::NoPen); | - |
2065 | cachePainter.setBrush(gradient); executed (the execution status of this line is deduced): cachePainter.setBrush(gradient); | - |
2066 | | - |
2067 | cachePainter.save(); executed (the execution status of this line is deduced): cachePainter.save(); | - |
2068 | cachePainter.setClipRect(updownRect); executed (the execution status of this line is deduced): cachePainter.setClipRect(updownRect); | - |
2069 | cachePainter.drawRoundedRect(r.adjusted(0, 0, -1, -1), 2, 2); executed (the execution status of this line is deduced): cachePainter.drawRoundedRect(r.adjusted(0, 0, -1, -1), 2, 2); | - |
2070 | cachePainter.setPen(QPen(d->innerContrastLine())); executed (the execution status of this line is deduced): cachePainter.setPen(QPen(d->innerContrastLine())); | - |
2071 | cachePainter.setBrush(Qt::NoBrush); executed (the execution status of this line is deduced): cachePainter.setBrush(Qt::NoBrush); | - |
2072 | cachePainter.drawRoundedRect(r.adjusted(1, 1, -2, -2), 2, 2); executed (the execution status of this line is deduced): cachePainter.drawRoundedRect(r.adjusted(1, 1, -2, -2), 2, 2); | - |
2073 | cachePainter.restore(); executed (the execution status of this line is deduced): cachePainter.restore(); | - |
2074 | | - |
2075 | if ((spinBox->stepEnabled & QAbstractSpinBox::StepUpEnabled) && upIsActive) { partially evaluated: (spinBox->stepEnabled & QAbstractSpinBox::StepUpEnabled) yes Evaluation Count:2 | no Evaluation Count:0 |
partially evaluated: upIsActive no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
2076 | if (sunken) | 0 |
2077 | cachePainter.fillRect(upRect.adjusted(0, -1, 0, 0), gradientStopColor.darker(110)); never executed: cachePainter.fillRect(upRect.adjusted(0, -1, 0, 0), gradientStopColor.darker(110)); | 0 |
2078 | else if (hover) | 0 |
2079 | cachePainter.fillRect(upRect.adjusted(0, -1, 0, 0), d->innerContrastLine()); never executed: cachePainter.fillRect(upRect.adjusted(0, -1, 0, 0), d->innerContrastLine()); | 0 |
2080 | } | - |
2081 | | - |
2082 | if ((spinBox->stepEnabled & QAbstractSpinBox::StepDownEnabled) && downIsActive) { partially evaluated: (spinBox->stepEnabled & QAbstractSpinBox::StepDownEnabled) no Evaluation Count:0 | yes Evaluation Count:2 |
never evaluated: downIsActive | 0-2 |
2083 | if (sunken) | 0 |
2084 | cachePainter.fillRect(downRect.adjusted(0, 0, 0, 1), gradientStopColor.darker(110)); never executed: cachePainter.fillRect(downRect.adjusted(0, 0, 0, 1), gradientStopColor.darker(110)); | 0 |
2085 | else if (hover) | 0 |
2086 | cachePainter.fillRect(downRect.adjusted(0, 0, 0, 1), d->innerContrastLine()); never executed: cachePainter.fillRect(downRect.adjusted(0, 0, 0, 1), d->innerContrastLine()); | 0 |
2087 | } | - |
2088 | | - |
2089 | cachePainter.setPen(hasFocus ? d->highlightedOutline(option->palette) : outline); executed (the execution status of this line is deduced): cachePainter.setPen(hasFocus ? d->highlightedOutline(option->palette) : outline); | - |
2090 | cachePainter.setBrush(Qt::NoBrush); executed (the execution status of this line is deduced): cachePainter.setBrush(Qt::NoBrush); | - |
2091 | cachePainter.drawRoundedRect(r.adjusted(0, 0, -1, -1), 2, 2); executed (the execution status of this line is deduced): cachePainter.drawRoundedRect(r.adjusted(0, 0, -1, -1), 2, 2); | - |
2092 | if (hasFocus) { evaluated: hasFocus yes Evaluation Count:1 | yes Evaluation Count:1 |
| 1 |
2093 | QColor softHighlight = option->palette.highlight().color(); executed (the execution status of this line is deduced): QColor softHighlight = option->palette.highlight().color(); | - |
2094 | softHighlight.setAlpha(40); executed (the execution status of this line is deduced): softHighlight.setAlpha(40); | - |
2095 | cachePainter.setPen(softHighlight); executed (the execution status of this line is deduced): cachePainter.setPen(softHighlight); | - |
2096 | cachePainter.drawRoundedRect(r.adjusted(1, 1, -2, -2), 1.7, 1.7); executed (the execution status of this line is deduced): cachePainter.drawRoundedRect(r.adjusted(1, 1, -2, -2), 1.7, 1.7); | - |
2097 | } executed: } Execution Count:1 | 1 |
2098 | cachePainter.restore(); executed (the execution status of this line is deduced): cachePainter.restore(); | - |
2099 | } executed: } Execution Count:2 | 2 |
2100 | | - |
2101 | // outline the up/down buttons | - |
2102 | cachePainter.setPen(outline); executed (the execution status of this line is deduced): cachePainter.setPen(outline); | - |
2103 | if (spinBox->direction == Qt::RightToLeft) { partially evaluated: spinBox->direction == Qt::RightToLeft no Evaluation Count:0 | yes Evaluation Count:3 |
| 0-3 |
2104 | cachePainter.drawLine(upRect.right(), upRect.top() - 1, upRect.right(), downRect.bottom() + 1); never executed (the execution status of this line is deduced): cachePainter.drawLine(upRect.right(), upRect.top() - 1, upRect.right(), downRect.bottom() + 1); | - |
2105 | } else { | 0 |
2106 | cachePainter.drawLine(upRect.left(), upRect.top() - 1, upRect.left(), downRect.bottom() + 1); executed (the execution status of this line is deduced): cachePainter.drawLine(upRect.left(), upRect.top() - 1, upRect.left(), downRect.bottom() + 1); | - |
2107 | } executed: } Execution Count:3 | 3 |
2108 | | - |
2109 | if (upIsActive && sunken) { partially evaluated: upIsActive no Evaluation Count:0 | yes Evaluation Count:3 |
never evaluated: sunken | 0-3 |
2110 | cachePainter.setPen(gradientStopColor.darker(130)); never executed (the execution status of this line is deduced): cachePainter.setPen(gradientStopColor.darker(130)); | - |
2111 | cachePainter.drawLine(downRect.left() + 1, downRect.top(), downRect.right(), downRect.top()); never executed (the execution status of this line is deduced): cachePainter.drawLine(downRect.left() + 1, downRect.top(), downRect.right(), downRect.top()); | - |
2112 | cachePainter.drawLine(upRect.left() + 1, upRect.top(), upRect.left() + 1, upRect.bottom()); never executed (the execution status of this line is deduced): cachePainter.drawLine(upRect.left() + 1, upRect.top(), upRect.left() + 1, upRect.bottom()); | - |
2113 | cachePainter.drawLine(upRect.left() + 1, upRect.top() - 1, upRect.right(), upRect.top() - 1); never executed (the execution status of this line is deduced): cachePainter.drawLine(upRect.left() + 1, upRect.top() - 1, upRect.right(), upRect.top() - 1); | - |
2114 | } | 0 |
2115 | | - |
2116 | if (downIsActive && sunken) { partially evaluated: downIsActive no Evaluation Count:0 | yes Evaluation Count:3 |
never evaluated: sunken | 0-3 |
2117 | cachePainter.setPen(gradientStopColor.darker(130)); never executed (the execution status of this line is deduced): cachePainter.setPen(gradientStopColor.darker(130)); | - |
2118 | cachePainter.drawLine(downRect.left() + 1, downRect.top(), downRect.left() + 1, downRect.bottom() + 1); never executed (the execution status of this line is deduced): cachePainter.drawLine(downRect.left() + 1, downRect.top(), downRect.left() + 1, downRect.bottom() + 1); | - |
2119 | cachePainter.drawLine(downRect.left() + 1, downRect.top(), downRect.right(), downRect.top()); never executed (the execution status of this line is deduced): cachePainter.drawLine(downRect.left() + 1, downRect.top(), downRect.right(), downRect.top()); | - |
2120 | cachePainter.setPen(gradientStopColor.darker(110)); never executed (the execution status of this line is deduced): cachePainter.setPen(gradientStopColor.darker(110)); | - |
2121 | cachePainter.drawLine(downRect.left() + 1, downRect.bottom() + 1, downRect.right(), downRect.bottom() + 1); never executed (the execution status of this line is deduced): cachePainter.drawLine(downRect.left() + 1, downRect.bottom() + 1, downRect.right(), downRect.bottom() + 1); | - |
2122 | } | 0 |
2123 | | - |
2124 | QColor disabledColor = mergedColors(arrowColor, option->palette.button().color()); executed (the execution status of this line is deduced): QColor disabledColor = mergedColors(arrowColor, option->palette.button().color()); | - |
2125 | if (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus) { partially evaluated: spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus no Evaluation Count:0 | yes Evaluation Count:3 |
| 0-3 |
2126 | int centerX = upRect.center().x(); never executed (the execution status of this line is deduced): int centerX = upRect.center().x(); | - |
2127 | int centerY = upRect.center().y(); never executed (the execution status of this line is deduced): int centerY = upRect.center().y(); | - |
2128 | | - |
2129 | // plus/minus | - |
2130 | cachePainter.setPen((spinBox->stepEnabled & QAbstractSpinBox::StepUpEnabled) ? arrowColor : disabledColor); never executed (the execution status of this line is deduced): cachePainter.setPen((spinBox->stepEnabled & QAbstractSpinBox::StepUpEnabled) ? arrowColor : disabledColor); | - |
2131 | cachePainter.drawLine(centerX - 1, centerY, centerX + 3, centerY); never executed (the execution status of this line is deduced): cachePainter.drawLine(centerX - 1, centerY, centerX + 3, centerY); | - |
2132 | cachePainter.drawLine(centerX + 1, centerY - 2, centerX + 1, centerY + 2); never executed (the execution status of this line is deduced): cachePainter.drawLine(centerX + 1, centerY - 2, centerX + 1, centerY + 2); | - |
2133 | | - |
2134 | centerX = downRect.center().x(); never executed (the execution status of this line is deduced): centerX = downRect.center().x(); | - |
2135 | centerY = downRect.center().y(); never executed (the execution status of this line is deduced): centerY = downRect.center().y(); | - |
2136 | cachePainter.setPen((spinBox->stepEnabled & QAbstractSpinBox::StepDownEnabled) ? arrowColor : disabledColor); never executed (the execution status of this line is deduced): cachePainter.setPen((spinBox->stepEnabled & QAbstractSpinBox::StepDownEnabled) ? arrowColor : disabledColor); | - |
2137 | cachePainter.drawLine(centerX - 1, centerY, centerX + 3, centerY); never executed (the execution status of this line is deduced): cachePainter.drawLine(centerX - 1, centerY, centerX + 3, centerY); | - |
2138 | | - |
2139 | } else if (spinBox->buttonSymbols == QAbstractSpinBox::UpDownArrows){ never executed: } partially evaluated: spinBox->buttonSymbols == QAbstractSpinBox::UpDownArrows yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-3 |
2140 | // arrows | - |
2141 | painter->setRenderHint(QPainter::SmoothPixmapTransform); executed (the execution status of this line is deduced): painter->setRenderHint(QPainter::SmoothPixmapTransform); | - |
2142 | | - |
2143 | QPixmap upArrow = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), executed (the execution status of this line is deduced): QPixmap upArrow = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), | - |
2144 | (spinBox->stepEnabled & QAbstractSpinBox::StepUpEnabled) ? arrowColor : disabledColor); executed (the execution status of this line is deduced): (spinBox->stepEnabled & QAbstractSpinBox::StepUpEnabled) ? arrowColor : disabledColor); | - |
2145 | | - |
2146 | QRectF upArrowRect = QRectF(upRect.center().x() - upArrow.width() / 4.0 + 1.0, executed (the execution status of this line is deduced): QRectF upArrowRect = QRectF(upRect.center().x() - upArrow.width() / 4.0 + 1.0, | - |
2147 | upRect.center().y() - upArrow.height() / 4.0 + 1.0, executed (the execution status of this line is deduced): upRect.center().y() - upArrow.height() / 4.0 + 1.0, | - |
2148 | upArrow.width() / 2.0, upArrow.height() / 2.0); executed (the execution status of this line is deduced): upArrow.width() / 2.0, upArrow.height() / 2.0); | - |
2149 | | - |
2150 | cachePainter.drawPixmap(upArrowRect, upArrow, QRectF(QPointF(0.0, 0.0), upArrow.size())); executed (the execution status of this line is deduced): cachePainter.drawPixmap(upArrowRect, upArrow, QRectF(QPointF(0.0, 0.0), upArrow.size())); | - |
2151 | | - |
2152 | QPixmap downArrow = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), executed (the execution status of this line is deduced): QPixmap downArrow = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), | - |
2153 | (spinBox->stepEnabled & QAbstractSpinBox::StepDownEnabled) ? arrowColor : disabledColor, 180); executed (the execution status of this line is deduced): (spinBox->stepEnabled & QAbstractSpinBox::StepDownEnabled) ? arrowColor : disabledColor, 180); | - |
2154 | QRectF downArrowRect = QRectF(downRect.center().x() - downArrow.width() / 4.0 + 1.0, executed (the execution status of this line is deduced): QRectF downArrowRect = QRectF(downRect.center().x() - downArrow.width() / 4.0 + 1.0, | - |
2155 | downRect.center().y() - downArrow.height() / 4.0 + 1.0, executed (the execution status of this line is deduced): downRect.center().y() - downArrow.height() / 4.0 + 1.0, | - |
2156 | downArrow.width() / 2.0, downArrow.height() / 2.0); executed (the execution status of this line is deduced): downArrow.width() / 2.0, downArrow.height() / 2.0); | - |
2157 | cachePainter.drawPixmap(downArrowRect, downArrow, QRectF(QPointF(0.0, 0.0), downArrow.size())); executed (the execution status of this line is deduced): cachePainter.drawPixmap(downArrowRect, downArrow, QRectF(QPointF(0.0, 0.0), downArrow.size())); | - |
2158 | } executed: } Execution Count:3 | 3 |
2159 | | - |
2160 | cachePainter.end(); executed (the execution status of this line is deduced): cachePainter.end(); | - |
2161 | QPixmapCache::insert(pixmapName, cache); executed (the execution status of this line is deduced): QPixmapCache::insert(pixmapName, cache); | - |
2162 | } executed: } Execution Count:3 | 3 |
2163 | painter->drawPixmap(spinBox->rect.topLeft(), cache); executed (the execution status of this line is deduced): painter->drawPixmap(spinBox->rect.topLeft(), cache); | - |
2164 | } executed: } Execution Count:3 | 3 |
2165 | break; executed: break; Execution Count:3 | 3 |
2166 | case CC_TitleBar: | - |
2167 | painter->save(); executed (the execution status of this line is deduced): painter->save(); | - |
2168 | if (const QStyleOptionTitleBar *titleBar = qstyleoption_cast<const QStyleOptionTitleBar *>(option)) { partially evaluated: const QStyleOptionTitleBar *titleBar = qstyleoption_cast<const QStyleOptionTitleBar *>(option) yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
2169 | const int buttonMargin = 5; executed (the execution status of this line is deduced): const int buttonMargin = 5; | - |
2170 | bool active = (titleBar->titleBarState & State_Active); executed (the execution status of this line is deduced): bool active = (titleBar->titleBarState & State_Active); | - |
2171 | QRect fullRect = titleBar->rect; executed (the execution status of this line is deduced): QRect fullRect = titleBar->rect; | - |
2172 | QPalette palette = option->palette; executed (the execution status of this line is deduced): QPalette palette = option->palette; | - |
2173 | QColor highlight = option->palette.highlight().color(); executed (the execution status of this line is deduced): QColor highlight = option->palette.highlight().color(); | - |
2174 | | - |
2175 | QColor titleBarFrameBorder(active ? highlight.darker(180): outline.darker(110)); executed (the execution status of this line is deduced): QColor titleBarFrameBorder(active ? highlight.darker(180): outline.darker(110)); | - |
2176 | QColor titleBarHighlight(active ? highlight.lighter(120): palette.background().color().lighter(120)); executed (the execution status of this line is deduced): QColor titleBarHighlight(active ? highlight.lighter(120): palette.background().color().lighter(120)); | - |
2177 | QColor textColor(active ? 0xffffff : 0xff000000); executed (the execution status of this line is deduced): QColor textColor(active ? 0xffffff : 0xff000000); | - |
2178 | QColor textAlphaColor(active ? 0xffffff : 0xff000000 ); executed (the execution status of this line is deduced): QColor textAlphaColor(active ? 0xffffff : 0xff000000 ); | - |
2179 | | - |
2180 | { | - |
2181 | // Fill title bar gradient | - |
2182 | QColor titlebarColor = QColor(active ? highlight: palette.background().color()); never executed (the execution status of this line is deduced): QColor titlebarColor = QColor(active ? highlight: palette.background().color()); | - |
2183 | QLinearGradient gradient(option->rect.center().x(), option->rect.top(), never executed (the execution status of this line is deduced): QLinearGradient gradient(option->rect.center().x(), option->rect.top(), | - |
2184 | option->rect.center().x(), option->rect.bottom()); never executed (the execution status of this line is deduced): option->rect.center().x(), option->rect.bottom()); | - |
2185 | | - |
2186 | gradient.setColorAt(0, titlebarColor.lighter(114)); never executed (the execution status of this line is deduced): gradient.setColorAt(0, titlebarColor.lighter(114)); | - |
2187 | gradient.setColorAt(0.5, titlebarColor.lighter(102)); never executed (the execution status of this line is deduced): gradient.setColorAt(0.5, titlebarColor.lighter(102)); | - |
2188 | gradient.setColorAt(0.51, titlebarColor.darker(104)); never executed (the execution status of this line is deduced): gradient.setColorAt(0.51, titlebarColor.darker(104)); | - |
2189 | gradient.setColorAt(1, titlebarColor); never executed (the execution status of this line is deduced): gradient.setColorAt(1, titlebarColor); | - |
2190 | painter->fillRect(option->rect.adjusted(1, 1, -1, 0), gradient); never executed (the execution status of this line is deduced): painter->fillRect(option->rect.adjusted(1, 1, -1, 0), gradient); | - |
2191 | | - |
2192 | // Frame and rounded corners | - |
2193 | painter->setPen(titleBarFrameBorder); never executed (the execution status of this line is deduced): painter->setPen(titleBarFrameBorder); | - |
2194 | | - |
2195 | // top outline | - |
2196 | painter->drawLine(fullRect.left() + 5, fullRect.top(), fullRect.right() - 5, fullRect.top()); never executed (the execution status of this line is deduced): painter->drawLine(fullRect.left() + 5, fullRect.top(), fullRect.right() - 5, fullRect.top()); | - |
2197 | painter->drawLine(fullRect.left(), fullRect.top() + 4, fullRect.left(), fullRect.bottom()); never executed (the execution status of this line is deduced): painter->drawLine(fullRect.left(), fullRect.top() + 4, fullRect.left(), fullRect.bottom()); | - |
2198 | const QPoint points[5] = { never executed (the execution status of this line is deduced): const QPoint points[5] = { | - |
2199 | QPoint(fullRect.left() + 4, fullRect.top() + 1), never executed (the execution status of this line is deduced): QPoint(fullRect.left() + 4, fullRect.top() + 1), | - |
2200 | QPoint(fullRect.left() + 3, fullRect.top() + 1), never executed (the execution status of this line is deduced): QPoint(fullRect.left() + 3, fullRect.top() + 1), | - |
2201 | QPoint(fullRect.left() + 2, fullRect.top() + 2), never executed (the execution status of this line is deduced): QPoint(fullRect.left() + 2, fullRect.top() + 2), | - |
2202 | QPoint(fullRect.left() + 1, fullRect.top() + 3), never executed (the execution status of this line is deduced): QPoint(fullRect.left() + 1, fullRect.top() + 3), | - |
2203 | QPoint(fullRect.left() + 1, fullRect.top() + 4) never executed (the execution status of this line is deduced): QPoint(fullRect.left() + 1, fullRect.top() + 4) | - |
2204 | }; never executed (the execution status of this line is deduced): }; | - |
2205 | painter->drawPoints(points, 5); never executed (the execution status of this line is deduced): painter->drawPoints(points, 5); | - |
2206 | | - |
2207 | painter->drawLine(fullRect.right(), fullRect.top() + 4, fullRect.right(), fullRect.bottom()); never executed (the execution status of this line is deduced): painter->drawLine(fullRect.right(), fullRect.top() + 4, fullRect.right(), fullRect.bottom()); | - |
2208 | const QPoint points2[5] = { never executed (the execution status of this line is deduced): const QPoint points2[5] = { | - |
2209 | QPoint(fullRect.right() - 3, fullRect.top() + 1), never executed (the execution status of this line is deduced): QPoint(fullRect.right() - 3, fullRect.top() + 1), | - |
2210 | QPoint(fullRect.right() - 4, fullRect.top() + 1), never executed (the execution status of this line is deduced): QPoint(fullRect.right() - 4, fullRect.top() + 1), | - |
2211 | QPoint(fullRect.right() - 2, fullRect.top() + 2), never executed (the execution status of this line is deduced): QPoint(fullRect.right() - 2, fullRect.top() + 2), | - |
2212 | QPoint(fullRect.right() - 1, fullRect.top() + 3), never executed (the execution status of this line is deduced): QPoint(fullRect.right() - 1, fullRect.top() + 3), | - |
2213 | QPoint(fullRect.right() - 1, fullRect.top() + 4) never executed (the execution status of this line is deduced): QPoint(fullRect.right() - 1, fullRect.top() + 4) | - |
2214 | }; never executed (the execution status of this line is deduced): }; | - |
2215 | painter->drawPoints(points2, 5); never executed (the execution status of this line is deduced): painter->drawPoints(points2, 5); | - |
2216 | | - |
2217 | // draw bottomline | - |
2218 | painter->drawLine(fullRect.right(), fullRect.bottom(), fullRect.left(), fullRect.bottom()); never executed (the execution status of this line is deduced): painter->drawLine(fullRect.right(), fullRect.bottom(), fullRect.left(), fullRect.bottom()); | - |
2219 | | - |
2220 | // top highlight | - |
2221 | painter->setPen(titleBarHighlight); never executed (the execution status of this line is deduced): painter->setPen(titleBarHighlight); | - |
2222 | painter->drawLine(fullRect.left() + 6, fullRect.top() + 1, fullRect.right() - 6, fullRect.top() + 1); never executed (the execution status of this line is deduced): painter->drawLine(fullRect.left() + 6, fullRect.top() + 1, fullRect.right() - 6, fullRect.top() + 1); | - |
2223 | } | - |
2224 | // draw title | - |
2225 | QRect textRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarLabel, widget); executed (the execution status of this line is deduced): QRect textRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarLabel, widget); | - |
2226 | painter->setPen(active? (titleBar->palette.text().color().lighter(120)) : executed (the execution status of this line is deduced): painter->setPen(active? (titleBar->palette.text().color().lighter(120)) : | - |
2227 | titleBar->palette.text().color() ); executed (the execution status of this line is deduced): titleBar->palette.text().color() ); | - |
2228 | // Note workspace also does elliding but it does not use the correct font | - |
2229 | QString title = painter->fontMetrics().elidedText(titleBar->text, Qt::ElideRight, textRect.width() - 14); executed (the execution status of this line is deduced): QString title = painter->fontMetrics().elidedText(titleBar->text, Qt::ElideRight, textRect.width() - 14); | - |
2230 | painter->drawText(textRect.adjusted(1, 1, 1, 1), title, QTextOption(Qt::AlignHCenter | Qt::AlignVCenter)); executed (the execution status of this line is deduced): painter->drawText(textRect.adjusted(1, 1, 1, 1), title, QTextOption(Qt::AlignHCenter | Qt::AlignVCenter)); | - |
2231 | painter->setPen(Qt::white); executed (the execution status of this line is deduced): painter->setPen(Qt::white); | - |
2232 | if (active) partially evaluated: active no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
2233 | painter->drawText(textRect, title, QTextOption(Qt::AlignHCenter | Qt::AlignVCenter)); never executed: painter->drawText(textRect, title, QTextOption(Qt::AlignHCenter | Qt::AlignVCenter)); | 0 |
2234 | // min button | - |
2235 | if ((titleBar->subControls & SC_TitleBarMinButton) && (titleBar->titleBarFlags & Qt::WindowMinimizeButtonHint) && partially evaluated: (titleBar->subControls & SC_TitleBarMinButton) yes Evaluation Count:1 | no Evaluation Count:0 |
partially evaluated: (titleBar->titleBarFlags & Qt::WindowMinimizeButtonHint) no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
2236 | !(titleBar->titleBarState& Qt::WindowMinimized)) { never evaluated: !(titleBar->titleBarState& Qt::WindowMinimized) | 0 |
2237 | QRect minButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarMinButton, widget); never executed (the execution status of this line is deduced): QRect minButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarMinButton, widget); | - |
2238 | if (minButtonRect.isValid()) { never evaluated: minButtonRect.isValid() | 0 |
2239 | bool hover = (titleBar->activeSubControls & SC_TitleBarMinButton) && (titleBar->state & State_MouseOver); never evaluated: (titleBar->activeSubControls & SC_TitleBarMinButton) never evaluated: (titleBar->state & State_MouseOver) | 0 |
2240 | bool sunken = (titleBar->activeSubControls & SC_TitleBarMinButton) && (titleBar->state & State_Sunken); never evaluated: (titleBar->activeSubControls & SC_TitleBarMinButton) never evaluated: (titleBar->state & State_Sunken) | 0 |
2241 | qt_fusion_draw_mdibutton(painter, titleBar, minButtonRect, hover, sunken); never executed (the execution status of this line is deduced): qt_fusion_draw_mdibutton(painter, titleBar, minButtonRect, hover, sunken); | - |
2242 | QRect minButtonIconRect = minButtonRect.adjusted(buttonMargin ,buttonMargin , -buttonMargin, -buttonMargin); never executed (the execution status of this line is deduced): QRect minButtonIconRect = minButtonRect.adjusted(buttonMargin ,buttonMargin , -buttonMargin, -buttonMargin); | - |
2243 | painter->setPen(textColor); never executed (the execution status of this line is deduced): painter->setPen(textColor); | - |
2244 | painter->drawLine(minButtonIconRect.center().x() - 2, minButtonIconRect.center().y() + 3, never executed (the execution status of this line is deduced): painter->drawLine(minButtonIconRect.center().x() - 2, minButtonIconRect.center().y() + 3, | - |
2245 | minButtonIconRect.center().x() + 3, minButtonIconRect.center().y() + 3); never executed (the execution status of this line is deduced): minButtonIconRect.center().x() + 3, minButtonIconRect.center().y() + 3); | - |
2246 | painter->drawLine(minButtonIconRect.center().x() - 2, minButtonIconRect.center().y() + 4, never executed (the execution status of this line is deduced): painter->drawLine(minButtonIconRect.center().x() - 2, minButtonIconRect.center().y() + 4, | - |
2247 | minButtonIconRect.center().x() + 3, minButtonIconRect.center().y() + 4); never executed (the execution status of this line is deduced): minButtonIconRect.center().x() + 3, minButtonIconRect.center().y() + 4); | - |
2248 | painter->setPen(textAlphaColor); never executed (the execution status of this line is deduced): painter->setPen(textAlphaColor); | - |
2249 | painter->drawLine(minButtonIconRect.center().x() - 3, minButtonIconRect.center().y() + 3, never executed (the execution status of this line is deduced): painter->drawLine(minButtonIconRect.center().x() - 3, minButtonIconRect.center().y() + 3, | - |
2250 | minButtonIconRect.center().x() - 3, minButtonIconRect.center().y() + 4); never executed (the execution status of this line is deduced): minButtonIconRect.center().x() - 3, minButtonIconRect.center().y() + 4); | - |
2251 | painter->drawLine(minButtonIconRect.center().x() + 4, minButtonIconRect.center().y() + 3, never executed (the execution status of this line is deduced): painter->drawLine(minButtonIconRect.center().x() + 4, minButtonIconRect.center().y() + 3, | - |
2252 | minButtonIconRect.center().x() + 4, minButtonIconRect.center().y() + 4); never executed (the execution status of this line is deduced): minButtonIconRect.center().x() + 4, minButtonIconRect.center().y() + 4); | - |
2253 | } | 0 |
2254 | } | 0 |
2255 | // max button | - |
2256 | if ((titleBar->subControls & SC_TitleBarMaxButton) && (titleBar->titleBarFlags & Qt::WindowMaximizeButtonHint) && partially evaluated: (titleBar->subControls & SC_TitleBarMaxButton) yes Evaluation Count:1 | no Evaluation Count:0 |
partially evaluated: (titleBar->titleBarFlags & Qt::WindowMaximizeButtonHint) no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
2257 | !(titleBar->titleBarState & Qt::WindowMaximized)) { never evaluated: !(titleBar->titleBarState & Qt::WindowMaximized) | 0 |
2258 | QRect maxButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarMaxButton, widget); never executed (the execution status of this line is deduced): QRect maxButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarMaxButton, widget); | - |
2259 | if (maxButtonRect.isValid()) { never evaluated: maxButtonRect.isValid() | 0 |
2260 | bool hover = (titleBar->activeSubControls & SC_TitleBarMaxButton) && (titleBar->state & State_MouseOver); never evaluated: (titleBar->activeSubControls & SC_TitleBarMaxButton) never evaluated: (titleBar->state & State_MouseOver) | 0 |
2261 | bool sunken = (titleBar->activeSubControls & SC_TitleBarMaxButton) && (titleBar->state & State_Sunken); never evaluated: (titleBar->activeSubControls & SC_TitleBarMaxButton) never evaluated: (titleBar->state & State_Sunken) | 0 |
2262 | qt_fusion_draw_mdibutton(painter, titleBar, maxButtonRect, hover, sunken); never executed (the execution status of this line is deduced): qt_fusion_draw_mdibutton(painter, titleBar, maxButtonRect, hover, sunken); | - |
2263 | | - |
2264 | QRect maxButtonIconRect = maxButtonRect.adjusted(buttonMargin, buttonMargin, -buttonMargin, -buttonMargin); never executed (the execution status of this line is deduced): QRect maxButtonIconRect = maxButtonRect.adjusted(buttonMargin, buttonMargin, -buttonMargin, -buttonMargin); | - |
2265 | | - |
2266 | painter->setPen(textColor); never executed (the execution status of this line is deduced): painter->setPen(textColor); | - |
2267 | painter->drawRect(maxButtonIconRect.adjusted(0, 0, -1, -1)); never executed (the execution status of this line is deduced): painter->drawRect(maxButtonIconRect.adjusted(0, 0, -1, -1)); | - |
2268 | painter->drawLine(maxButtonIconRect.left() + 1, maxButtonIconRect.top() + 1, never executed (the execution status of this line is deduced): painter->drawLine(maxButtonIconRect.left() + 1, maxButtonIconRect.top() + 1, | - |
2269 | maxButtonIconRect.right() - 1, maxButtonIconRect.top() + 1); never executed (the execution status of this line is deduced): maxButtonIconRect.right() - 1, maxButtonIconRect.top() + 1); | - |
2270 | painter->setPen(textAlphaColor); never executed (the execution status of this line is deduced): painter->setPen(textAlphaColor); | - |
2271 | const QPoint points[4] = { never executed (the execution status of this line is deduced): const QPoint points[4] = { | - |
2272 | maxButtonIconRect.topLeft(), never executed (the execution status of this line is deduced): maxButtonIconRect.topLeft(), | - |
2273 | maxButtonIconRect.topRight(), never executed (the execution status of this line is deduced): maxButtonIconRect.topRight(), | - |
2274 | maxButtonIconRect.bottomLeft(), never executed (the execution status of this line is deduced): maxButtonIconRect.bottomLeft(), | - |
2275 | maxButtonIconRect.bottomRight() never executed (the execution status of this line is deduced): maxButtonIconRect.bottomRight() | - |
2276 | }; never executed (the execution status of this line is deduced): }; | - |
2277 | painter->drawPoints(points, 4); never executed (the execution status of this line is deduced): painter->drawPoints(points, 4); | - |
2278 | } | 0 |
2279 | } | 0 |
2280 | | - |
2281 | // close button | - |
2282 | if ((titleBar->subControls & SC_TitleBarCloseButton) && (titleBar->titleBarFlags & Qt::WindowSystemMenuHint)) { partially evaluated: (titleBar->subControls & SC_TitleBarCloseButton) yes Evaluation Count:1 | no Evaluation Count:0 |
partially evaluated: (titleBar->titleBarFlags & Qt::WindowSystemMenuHint) no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
2283 | QRect closeButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarCloseButton, widget); never executed (the execution status of this line is deduced): QRect closeButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarCloseButton, widget); | - |
2284 | if (closeButtonRect.isValid()) { never evaluated: closeButtonRect.isValid() | 0 |
2285 | bool hover = (titleBar->activeSubControls & SC_TitleBarCloseButton) && (titleBar->state & State_MouseOver); never evaluated: (titleBar->activeSubControls & SC_TitleBarCloseButton) never evaluated: (titleBar->state & State_MouseOver) | 0 |
2286 | bool sunken = (titleBar->activeSubControls & SC_TitleBarCloseButton) && (titleBar->state & State_Sunken); never evaluated: (titleBar->activeSubControls & SC_TitleBarCloseButton) never evaluated: (titleBar->state & State_Sunken) | 0 |
2287 | qt_fusion_draw_mdibutton(painter, titleBar, closeButtonRect, hover, sunken); never executed (the execution status of this line is deduced): qt_fusion_draw_mdibutton(painter, titleBar, closeButtonRect, hover, sunken); | - |
2288 | QRect closeIconRect = closeButtonRect.adjusted(buttonMargin, buttonMargin, -buttonMargin, -buttonMargin); never executed (the execution status of this line is deduced): QRect closeIconRect = closeButtonRect.adjusted(buttonMargin, buttonMargin, -buttonMargin, -buttonMargin); | - |
2289 | painter->setPen(textAlphaColor); never executed (the execution status of this line is deduced): painter->setPen(textAlphaColor); | - |
2290 | const QLine lines[4] = { never executed (the execution status of this line is deduced): const QLine lines[4] = { | - |
2291 | QLine(closeIconRect.left() + 1, closeIconRect.top(), never executed (the execution status of this line is deduced): QLine(closeIconRect.left() + 1, closeIconRect.top(), | - |
2292 | closeIconRect.right(), closeIconRect.bottom() - 1), never executed (the execution status of this line is deduced): closeIconRect.right(), closeIconRect.bottom() - 1), | - |
2293 | QLine(closeIconRect.left(), closeIconRect.top() + 1, never executed (the execution status of this line is deduced): QLine(closeIconRect.left(), closeIconRect.top() + 1, | - |
2294 | closeIconRect.right() - 1, closeIconRect.bottom()), never executed (the execution status of this line is deduced): closeIconRect.right() - 1, closeIconRect.bottom()), | - |
2295 | QLine(closeIconRect.right() - 1, closeIconRect.top(), never executed (the execution status of this line is deduced): QLine(closeIconRect.right() - 1, closeIconRect.top(), | - |
2296 | closeIconRect.left(), closeIconRect.bottom() - 1), never executed (the execution status of this line is deduced): closeIconRect.left(), closeIconRect.bottom() - 1), | - |
2297 | QLine(closeIconRect.right(), closeIconRect.top() + 1, never executed (the execution status of this line is deduced): QLine(closeIconRect.right(), closeIconRect.top() + 1, | - |
2298 | closeIconRect.left() + 1, closeIconRect.bottom()) never executed (the execution status of this line is deduced): closeIconRect.left() + 1, closeIconRect.bottom()) | - |
2299 | }; never executed (the execution status of this line is deduced): }; | - |
2300 | painter->drawLines(lines, 4); never executed (the execution status of this line is deduced): painter->drawLines(lines, 4); | - |
2301 | const QPoint points[4] = { never executed (the execution status of this line is deduced): const QPoint points[4] = { | - |
2302 | closeIconRect.topLeft(), never executed (the execution status of this line is deduced): closeIconRect.topLeft(), | - |
2303 | closeIconRect.topRight(), never executed (the execution status of this line is deduced): closeIconRect.topRight(), | - |
2304 | closeIconRect.bottomLeft(), never executed (the execution status of this line is deduced): closeIconRect.bottomLeft(), | - |
2305 | closeIconRect.bottomRight() never executed (the execution status of this line is deduced): closeIconRect.bottomRight() | - |
2306 | }; never executed (the execution status of this line is deduced): }; | - |
2307 | painter->drawPoints(points, 4); never executed (the execution status of this line is deduced): painter->drawPoints(points, 4); | - |
2308 | | - |
2309 | painter->setPen(textColor); never executed (the execution status of this line is deduced): painter->setPen(textColor); | - |
2310 | painter->drawLine(closeIconRect.left() + 1, closeIconRect.top() + 1, never executed (the execution status of this line is deduced): painter->drawLine(closeIconRect.left() + 1, closeIconRect.top() + 1, | - |
2311 | closeIconRect.right() - 1, closeIconRect.bottom() - 1); never executed (the execution status of this line is deduced): closeIconRect.right() - 1, closeIconRect.bottom() - 1); | - |
2312 | painter->drawLine(closeIconRect.left() + 1, closeIconRect.bottom() - 1, never executed (the execution status of this line is deduced): painter->drawLine(closeIconRect.left() + 1, closeIconRect.bottom() - 1, | - |
2313 | closeIconRect.right() - 1, closeIconRect.top() + 1); never executed (the execution status of this line is deduced): closeIconRect.right() - 1, closeIconRect.top() + 1); | - |
2314 | } | 0 |
2315 | } | 0 |
2316 | | - |
2317 | // normalize button | - |
2318 | if ((titleBar->subControls & SC_TitleBarNormalButton) && partially evaluated: (titleBar->subControls & SC_TitleBarNormalButton) yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
2319 | (((titleBar->titleBarFlags & Qt::WindowMinimizeButtonHint) && partially evaluated: (titleBar->titleBarFlags & Qt::WindowMinimizeButtonHint) no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
2320 | (titleBar->titleBarState & Qt::WindowMinimized)) || never evaluated: (titleBar->titleBarState & Qt::WindowMinimized) | 0 |
2321 | ((titleBar->titleBarFlags & Qt::WindowMaximizeButtonHint) && partially evaluated: (titleBar->titleBarFlags & Qt::WindowMaximizeButtonHint) no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
2322 | (titleBar->titleBarState & Qt::WindowMaximized)))) { never evaluated: (titleBar->titleBarState & Qt::WindowMaximized) | 0 |
2323 | QRect normalButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarNormalButton, widget); never executed (the execution status of this line is deduced): QRect normalButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarNormalButton, widget); | - |
2324 | if (normalButtonRect.isValid()) { never evaluated: normalButtonRect.isValid() | 0 |
2325 | | - |
2326 | bool hover = (titleBar->activeSubControls & SC_TitleBarNormalButton) && (titleBar->state & State_MouseOver); never evaluated: (titleBar->activeSubControls & SC_TitleBarNormalButton) never evaluated: (titleBar->state & State_MouseOver) | 0 |
2327 | bool sunken = (titleBar->activeSubControls & SC_TitleBarNormalButton) && (titleBar->state & State_Sunken); never evaluated: (titleBar->activeSubControls & SC_TitleBarNormalButton) never evaluated: (titleBar->state & State_Sunken) | 0 |
2328 | QRect normalButtonIconRect = normalButtonRect.adjusted(buttonMargin, buttonMargin, -buttonMargin, -buttonMargin); never executed (the execution status of this line is deduced): QRect normalButtonIconRect = normalButtonRect.adjusted(buttonMargin, buttonMargin, -buttonMargin, -buttonMargin); | - |
2329 | qt_fusion_draw_mdibutton(painter, titleBar, normalButtonRect, hover, sunken); never executed (the execution status of this line is deduced): qt_fusion_draw_mdibutton(painter, titleBar, normalButtonRect, hover, sunken); | - |
2330 | | - |
2331 | QRect frontWindowRect = normalButtonIconRect.adjusted(0, 3, -3, 0); never executed (the execution status of this line is deduced): QRect frontWindowRect = normalButtonIconRect.adjusted(0, 3, -3, 0); | - |
2332 | painter->setPen(textColor); never executed (the execution status of this line is deduced): painter->setPen(textColor); | - |
2333 | painter->drawRect(frontWindowRect.adjusted(0, 0, -1, -1)); never executed (the execution status of this line is deduced): painter->drawRect(frontWindowRect.adjusted(0, 0, -1, -1)); | - |
2334 | painter->drawLine(frontWindowRect.left() + 1, frontWindowRect.top() + 1, never executed (the execution status of this line is deduced): painter->drawLine(frontWindowRect.left() + 1, frontWindowRect.top() + 1, | - |
2335 | frontWindowRect.right() - 1, frontWindowRect.top() + 1); never executed (the execution status of this line is deduced): frontWindowRect.right() - 1, frontWindowRect.top() + 1); | - |
2336 | painter->setPen(textAlphaColor); never executed (the execution status of this line is deduced): painter->setPen(textAlphaColor); | - |
2337 | const QPoint points[4] = { never executed (the execution status of this line is deduced): const QPoint points[4] = { | - |
2338 | frontWindowRect.topLeft(), never executed (the execution status of this line is deduced): frontWindowRect.topLeft(), | - |
2339 | frontWindowRect.topRight(), never executed (the execution status of this line is deduced): frontWindowRect.topRight(), | - |
2340 | frontWindowRect.bottomLeft(), never executed (the execution status of this line is deduced): frontWindowRect.bottomLeft(), | - |
2341 | frontWindowRect.bottomRight() never executed (the execution status of this line is deduced): frontWindowRect.bottomRight() | - |
2342 | }; never executed (the execution status of this line is deduced): }; | - |
2343 | painter->drawPoints(points, 4); never executed (the execution status of this line is deduced): painter->drawPoints(points, 4); | - |
2344 | | - |
2345 | QRect backWindowRect = normalButtonIconRect.adjusted(3, 0, 0, -3); never executed (the execution status of this line is deduced): QRect backWindowRect = normalButtonIconRect.adjusted(3, 0, 0, -3); | - |
2346 | QRegion clipRegion = backWindowRect; never executed (the execution status of this line is deduced): QRegion clipRegion = backWindowRect; | - |
2347 | clipRegion -= frontWindowRect; never executed (the execution status of this line is deduced): clipRegion -= frontWindowRect; | - |
2348 | painter->save(); never executed (the execution status of this line is deduced): painter->save(); | - |
2349 | painter->setClipRegion(clipRegion); never executed (the execution status of this line is deduced): painter->setClipRegion(clipRegion); | - |
2350 | painter->setPen(textColor); never executed (the execution status of this line is deduced): painter->setPen(textColor); | - |
2351 | painter->drawRect(backWindowRect.adjusted(0, 0, -1, -1)); never executed (the execution status of this line is deduced): painter->drawRect(backWindowRect.adjusted(0, 0, -1, -1)); | - |
2352 | painter->drawLine(backWindowRect.left() + 1, backWindowRect.top() + 1, never executed (the execution status of this line is deduced): painter->drawLine(backWindowRect.left() + 1, backWindowRect.top() + 1, | - |
2353 | backWindowRect.right() - 1, backWindowRect.top() + 1); never executed (the execution status of this line is deduced): backWindowRect.right() - 1, backWindowRect.top() + 1); | - |
2354 | painter->setPen(textAlphaColor); never executed (the execution status of this line is deduced): painter->setPen(textAlphaColor); | - |
2355 | const QPoint points2[4] = { never executed (the execution status of this line is deduced): const QPoint points2[4] = { | - |
2356 | backWindowRect.topLeft(), never executed (the execution status of this line is deduced): backWindowRect.topLeft(), | - |
2357 | backWindowRect.topRight(), never executed (the execution status of this line is deduced): backWindowRect.topRight(), | - |
2358 | backWindowRect.bottomLeft(), never executed (the execution status of this line is deduced): backWindowRect.bottomLeft(), | - |
2359 | backWindowRect.bottomRight() never executed (the execution status of this line is deduced): backWindowRect.bottomRight() | - |
2360 | }; never executed (the execution status of this line is deduced): }; | - |
2361 | painter->drawPoints(points2, 4); never executed (the execution status of this line is deduced): painter->drawPoints(points2, 4); | - |
2362 | painter->restore(); never executed (the execution status of this line is deduced): painter->restore(); | - |
2363 | } | 0 |
2364 | } | 0 |
2365 | | - |
2366 | // context help button | - |
2367 | if (titleBar->subControls & SC_TitleBarContextHelpButton partially evaluated: titleBar->subControls & SC_TitleBarContextHelpButton yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
2368 | && (titleBar->titleBarFlags & Qt::WindowContextHelpButtonHint)) { partially evaluated: (titleBar->titleBarFlags & Qt::WindowContextHelpButtonHint) no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
2369 | QRect contextHelpButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarContextHelpButton, widget); never executed (the execution status of this line is deduced): QRect contextHelpButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarContextHelpButton, widget); | - |
2370 | if (contextHelpButtonRect.isValid()) { never evaluated: contextHelpButtonRect.isValid() | 0 |
2371 | bool hover = (titleBar->activeSubControls & SC_TitleBarContextHelpButton) && (titleBar->state & State_MouseOver); never evaluated: (titleBar->activeSubControls & SC_TitleBarContextHelpButton) never evaluated: (titleBar->state & State_MouseOver) | 0 |
2372 | bool sunken = (titleBar->activeSubControls & SC_TitleBarContextHelpButton) && (titleBar->state & State_Sunken); never evaluated: (titleBar->activeSubControls & SC_TitleBarContextHelpButton) never evaluated: (titleBar->state & State_Sunken) | 0 |
2373 | qt_fusion_draw_mdibutton(painter, titleBar, contextHelpButtonRect, hover, sunken); never executed (the execution status of this line is deduced): qt_fusion_draw_mdibutton(painter, titleBar, contextHelpButtonRect, hover, sunken); | - |
2374 | QImage image(qt_titlebar_context_help); never executed (the execution status of this line is deduced): QImage image(qt_titlebar_context_help); | - |
2375 | QColor alpha = textColor; never executed (the execution status of this line is deduced): QColor alpha = textColor; | - |
2376 | alpha.setAlpha(128); never executed (the execution status of this line is deduced): alpha.setAlpha(128); | - |
2377 | image.setColor(1, textColor.rgba()); never executed (the execution status of this line is deduced): image.setColor(1, textColor.rgba()); | - |
2378 | image.setColor(2, alpha.rgba()); never executed (the execution status of this line is deduced): image.setColor(2, alpha.rgba()); | - |
2379 | painter->setRenderHint(QPainter::SmoothPixmapTransform); never executed (the execution status of this line is deduced): painter->setRenderHint(QPainter::SmoothPixmapTransform); | - |
2380 | painter->drawImage(contextHelpButtonRect.adjusted(4, 4, -4, -4), image); never executed (the execution status of this line is deduced): painter->drawImage(contextHelpButtonRect.adjusted(4, 4, -4, -4), image); | - |
2381 | } | 0 |
2382 | } | 0 |
2383 | | - |
2384 | // shade button | - |
2385 | if (titleBar->subControls & SC_TitleBarShadeButton && (titleBar->titleBarFlags & Qt::WindowShadeButtonHint)) { partially evaluated: titleBar->subControls & SC_TitleBarShadeButton yes Evaluation Count:1 | no Evaluation Count:0 |
partially evaluated: (titleBar->titleBarFlags & Qt::WindowShadeButtonHint) no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
2386 | QRect shadeButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarShadeButton, widget); never executed (the execution status of this line is deduced): QRect shadeButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarShadeButton, widget); | - |
2387 | if (shadeButtonRect.isValid()) { never evaluated: shadeButtonRect.isValid() | 0 |
2388 | bool hover = (titleBar->activeSubControls & SC_TitleBarShadeButton) && (titleBar->state & State_MouseOver); never evaluated: (titleBar->activeSubControls & SC_TitleBarShadeButton) never evaluated: (titleBar->state & State_MouseOver) | 0 |
2389 | bool sunken = (titleBar->activeSubControls & SC_TitleBarShadeButton) && (titleBar->state & State_Sunken); never evaluated: (titleBar->activeSubControls & SC_TitleBarShadeButton) never evaluated: (titleBar->state & State_Sunken) | 0 |
2390 | qt_fusion_draw_mdibutton(painter, titleBar, shadeButtonRect, hover, sunken); never executed (the execution status of this line is deduced): qt_fusion_draw_mdibutton(painter, titleBar, shadeButtonRect, hover, sunken); | - |
2391 | QPixmap arrow = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), textColor); never executed (the execution status of this line is deduced): QPixmap arrow = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), textColor); | - |
2392 | painter->drawPixmap(shadeButtonRect.adjusted(5, 7, -5, -7), arrow); never executed (the execution status of this line is deduced): painter->drawPixmap(shadeButtonRect.adjusted(5, 7, -5, -7), arrow); | - |
2393 | } | 0 |
2394 | } | 0 |
2395 | | - |
2396 | // unshade button | - |
2397 | if (titleBar->subControls & SC_TitleBarUnshadeButton && (titleBar->titleBarFlags & Qt::WindowShadeButtonHint)) { partially evaluated: titleBar->subControls & SC_TitleBarUnshadeButton yes Evaluation Count:1 | no Evaluation Count:0 |
partially evaluated: (titleBar->titleBarFlags & Qt::WindowShadeButtonHint) no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
2398 | QRect unshadeButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarUnshadeButton, widget); never executed (the execution status of this line is deduced): QRect unshadeButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarUnshadeButton, widget); | - |
2399 | if (unshadeButtonRect.isValid()) { never evaluated: unshadeButtonRect.isValid() | 0 |
2400 | bool hover = (titleBar->activeSubControls & SC_TitleBarUnshadeButton) && (titleBar->state & State_MouseOver); never evaluated: (titleBar->activeSubControls & SC_TitleBarUnshadeButton) never evaluated: (titleBar->state & State_MouseOver) | 0 |
2401 | bool sunken = (titleBar->activeSubControls & SC_TitleBarUnshadeButton) && (titleBar->state & State_Sunken); never evaluated: (titleBar->activeSubControls & SC_TitleBarUnshadeButton) never evaluated: (titleBar->state & State_Sunken) | 0 |
2402 | qt_fusion_draw_mdibutton(painter, titleBar, unshadeButtonRect, hover, sunken); never executed (the execution status of this line is deduced): qt_fusion_draw_mdibutton(painter, titleBar, unshadeButtonRect, hover, sunken); | - |
2403 | QPixmap arrow = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), textColor, 180); never executed (the execution status of this line is deduced): QPixmap arrow = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), textColor, 180); | - |
2404 | painter->drawPixmap(unshadeButtonRect.adjusted(5, 7, -5, -7), arrow); never executed (the execution status of this line is deduced): painter->drawPixmap(unshadeButtonRect.adjusted(5, 7, -5, -7), arrow); | - |
2405 | } | 0 |
2406 | } | 0 |
2407 | | - |
2408 | if ((titleBar->subControls & SC_TitleBarSysMenu) && (titleBar->titleBarFlags & Qt::WindowSystemMenuHint)) { partially evaluated: (titleBar->subControls & SC_TitleBarSysMenu) yes Evaluation Count:1 | no Evaluation Count:0 |
partially evaluated: (titleBar->titleBarFlags & Qt::WindowSystemMenuHint) no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
2409 | QRect iconRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarSysMenu, widget); never executed (the execution status of this line is deduced): QRect iconRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarSysMenu, widget); | - |
2410 | if (iconRect.isValid()) { never evaluated: iconRect.isValid() | 0 |
2411 | if (!titleBar->icon.isNull()) { never evaluated: !titleBar->icon.isNull() | 0 |
2412 | titleBar->icon.paint(painter, iconRect); never executed (the execution status of this line is deduced): titleBar->icon.paint(painter, iconRect); | - |
2413 | } else { | 0 |
2414 | QStyleOption tool(0); never executed (the execution status of this line is deduced): QStyleOption tool(0); | - |
2415 | tool.palette = titleBar->palette; never executed (the execution status of this line is deduced): tool.palette = titleBar->palette; | - |
2416 | QPixmap pm = standardIcon(SP_TitleBarMenuButton, &tool, widget).pixmap(16, 16); never executed (the execution status of this line is deduced): QPixmap pm = standardIcon(SP_TitleBarMenuButton, &tool, widget).pixmap(16, 16); | - |
2417 | tool.rect = iconRect; never executed (the execution status of this line is deduced): tool.rect = iconRect; | - |
2418 | painter->save(); never executed (the execution status of this line is deduced): painter->save(); | - |
2419 | proxy()->drawItemPixmap(painter, iconRect, Qt::AlignCenter, pm); never executed (the execution status of this line is deduced): proxy()->drawItemPixmap(painter, iconRect, Qt::AlignCenter, pm); | - |
2420 | painter->restore(); never executed (the execution status of this line is deduced): painter->restore(); | - |
2421 | } | 0 |
2422 | } | - |
2423 | } | 0 |
2424 | } executed: } Execution Count:1 | 1 |
2425 | painter->restore(); executed (the execution status of this line is deduced): painter->restore(); | - |
2426 | break; executed: break; Execution Count:1 | 1 |
2427 | case CC_ScrollBar: | - |
2428 | painter->save(); executed (the execution status of this line is deduced): painter->save(); | - |
2429 | if (const QStyleOptionSlider *scrollBar = qstyleoption_cast<const QStyleOptionSlider *>(option)) { partially evaluated: const QStyleOptionSlider *scrollBar = qstyleoption_cast<const QStyleOptionSlider *>(option) yes Evaluation Count:145 | no Evaluation Count:0 |
| 0-145 |
2430 | bool horizontal = scrollBar->orientation == Qt::Horizontal; executed (the execution status of this line is deduced): bool horizontal = scrollBar->orientation == Qt::Horizontal; | - |
2431 | bool sunken = scrollBar->state & State_Sunken; executed (the execution status of this line is deduced): bool sunken = scrollBar->state & State_Sunken; | - |
2432 | | - |
2433 | QRect scrollBarSubLine = proxy()->subControlRect(control, scrollBar, SC_ScrollBarSubLine, widget); executed (the execution status of this line is deduced): QRect scrollBarSubLine = proxy()->subControlRect(control, scrollBar, SC_ScrollBarSubLine, widget); | - |
2434 | QRect scrollBarAddLine = proxy()->subControlRect(control, scrollBar, SC_ScrollBarAddLine, widget); executed (the execution status of this line is deduced): QRect scrollBarAddLine = proxy()->subControlRect(control, scrollBar, SC_ScrollBarAddLine, widget); | - |
2435 | QRect scrollBarSlider = proxy()->subControlRect(control, scrollBar, SC_ScrollBarSlider, widget); executed (the execution status of this line is deduced): QRect scrollBarSlider = proxy()->subControlRect(control, scrollBar, SC_ScrollBarSlider, widget); | - |
2436 | QRect scrollBarGroove = proxy()->subControlRect(control, scrollBar, SC_ScrollBarGroove, widget); executed (the execution status of this line is deduced): QRect scrollBarGroove = proxy()->subControlRect(control, scrollBar, SC_ScrollBarGroove, widget); | - |
2437 | | - |
2438 | QRect rect = option->rect; executed (the execution status of this line is deduced): QRect rect = option->rect; | - |
2439 | QColor alphaOutline = outline; executed (the execution status of this line is deduced): QColor alphaOutline = outline; | - |
2440 | alphaOutline.setAlpha(180); executed (the execution status of this line is deduced): alphaOutline.setAlpha(180); | - |
2441 | | - |
2442 | QColor arrowColor = option->palette.foreground().color(); executed (the execution status of this line is deduced): QColor arrowColor = option->palette.foreground().color(); | - |
2443 | arrowColor.setAlpha(220); executed (the execution status of this line is deduced): arrowColor.setAlpha(220); | - |
2444 | | - |
2445 | // Paint groove | - |
2446 | if (scrollBar->subControls & SC_ScrollBarGroove) { partially evaluated: scrollBar->subControls & SC_ScrollBarGroove yes Evaluation Count:145 | no Evaluation Count:0 |
| 0-145 |
2447 | QLinearGradient gradient(rect.center().x(), rect.top(), executed (the execution status of this line is deduced): QLinearGradient gradient(rect.center().x(), rect.top(), | - |
2448 | rect.center().x(), rect.bottom()); executed (the execution status of this line is deduced): rect.center().x(), rect.bottom()); | - |
2449 | if (!horizontal) evaluated: !horizontal yes Evaluation Count:96 | yes Evaluation Count:49 |
| 49-96 |
2450 | gradient = QLinearGradient(rect.left(), rect.center().y(), executed: gradient = QLinearGradient(rect.left(), rect.center().y(), rect.right(), rect.center().y()); Execution Count:96 | 96 |
2451 | rect.right(), rect.center().y()); executed: gradient = QLinearGradient(rect.left(), rect.center().y(), rect.right(), rect.center().y()); Execution Count:96 | 96 |
2452 | gradient.setColorAt(0, buttonColor.darker(107)); executed (the execution status of this line is deduced): gradient.setColorAt(0, buttonColor.darker(107)); | - |
2453 | gradient.setColorAt(0.1, buttonColor.darker(105)); executed (the execution status of this line is deduced): gradient.setColorAt(0.1, buttonColor.darker(105)); | - |
2454 | gradient.setColorAt(0.9, buttonColor.darker(105)); executed (the execution status of this line is deduced): gradient.setColorAt(0.9, buttonColor.darker(105)); | - |
2455 | gradient.setColorAt(1, buttonColor.darker(107)); executed (the execution status of this line is deduced): gradient.setColorAt(1, buttonColor.darker(107)); | - |
2456 | | - |
2457 | painter->fillRect(option->rect, gradient); executed (the execution status of this line is deduced): painter->fillRect(option->rect, gradient); | - |
2458 | painter->setPen(Qt::NoPen); executed (the execution status of this line is deduced): painter->setPen(Qt::NoPen); | - |
2459 | painter->setPen(alphaOutline); executed (the execution status of this line is deduced): painter->setPen(alphaOutline); | - |
2460 | if (horizontal) evaluated: horizontal yes Evaluation Count:49 | yes Evaluation Count:96 |
| 49-96 |
2461 | painter->drawLine(rect.topLeft(), rect.topRight()); executed: painter->drawLine(rect.topLeft(), rect.topRight()); Execution Count:49 | 49 |
2462 | else | - |
2463 | painter->drawLine(rect.topLeft(), rect.bottomLeft()); executed: painter->drawLine(rect.topLeft(), rect.bottomLeft()); Execution Count:96 | 96 |
2464 | | - |
2465 | QColor subtleEdge = alphaOutline; executed (the execution status of this line is deduced): QColor subtleEdge = alphaOutline; | - |
2466 | subtleEdge.setAlpha(40); executed (the execution status of this line is deduced): subtleEdge.setAlpha(40); | - |
2467 | painter->setPen(Qt::NoPen); executed (the execution status of this line is deduced): painter->setPen(Qt::NoPen); | - |
2468 | painter->setBrush(Qt::NoBrush); executed (the execution status of this line is deduced): painter->setBrush(Qt::NoBrush); | - |
2469 | painter->save(); executed (the execution status of this line is deduced): painter->save(); | - |
2470 | painter->setClipRect(scrollBarGroove.adjusted(1, 0, -1, -3)); executed (the execution status of this line is deduced): painter->setClipRect(scrollBarGroove.adjusted(1, 0, -1, -3)); | - |
2471 | painter->drawRect(scrollBarGroove.adjusted(1, 0, -1, -1)); executed (the execution status of this line is deduced): painter->drawRect(scrollBarGroove.adjusted(1, 0, -1, -1)); | - |
2472 | painter->restore(); executed (the execution status of this line is deduced): painter->restore(); | - |
2473 | } executed: } Execution Count:145 | 145 |
2474 | | - |
2475 | QRect pixmapRect = scrollBarSlider; executed (the execution status of this line is deduced): QRect pixmapRect = scrollBarSlider; | - |
2476 | QLinearGradient gradient(pixmapRect.center().x(), pixmapRect.top(), executed (the execution status of this line is deduced): QLinearGradient gradient(pixmapRect.center().x(), pixmapRect.top(), | - |
2477 | pixmapRect.center().x(), pixmapRect.bottom()); executed (the execution status of this line is deduced): pixmapRect.center().x(), pixmapRect.bottom()); | - |
2478 | if (!horizontal) evaluated: !horizontal yes Evaluation Count:96 | yes Evaluation Count:49 |
| 49-96 |
2479 | gradient = QLinearGradient(pixmapRect.left(), pixmapRect.center().y(), executed: gradient = QLinearGradient(pixmapRect.left(), pixmapRect.center().y(), pixmapRect.right(), pixmapRect.center().y()); Execution Count:96 | 96 |
2480 | pixmapRect.right(), pixmapRect.center().y()); executed: gradient = QLinearGradient(pixmapRect.left(), pixmapRect.center().y(), pixmapRect.right(), pixmapRect.center().y()); Execution Count:96 | 96 |
2481 | | - |
2482 | QLinearGradient highlightedGradient = gradient; executed (the execution status of this line is deduced): QLinearGradient highlightedGradient = gradient; | - |
2483 | | - |
2484 | QColor midColor2 = mergedColors(gradientStartColor, gradientStopColor, 40); executed (the execution status of this line is deduced): QColor midColor2 = mergedColors(gradientStartColor, gradientStopColor, 40); | - |
2485 | gradient.setColorAt(0, d->buttonColor(option->palette).lighter(108)); executed (the execution status of this line is deduced): gradient.setColorAt(0, d->buttonColor(option->palette).lighter(108)); | - |
2486 | gradient.setColorAt(1, d->buttonColor(option->palette)); executed (the execution status of this line is deduced): gradient.setColorAt(1, d->buttonColor(option->palette)); | - |
2487 | | - |
2488 | highlightedGradient.setColorAt(0, gradientStartColor.darker(102)); executed (the execution status of this line is deduced): highlightedGradient.setColorAt(0, gradientStartColor.darker(102)); | - |
2489 | highlightedGradient.setColorAt(1, gradientStopColor.lighter(102)); executed (the execution status of this line is deduced): highlightedGradient.setColorAt(1, gradientStopColor.lighter(102)); | - |
2490 | | - |
2491 | // Paint slider | - |
2492 | if (scrollBar->subControls & SC_ScrollBarSlider) { partially evaluated: scrollBar->subControls & SC_ScrollBarSlider yes Evaluation Count:145 | no Evaluation Count:0 |
| 0-145 |
2493 | QRect pixmapRect = scrollBarSlider; executed (the execution status of this line is deduced): QRect pixmapRect = scrollBarSlider; | - |
2494 | painter->setPen(QPen(alphaOutline)); executed (the execution status of this line is deduced): painter->setPen(QPen(alphaOutline)); | - |
2495 | if (option->state & State_Sunken && scrollBar->activeSubControls & SC_ScrollBarSlider) partially evaluated: option->state & State_Sunken no Evaluation Count:0 | yes Evaluation Count:145 |
never evaluated: scrollBar->activeSubControls & SC_ScrollBarSlider | 0-145 |
2496 | painter->setBrush(midColor2); never executed: painter->setBrush(midColor2); | 0 |
2497 | else if (option->state & State_MouseOver && scrollBar->activeSubControls & SC_ScrollBarSlider) partially evaluated: option->state & State_MouseOver no Evaluation Count:0 | yes Evaluation Count:145 |
never evaluated: scrollBar->activeSubControls & SC_ScrollBarSlider | 0-145 |
2498 | painter->setBrush(highlightedGradient); never executed: painter->setBrush(highlightedGradient); | 0 |
2499 | else | - |
2500 | painter->setBrush(gradient); executed: painter->setBrush(gradient); Execution Count:145 | 145 |
2501 | | - |
2502 | painter->drawRect(pixmapRect.adjusted(horizontal ? -1 : 0, horizontal ? 0 : -1, horizontal ? 0 : 1, horizontal ? 1 : 0)); executed (the execution status of this line is deduced): painter->drawRect(pixmapRect.adjusted(horizontal ? -1 : 0, horizontal ? 0 : -1, horizontal ? 0 : 1, horizontal ? 1 : 0)); | - |
2503 | | - |
2504 | painter->setPen(d->innerContrastLine()); executed (the execution status of this line is deduced): painter->setPen(d->innerContrastLine()); | - |
2505 | painter->drawRect(scrollBarSlider.adjusted(horizontal ? 0 : 1, horizontal ? 1 : 0, -1, -1)); executed (the execution status of this line is deduced): painter->drawRect(scrollBarSlider.adjusted(horizontal ? 0 : 1, horizontal ? 1 : 0, -1, -1)); | - |
2506 | | - |
2507 | // Outer shadow | - |
2508 | // painter->setPen(subtleEdge); | - |
2509 | // if (horizontal) { | - |
2510 | //// painter->drawLine(scrollBarSlider.topLeft() + QPoint(-2, 0), scrollBarSlider.bottomLeft() + QPoint(2, 0)); | - |
2511 | //// painter->drawLine(scrollBarSlider.topRight() + QPoint(-2, 0), scrollBarSlider.bottomRight() + QPoint(2, 0)); | - |
2512 | // } else { | - |
2513 | //// painter->drawLine(pixmapRect.topLeft() + QPoint(0, -2), pixmapRect.bottomLeft() + QPoint(0, -2)); | - |
2514 | //// painter->drawLine(pixmapRect.topRight() + QPoint(0, 2), pixmapRect.bottomRight() + QPoint(0, 2)); | - |
2515 | // } | - |
2516 | } executed: } Execution Count:145 | 145 |
2517 | | - |
2518 | // The SubLine (up/left) buttons | - |
2519 | if (scrollBar->subControls & SC_ScrollBarSubLine) { partially evaluated: scrollBar->subControls & SC_ScrollBarSubLine yes Evaluation Count:145 | no Evaluation Count:0 |
| 0-145 |
2520 | if ((scrollBar->activeSubControls & SC_ScrollBarSubLine) && sunken) partially evaluated: (scrollBar->activeSubControls & SC_ScrollBarSubLine) no Evaluation Count:0 | yes Evaluation Count:145 |
never evaluated: sunken | 0-145 |
2521 | painter->setBrush(gradientStopColor); never executed: painter->setBrush(gradientStopColor); | 0 |
2522 | else if ((scrollBar->activeSubControls & SC_ScrollBarSubLine)) partially evaluated: (scrollBar->activeSubControls & SC_ScrollBarSubLine) no Evaluation Count:0 | yes Evaluation Count:145 |
| 0-145 |
2523 | painter->setBrush(highlightedGradient); never executed: painter->setBrush(highlightedGradient); | 0 |
2524 | else | - |
2525 | painter->setBrush(gradient); executed: painter->setBrush(gradient); Execution Count:145 | 145 |
2526 | | - |
2527 | painter->setPen(Qt::NoPen); executed (the execution status of this line is deduced): painter->setPen(Qt::NoPen); | - |
2528 | painter->drawRect(scrollBarSubLine.adjusted(horizontal ? 0 : 1, horizontal ? 1 : 0, 0, 0)); executed (the execution status of this line is deduced): painter->drawRect(scrollBarSubLine.adjusted(horizontal ? 0 : 1, horizontal ? 1 : 0, 0, 0)); | - |
2529 | painter->setPen(QPen(alphaOutline)); executed (the execution status of this line is deduced): painter->setPen(QPen(alphaOutline)); | - |
2530 | if (option->state & State_Horizontal) { evaluated: option->state & State_Horizontal yes Evaluation Count:48 | yes Evaluation Count:97 |
| 48-97 |
2531 | if (option->direction == Qt::RightToLeft) { partially evaluated: option->direction == Qt::RightToLeft no Evaluation Count:0 | yes Evaluation Count:48 |
| 0-48 |
2532 | pixmapRect.setLeft(scrollBarSubLine.left()); never executed (the execution status of this line is deduced): pixmapRect.setLeft(scrollBarSubLine.left()); | - |
2533 | painter->drawLine(pixmapRect.topLeft(), pixmapRect.bottomLeft()); never executed (the execution status of this line is deduced): painter->drawLine(pixmapRect.topLeft(), pixmapRect.bottomLeft()); | - |
2534 | } else { | 0 |
2535 | pixmapRect.setRight(scrollBarSubLine.right()); executed (the execution status of this line is deduced): pixmapRect.setRight(scrollBarSubLine.right()); | - |
2536 | painter->drawLine(pixmapRect.topRight(), pixmapRect.bottomRight()); executed (the execution status of this line is deduced): painter->drawLine(pixmapRect.topRight(), pixmapRect.bottomRight()); | - |
2537 | } executed: } Execution Count:48 | 48 |
2538 | } else { | - |
2539 | pixmapRect.setBottom(scrollBarSubLine.bottom()); executed (the execution status of this line is deduced): pixmapRect.setBottom(scrollBarSubLine.bottom()); | - |
2540 | painter->drawLine(pixmapRect.bottomLeft(), pixmapRect.bottomRight()); executed (the execution status of this line is deduced): painter->drawLine(pixmapRect.bottomLeft(), pixmapRect.bottomRight()); | - |
2541 | } executed: } Execution Count:97 | 97 |
2542 | | - |
2543 | painter->setBrush(Qt::NoBrush); executed (the execution status of this line is deduced): painter->setBrush(Qt::NoBrush); | - |
2544 | painter->setPen(d->innerContrastLine()); executed (the execution status of this line is deduced): painter->setPen(d->innerContrastLine()); | - |
2545 | painter->drawRect(scrollBarSubLine.adjusted(horizontal ? 0 : 1, horizontal ? 1 : 0 , horizontal ? -2 : -1, horizontal ? -1 : -2)); executed (the execution status of this line is deduced): painter->drawRect(scrollBarSubLine.adjusted(horizontal ? 0 : 1, horizontal ? 1 : 0 , horizontal ? -2 : -1, horizontal ? -1 : -2)); | - |
2546 | | - |
2547 | // Arrows | - |
2548 | int rotation = 0; executed (the execution status of this line is deduced): int rotation = 0; | - |
2549 | if (option->state & State_Horizontal) evaluated: option->state & State_Horizontal yes Evaluation Count:48 | yes Evaluation Count:97 |
| 48-97 |
2550 | rotation = option->direction == Qt::LeftToRight ? -90 : 90; executed: rotation = option->direction == Qt::LeftToRight ? -90 : 90; Execution Count:48 partially evaluated: option->direction == Qt::LeftToRight yes Evaluation Count:48 | no Evaluation Count:0 |
| 0-48 |
2551 | QRect upRect = scrollBarSubLine.translated(horizontal ? -2 : -1, 0); executed (the execution status of this line is deduced): QRect upRect = scrollBarSubLine.translated(horizontal ? -2 : -1, 0); | - |
2552 | QPixmap arrowPixmap = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), arrowColor, rotation); executed (the execution status of this line is deduced): QPixmap arrowPixmap = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), arrowColor, rotation); | - |
2553 | painter->drawPixmap(QRectF(upRect.center().x() - arrowPixmap.width() / 4.0 + 2.0, executed (the execution status of this line is deduced): painter->drawPixmap(QRectF(upRect.center().x() - arrowPixmap.width() / 4.0 + 2.0, | - |
2554 | upRect.center().y() - arrowPixmap.height() / 4.0 + 1.0, executed (the execution status of this line is deduced): upRect.center().y() - arrowPixmap.height() / 4.0 + 1.0, | - |
2555 | arrowPixmap.width() / 2.0, arrowPixmap.height() / 2.0), executed (the execution status of this line is deduced): arrowPixmap.width() / 2.0, arrowPixmap.height() / 2.0), | - |
2556 | arrowPixmap, QRectF(QPoint(0.0, 0.0), arrowPixmap.size())); executed (the execution status of this line is deduced): arrowPixmap, QRectF(QPoint(0.0, 0.0), arrowPixmap.size())); | - |
2557 | } executed: } Execution Count:145 | 145 |
2558 | | - |
2559 | // The AddLine (down/right) button | - |
2560 | if (scrollBar->subControls & SC_ScrollBarAddLine) { partially evaluated: scrollBar->subControls & SC_ScrollBarAddLine yes Evaluation Count:145 | no Evaluation Count:0 |
| 0-145 |
2561 | if ((scrollBar->activeSubControls & SC_ScrollBarAddLine) && sunken) partially evaluated: (scrollBar->activeSubControls & SC_ScrollBarAddLine) no Evaluation Count:0 | yes Evaluation Count:145 |
never evaluated: sunken | 0-145 |
2562 | painter->setBrush(gradientStopColor); never executed: painter->setBrush(gradientStopColor); | 0 |
2563 | else if ((scrollBar->activeSubControls & SC_ScrollBarAddLine)) partially evaluated: (scrollBar->activeSubControls & SC_ScrollBarAddLine) no Evaluation Count:0 | yes Evaluation Count:145 |
| 0-145 |
2564 | painter->setBrush(midColor2); never executed: painter->setBrush(midColor2); | 0 |
2565 | else | - |
2566 | painter->setBrush(gradient); executed: painter->setBrush(gradient); Execution Count:145 | 145 |
2567 | | - |
2568 | painter->setPen(Qt::NoPen); executed (the execution status of this line is deduced): painter->setPen(Qt::NoPen); | - |
2569 | painter->drawRect(scrollBarAddLine.adjusted(horizontal ? 0 : 1, horizontal ? 1 : 0, 0, 0)); executed (the execution status of this line is deduced): painter->drawRect(scrollBarAddLine.adjusted(horizontal ? 0 : 1, horizontal ? 1 : 0, 0, 0)); | - |
2570 | painter->setPen(QPen(alphaOutline, 1)); executed (the execution status of this line is deduced): painter->setPen(QPen(alphaOutline, 1)); | - |
2571 | if (option->state & State_Horizontal) { evaluated: option->state & State_Horizontal yes Evaluation Count:48 | yes Evaluation Count:97 |
| 48-97 |
2572 | if (option->direction == Qt::LeftToRight) { partially evaluated: option->direction == Qt::LeftToRight yes Evaluation Count:48 | no Evaluation Count:0 |
| 0-48 |
2573 | pixmapRect.setLeft(scrollBarAddLine.left()); executed (the execution status of this line is deduced): pixmapRect.setLeft(scrollBarAddLine.left()); | - |
2574 | painter->drawLine(pixmapRect.topLeft(), pixmapRect.bottomLeft()); executed (the execution status of this line is deduced): painter->drawLine(pixmapRect.topLeft(), pixmapRect.bottomLeft()); | - |
2575 | } else { executed: } Execution Count:48 | 48 |
2576 | pixmapRect.setRight(scrollBarAddLine.right()); never executed (the execution status of this line is deduced): pixmapRect.setRight(scrollBarAddLine.right()); | - |
2577 | painter->drawLine(pixmapRect.topRight(), pixmapRect.bottomRight()); never executed (the execution status of this line is deduced): painter->drawLine(pixmapRect.topRight(), pixmapRect.bottomRight()); | - |
2578 | } | 0 |
2579 | } else { | - |
2580 | pixmapRect.setTop(scrollBarAddLine.top()); executed (the execution status of this line is deduced): pixmapRect.setTop(scrollBarAddLine.top()); | - |
2581 | painter->drawLine(pixmapRect.topLeft(), pixmapRect.topRight()); executed (the execution status of this line is deduced): painter->drawLine(pixmapRect.topLeft(), pixmapRect.topRight()); | - |
2582 | } executed: } Execution Count:97 | 97 |
2583 | | - |
2584 | painter->setPen(d->innerContrastLine()); executed (the execution status of this line is deduced): painter->setPen(d->innerContrastLine()); | - |
2585 | painter->setBrush(Qt::NoBrush); executed (the execution status of this line is deduced): painter->setBrush(Qt::NoBrush); | - |
2586 | painter->drawRect(scrollBarAddLine.adjusted(1, 1, -1, -1)); executed (the execution status of this line is deduced): painter->drawRect(scrollBarAddLine.adjusted(1, 1, -1, -1)); | - |
2587 | | - |
2588 | int rotation = 180; executed (the execution status of this line is deduced): int rotation = 180; | - |
2589 | if (option->state & State_Horizontal) evaluated: option->state & State_Horizontal yes Evaluation Count:48 | yes Evaluation Count:97 |
| 48-97 |
2590 | rotation = option->direction == Qt::LeftToRight ? 90 : -90; executed: rotation = option->direction == Qt::LeftToRight ? 90 : -90; Execution Count:48 partially evaluated: option->direction == Qt::LeftToRight yes Evaluation Count:48 | no Evaluation Count:0 |
| 0-48 |
2591 | QRect downRect = scrollBarAddLine.translated(-1, 1); executed (the execution status of this line is deduced): QRect downRect = scrollBarAddLine.translated(-1, 1); | - |
2592 | QPixmap arrowPixmap = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), arrowColor, rotation); executed (the execution status of this line is deduced): QPixmap arrowPixmap = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), arrowColor, rotation); | - |
2593 | painter->drawPixmap(QRectF(downRect.center().x() - arrowPixmap.width() / 4.0 + 2.0, executed (the execution status of this line is deduced): painter->drawPixmap(QRectF(downRect.center().x() - arrowPixmap.width() / 4.0 + 2.0, | - |
2594 | downRect.center().y() - arrowPixmap.height() / 4.0, executed (the execution status of this line is deduced): downRect.center().y() - arrowPixmap.height() / 4.0, | - |
2595 | arrowPixmap.width() / 2.0, arrowPixmap.height() / 2.0), executed (the execution status of this line is deduced): arrowPixmap.width() / 2.0, arrowPixmap.height() / 2.0), | - |
2596 | arrowPixmap, QRectF(QPoint(0.0, 0.0), arrowPixmap.size())); executed (the execution status of this line is deduced): arrowPixmap, QRectF(QPoint(0.0, 0.0), arrowPixmap.size())); | - |
2597 | } executed: } Execution Count:145 | 145 |
2598 | | - |
2599 | } executed: } Execution Count:145 | 145 |
2600 | painter->restore(); executed (the execution status of this line is deduced): painter->restore(); | - |
2601 | break;; executed: break; Execution Count:145 | 145 |
2602 | case CC_ComboBox: | - |
2603 | painter->save(); executed (the execution status of this line is deduced): painter->save(); | - |
2604 | if (const QStyleOptionComboBox *comboBox = qstyleoption_cast<const QStyleOptionComboBox *>(option)) { partially evaluated: const QStyleOptionComboBox *comboBox = qstyleoption_cast<const QStyleOptionComboBox *>(option) yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
2605 | bool hasFocus = option->state & State_HasFocus && option->state & State_KeyboardFocusChange; partially evaluated: option->state & State_HasFocus no Evaluation Count:0 | yes Evaluation Count:2 |
never evaluated: option->state & State_KeyboardFocusChange | 0-2 |
2606 | bool sunken = comboBox->state & State_On; // play dead, if combobox has no items executed (the execution status of this line is deduced): bool sunken = comboBox->state & State_On; | - |
2607 | bool isEnabled = (comboBox->state & State_Enabled); executed (the execution status of this line is deduced): bool isEnabled = (comboBox->state & State_Enabled); | - |
2608 | QPixmap cache; executed (the execution status of this line is deduced): QPixmap cache; | - |
2609 | QString pixmapName = QStyleHelper::uniqueName(QLatin1String("combobox"), option, comboBox->rect.size()); executed (the execution status of this line is deduced): QString pixmapName = QStyleHelper::uniqueName(QLatin1String("combobox"), option, comboBox->rect.size()); | - |
2610 | if (sunken) partially evaluated: sunken no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
2611 | pixmapName += QLatin1String("-sunken"); never executed: pixmapName += QLatin1String("-sunken"); | 0 |
2612 | if (comboBox->editable) evaluated: comboBox->editable yes Evaluation Count:1 | yes Evaluation Count:1 |
| 1 |
2613 | pixmapName += QLatin1String("-editable"); executed: pixmapName += QLatin1String("-editable"); Execution Count:1 | 1 |
2614 | if (isEnabled) partially evaluated: isEnabled yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
2615 | pixmapName += QLatin1String("-enabled"); executed: pixmapName += QLatin1String("-enabled"); Execution Count:2 | 2 |
2616 | | - |
2617 | if (!QPixmapCache::find(pixmapName, cache)) { partially evaluated: !QPixmapCache::find(pixmapName, cache) yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
2618 | cache = styleCachePixmap(comboBox->rect.size()); executed (the execution status of this line is deduced): cache = styleCachePixmap(comboBox->rect.size()); | - |
2619 | cache.fill(Qt::transparent); executed (the execution status of this line is deduced): cache.fill(Qt::transparent); | - |
2620 | QPainter cachePainter(&cache); executed (the execution status of this line is deduced): QPainter cachePainter(&cache); | - |
2621 | QRect pixmapRect(0, 0, comboBox->rect.width(), comboBox->rect.height()); executed (the execution status of this line is deduced): QRect pixmapRect(0, 0, comboBox->rect.width(), comboBox->rect.height()); | - |
2622 | QStyleOptionComboBox comboBoxCopy = *comboBox; executed (the execution status of this line is deduced): QStyleOptionComboBox comboBoxCopy = *comboBox; | - |
2623 | comboBoxCopy.rect = pixmapRect; executed (the execution status of this line is deduced): comboBoxCopy.rect = pixmapRect; | - |
2624 | | - |
2625 | QRect rect = pixmapRect; executed (the execution status of this line is deduced): QRect rect = pixmapRect; | - |
2626 | QRect downArrowRect = proxy()->subControlRect(CC_ComboBox, &comboBoxCopy, executed (the execution status of this line is deduced): QRect downArrowRect = proxy()->subControlRect(CC_ComboBox, &comboBoxCopy, | - |
2627 | SC_ComboBoxArrow, widget); executed (the execution status of this line is deduced): SC_ComboBoxArrow, widget); | - |
2628 | // Draw a line edit | - |
2629 | if (comboBox->editable) { evaluated: comboBox->editable yes Evaluation Count:1 | yes Evaluation Count:1 |
| 1 |
2630 | QStyleOptionFrame buttonOption; executed (the execution status of this line is deduced): QStyleOptionFrame buttonOption; | - |
2631 | buttonOption.QStyleOption::operator=(*comboBox); executed (the execution status of this line is deduced): buttonOption.QStyleOption::operator=(*comboBox); | - |
2632 | buttonOption.rect = rect; executed (the execution status of this line is deduced): buttonOption.rect = rect; | - |
2633 | buttonOption.state = (comboBox->state & (State_Enabled | State_MouseOver | State_HasFocus)) executed (the execution status of this line is deduced): buttonOption.state = (comboBox->state & (State_Enabled | State_MouseOver | State_HasFocus)) | - |
2634 | | State_KeyboardFocusChange; // Always show hig executed (the execution status of this line is deduced): | State_KeyboardFocusChange; | - |
2635 | | - |
2636 | if (sunken) { partially evaluated: sunken no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
2637 | buttonOption.state |= State_Sunken; never executed (the execution status of this line is deduced): buttonOption.state |= State_Sunken; | - |
2638 | buttonOption.state &= ~State_MouseOver; never executed (the execution status of this line is deduced): buttonOption.state &= ~State_MouseOver; | - |
2639 | } | 0 |
2640 | | - |
2641 | proxy()->drawPrimitive(PE_FrameLineEdit, &buttonOption, &cachePainter, widget); executed (the execution status of this line is deduced): proxy()->drawPrimitive(PE_FrameLineEdit, &buttonOption, &cachePainter, widget); | - |
2642 | | - |
2643 | // Draw button clipped | - |
2644 | cachePainter.save(); executed (the execution status of this line is deduced): cachePainter.save(); | - |
2645 | cachePainter.setClipRect(downArrowRect.adjusted(0, 0, 1, 0)); executed (the execution status of this line is deduced): cachePainter.setClipRect(downArrowRect.adjusted(0, 0, 1, 0)); | - |
2646 | buttonOption.rect.setLeft(comboBox->direction == Qt::LeftToRight ? executed (the execution status of this line is deduced): buttonOption.rect.setLeft(comboBox->direction == Qt::LeftToRight ? | - |
2647 | downArrowRect.left() - 6: downArrowRect.right() + 6); executed (the execution status of this line is deduced): downArrowRect.left() - 6: downArrowRect.right() + 6); | - |
2648 | proxy()->drawPrimitive(PE_PanelButtonCommand, &buttonOption, &cachePainter, widget); executed (the execution status of this line is deduced): proxy()->drawPrimitive(PE_PanelButtonCommand, &buttonOption, &cachePainter, widget); | - |
2649 | cachePainter.restore(); executed (the execution status of this line is deduced): cachePainter.restore(); | - |
2650 | cachePainter.setPen( QPen(hasFocus ? option->palette.highlight() : outline.lighter(110), 1)); executed (the execution status of this line is deduced): cachePainter.setPen( QPen(hasFocus ? option->palette.highlight() : outline.lighter(110), 1)); | - |
2651 | | - |
2652 | if (!sunken) { partially evaluated: !sunken yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
2653 | int borderSize = 1; executed (the execution status of this line is deduced): int borderSize = 1; | - |
2654 | if (comboBox->direction == Qt::RightToLeft) { partially evaluated: comboBox->direction == Qt::RightToLeft no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
2655 | cachePainter.drawLine(QPoint(downArrowRect.right() - 1, downArrowRect.top() + borderSize ), never executed (the execution status of this line is deduced): cachePainter.drawLine(QPoint(downArrowRect.right() - 1, downArrowRect.top() + borderSize ), | - |
2656 | QPoint(downArrowRect.right() - 1, downArrowRect.bottom() - borderSize)); never executed (the execution status of this line is deduced): QPoint(downArrowRect.right() - 1, downArrowRect.bottom() - borderSize)); | - |
2657 | } else { | 0 |
2658 | cachePainter.drawLine(QPoint(downArrowRect.left() , downArrowRect.top() + borderSize), executed (the execution status of this line is deduced): cachePainter.drawLine(QPoint(downArrowRect.left() , downArrowRect.top() + borderSize), | - |
2659 | QPoint(downArrowRect.left() , downArrowRect.bottom() - borderSize)); executed (the execution status of this line is deduced): QPoint(downArrowRect.left() , downArrowRect.bottom() - borderSize)); | - |
2660 | } executed: } Execution Count:1 | 1 |
2661 | } else { | - |
2662 | if (comboBox->direction == Qt::RightToLeft) { never evaluated: comboBox->direction == Qt::RightToLeft | 0 |
2663 | cachePainter.drawLine(QPoint(downArrowRect.right(), downArrowRect.top() + 2), never executed (the execution status of this line is deduced): cachePainter.drawLine(QPoint(downArrowRect.right(), downArrowRect.top() + 2), | - |
2664 | QPoint(downArrowRect.right(), downArrowRect.bottom() - 2)); never executed (the execution status of this line is deduced): QPoint(downArrowRect.right(), downArrowRect.bottom() - 2)); | - |
2665 | | - |
2666 | } else { | 0 |
2667 | cachePainter.drawLine(QPoint(downArrowRect.left(), downArrowRect.top() + 2), never executed (the execution status of this line is deduced): cachePainter.drawLine(QPoint(downArrowRect.left(), downArrowRect.top() + 2), | - |
2668 | QPoint(downArrowRect.left(), downArrowRect.bottom() - 2)); never executed (the execution status of this line is deduced): QPoint(downArrowRect.left(), downArrowRect.bottom() - 2)); | - |
2669 | } | 0 |
2670 | } | - |
2671 | } else { | - |
2672 | QStyleOptionButton buttonOption; executed (the execution status of this line is deduced): QStyleOptionButton buttonOption; | - |
2673 | buttonOption.QStyleOption::operator=(*comboBox); executed (the execution status of this line is deduced): buttonOption.QStyleOption::operator=(*comboBox); | - |
2674 | buttonOption.rect = rect; executed (the execution status of this line is deduced): buttonOption.rect = rect; | - |
2675 | buttonOption.state = comboBox->state & (State_Enabled | State_MouseOver | State_HasFocus | State_KeyboardFocusChange); executed (the execution status of this line is deduced): buttonOption.state = comboBox->state & (State_Enabled | State_MouseOver | State_HasFocus | State_KeyboardFocusChange); | - |
2676 | if (sunken) { partially evaluated: sunken no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
2677 | buttonOption.state |= State_Sunken; never executed (the execution status of this line is deduced): buttonOption.state |= State_Sunken; | - |
2678 | buttonOption.state &= ~State_MouseOver; never executed (the execution status of this line is deduced): buttonOption.state &= ~State_MouseOver; | - |
2679 | } | 0 |
2680 | proxy()->drawPrimitive(PE_PanelButtonCommand, &buttonOption, &cachePainter, widget); executed (the execution status of this line is deduced): proxy()->drawPrimitive(PE_PanelButtonCommand, &buttonOption, &cachePainter, widget); | - |
2681 | } executed: } Execution Count:1 | 1 |
2682 | if (comboBox->subControls & SC_ComboBoxArrow) { partially evaluated: comboBox->subControls & SC_ComboBoxArrow yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
2683 | // Draw the up/down arrow | - |
2684 | QColor arrowColor = option->palette.buttonText().color(); executed (the execution status of this line is deduced): QColor arrowColor = option->palette.buttonText().color(); | - |
2685 | arrowColor.setAlpha(220); executed (the execution status of this line is deduced): arrowColor.setAlpha(220); | - |
2686 | QPixmap downArrow = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), arrowColor, 180); executed (the execution status of this line is deduced): QPixmap downArrow = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), arrowColor, 180); | - |
2687 | cachePainter.drawPixmap(QRectF(downArrowRect.center().x() - downArrow.width() / 4.0 + 1.0, executed (the execution status of this line is deduced): cachePainter.drawPixmap(QRectF(downArrowRect.center().x() - downArrow.width() / 4.0 + 1.0, | - |
2688 | downArrowRect.center().y() - downArrow.height() / 4.0 + 1.0, executed (the execution status of this line is deduced): downArrowRect.center().y() - downArrow.height() / 4.0 + 1.0, | - |
2689 | downArrow.width() / 2.0, downArrow.height() / 2.0), executed (the execution status of this line is deduced): downArrow.width() / 2.0, downArrow.height() / 2.0), | - |
2690 | downArrow, QRectF(QPointF(0.0, 0.0), downArrow.size())); executed (the execution status of this line is deduced): downArrow, QRectF(QPointF(0.0, 0.0), downArrow.size())); | - |
2691 | } executed: } Execution Count:2 | 2 |
2692 | cachePainter.end(); executed (the execution status of this line is deduced): cachePainter.end(); | - |
2693 | QPixmapCache::insert(pixmapName, cache); executed (the execution status of this line is deduced): QPixmapCache::insert(pixmapName, cache); | - |
2694 | } executed: } Execution Count:2 | 2 |
2695 | painter->drawPixmap(comboBox->rect.topLeft(), cache); executed (the execution status of this line is deduced): painter->drawPixmap(comboBox->rect.topLeft(), cache); | - |
2696 | } executed: } Execution Count:2 | 2 |
2697 | painter->restore(); executed (the execution status of this line is deduced): painter->restore(); | - |
2698 | break; executed: break; Execution Count:2 | 2 |
2699 | case CC_Slider: | - |
2700 | if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(option)) { partially evaluated: const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(option) yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
2701 | QRect groove = proxy()->subControlRect(CC_Slider, option, SC_SliderGroove, widget); executed (the execution status of this line is deduced): QRect groove = proxy()->subControlRect(CC_Slider, option, SC_SliderGroove, widget); | - |
2702 | QRect handle = proxy()->subControlRect(CC_Slider, option, SC_SliderHandle, widget); executed (the execution status of this line is deduced): QRect handle = proxy()->subControlRect(CC_Slider, option, SC_SliderHandle, widget); | - |
2703 | | - |
2704 | bool horizontal = slider->orientation == Qt::Horizontal; executed (the execution status of this line is deduced): bool horizontal = slider->orientation == Qt::Horizontal; | - |
2705 | bool ticksAbove = slider->tickPosition & QSlider::TicksAbove; executed (the execution status of this line is deduced): bool ticksAbove = slider->tickPosition & QSlider::TicksAbove; | - |
2706 | bool ticksBelow = slider->tickPosition & QSlider::TicksBelow; executed (the execution status of this line is deduced): bool ticksBelow = slider->tickPosition & QSlider::TicksBelow; | - |
2707 | QColor activeHighlight = d->highlight(option->palette); executed (the execution status of this line is deduced): QColor activeHighlight = d->highlight(option->palette); | - |
2708 | QPixmap cache; executed (the execution status of this line is deduced): QPixmap cache; | - |
2709 | QBrush oldBrush = painter->brush(); executed (the execution status of this line is deduced): QBrush oldBrush = painter->brush(); | - |
2710 | QPen oldPen = painter->pen(); executed (the execution status of this line is deduced): QPen oldPen = painter->pen(); | - |
2711 | QColor shadowAlpha(Qt::black); executed (the execution status of this line is deduced): QColor shadowAlpha(Qt::black); | - |
2712 | shadowAlpha.setAlpha(10); executed (the execution status of this line is deduced): shadowAlpha.setAlpha(10); | - |
2713 | if (option->state & State_HasFocus && option->state & State_KeyboardFocusChange) partially evaluated: option->state & State_HasFocus no Evaluation Count:0 | yes Evaluation Count:1 |
never evaluated: option->state & State_KeyboardFocusChange | 0-1 |
2714 | outline = d->highlightedOutline(option->palette); never executed: outline = d->highlightedOutline(option->palette); | 0 |
2715 | | - |
2716 | | - |
2717 | if ((option->subControls & SC_SliderGroove) && groove.isValid()) { partially evaluated: (option->subControls & SC_SliderGroove) yes Evaluation Count:1 | no Evaluation Count:0 |
partially evaluated: groove.isValid() yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
2718 | QColor grooveColor; executed (the execution status of this line is deduced): QColor grooveColor; | - |
2719 | grooveColor.setHsv(buttonColor.hue(), executed (the execution status of this line is deduced): grooveColor.setHsv(buttonColor.hue(), | - |
2720 | qMin(255, (int)(buttonColor.saturation())), executed (the execution status of this line is deduced): qMin(255, (int)(buttonColor.saturation())), | - |
2721 | qMin(255, (int)(buttonColor.value()*0.9))); executed (the execution status of this line is deduced): qMin(255, (int)(buttonColor.value()*0.9))); | - |
2722 | QString groovePixmapName = QStyleHelper::uniqueName(QLatin1String("slider_groove"), option, groove.size()); executed (the execution status of this line is deduced): QString groovePixmapName = QStyleHelper::uniqueName(QLatin1String("slider_groove"), option, groove.size()); | - |
2723 | QRect pixmapRect(0, 0, groove.width(), groove.height()); executed (the execution status of this line is deduced): QRect pixmapRect(0, 0, groove.width(), groove.height()); | - |
2724 | | - |
2725 | // draw background groove | - |
2726 | if (!QPixmapCache::find(groovePixmapName, cache)) { partially evaluated: !QPixmapCache::find(groovePixmapName, cache) yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
2727 | cache = styleCachePixmap(pixmapRect.size()); executed (the execution status of this line is deduced): cache = styleCachePixmap(pixmapRect.size()); | - |
2728 | cache.fill(Qt::transparent); executed (the execution status of this line is deduced): cache.fill(Qt::transparent); | - |
2729 | QPainter groovePainter(&cache); executed (the execution status of this line is deduced): QPainter groovePainter(&cache); | - |
2730 | groovePainter.setRenderHint(QPainter::Antialiasing, true); executed (the execution status of this line is deduced): groovePainter.setRenderHint(QPainter::Antialiasing, true); | - |
2731 | groovePainter.translate(0.5, 0.5); executed (the execution status of this line is deduced): groovePainter.translate(0.5, 0.5); | - |
2732 | QLinearGradient gradient; executed (the execution status of this line is deduced): QLinearGradient gradient; | - |
2733 | if (horizontal) { partially evaluated: horizontal yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
2734 | gradient.setStart(pixmapRect.center().x(), pixmapRect.top()); executed (the execution status of this line is deduced): gradient.setStart(pixmapRect.center().x(), pixmapRect.top()); | - |
2735 | gradient.setFinalStop(pixmapRect.center().x(), pixmapRect.bottom()); executed (the execution status of this line is deduced): gradient.setFinalStop(pixmapRect.center().x(), pixmapRect.bottom()); | - |
2736 | } executed: } Execution Count:1 | 1 |
2737 | else { | - |
2738 | gradient.setStart(pixmapRect.left(), pixmapRect.center().y()); never executed (the execution status of this line is deduced): gradient.setStart(pixmapRect.left(), pixmapRect.center().y()); | - |
2739 | gradient.setFinalStop(pixmapRect.right(), pixmapRect.center().y()); never executed (the execution status of this line is deduced): gradient.setFinalStop(pixmapRect.right(), pixmapRect.center().y()); | - |
2740 | } | 0 |
2741 | groovePainter.setPen(QPen(outline)); executed (the execution status of this line is deduced): groovePainter.setPen(QPen(outline)); | - |
2742 | gradient.setColorAt(0, grooveColor.darker(110)); executed (the execution status of this line is deduced): gradient.setColorAt(0, grooveColor.darker(110)); | - |
2743 | gradient.setColorAt(1, grooveColor.lighter(110));//palette.button().color().darker(115)); executed (the execution status of this line is deduced): gradient.setColorAt(1, grooveColor.lighter(110)); | - |
2744 | groovePainter.setBrush(gradient); executed (the execution status of this line is deduced): groovePainter.setBrush(gradient); | - |
2745 | groovePainter.drawRoundedRect(pixmapRect.adjusted(1, 1, -2, -2), 1, 1); executed (the execution status of this line is deduced): groovePainter.drawRoundedRect(pixmapRect.adjusted(1, 1, -2, -2), 1, 1); | - |
2746 | groovePainter.end(); executed (the execution status of this line is deduced): groovePainter.end(); | - |
2747 | QPixmapCache::insert(groovePixmapName, cache); executed (the execution status of this line is deduced): QPixmapCache::insert(groovePixmapName, cache); | - |
2748 | } executed: } Execution Count:1 | 1 |
2749 | painter->drawPixmap(groove.topLeft(), cache); executed (the execution status of this line is deduced): painter->drawPixmap(groove.topLeft(), cache); | - |
2750 | | - |
2751 | // draw blue groove highlight | - |
2752 | QRect clipRect; executed (the execution status of this line is deduced): QRect clipRect; | - |
2753 | groovePixmapName += QLatin1String("_blue"); executed (the execution status of this line is deduced): groovePixmapName += QLatin1String("_blue"); | - |
2754 | if (!QPixmapCache::find(groovePixmapName, cache)) { partially evaluated: !QPixmapCache::find(groovePixmapName, cache) yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
2755 | cache = styleCachePixmap(pixmapRect.size()); executed (the execution status of this line is deduced): cache = styleCachePixmap(pixmapRect.size()); | - |
2756 | cache.fill(Qt::transparent); executed (the execution status of this line is deduced): cache.fill(Qt::transparent); | - |
2757 | QPainter groovePainter(&cache); executed (the execution status of this line is deduced): QPainter groovePainter(&cache); | - |
2758 | QLinearGradient gradient; executed (the execution status of this line is deduced): QLinearGradient gradient; | - |
2759 | if (horizontal) { partially evaluated: horizontal yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
2760 | gradient.setStart(pixmapRect.center().x(), pixmapRect.top()); executed (the execution status of this line is deduced): gradient.setStart(pixmapRect.center().x(), pixmapRect.top()); | - |
2761 | gradient.setFinalStop(pixmapRect.center().x(), pixmapRect.bottom()); executed (the execution status of this line is deduced): gradient.setFinalStop(pixmapRect.center().x(), pixmapRect.bottom()); | - |
2762 | } executed: } Execution Count:1 | 1 |
2763 | else { | - |
2764 | gradient.setStart(pixmapRect.left(), pixmapRect.center().y()); never executed (the execution status of this line is deduced): gradient.setStart(pixmapRect.left(), pixmapRect.center().y()); | - |
2765 | gradient.setFinalStop(pixmapRect.right(), pixmapRect.center().y()); never executed (the execution status of this line is deduced): gradient.setFinalStop(pixmapRect.right(), pixmapRect.center().y()); | - |
2766 | } | 0 |
2767 | QColor highlight = d->highlight(option->palette); executed (the execution status of this line is deduced): QColor highlight = d->highlight(option->palette); | - |
2768 | QColor highlightedoutline = highlight.darker(140); executed (the execution status of this line is deduced): QColor highlightedoutline = highlight.darker(140); | - |
2769 | if (qGray(outline.rgb()) > qGray(highlightedoutline.rgb())) partially evaluated: qGray(outline.rgb()) > qGray(highlightedoutline.rgb()) yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
2770 | outline = highlightedoutline; executed: outline = highlightedoutline; Execution Count:1 | 1 |
2771 | | - |
2772 | | - |
2773 | groovePainter.setRenderHint(QPainter::Antialiasing, true); executed (the execution status of this line is deduced): groovePainter.setRenderHint(QPainter::Antialiasing, true); | - |
2774 | groovePainter.translate(0.5, 0.5); executed (the execution status of this line is deduced): groovePainter.translate(0.5, 0.5); | - |
2775 | groovePainter.setPen(QPen(outline)); executed (the execution status of this line is deduced): groovePainter.setPen(QPen(outline)); | - |
2776 | gradient.setColorAt(0, activeHighlight); executed (the execution status of this line is deduced): gradient.setColorAt(0, activeHighlight); | - |
2777 | gradient.setColorAt(1, activeHighlight.lighter(130)); executed (the execution status of this line is deduced): gradient.setColorAt(1, activeHighlight.lighter(130)); | - |
2778 | groovePainter.setBrush(gradient); executed (the execution status of this line is deduced): groovePainter.setBrush(gradient); | - |
2779 | groovePainter.drawRoundedRect(pixmapRect.adjusted(1, 1, -2, -2), 1, 1); executed (the execution status of this line is deduced): groovePainter.drawRoundedRect(pixmapRect.adjusted(1, 1, -2, -2), 1, 1); | - |
2780 | groovePainter.setPen(d->innerContrastLine()); executed (the execution status of this line is deduced): groovePainter.setPen(d->innerContrastLine()); | - |
2781 | groovePainter.setBrush(Qt::NoBrush); executed (the execution status of this line is deduced): groovePainter.setBrush(Qt::NoBrush); | - |
2782 | groovePainter.drawRoundedRect(pixmapRect.adjusted(2, 2, -3, -3), 1, 1); executed (the execution status of this line is deduced): groovePainter.drawRoundedRect(pixmapRect.adjusted(2, 2, -3, -3), 1, 1); | - |
2783 | groovePainter.end(); executed (the execution status of this line is deduced): groovePainter.end(); | - |
2784 | QPixmapCache::insert(groovePixmapName, cache); executed (the execution status of this line is deduced): QPixmapCache::insert(groovePixmapName, cache); | - |
2785 | } executed: } Execution Count:1 | 1 |
2786 | if (horizontal) { partially evaluated: horizontal yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
2787 | if (slider->upsideDown) partially evaluated: slider->upsideDown no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
2788 | clipRect = QRect(handle.right(), groove.top(), groove.right() - handle.right(), groove.height()); never executed: clipRect = QRect(handle.right(), groove.top(), groove.right() - handle.right(), groove.height()); | 0 |
2789 | else | - |
2790 | clipRect = QRect(groove.left(), groove.top(), handle.left(), groove.height()); executed: clipRect = QRect(groove.left(), groove.top(), handle.left(), groove.height()); Execution Count:1 | 1 |
2791 | } else { | - |
2792 | if (slider->upsideDown) never evaluated: slider->upsideDown | 0 |
2793 | clipRect = QRect(groove.left(), handle.bottom(), groove.width(), groove.height() - handle.bottom()); never executed: clipRect = QRect(groove.left(), handle.bottom(), groove.width(), groove.height() - handle.bottom()); | 0 |
2794 | else | - |
2795 | clipRect = QRect(groove.left(), groove.top(), groove.width(), handle.top() - groove.top()); never executed: clipRect = QRect(groove.left(), groove.top(), groove.width(), handle.top() - groove.top()); | 0 |
2796 | } | - |
2797 | painter->save(); executed (the execution status of this line is deduced): painter->save(); | - |
2798 | painter->setClipRect(clipRect.adjusted(0, 0, 1, 1)); executed (the execution status of this line is deduced): painter->setClipRect(clipRect.adjusted(0, 0, 1, 1)); | - |
2799 | painter->drawPixmap(groove.topLeft(), cache); executed (the execution status of this line is deduced): painter->drawPixmap(groove.topLeft(), cache); | - |
2800 | painter->restore(); executed (the execution status of this line is deduced): painter->restore(); | - |
2801 | } executed: } Execution Count:1 | 1 |
2802 | | - |
2803 | // draw handle | - |
2804 | if ((option->subControls & SC_SliderHandle) ) { partially evaluated: (option->subControls & SC_SliderHandle) yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
2805 | QString handlePixmapName = QStyleHelper::uniqueName(QLatin1String("slider_handle"), option, handle.size()); executed (the execution status of this line is deduced): QString handlePixmapName = QStyleHelper::uniqueName(QLatin1String("slider_handle"), option, handle.size()); | - |
2806 | if (!QPixmapCache::find(handlePixmapName, cache)) { partially evaluated: !QPixmapCache::find(handlePixmapName, cache) yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
2807 | cache = styleCachePixmap(handle.size()); executed (the execution status of this line is deduced): cache = styleCachePixmap(handle.size()); | - |
2808 | cache.fill(Qt::transparent); executed (the execution status of this line is deduced): cache.fill(Qt::transparent); | - |
2809 | QRect pixmapRect(0, 0, handle.width(), handle.height()); executed (the execution status of this line is deduced): QRect pixmapRect(0, 0, handle.width(), handle.height()); | - |
2810 | QPainter handlePainter(&cache); executed (the execution status of this line is deduced): QPainter handlePainter(&cache); | - |
2811 | QRect gradRect = pixmapRect.adjusted(2, 2, -2, -2); executed (the execution status of this line is deduced): QRect gradRect = pixmapRect.adjusted(2, 2, -2, -2); | - |
2812 | | - |
2813 | // gradient fill | - |
2814 | QRect r = pixmapRect.adjusted(1, 1, -2, -2); executed (the execution status of this line is deduced): QRect r = pixmapRect.adjusted(1, 1, -2, -2); | - |
2815 | QLinearGradient gradient = qt_fusion_gradient(gradRect, d->buttonColor(option->palette),horizontal ? TopDown : FromLeft); executed (the execution status of this line is deduced): QLinearGradient gradient = qt_fusion_gradient(gradRect, d->buttonColor(option->palette),horizontal ? TopDown : FromLeft); | - |
2816 | | - |
2817 | handlePainter.setRenderHint(QPainter::Antialiasing, true); executed (the execution status of this line is deduced): handlePainter.setRenderHint(QPainter::Antialiasing, true); | - |
2818 | handlePainter.translate(0.5, 0.5); executed (the execution status of this line is deduced): handlePainter.translate(0.5, 0.5); | - |
2819 | | - |
2820 | handlePainter.setPen(Qt::NoPen); executed (the execution status of this line is deduced): handlePainter.setPen(Qt::NoPen); | - |
2821 | handlePainter.setBrush(QColor(0, 0, 0, 40)); executed (the execution status of this line is deduced): handlePainter.setBrush(QColor(0, 0, 0, 40)); | - |
2822 | handlePainter.drawRect(r.adjusted(-1, 2, 1, -2)); executed (the execution status of this line is deduced): handlePainter.drawRect(r.adjusted(-1, 2, 1, -2)); | - |
2823 | | - |
2824 | handlePainter.setPen(QPen(d->outline(option->palette))); executed (the execution status of this line is deduced): handlePainter.setPen(QPen(d->outline(option->palette))); | - |
2825 | if (option->state & State_HasFocus && option->state & State_KeyboardFocusChange) partially evaluated: option->state & State_HasFocus no Evaluation Count:0 | yes Evaluation Count:1 |
never evaluated: option->state & State_KeyboardFocusChange | 0-1 |
2826 | handlePainter.setPen(QPen(d->highlightedOutline(option->palette))); never executed: handlePainter.setPen(QPen(d->highlightedOutline(option->palette))); | 0 |
2827 | | - |
2828 | handlePainter.setBrush(gradient); executed (the execution status of this line is deduced): handlePainter.setBrush(gradient); | - |
2829 | handlePainter.drawRoundedRect(r, 2, 2); executed (the execution status of this line is deduced): handlePainter.drawRoundedRect(r, 2, 2); | - |
2830 | handlePainter.setBrush(Qt::NoBrush); executed (the execution status of this line is deduced): handlePainter.setBrush(Qt::NoBrush); | - |
2831 | handlePainter.setPen(d->innerContrastLine()); executed (the execution status of this line is deduced): handlePainter.setPen(d->innerContrastLine()); | - |
2832 | handlePainter.drawRoundedRect(r.adjusted(1, 1, -1, -1), 2, 2); executed (the execution status of this line is deduced): handlePainter.drawRoundedRect(r.adjusted(1, 1, -1, -1), 2, 2); | - |
2833 | | - |
2834 | QColor cornerAlpha = outline.darker(120); executed (the execution status of this line is deduced): QColor cornerAlpha = outline.darker(120); | - |
2835 | cornerAlpha.setAlpha(80); executed (the execution status of this line is deduced): cornerAlpha.setAlpha(80); | - |
2836 | | - |
2837 | //handle shadow | - |
2838 | handlePainter.setPen(shadowAlpha); executed (the execution status of this line is deduced): handlePainter.setPen(shadowAlpha); | - |
2839 | handlePainter.drawLine(QPoint(r.left() + 2, r.bottom() + 1), QPoint(r.right() - 2, r.bottom() + 1)); executed (the execution status of this line is deduced): handlePainter.drawLine(QPoint(r.left() + 2, r.bottom() + 1), QPoint(r.right() - 2, r.bottom() + 1)); | - |
2840 | handlePainter.drawLine(QPoint(r.right() + 1, r.bottom() - 3), QPoint(r.right() + 1, r.top() + 4)); executed (the execution status of this line is deduced): handlePainter.drawLine(QPoint(r.right() + 1, r.bottom() - 3), QPoint(r.right() + 1, r.top() + 4)); | - |
2841 | handlePainter.drawLine(QPoint(r.right() - 1, r.bottom()), QPoint(r.right() + 1, r.bottom() - 2)); executed (the execution status of this line is deduced): handlePainter.drawLine(QPoint(r.right() - 1, r.bottom()), QPoint(r.right() + 1, r.bottom() - 2)); | - |
2842 | | - |
2843 | handlePainter.end(); executed (the execution status of this line is deduced): handlePainter.end(); | - |
2844 | QPixmapCache::insert(handlePixmapName, cache); executed (the execution status of this line is deduced): QPixmapCache::insert(handlePixmapName, cache); | - |
2845 | } executed: } Execution Count:1 | 1 |
2846 | | - |
2847 | painter->drawPixmap(handle.topLeft(), cache); executed (the execution status of this line is deduced): painter->drawPixmap(handle.topLeft(), cache); | - |
2848 | | - |
2849 | } executed: } Execution Count:1 | 1 |
2850 | if (option->subControls & SC_SliderTickmarks) { partially evaluated: option->subControls & SC_SliderTickmarks yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
2851 | painter->setPen(outline); executed (the execution status of this line is deduced): painter->setPen(outline); | - |
2852 | int tickSize = proxy()->pixelMetric(PM_SliderTickmarkOffset, option, widget); executed (the execution status of this line is deduced): int tickSize = proxy()->pixelMetric(PM_SliderTickmarkOffset, option, widget); | - |
2853 | int available = proxy()->pixelMetric(PM_SliderSpaceAvailable, slider, widget); executed (the execution status of this line is deduced): int available = proxy()->pixelMetric(PM_SliderSpaceAvailable, slider, widget); | - |
2854 | int interval = slider->tickInterval; executed (the execution status of this line is deduced): int interval = slider->tickInterval; | - |
2855 | if (interval <= 0) { partially evaluated: interval <= 0 no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
2856 | interval = slider->singleStep; never executed (the execution status of this line is deduced): interval = slider->singleStep; | - |
2857 | if (QStyle::sliderPositionFromValue(slider->minimum, slider->maximum, interval, never evaluated: QStyle::sliderPositionFromValue(slider->minimum, slider->maximum, interval, available) - QStyle::sliderPositionFromValue(slider->minimum, slider->maximum, 0, available) < 3 | 0 |
2858 | available) never evaluated: QStyle::sliderPositionFromValue(slider->minimum, slider->maximum, interval, available) - QStyle::sliderPositionFromValue(slider->minimum, slider->maximum, 0, available) < 3 | 0 |
2859 | - QStyle::sliderPositionFromValue(slider->minimum, slider->maximum, never evaluated: QStyle::sliderPositionFromValue(slider->minimum, slider->maximum, interval, available) - QStyle::sliderPositionFromValue(slider->minimum, slider->maximum, 0, available) < 3 | 0 |
2860 | 0, available) < 3) never evaluated: QStyle::sliderPositionFromValue(slider->minimum, slider->maximum, interval, available) - QStyle::sliderPositionFromValue(slider->minimum, slider->maximum, 0, available) < 3 | 0 |
2861 | interval = slider->pageStep; never executed: interval = slider->pageStep; | 0 |
2862 | } | 0 |
2863 | if (interval <= 0) partially evaluated: interval <= 0 no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
2864 | interval = 1; never executed: interval = 1; | 0 |
2865 | | - |
2866 | int v = slider->minimum; executed (the execution status of this line is deduced): int v = slider->minimum; | - |
2867 | int len = proxy()->pixelMetric(PM_SliderLength, slider, widget); executed (the execution status of this line is deduced): int len = proxy()->pixelMetric(PM_SliderLength, slider, widget); | - |
2868 | while (v <= slider->maximum + 1) { evaluated: v <= slider->maximum + 1 yes Evaluation Count:5 | yes Evaluation Count:1 |
| 1-5 |
2869 | if (v == slider->maximum + 1 && interval == 1) partially evaluated: v == slider->maximum + 1 no Evaluation Count:0 | yes Evaluation Count:5 |
never evaluated: interval == 1 | 0-5 |
2870 | break; | 0 |
2871 | const int v_ = qMin(v, slider->maximum); executed (the execution status of this line is deduced): const int v_ = qMin(v, slider->maximum); | - |
2872 | int pos = sliderPositionFromValue(slider->minimum, slider->maximum, executed (the execution status of this line is deduced): int pos = sliderPositionFromValue(slider->minimum, slider->maximum, | - |
2873 | v_, (horizontal executed (the execution status of this line is deduced): v_, (horizontal | - |
2874 | ? slider->rect.width() executed (the execution status of this line is deduced): ? slider->rect.width() | - |
2875 | : slider->rect.height()) - len, executed (the execution status of this line is deduced): : slider->rect.height()) - len, | - |
2876 | slider->upsideDown) + len / 2; executed (the execution status of this line is deduced): slider->upsideDown) + len / 2; | - |
2877 | int extra = 2 - ((v_ == slider->minimum || v_ == slider->maximum) ? 1 : 0); evaluated: v_ == slider->minimum yes Evaluation Count:1 | yes Evaluation Count:4 |
evaluated: v_ == slider->maximum yes Evaluation Count:1 | yes Evaluation Count:3 |
| 1-4 |
2878 | | - |
2879 | if (horizontal) { partially evaluated: horizontal yes Evaluation Count:5 | no Evaluation Count:0 |
| 0-5 |
2880 | if (ticksAbove) { partially evaluated: ticksAbove no Evaluation Count:0 | yes Evaluation Count:5 |
| 0-5 |
2881 | painter->drawLine(pos, slider->rect.top() + extra, never executed (the execution status of this line is deduced): painter->drawLine(pos, slider->rect.top() + extra, | - |
2882 | pos, slider->rect.top() + tickSize); never executed (the execution status of this line is deduced): pos, slider->rect.top() + tickSize); | - |
2883 | } | 0 |
2884 | if (ticksBelow) { partially evaluated: ticksBelow no Evaluation Count:0 | yes Evaluation Count:5 |
| 0-5 |
2885 | painter->drawLine(pos, slider->rect.bottom() - extra, never executed (the execution status of this line is deduced): painter->drawLine(pos, slider->rect.bottom() - extra, | - |
2886 | pos, slider->rect.bottom() - tickSize); never executed (the execution status of this line is deduced): pos, slider->rect.bottom() - tickSize); | - |
2887 | } | 0 |
2888 | } else { executed: } Execution Count:5 | 5 |
2889 | if (ticksAbove) { never evaluated: ticksAbove | 0 |
2890 | painter->drawLine(slider->rect.left() + extra, pos, never executed (the execution status of this line is deduced): painter->drawLine(slider->rect.left() + extra, pos, | - |
2891 | slider->rect.left() + tickSize, pos); never executed (the execution status of this line is deduced): slider->rect.left() + tickSize, pos); | - |
2892 | } | 0 |
2893 | if (ticksBelow) { never evaluated: ticksBelow | 0 |
2894 | painter->drawLine(slider->rect.right() - extra, pos, never executed (the execution status of this line is deduced): painter->drawLine(slider->rect.right() - extra, pos, | - |
2895 | slider->rect.right() - tickSize, pos); never executed (the execution status of this line is deduced): slider->rect.right() - tickSize, pos); | - |
2896 | } | 0 |
2897 | } | 0 |
2898 | // in the case where maximum is max int | - |
2899 | int nextInterval = v + interval; executed (the execution status of this line is deduced): int nextInterval = v + interval; | - |
2900 | if (nextInterval < v) partially evaluated: nextInterval < v no Evaluation Count:0 | yes Evaluation Count:5 |
| 0-5 |
2901 | break; | 0 |
2902 | v = nextInterval; executed (the execution status of this line is deduced): v = nextInterval; | - |
2903 | } executed: } Execution Count:5 | 5 |
2904 | } executed: } Execution Count:1 | 1 |
2905 | painter->setBrush(oldBrush); executed (the execution status of this line is deduced): painter->setBrush(oldBrush); | - |
2906 | painter->setPen(oldPen); executed (the execution status of this line is deduced): painter->setPen(oldPen); | - |
2907 | } executed: } Execution Count:1 | 1 |
2908 | break; executed: break; Execution Count:1 | 1 |
2909 | case CC_Dial: | - |
2910 | if (const QStyleOptionSlider *dial = qstyleoption_cast<const QStyleOptionSlider *>(option)) partially evaluated: const QStyleOptionSlider *dial = qstyleoption_cast<const QStyleOptionSlider *>(option) yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
2911 | QStyleHelper::drawDial(dial, painter); executed: QStyleHelper::drawDial(dial, painter); Execution Count:1 | 1 |
2912 | break; executed: break; Execution Count:1 | 1 |
2913 | default: | - |
2914 | QCommonStyle::drawComplexControl(control, option, painter, widget); executed (the execution status of this line is deduced): QCommonStyle::drawComplexControl(control, option, painter, widget); | - |
2915 | break; executed: break; Execution Count:1 | 1 |
2916 | } | - |
2917 | } executed: } Execution Count:155 | 155 |
2918 | | - |
2919 | /*! | - |
2920 | \reimp | - |
2921 | */ | - |
2922 | int QFusionStyle::pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const | - |
2923 | { | - |
2924 | switch (metric) { | - |
2925 | case PM_HeaderMargin: | - |
2926 | return 2; executed: return 2; Execution Count:2 | 2 |
2927 | case PM_ToolTipLabelFrameWidth: | - |
2928 | return 2; executed: return 2; Execution Count:2 | 2 |
2929 | case PM_ButtonDefaultIndicator: | - |
2930 | return 0; executed: return 0; Execution Count:56 | 56 |
2931 | case PM_ButtonShiftHorizontal: | - |
2932 | case PM_ButtonShiftVertical: | - |
2933 | return 0; executed: return 0; Execution Count:4 | 4 |
2934 | case PM_MessageBoxIconSize: | - |
2935 | return 48; executed: return 48; Execution Count:2 | 2 |
2936 | case PM_ListViewIconSize: | - |
2937 | return 24; executed: return 24; Execution Count:2 | 2 |
2938 | case PM_DialogButtonsSeparator: | - |
2939 | case PM_ScrollBarSliderMin: | - |
2940 | return 26; executed: return 26; Execution Count:2460 | 2460 |
2941 | case PM_TitleBarHeight: | - |
2942 | return 24; executed: return 24; Execution Count:2 | 2 |
2943 | case PM_ScrollBarExtent: | - |
2944 | return 14; executed: return 14; Execution Count:3806 | 3806 |
2945 | case PM_SliderThickness: | - |
2946 | return 15; executed: return 15; Execution Count:3 | 3 |
2947 | case PM_SliderLength: | - |
2948 | return 15; executed: return 15; Execution Count:6 | 6 |
2949 | case PM_DockWidgetTitleMargin: | - |
2950 | return 1; executed: return 1; Execution Count:2 | 2 |
2951 | case PM_DefaultFrameWidth: | - |
2952 | return 1; executed: return 1; Execution Count:1989 | 1989 |
2953 | case PM_SpinBoxFrameWidth: | - |
2954 | return 3; executed: return 3; Execution Count:18 | 18 |
2955 | case PM_MenuVMargin: | - |
2956 | case PM_MenuHMargin: | - |
2957 | return 0; executed: return 0; Execution Count:4 | 4 |
2958 | case PM_MenuPanelWidth: | - |
2959 | return 0; executed: return 0; Execution Count:2 | 2 |
2960 | case PM_MenuBarItemSpacing: | - |
2961 | return 6; executed: return 6; Execution Count:2 | 2 |
2962 | case PM_MenuBarVMargin: | - |
2963 | return 0; executed: return 0; Execution Count:2 | 2 |
2964 | case PM_MenuBarHMargin: | - |
2965 | return 0; executed: return 0; Execution Count:2 | 2 |
2966 | case PM_MenuBarPanelWidth: | - |
2967 | return 0; executed: return 0; Execution Count:2 | 2 |
2968 | case PM_ToolBarHandleExtent: | - |
2969 | return 9; executed: return 9; Execution Count:2 | 2 |
2970 | case PM_ToolBarItemSpacing: | - |
2971 | return 1; executed: return 1; Execution Count:2 | 2 |
2972 | case PM_ToolBarFrameWidth: | - |
2973 | return 2; executed: return 2; Execution Count:2 | 2 |
2974 | case PM_ToolBarItemMargin: | - |
2975 | return 2; executed: return 2; Execution Count:2 | 2 |
2976 | case PM_SmallIconSize: | - |
2977 | return 16; executed: return 16; Execution Count:51 | 51 |
2978 | case PM_ButtonIconSize: | - |
2979 | return 16; executed: return 16; Execution Count:53 | 53 |
2980 | case PM_DockWidgetTitleBarButtonMargin: | - |
2981 | return 2; executed: return 2; Execution Count:2 | 2 |
2982 | case PM_MaximumDragDistance: | - |
2983 | return -1; executed: return -1; Execution Count:2 | 2 |
2984 | case PM_TabCloseIndicatorWidth: | - |
2985 | case PM_TabCloseIndicatorHeight: | - |
2986 | return 20; never executed: return 20; | 0 |
2987 | case PM_TabBarTabVSpace: | - |
2988 | return 12; executed: return 12; Execution Count:80 | 80 |
2989 | case PM_TabBarTabOverlap: | - |
2990 | return 1; executed: return 1; Execution Count:14 | 14 |
2991 | case PM_TabBarBaseOverlap: | - |
2992 | return 2; executed: return 2; Execution Count:36 | 36 |
2993 | case PM_SubMenuOverlap: | - |
2994 | return -1; never executed: return -1; | 0 |
2995 | case PM_DockWidgetHandleExtent: | - |
2996 | case PM_SplitterWidth: | - |
2997 | return 4; executed: return 4; Execution Count:4 | 4 |
2998 | case PM_IndicatorHeight: | - |
2999 | case PM_IndicatorWidth: | - |
3000 | case PM_ExclusiveIndicatorHeight: | - |
3001 | case PM_ExclusiveIndicatorWidth: | - |
3002 | return 14; executed: return 14; Execution Count:16 | 16 |
3003 | case PM_ScrollView_ScrollBarSpacing: | - |
3004 | return 0; never executed: return 0; | 0 |
3005 | default: | - |
3006 | break; executed: break; Execution Count:1376 | 1376 |
3007 | } | - |
3008 | return QCommonStyle::pixelMetric(metric, option, widget); executed: return QCommonStyle::pixelMetric(metric, option, widget); Execution Count:1376 | 1376 |
3009 | } | - |
3010 | | - |
3011 | /*! | - |
3012 | \reimp | - |
3013 | */ | - |
3014 | QSize QFusionStyle::sizeFromContents(ContentsType type, const QStyleOption *option, | - |
3015 | const QSize &size, const QWidget *widget) const | - |
3016 | { | - |
3017 | QSize newSize = QCommonStyle::sizeFromContents(type, option, size, widget); executed (the execution status of this line is deduced): QSize newSize = QCommonStyle::sizeFromContents(type, option, size, widget); | - |
3018 | switch (type) { | - |
3019 | case CT_PushButton: | - |
3020 | if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(option)) { partially evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(option) yes Evaluation Count:15 | no Evaluation Count:0 |
| 0-15 |
3021 | if (!btn->text.isEmpty() && newSize.width() < 80) partially evaluated: !btn->text.isEmpty() yes Evaluation Count:15 | no Evaluation Count:0 |
evaluated: newSize.width() < 80 yes Evaluation Count:14 | yes Evaluation Count:1 |
| 0-15 |
3022 | newSize.setWidth(80); executed: newSize.setWidth(80); Execution Count:14 | 14 |
3023 | if (!btn->icon.isNull() && btn->iconSize.height() > 16) partially evaluated: !btn->icon.isNull() no Evaluation Count:0 | yes Evaluation Count:15 |
never evaluated: btn->iconSize.height() > 16 | 0-15 |
3024 | newSize -= QSize(0, 2); never executed: newSize -= QSize(0, 2); | 0 |
3025 | } executed: } Execution Count:15 | 15 |
3026 | break; executed: break; Execution Count:15 | 15 |
3027 | case CT_GroupBox: | - |
3028 | if (option) { | 0 |
3029 | int topMargin = qMax(pixelMetric(PM_ExclusiveIndicatorHeight), option->fontMetrics.height()) + groupBoxTopMargin; never executed (the execution status of this line is deduced): int topMargin = qMax(pixelMetric(PM_ExclusiveIndicatorHeight), option->fontMetrics.height()) + groupBoxTopMargin; | - |
3030 | newSize += QSize(10, topMargin); // Add some space below the groupbox never executed (the execution status of this line is deduced): newSize += QSize(10, topMargin); | - |
3031 | } | 0 |
3032 | break; | 0 |
3033 | case CT_RadioButton: | - |
3034 | case CT_CheckBox: | - |
3035 | newSize += QSize(0, 1); never executed (the execution status of this line is deduced): newSize += QSize(0, 1); | - |
3036 | break; | 0 |
3037 | case CT_ToolButton: | - |
3038 | newSize += QSize(2, 2); executed (the execution status of this line is deduced): newSize += QSize(2, 2); | - |
3039 | break; executed: break; Execution Count:2 | 2 |
3040 | case CT_SpinBox: | - |
3041 | newSize += QSize(0, -3); executed (the execution status of this line is deduced): newSize += QSize(0, -3); | - |
3042 | break; executed: break; Execution Count:2 | 2 |
3043 | case CT_ComboBox: | - |
3044 | newSize += QSize(2, 4); executed (the execution status of this line is deduced): newSize += QSize(2, 4); | - |
3045 | break; executed: break; Execution Count:3 | 3 |
3046 | case CT_LineEdit: | - |
3047 | newSize += QSize(0, 4); executed (the execution status of this line is deduced): newSize += QSize(0, 4); | - |
3048 | break; executed: break; Execution Count:4 | 4 |
3049 | case CT_MenuBarItem: | - |
3050 | newSize += QSize(8, 5); never executed (the execution status of this line is deduced): newSize += QSize(8, 5); | - |
3051 | break; | 0 |
3052 | case CT_MenuItem: | - |
3053 | if (const QStyleOptionMenuItem *menuItem = qstyleoption_cast<const QStyleOptionMenuItem *>(option)) { never evaluated: const QStyleOptionMenuItem *menuItem = qstyleoption_cast<const QStyleOptionMenuItem *>(option) | 0 |
3054 | int w = newSize.width(); never executed (the execution status of this line is deduced): int w = newSize.width(); | - |
3055 | int maxpmw = menuItem->maxIconWidth; never executed (the execution status of this line is deduced): int maxpmw = menuItem->maxIconWidth; | - |
3056 | int tabSpacing = 20; never executed (the execution status of this line is deduced): int tabSpacing = 20; | - |
3057 | if (menuItem->text.contains(QLatin1Char('\t'))) never evaluated: menuItem->text.contains(QLatin1Char('\t')) | 0 |
3058 | w += tabSpacing; never executed: w += tabSpacing; | 0 |
3059 | else if (menuItem->menuItemType == QStyleOptionMenuItem::SubMenu) never evaluated: menuItem->menuItemType == QStyleOptionMenuItem::SubMenu | 0 |
3060 | w += 2 * QFusionStylePrivate::menuArrowHMargin; never executed: w += 2 * QFusionStylePrivate::menuArrowHMargin; | 0 |
3061 | else if (menuItem->menuItemType == QStyleOptionMenuItem::DefaultItem) { never evaluated: menuItem->menuItemType == QStyleOptionMenuItem::DefaultItem | 0 |
3062 | QFontMetrics fm(menuItem->font); never executed (the execution status of this line is deduced): QFontMetrics fm(menuItem->font); | - |
3063 | QFont fontBold = menuItem->font; never executed (the execution status of this line is deduced): QFont fontBold = menuItem->font; | - |
3064 | fontBold.setBold(true); never executed (the execution status of this line is deduced): fontBold.setBold(true); | - |
3065 | QFontMetrics fmBold(fontBold); never executed (the execution status of this line is deduced): QFontMetrics fmBold(fontBold); | - |
3066 | w += fmBold.width(menuItem->text) - fm.width(menuItem->text); never executed (the execution status of this line is deduced): w += fmBold.width(menuItem->text) - fm.width(menuItem->text); | - |
3067 | } | 0 |
3068 | int checkcol = qMax<int>(maxpmw, QFusionStylePrivate::menuCheckMarkWidth); // Windows always shows a check column never executed (the execution status of this line is deduced): int checkcol = qMax<int>(maxpmw, QFusionStylePrivate::menuCheckMarkWidth); | - |
3069 | w += checkcol; never executed (the execution status of this line is deduced): w += checkcol; | - |
3070 | w += int(QFusionStylePrivate::menuRightBorder) + 10; never executed (the execution status of this line is deduced): w += int(QFusionStylePrivate::menuRightBorder) + 10; | - |
3071 | newSize.setWidth(w); never executed (the execution status of this line is deduced): newSize.setWidth(w); | - |
3072 | if (menuItem->menuItemType == QStyleOptionMenuItem::Separator) { never evaluated: menuItem->menuItemType == QStyleOptionMenuItem::Separator | 0 |
3073 | if (!menuItem->text.isEmpty()) { never evaluated: !menuItem->text.isEmpty() | 0 |
3074 | newSize.setHeight(menuItem->fontMetrics.height()); never executed (the execution status of this line is deduced): newSize.setHeight(menuItem->fontMetrics.height()); | - |
3075 | } | 0 |
3076 | } | 0 |
3077 | else if (!menuItem->icon.isNull()) { never evaluated: !menuItem->icon.isNull() | 0 |
3078 | if (const QComboBox *combo = qobject_cast<const QComboBox*>(widget)) { never evaluated: const QComboBox *combo = qobject_cast<const QComboBox*>(widget) | 0 |
3079 | newSize.setHeight(qMax(combo->iconSize().height() + 2, newSize.height())); never executed (the execution status of this line is deduced): newSize.setHeight(qMax(combo->iconSize().height() + 2, newSize.height())); | - |
3080 | } | 0 |
3081 | } | 0 |
3082 | newSize.setWidth(newSize.width() + 12); never executed (the execution status of this line is deduced): newSize.setWidth(newSize.width() + 12); | - |
3083 | newSize.setWidth(qMax(newSize.width(), 120)); never executed (the execution status of this line is deduced): newSize.setWidth(qMax(newSize.width(), 120)); | - |
3084 | } | 0 |
3085 | break; | 0 |
3086 | case CT_SizeGrip: | - |
3087 | newSize += QSize(4, 4); never executed (the execution status of this line is deduced): newSize += QSize(4, 4); | - |
3088 | break; | 0 |
3089 | case CT_MdiControls: | - |
3090 | if (const QStyleOptionComplex *styleOpt = qstyleoption_cast<const QStyleOptionComplex *>(option)) { never evaluated: const QStyleOptionComplex *styleOpt = qstyleoption_cast<const QStyleOptionComplex *>(option) | 0 |
3091 | int width = 0; never executed (the execution status of this line is deduced): int width = 0; | - |
3092 | if (styleOpt->subControls & SC_MdiMinButton) never evaluated: styleOpt->subControls & SC_MdiMinButton | 0 |
3093 | width += 19 + 1; never executed: width += 19 + 1; | 0 |
3094 | if (styleOpt->subControls & SC_MdiNormalButton) never evaluated: styleOpt->subControls & SC_MdiNormalButton | 0 |
3095 | width += 19 + 1; never executed: width += 19 + 1; | 0 |
3096 | if (styleOpt->subControls & SC_MdiCloseButton) never evaluated: styleOpt->subControls & SC_MdiCloseButton | 0 |
3097 | width += 19 + 1; never executed: width += 19 + 1; | 0 |
3098 | newSize = QSize(width, 19); never executed (the execution status of this line is deduced): newSize = QSize(width, 19); | - |
3099 | } else { | 0 |
3100 | newSize = QSize(60, 19); never executed (the execution status of this line is deduced): newSize = QSize(60, 19); | - |
3101 | } | 0 |
3102 | break; | 0 |
3103 | default: | - |
3104 | break; executed: break; Execution Count:2481 | 2481 |
3105 | } | - |
3106 | return newSize; executed: return newSize; Execution Count:2507 | 2507 |
3107 | } | - |
3108 | | - |
3109 | /*! | - |
3110 | \reimp | - |
3111 | */ | - |
3112 | void QFusionStyle::polish(QApplication *app) | - |
3113 | { | - |
3114 | QCommonStyle::polish(app); executed (the execution status of this line is deduced): QCommonStyle::polish(app); | - |
3115 | } executed: } Execution Count:1 | 1 |
3116 | | - |
3117 | /*! | - |
3118 | \reimp | - |
3119 | */ | - |
3120 | void QFusionStyle::polish(QWidget *widget) | - |
3121 | { | - |
3122 | QCommonStyle::polish(widget); executed (the execution status of this line is deduced): QCommonStyle::polish(widget); | - |
3123 | if (qobject_cast<QAbstractButton*>(widget) evaluated: qobject_cast<QAbstractButton*>(widget) yes Evaluation Count:16 | yes Evaluation Count:1184 |
| 16-1184 |
3124 | || qobject_cast<QComboBox *>(widget) evaluated: qobject_cast<QComboBox *>(widget) yes Evaluation Count:1 | yes Evaluation Count:1183 |
| 1-1183 |
3125 | || qobject_cast<QProgressBar *>(widget) evaluated: qobject_cast<QProgressBar *>(widget) yes Evaluation Count:3 | yes Evaluation Count:1180 |
| 3-1180 |
3126 | || qobject_cast<QScrollBar *>(widget) evaluated: qobject_cast<QScrollBar *>(widget) yes Evaluation Count:386 | yes Evaluation Count:794 |
| 386-794 |
3127 | || qobject_cast<QSplitterHandle *>(widget) partially evaluated: qobject_cast<QSplitterHandle *>(widget) no Evaluation Count:0 | yes Evaluation Count:794 |
| 0-794 |
3128 | || qobject_cast<QAbstractSlider *>(widget) partially evaluated: qobject_cast<QAbstractSlider *>(widget) no Evaluation Count:0 | yes Evaluation Count:794 |
| 0-794 |
3129 | || qobject_cast<QAbstractSpinBox *>(widget) evaluated: qobject_cast<QAbstractSpinBox *>(widget) yes Evaluation Count:1 | yes Evaluation Count:793 |
| 1-793 |
3130 | || (widget->inherits("QDockSeparator")) partially evaluated: (widget->inherits("QDockSeparator")) no Evaluation Count:0 | yes Evaluation Count:793 |
| 0-793 |
3131 | || (widget->inherits("QDockWidgetSeparator")) partially evaluated: (widget->inherits("QDockWidgetSeparator")) no Evaluation Count:0 | yes Evaluation Count:793 |
| 0-793 |
3132 | ) { | - |
3133 | widget->setAttribute(Qt::WA_Hover, true); executed (the execution status of this line is deduced): widget->setAttribute(Qt::WA_Hover, true); | - |
3134 | } executed: } Execution Count:407 | 407 |
3135 | } executed: } Execution Count:1200 | 1200 |
3136 | | - |
3137 | /*! | - |
3138 | \reimp | - |
3139 | */ | - |
3140 | void QFusionStyle::polish(QPalette &pal) | - |
3141 | { | - |
3142 | QCommonStyle::polish(pal); executed (the execution status of this line is deduced): QCommonStyle::polish(pal); | - |
3143 | } executed: } Execution Count:1 | 1 |
3144 | | - |
3145 | /*! | - |
3146 | \reimp | - |
3147 | */ | - |
3148 | void QFusionStyle::unpolish(QWidget *widget) | - |
3149 | { | - |
3150 | QCommonStyle::unpolish(widget); executed (the execution status of this line is deduced): QCommonStyle::unpolish(widget); | - |
3151 | if (qobject_cast<QAbstractButton*>(widget) partially evaluated: qobject_cast<QAbstractButton*>(widget) no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
3152 | || qobject_cast<QComboBox *>(widget) partially evaluated: qobject_cast<QComboBox *>(widget) no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
3153 | || qobject_cast<QProgressBar *>(widget) partially evaluated: qobject_cast<QProgressBar *>(widget) yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
3154 | || qobject_cast<QScrollBar *>(widget) never evaluated: qobject_cast<QScrollBar *>(widget) | 0 |
3155 | || qobject_cast<QSplitterHandle *>(widget) never evaluated: qobject_cast<QSplitterHandle *>(widget) | 0 |
3156 | || qobject_cast<QAbstractSlider *>(widget) never evaluated: qobject_cast<QAbstractSlider *>(widget) | 0 |
3157 | || qobject_cast<QAbstractSpinBox *>(widget) never evaluated: qobject_cast<QAbstractSpinBox *>(widget) | 0 |
3158 | || (widget->inherits("QDockSeparator")) never evaluated: (widget->inherits("QDockSeparator")) | 0 |
3159 | || (widget->inherits("QDockWidgetSeparator")) never evaluated: (widget->inherits("QDockWidgetSeparator")) | 0 |
3160 | ) { | - |
3161 | widget->setAttribute(Qt::WA_Hover, false); executed (the execution status of this line is deduced): widget->setAttribute(Qt::WA_Hover, false); | - |
3162 | } executed: } Execution Count:1 | 1 |
3163 | } executed: } Execution Count:1 | 1 |
3164 | | - |
3165 | /*! | - |
3166 | \reimp | - |
3167 | */ | - |
3168 | void QFusionStyle::unpolish(QApplication *app) | - |
3169 | { | - |
3170 | QCommonStyle::unpolish(app); never executed (the execution status of this line is deduced): QCommonStyle::unpolish(app); | - |
3171 | } | 0 |
3172 | | - |
3173 | /*! | - |
3174 | \reimp | - |
3175 | */ | - |
3176 | QRect QFusionStyle::subControlRect(ComplexControl control, const QStyleOptionComplex *option, | - |
3177 | SubControl subControl, const QWidget *widget) const | - |
3178 | { | - |
3179 | QRect rect = QCommonStyle::subControlRect(control, option, subControl, widget); executed (the execution status of this line is deduced): QRect rect = QCommonStyle::subControlRect(control, option, subControl, widget); | - |
3180 | | - |
3181 | switch (control) { | - |
3182 | case CC_Slider: | - |
3183 | if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(option)) { partially evaluated: const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(option) yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
3184 | int tickSize = proxy()->pixelMetric(PM_SliderTickmarkOffset, option, widget); executed (the execution status of this line is deduced): int tickSize = proxy()->pixelMetric(PM_SliderTickmarkOffset, option, widget); | - |
3185 | switch (subControl) { | - |
3186 | case SC_SliderHandle: { | - |
3187 | if (slider->orientation == Qt::Horizontal) { partially evaluated: slider->orientation == Qt::Horizontal yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
3188 | rect.setHeight(proxy()->pixelMetric(PM_SliderThickness)); executed (the execution status of this line is deduced): rect.setHeight(proxy()->pixelMetric(PM_SliderThickness)); | - |
3189 | rect.setWidth(proxy()->pixelMetric(PM_SliderLength)); executed (the execution status of this line is deduced): rect.setWidth(proxy()->pixelMetric(PM_SliderLength)); | - |
3190 | int centerY = slider->rect.center().y() - rect.height() / 2; executed (the execution status of this line is deduced): int centerY = slider->rect.center().y() - rect.height() / 2; | - |
3191 | if (slider->tickPosition & QSlider::TicksAbove) partially evaluated: slider->tickPosition & QSlider::TicksAbove no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
3192 | centerY += tickSize; never executed: centerY += tickSize; | 0 |
3193 | if (slider->tickPosition & QSlider::TicksBelow) partially evaluated: slider->tickPosition & QSlider::TicksBelow no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
3194 | centerY -= tickSize; never executed: centerY -= tickSize; | 0 |
3195 | rect.moveTop(centerY); executed (the execution status of this line is deduced): rect.moveTop(centerY); | - |
3196 | } else { executed: } Execution Count:1 | 1 |
3197 | rect.setWidth(proxy()->pixelMetric(PM_SliderThickness)); never executed (the execution status of this line is deduced): rect.setWidth(proxy()->pixelMetric(PM_SliderThickness)); | - |
3198 | rect.setHeight(proxy()->pixelMetric(PM_SliderLength)); never executed (the execution status of this line is deduced): rect.setHeight(proxy()->pixelMetric(PM_SliderLength)); | - |
3199 | int centerX = slider->rect.center().x() - rect.width() / 2; never executed (the execution status of this line is deduced): int centerX = slider->rect.center().x() - rect.width() / 2; | - |
3200 | if (slider->tickPosition & QSlider::TicksAbove) never evaluated: slider->tickPosition & QSlider::TicksAbove | 0 |
3201 | centerX += tickSize; never executed: centerX += tickSize; | 0 |
3202 | if (slider->tickPosition & QSlider::TicksBelow) never evaluated: slider->tickPosition & QSlider::TicksBelow | 0 |
3203 | centerX -= tickSize; never executed: centerX -= tickSize; | 0 |
3204 | rect.moveLeft(centerX); never executed (the execution status of this line is deduced): rect.moveLeft(centerX); | - |
3205 | } | 0 |
3206 | } | - |
3207 | break; executed: break; Execution Count:1 | 1 |
3208 | case SC_SliderGroove: { | - |
3209 | QPoint grooveCenter = slider->rect.center(); executed (the execution status of this line is deduced): QPoint grooveCenter = slider->rect.center(); | - |
3210 | if (slider->orientation == Qt::Horizontal) { partially evaluated: slider->orientation == Qt::Horizontal yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
3211 | rect.setHeight(7); executed (the execution status of this line is deduced): rect.setHeight(7); | - |
3212 | if (slider->tickPosition & QSlider::TicksAbove) partially evaluated: slider->tickPosition & QSlider::TicksAbove no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
3213 | grooveCenter.ry() += tickSize; never executed: grooveCenter.ry() += tickSize; | 0 |
3214 | if (slider->tickPosition & QSlider::TicksBelow) partially evaluated: slider->tickPosition & QSlider::TicksBelow no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
3215 | grooveCenter.ry() -= tickSize; never executed: grooveCenter.ry() -= tickSize; | 0 |
3216 | } else { executed: } Execution Count:1 | 1 |
3217 | rect.setWidth(7); never executed (the execution status of this line is deduced): rect.setWidth(7); | - |
3218 | if (slider->tickPosition & QSlider::TicksAbove) never evaluated: slider->tickPosition & QSlider::TicksAbove | 0 |
3219 | grooveCenter.rx() += tickSize; never executed: grooveCenter.rx() += tickSize; | 0 |
3220 | if (slider->tickPosition & QSlider::TicksBelow) never evaluated: slider->tickPosition & QSlider::TicksBelow | 0 |
3221 | grooveCenter.rx() -= tickSize; never executed: grooveCenter.rx() -= tickSize; | 0 |
3222 | } | 0 |
3223 | rect.moveCenter(grooveCenter); executed (the execution status of this line is deduced): rect.moveCenter(grooveCenter); | - |
3224 | break; executed: break; Execution Count:1 | 1 |
3225 | } | - |
3226 | default: | - |
3227 | break; | 0 |
3228 | } | - |
3229 | } executed: } Execution Count:2 | 2 |
3230 | break; executed: break; Execution Count:2 | 2 |
3231 | case CC_SpinBox: | - |
3232 | if (const QStyleOptionSpinBox *spinbox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) { partially evaluated: const QStyleOptionSpinBox *spinbox = qstyleoption_cast<const QStyleOptionSpinBox *>(option) yes Evaluation Count:10 | no Evaluation Count:0 |
| 0-10 |
3233 | QSize bs; executed (the execution status of this line is deduced): QSize bs; | - |
3234 | int center = spinbox->rect.height() / 2; executed (the execution status of this line is deduced): int center = spinbox->rect.height() / 2; | - |
3235 | int fw = spinbox->frame ? proxy()->pixelMetric(PM_SpinBoxFrameWidth, spinbox, widget) : 0; evaluated: spinbox->frame yes Evaluation Count:8 | yes Evaluation Count:2 |
| 2-8 |
3236 | int y = fw; executed (the execution status of this line is deduced): int y = fw; | - |
3237 | bs.setHeight(qMax(8, spinbox->rect.height()/2 - y)); executed (the execution status of this line is deduced): bs.setHeight(qMax(8, spinbox->rect.height()/2 - y)); | - |
3238 | bs.setWidth(14); executed (the execution status of this line is deduced): bs.setWidth(14); | - |
3239 | int x, lx, rx; executed (the execution status of this line is deduced): int x, lx, rx; | - |
3240 | x = spinbox->rect.width() - y - bs.width() + 2; executed (the execution status of this line is deduced): x = spinbox->rect.width() - y - bs.width() + 2; | - |
3241 | lx = fw; executed (the execution status of this line is deduced): lx = fw; | - |
3242 | rx = x - fw; executed (the execution status of this line is deduced): rx = x - fw; | - |
3243 | switch (subControl) { | - |
3244 | case SC_SpinBoxUp: | - |
3245 | if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons) partially evaluated: spinbox->buttonSymbols == QAbstractSpinBox::NoButtons no Evaluation Count:0 | yes Evaluation Count:3 |
| 0-3 |
3246 | return QRect(); never executed: return QRect(); | 0 |
3247 | rect = QRect(x, fw, bs.width(), center - fw); executed (the execution status of this line is deduced): rect = QRect(x, fw, bs.width(), center - fw); | - |
3248 | break; executed: break; Execution Count:3 | 3 |
3249 | case SC_SpinBoxDown: | - |
3250 | if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons) partially evaluated: spinbox->buttonSymbols == QAbstractSpinBox::NoButtons no Evaluation Count:0 | yes Evaluation Count:3 |
| 0-3 |
3251 | return QRect(); never executed: return QRect(); | 0 |
3252 | | - |
3253 | rect = QRect(x, center, bs.width(), spinbox->rect.bottom() - center - fw + 1); executed (the execution status of this line is deduced): rect = QRect(x, center, bs.width(), spinbox->rect.bottom() - center - fw + 1); | - |
3254 | break; executed: break; Execution Count:3 | 3 |
3255 | case SC_SpinBoxEditField: | - |
3256 | if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons) { partially evaluated: spinbox->buttonSymbols == QAbstractSpinBox::NoButtons no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
3257 | rect = QRect(lx, fw, spinbox->rect.width() - 2*fw, spinbox->rect.height() - 2*fw); never executed (the execution status of this line is deduced): rect = QRect(lx, fw, spinbox->rect.width() - 2*fw, spinbox->rect.height() - 2*fw); | - |
3258 | } else { | 0 |
3259 | rect = QRect(lx, fw, rx - qMax(fw - 1, 0), spinbox->rect.height() - 2*fw); executed (the execution status of this line is deduced): rect = QRect(lx, fw, rx - qMax(fw - 1, 0), spinbox->rect.height() - 2*fw); | - |
3260 | } executed: } Execution Count:4 | 4 |
3261 | break; executed: break; Execution Count:4 | 4 |
3262 | case SC_SpinBoxFrame: | - |
3263 | rect = spinbox->rect; never executed (the execution status of this line is deduced): rect = spinbox->rect; | - |
3264 | default: | - |
3265 | break; | 0 |
3266 | } | - |
3267 | rect = visualRect(spinbox->direction, spinbox->rect, rect); executed (the execution status of this line is deduced): rect = visualRect(spinbox->direction, spinbox->rect, rect); | - |
3268 | } executed: } Execution Count:10 | 10 |
3269 | break; executed: break; Execution Count:10 | 10 |
3270 | | - |
3271 | case CC_GroupBox: | - |
3272 | if (const QStyleOptionGroupBox *groupBox = qstyleoption_cast<const QStyleOptionGroupBox *>(option)) { partially evaluated: const QStyleOptionGroupBox *groupBox = qstyleoption_cast<const QStyleOptionGroupBox *>(option) yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-3 |
3273 | rect = option->rect; executed (the execution status of this line is deduced): rect = option->rect; | - |
3274 | if (subControl == SC_GroupBoxFrame) evaluated: subControl == SC_GroupBoxFrame yes Evaluation Count:1 | yes Evaluation Count:2 |
| 1-2 |
3275 | return rect.adjusted(0, 0, 0, 0); executed: return rect.adjusted(0, 0, 0, 0); Execution Count:1 | 1 |
3276 | else if (subControl == SC_GroupBoxContents) { partially evaluated: subControl == SC_GroupBoxContents no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
3277 | QRect frameRect = option->rect.adjusted(0, 0, 0, -groupBoxBottomMargin); never executed (the execution status of this line is deduced): QRect frameRect = option->rect.adjusted(0, 0, 0, -groupBoxBottomMargin); | - |
3278 | int margin = 3; never executed (the execution status of this line is deduced): int margin = 3; | - |
3279 | int leftMarginExtension = 0; never executed (the execution status of this line is deduced): int leftMarginExtension = 0; | - |
3280 | int topMargin = qMax(pixelMetric(PM_ExclusiveIndicatorHeight), option->fontMetrics.height()) + groupBoxTopMargin; never executed (the execution status of this line is deduced): int topMargin = qMax(pixelMetric(PM_ExclusiveIndicatorHeight), option->fontMetrics.height()) + groupBoxTopMargin; | - |
3281 | return frameRect.adjusted(leftMarginExtension + margin, margin + topMargin, -margin, -margin - groupBoxBottomMargin); never executed: return frameRect.adjusted(leftMarginExtension + margin, margin + topMargin, -margin, -margin - groupBoxBottomMargin); | 0 |
3282 | } | - |
3283 | | - |
3284 | QSize textSize = option->fontMetrics.boundingRect(groupBox->text).size() + QSize(2, 2); executed (the execution status of this line is deduced): QSize textSize = option->fontMetrics.boundingRect(groupBox->text).size() + QSize(2, 2); | - |
3285 | int indicatorWidth = proxy()->pixelMetric(PM_IndicatorWidth, option, widget); executed (the execution status of this line is deduced): int indicatorWidth = proxy()->pixelMetric(PM_IndicatorWidth, option, widget); | - |
3286 | int indicatorHeight = proxy()->pixelMetric(PM_IndicatorHeight, option, widget); executed (the execution status of this line is deduced): int indicatorHeight = proxy()->pixelMetric(PM_IndicatorHeight, option, widget); | - |
3287 | rect = QRect(); executed (the execution status of this line is deduced): rect = QRect(); | - |
3288 | if (subControl == SC_GroupBoxCheckBox) { evaluated: subControl == SC_GroupBoxCheckBox yes Evaluation Count:1 | yes Evaluation Count:1 |
| 1 |
3289 | rect.setWidth(indicatorWidth); executed (the execution status of this line is deduced): rect.setWidth(indicatorWidth); | - |
3290 | rect.setHeight(indicatorHeight); executed (the execution status of this line is deduced): rect.setHeight(indicatorHeight); | - |
3291 | rect.moveTop(textSize.height() > indicatorHeight ? (textSize.height() - indicatorHeight) / 2 : 0); executed (the execution status of this line is deduced): rect.moveTop(textSize.height() > indicatorHeight ? (textSize.height() - indicatorHeight) / 2 : 0); | - |
3292 | rect.moveLeft(1); executed (the execution status of this line is deduced): rect.moveLeft(1); | - |
3293 | } else if (subControl == SC_GroupBoxLabel) { executed: } Execution Count:1 partially evaluated: subControl == SC_GroupBoxLabel yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
3294 | rect.setSize(textSize); executed (the execution status of this line is deduced): rect.setSize(textSize); | - |
3295 | rect.moveTop(1); executed (the execution status of this line is deduced): rect.moveTop(1); | - |
3296 | if (option->subControls & QStyle::SC_GroupBoxCheckBox) partially evaluated: option->subControls & QStyle::SC_GroupBoxCheckBox yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
3297 | rect.translate(indicatorWidth + 5, 0); executed: rect.translate(indicatorWidth + 5, 0); Execution Count:1 | 1 |
3298 | } executed: } Execution Count:1 | 1 |
3299 | return visualRect(option->direction, option->rect, rect); executed: return visualRect(option->direction, option->rect, rect); Execution Count:2 | 2 |
3300 | } | - |
3301 | | - |
3302 | return rect; never executed: return rect; | 0 |
3303 | | - |
3304 | case CC_ComboBox: | - |
3305 | switch (subControl) { | - |
3306 | case SC_ComboBoxArrow: | - |
3307 | rect = visualRect(option->direction, option->rect, rect); executed (the execution status of this line is deduced): rect = visualRect(option->direction, option->rect, rect); | - |
3308 | rect.setRect(rect.right() - 18, rect.top() - 2, executed (the execution status of this line is deduced): rect.setRect(rect.right() - 18, rect.top() - 2, | - |
3309 | 19, rect.height() + 4); executed (the execution status of this line is deduced): 19, rect.height() + 4); | - |
3310 | rect = visualRect(option->direction, option->rect, rect); executed (the execution status of this line is deduced): rect = visualRect(option->direction, option->rect, rect); | - |
3311 | break; executed: break; Execution Count:2 | 2 |
3312 | case SC_ComboBoxEditField: { | - |
3313 | int frameWidth = 2; executed (the execution status of this line is deduced): int frameWidth = 2; | - |
3314 | rect = visualRect(option->direction, option->rect, rect); executed (the execution status of this line is deduced): rect = visualRect(option->direction, option->rect, rect); | - |
3315 | rect.setRect(option->rect.left() + frameWidth, option->rect.top() + frameWidth, executed (the execution status of this line is deduced): rect.setRect(option->rect.left() + frameWidth, option->rect.top() + frameWidth, | - |
3316 | option->rect.width() - 19 - 2 * frameWidth, executed (the execution status of this line is deduced): option->rect.width() - 19 - 2 * frameWidth, | - |
3317 | option->rect.height() - 2 * frameWidth); executed (the execution status of this line is deduced): option->rect.height() - 2 * frameWidth); | - |
3318 | if (const QStyleOptionComboBox *box = qstyleoption_cast<const QStyleOptionComboBox *>(option)) { partially evaluated: const QStyleOptionComboBox *box = qstyleoption_cast<const QStyleOptionComboBox *>(option) yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-3 |
3319 | if (!box->editable) { partially evaluated: !box->editable no Evaluation Count:0 | yes Evaluation Count:3 |
| 0-3 |
3320 | rect.adjust(2, 0, 0, 0); never executed (the execution status of this line is deduced): rect.adjust(2, 0, 0, 0); | - |
3321 | if (box->state & (State_Sunken | State_On)) never evaluated: box->state & (State_Sunken | State_On) | 0 |
3322 | rect.translate(1, 1); never executed: rect.translate(1, 1); | 0 |
3323 | } | 0 |
3324 | } executed: } Execution Count:3 | 3 |
3325 | rect = visualRect(option->direction, option->rect, rect); executed (the execution status of this line is deduced): rect = visualRect(option->direction, option->rect, rect); | - |
3326 | break; executed: break; Execution Count:3 | 3 |
3327 | } | - |
3328 | default: | - |
3329 | break; | 0 |
3330 | } | - |
3331 | break; executed: break; Execution Count:5 | 5 |
3332 | case CC_TitleBar: | - |
3333 | if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(option)) { partially evaluated: const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(option) yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
3334 | SubControl sc = subControl; executed (the execution status of this line is deduced): SubControl sc = subControl; | - |
3335 | QRect &ret = rect; executed (the execution status of this line is deduced): QRect &ret = rect; | - |
3336 | const int indent = 3; executed (the execution status of this line is deduced): const int indent = 3; | - |
3337 | const int controlTopMargin = 3; executed (the execution status of this line is deduced): const int controlTopMargin = 3; | - |
3338 | const int controlBottomMargin = 3; executed (the execution status of this line is deduced): const int controlBottomMargin = 3; | - |
3339 | const int controlWidthMargin = 2; executed (the execution status of this line is deduced): const int controlWidthMargin = 2; | - |
3340 | const int controlHeight = tb->rect.height() - controlTopMargin - controlBottomMargin ; executed (the execution status of this line is deduced): const int controlHeight = tb->rect.height() - controlTopMargin - controlBottomMargin ; | - |
3341 | const int delta = controlHeight + controlWidthMargin; executed (the execution status of this line is deduced): const int delta = controlHeight + controlWidthMargin; | - |
3342 | int offset = 0; executed (the execution status of this line is deduced): int offset = 0; | - |
3343 | | - |
3344 | bool isMinimized = tb->titleBarState & Qt::WindowMinimized; executed (the execution status of this line is deduced): bool isMinimized = tb->titleBarState & Qt::WindowMinimized; | - |
3345 | bool isMaximized = tb->titleBarState & Qt::WindowMaximized; executed (the execution status of this line is deduced): bool isMaximized = tb->titleBarState & Qt::WindowMaximized; | - |
3346 | | - |
3347 | switch (sc) { | - |
3348 | case SC_TitleBarLabel: | - |
3349 | if (tb->titleBarFlags & (Qt::WindowTitleHint | Qt::WindowSystemMenuHint)) { partially evaluated: tb->titleBarFlags & (Qt::WindowTitleHint | Qt::WindowSystemMenuHint) no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
3350 | ret = tb->rect; never executed (the execution status of this line is deduced): ret = tb->rect; | - |
3351 | if (tb->titleBarFlags & Qt::WindowSystemMenuHint) never evaluated: tb->titleBarFlags & Qt::WindowSystemMenuHint | 0 |
3352 | ret.adjust(delta, 0, -delta, 0); never executed: ret.adjust(delta, 0, -delta, 0); | 0 |
3353 | if (tb->titleBarFlags & Qt::WindowMinimizeButtonHint) never evaluated: tb->titleBarFlags & Qt::WindowMinimizeButtonHint | 0 |
3354 | ret.adjust(0, 0, -delta, 0); never executed: ret.adjust(0, 0, -delta, 0); | 0 |
3355 | if (tb->titleBarFlags & Qt::WindowMaximizeButtonHint) never evaluated: tb->titleBarFlags & Qt::WindowMaximizeButtonHint | 0 |
3356 | ret.adjust(0, 0, -delta, 0); never executed: ret.adjust(0, 0, -delta, 0); | 0 |
3357 | if (tb->titleBarFlags & Qt::WindowShadeButtonHint) never evaluated: tb->titleBarFlags & Qt::WindowShadeButtonHint | 0 |
3358 | ret.adjust(0, 0, -delta, 0); never executed: ret.adjust(0, 0, -delta, 0); | 0 |
3359 | if (tb->titleBarFlags & Qt::WindowContextHelpButtonHint) never evaluated: tb->titleBarFlags & Qt::WindowContextHelpButtonHint | 0 |
3360 | ret.adjust(0, 0, -delta, 0); never executed: ret.adjust(0, 0, -delta, 0); | 0 |
3361 | } | 0 |
3362 | break; executed: break; Execution Count:1 | 1 |
3363 | case SC_TitleBarContextHelpButton: | - |
3364 | if (tb->titleBarFlags & Qt::WindowContextHelpButtonHint) never evaluated: tb->titleBarFlags & Qt::WindowContextHelpButtonHint | 0 |
3365 | offset += delta; never executed: offset += delta; | 0 |
3366 | case SC_TitleBarMinButton: code before this statement never executed: case SC_TitleBarMinButton: | 0 |
3367 | if (!isMinimized && (tb->titleBarFlags & Qt::WindowMinimizeButtonHint)) never evaluated: !isMinimized never evaluated: (tb->titleBarFlags & Qt::WindowMinimizeButtonHint) | 0 |
3368 | offset += delta; never executed: offset += delta; | 0 |
3369 | else if (sc == SC_TitleBarMinButton) never evaluated: sc == SC_TitleBarMinButton | 0 |
3370 | break; | 0 |
3371 | case SC_TitleBarNormalButton: code before this statement never executed: case SC_TitleBarNormalButton: | 0 |
3372 | if (isMinimized && (tb->titleBarFlags & Qt::WindowMinimizeButtonHint)) never evaluated: isMinimized never evaluated: (tb->titleBarFlags & Qt::WindowMinimizeButtonHint) | 0 |
3373 | offset += delta; never executed: offset += delta; | 0 |
3374 | else if (isMaximized && (tb->titleBarFlags & Qt::WindowMaximizeButtonHint)) never evaluated: isMaximized never evaluated: (tb->titleBarFlags & Qt::WindowMaximizeButtonHint) | 0 |
3375 | offset += delta; never executed: offset += delta; | 0 |
3376 | else if (sc == SC_TitleBarNormalButton) never evaluated: sc == SC_TitleBarNormalButton | 0 |
3377 | break; | 0 |
3378 | case SC_TitleBarMaxButton: code before this statement never executed: case SC_TitleBarMaxButton: | 0 |
3379 | if (!isMaximized && (tb->titleBarFlags & Qt::WindowMaximizeButtonHint)) never evaluated: !isMaximized never evaluated: (tb->titleBarFlags & Qt::WindowMaximizeButtonHint) | 0 |
3380 | offset += delta; never executed: offset += delta; | 0 |
3381 | else if (sc == SC_TitleBarMaxButton) never evaluated: sc == SC_TitleBarMaxButton | 0 |
3382 | break; | 0 |
3383 | case SC_TitleBarShadeButton: code before this statement never executed: case SC_TitleBarShadeButton: | 0 |
3384 | if (!isMinimized && (tb->titleBarFlags & Qt::WindowShadeButtonHint)) never evaluated: !isMinimized never evaluated: (tb->titleBarFlags & Qt::WindowShadeButtonHint) | 0 |
3385 | offset += delta; never executed: offset += delta; | 0 |
3386 | else if (sc == SC_TitleBarShadeButton) never evaluated: sc == SC_TitleBarShadeButton | 0 |
3387 | break; | 0 |
3388 | case SC_TitleBarUnshadeButton: code before this statement never executed: case SC_TitleBarUnshadeButton: | 0 |
3389 | if (isMinimized && (tb->titleBarFlags & Qt::WindowShadeButtonHint)) never evaluated: isMinimized never evaluated: (tb->titleBarFlags & Qt::WindowShadeButtonHint) | 0 |
3390 | offset += delta; never executed: offset += delta; | 0 |
3391 | else if (sc == SC_TitleBarUnshadeButton) never evaluated: sc == SC_TitleBarUnshadeButton | 0 |
3392 | break; | 0 |
3393 | case SC_TitleBarCloseButton: code before this statement never executed: case SC_TitleBarCloseButton: | 0 |
3394 | if (tb->titleBarFlags & Qt::WindowSystemMenuHint) never evaluated: tb->titleBarFlags & Qt::WindowSystemMenuHint | 0 |
3395 | offset += delta; never executed: offset += delta; | 0 |
3396 | else if (sc == SC_TitleBarCloseButton) never evaluated: sc == SC_TitleBarCloseButton | 0 |
3397 | break; | 0 |
3398 | ret.setRect(tb->rect.right() - indent - offset, tb->rect.top() + controlTopMargin, never executed (the execution status of this line is deduced): ret.setRect(tb->rect.right() - indent - offset, tb->rect.top() + controlTopMargin, | - |
3399 | controlHeight, controlHeight); never executed (the execution status of this line is deduced): controlHeight, controlHeight); | - |
3400 | break; | 0 |
3401 | case SC_TitleBarSysMenu: | - |
3402 | if (tb->titleBarFlags & Qt::WindowSystemMenuHint) { never evaluated: tb->titleBarFlags & Qt::WindowSystemMenuHint | 0 |
3403 | ret.setRect(tb->rect.left() + controlWidthMargin + indent, tb->rect.top() + controlTopMargin, never executed (the execution status of this line is deduced): ret.setRect(tb->rect.left() + controlWidthMargin + indent, tb->rect.top() + controlTopMargin, | - |
3404 | controlHeight, controlHeight); never executed (the execution status of this line is deduced): controlHeight, controlHeight); | - |
3405 | } | 0 |
3406 | break; | 0 |
3407 | default: | - |
3408 | break; | 0 |
3409 | } | - |
3410 | ret = visualRect(tb->direction, tb->rect, ret); executed (the execution status of this line is deduced): ret = visualRect(tb->direction, tb->rect, ret); | - |
3411 | } executed: } Execution Count:1 | 1 |
3412 | break; executed: break; Execution Count:1 | 1 |
3413 | default: | - |
3414 | break; executed: break; Execution Count:586 | 586 |
3415 | } | - |
3416 | | - |
3417 | return rect; executed: return rect; Execution Count:604 | 604 |
3418 | } | - |
3419 | | - |
3420 | | - |
3421 | /*! | - |
3422 | \reimp | - |
3423 | */ | - |
3424 | QRect QFusionStyle::itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const | - |
3425 | { | - |
3426 | return QCommonStyle::itemPixmapRect(r, flags, pixmap); executed: return QCommonStyle::itemPixmapRect(r, flags, pixmap); Execution Count:1 | 1 |
3427 | } | - |
3428 | | - |
3429 | /*! | - |
3430 | \reimp | - |
3431 | */ | - |
3432 | void QFusionStyle::drawItemPixmap(QPainter *painter, const QRect &rect, | - |
3433 | int alignment, const QPixmap &pixmap) const | - |
3434 | { | - |
3435 | QCommonStyle::drawItemPixmap(painter, rect, alignment, pixmap); executed (the execution status of this line is deduced): QCommonStyle::drawItemPixmap(painter, rect, alignment, pixmap); | - |
3436 | } executed: } Execution Count:1 | 1 |
3437 | | - |
3438 | /*! | - |
3439 | \reimp | - |
3440 | */ | - |
3441 | QStyle::SubControl QFusionStyle::hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, | - |
3442 | const QPoint &pt, const QWidget *w) const | - |
3443 | { | - |
3444 | return QCommonStyle::hitTestComplexControl(cc, opt, pt, w); never executed: return QCommonStyle::hitTestComplexControl(cc, opt, pt, w); | 0 |
3445 | } | - |
3446 | | - |
3447 | /*! | - |
3448 | \reimp | - |
3449 | */ | - |
3450 | QPixmap QFusionStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, | - |
3451 | const QStyleOption *opt) const | - |
3452 | { | - |
3453 | return QCommonStyle::generatedIconPixmap(iconMode, pixmap, opt); never executed: return QCommonStyle::generatedIconPixmap(iconMode, pixmap, opt); | 0 |
3454 | } | - |
3455 | | - |
3456 | /*! | - |
3457 | \reimp | - |
3458 | */ | - |
3459 | int QFusionStyle::styleHint(StyleHint hint, const QStyleOption *option, const QWidget *widget, | - |
3460 | QStyleHintReturn *returnData) const | - |
3461 | { | - |
3462 | switch (hint) { | - |
3463 | case SH_Slider_SnapToValue: | - |
3464 | case SH_PrintDialog_RightAlignButtons: | - |
3465 | case SH_FontDialog_SelectAssociatedText: | - |
3466 | case SH_MenuBar_AltKeyNavigation: | - |
3467 | case SH_ComboBox_ListMouseTracking: | - |
3468 | case SH_ScrollBar_StopMouseOverSlider: | - |
3469 | case SH_ScrollBar_MiddleClickAbsolutePosition: | - |
3470 | case SH_EtchDisabledText: | - |
3471 | case SH_TitleBar_AutoRaise: | - |
3472 | case SH_TitleBar_NoBorder: | - |
3473 | case SH_ItemView_ShowDecorationSelected: | - |
3474 | case SH_ItemView_ArrowKeysNavigateIntoChildren: | - |
3475 | case SH_ItemView_ChangeHighlightOnFocus: | - |
3476 | case SH_MenuBar_MouseTracking: | - |
3477 | case SH_Menu_MouseTracking: | - |
3478 | return 1; executed: return 1; Execution Count:31 | 31 |
3479 | | - |
3480 | case SH_ToolBox_SelectedPageTitleBold: | - |
3481 | case SH_ScrollView_FrameOnlyAroundContents: | - |
3482 | case SH_Menu_AllowActiveAndDisabled: | - |
3483 | case SH_MainWindow_SpaceBelowMenuBar: | - |
3484 | case SH_DialogButtonBox_ButtonsHaveIcons: | - |
3485 | case SH_MessageBox_CenterButtons: | - |
3486 | case SH_RubberBand_Mask: | - |
3487 | return 0; executed: return 0; Execution Count:1071 | 1071 |
3488 | | - |
3489 | case SH_ComboBox_Popup: | - |
3490 | if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(option)) evaluated: const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(option) yes Evaluation Count:1 | yes Evaluation Count:2 |
| 1-2 |
3491 | return !cmb->editable; executed: return !cmb->editable; Execution Count:1 | 1 |
3492 | return 0; executed: return 0; Execution Count:2 | 2 |
3493 | | - |
3494 | case SH_Table_GridLineColor: | - |
3495 | return option ? option->palette.background().color().darker(120).rgb() : 0; executed: return option ? option->palette.background().color().darker(120).rgb() : 0; Execution Count:2 | 2 |
3496 | | - |
3497 | case SH_MessageBox_TextInteractionFlags: | - |
3498 | return Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse; executed: return Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse; Execution Count:2 | 2 |
3499 | #ifndef QT_NO_WIZARD | - |
3500 | case SH_WizardStyle: | - |
3501 | return QWizard::ClassicStyle; executed: return QWizard::ClassicStyle; Execution Count:2 | 2 |
3502 | #endif | - |
3503 | case SH_Menu_SubMenuPopupDelay: | - |
3504 | return 225; // default from GtkMenu executed: return 225; Execution Count:2 | 2 |
3505 | | - |
3506 | case SH_WindowFrame_Mask: | - |
3507 | if (QStyleHintReturnMask *mask = qstyleoption_cast<QStyleHintReturnMask *>(returnData)) { partially evaluated: QStyleHintReturnMask *mask = qstyleoption_cast<QStyleHintReturnMask *>(returnData) no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
3508 | //left rounded corner | - |
3509 | mask->region = option->rect; never executed (the execution status of this line is deduced): mask->region = option->rect; | - |
3510 | mask->region -= QRect(option->rect.left(), option->rect.top(), 5, 1); never executed (the execution status of this line is deduced): mask->region -= QRect(option->rect.left(), option->rect.top(), 5, 1); | - |
3511 | mask->region -= QRect(option->rect.left(), option->rect.top() + 1, 3, 1); never executed (the execution status of this line is deduced): mask->region -= QRect(option->rect.left(), option->rect.top() + 1, 3, 1); | - |
3512 | mask->region -= QRect(option->rect.left(), option->rect.top() + 2, 2, 1); never executed (the execution status of this line is deduced): mask->region -= QRect(option->rect.left(), option->rect.top() + 2, 2, 1); | - |
3513 | mask->region -= QRect(option->rect.left(), option->rect.top() + 3, 1, 2); never executed (the execution status of this line is deduced): mask->region -= QRect(option->rect.left(), option->rect.top() + 3, 1, 2); | - |
3514 | | - |
3515 | //right rounded corner | - |
3516 | mask->region -= QRect(option->rect.right() - 4, option->rect.top(), 5, 1); never executed (the execution status of this line is deduced): mask->region -= QRect(option->rect.right() - 4, option->rect.top(), 5, 1); | - |
3517 | mask->region -= QRect(option->rect.right() - 2, option->rect.top() + 1, 3, 1); never executed (the execution status of this line is deduced): mask->region -= QRect(option->rect.right() - 2, option->rect.top() + 1, 3, 1); | - |
3518 | mask->region -= QRect(option->rect.right() - 1, option->rect.top() + 2, 2, 1); never executed (the execution status of this line is deduced): mask->region -= QRect(option->rect.right() - 1, option->rect.top() + 2, 2, 1); | - |
3519 | mask->region -= QRect(option->rect.right() , option->rect.top() + 3, 1, 2); never executed (the execution status of this line is deduced): mask->region -= QRect(option->rect.right() , option->rect.top() + 3, 1, 2); | - |
3520 | return 1; never executed: return 1; | 0 |
3521 | } | - |
3522 | default: | - |
3523 | break; executed: break; Execution Count:12137 | 12137 |
3524 | } | - |
3525 | return QCommonStyle::styleHint(hint, option, widget, returnData); executed: return QCommonStyle::styleHint(hint, option, widget, returnData); Execution Count:12137 | 12137 |
3526 | } | - |
3527 | | - |
3528 | /*! \reimp */ | - |
3529 | QRect QFusionStyle::subElementRect(SubElement sr, const QStyleOption *opt, const QWidget *w) const | - |
3530 | { | - |
3531 | QRect r = QCommonStyle::subElementRect(sr, opt, w); executed (the execution status of this line is deduced): QRect r = QCommonStyle::subElementRect(sr, opt, w); | - |
3532 | switch (sr) { | - |
3533 | case SE_ProgressBarLabel: | - |
3534 | case SE_ProgressBarContents: | - |
3535 | case SE_ProgressBarGroove: | - |
3536 | return opt->rect; executed: return opt->rect; Execution Count:6 | 6 |
3537 | case SE_PushButtonFocusRect: | - |
3538 | r.adjust(0, 1, 0, -1); never executed (the execution status of this line is deduced): r.adjust(0, 1, 0, -1); | - |
3539 | break; | 0 |
3540 | case SE_DockWidgetTitleBarText: { | - |
3541 | if (const QStyleOptionDockWidget *titlebar = qstyleoption_cast<const QStyleOptionDockWidget*>(opt)) { never evaluated: const QStyleOptionDockWidget *titlebar = qstyleoption_cast<const QStyleOptionDockWidget*>(opt) | 0 |
3542 | bool verticalTitleBar = titlebar->verticalTitleBar; never executed (the execution status of this line is deduced): bool verticalTitleBar = titlebar->verticalTitleBar; | - |
3543 | if (verticalTitleBar) { never evaluated: verticalTitleBar | 0 |
3544 | r.adjust(0, 0, 0, -4); never executed (the execution status of this line is deduced): r.adjust(0, 0, 0, -4); | - |
3545 | } else { | 0 |
3546 | if (opt->direction == Qt::LeftToRight) never evaluated: opt->direction == Qt::LeftToRight | 0 |
3547 | r.adjust(4, 0, 0, 0); never executed: r.adjust(4, 0, 0, 0); | 0 |
3548 | else | - |
3549 | r.adjust(0, 0, -4, 0); never executed: r.adjust(0, 0, -4, 0); | 0 |
3550 | } | - |
3551 | } | - |
3552 | | - |
3553 | break; | 0 |
3554 | } | - |
3555 | default: | - |
3556 | break; executed: break; Execution Count:1608 | 1608 |
3557 | } | - |
3558 | return r; executed: return r; Execution Count:1608 | 1608 |
3559 | } | - |
3560 | | - |
3561 | /*! | - |
3562 | \reimp | - |
3563 | */ | - |
3564 | QIcon QFusionStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption *option, | - |
3565 | const QWidget *widget) const | - |
3566 | { | - |
3567 | return QCommonStyle::standardIcon(standardIcon, option, widget); executed: return QCommonStyle::standardIcon(standardIcon, option, widget); Execution Count:28 | 28 |
3568 | } | - |
3569 | | - |
3570 | /*! | - |
3571 | \reimp | - |
3572 | */ | - |
3573 | QPixmap QFusionStyle::standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, | - |
3574 | const QWidget *widget) const | - |
3575 | { | - |
3576 | #ifndef QT_NO_IMAGEFORMAT_XPM | - |
3577 | switch (standardPixmap) { | - |
3578 | case SP_TitleBarNormalButton: | - |
3579 | return QPixmap((const char **)dock_widget_restore_xpm); executed: return QPixmap((const char **)dock_widget_restore_xpm); Execution Count:2 | 2 |
3580 | case SP_TitleBarMinButton: | - |
3581 | return QPixmap((const char **)workspace_minimize); executed: return QPixmap((const char **)workspace_minimize); Execution Count:2 | 2 |
3582 | case SP_TitleBarCloseButton: | - |
3583 | case SP_DockWidgetCloseButton: | - |
3584 | return QPixmap((const char **)dock_widget_close_xpm); executed: return QPixmap((const char **)dock_widget_close_xpm); Execution Count:4 | 4 |
3585 | | - |
3586 | default: | - |
3587 | break; executed: break; Execution Count:43 | 43 |
3588 | } | - |
3589 | #endif //QT_NO_IMAGEFORMAT_XPM | - |
3590 | | - |
3591 | return QCommonStyle::standardPixmap(standardPixmap, opt, widget); executed: return QCommonStyle::standardPixmap(standardPixmap, opt, widget); Execution Count:43 | 43 |
3592 | } | - |
3593 | | - |
3594 | QT_END_NAMESPACE | - |
3595 | | - |
3596 | #endif // QT_NO_STYLE_FUSION || QT_PLUGIN | - |
3597 | | - |
| | |