| Line | Source Code | Coverage |
|---|
| 1 | | - |
| 2 | | - |
| 3 | | - |
| 4 | | - |
| 5 | | - |
| 6 | | - |
| 7 | | - |
| 8 | | - |
| 9 | QCommonStyle::QCommonStyle() | - |
| 10 | : QStyle(*new QCommonStylePrivate) | - |
| 11 | { } executed: }Execution Count:4 | 4 |
| 12 | | - |
| 13 | | - |
| 14 | | - |
| 15 | QCommonStyle::QCommonStyle(QCommonStylePrivate &dd) | - |
| 16 | : QStyle(dd) | - |
| 17 | { } executed: }Execution Count:1160 | 1160 |
| 18 | | - |
| 19 | | - |
| 20 | | - |
| 21 | | - |
| 22 | QCommonStyle::~QCommonStyle() | - |
| 23 | { } | - |
| 24 | | - |
| 25 | | - |
| 26 | | - |
| 27 | | - |
| 28 | | - |
| 29 | void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, | - |
| 30 | const QWidget *widget) const | - |
| 31 | { | - |
| 32 | const QCommonStylePrivate * const d = d_func(); | - |
| 33 | switch (pe) { | - |
| 34 | case PE_FrameButtonBevel: | - |
| 35 | case PE_FrameButtonTool: | - |
| 36 | qDrawShadeRect(p, opt->rect, opt->palette, | - |
| 37 | opt->state & (State_Sunken | State_On), 1, 0); | - |
| 38 | break; | 0 |
| 39 | case PE_PanelButtonCommand: | - |
| 40 | case PE_PanelButtonBevel: | - |
| 41 | case PE_PanelButtonTool: | - |
| 42 | case PE_IndicatorButtonDropDown: | - |
| 43 | qDrawShadePanel(p, opt->rect, opt->palette, | - |
| 44 | opt->state & (State_Sunken | State_On), 1, | - |
| 45 | &opt->palette.brush(QPalette::Button)); | - |
| 46 | break; executed: break;Execution Count:1 | 1 |
| 47 | case PE_IndicatorViewItemCheck: | - |
| 48 | proxy()->drawPrimitive(PE_IndicatorCheckBox, opt, p, widget); | - |
| 49 | break; | 0 |
| 50 | case PE_IndicatorCheckBox: | - |
| 51 | if (opt->state & State_NoChange) { never evaluated: opt->state & State_NoChange | 0 |
| 52 | p->setPen(opt->palette.foreground().color()); | - |
| 53 | p->fillRect(opt->rect, opt->palette.brush(QPalette::Button)); | - |
| 54 | p->drawRect(opt->rect); | - |
| 55 | p->drawLine(opt->rect.topLeft(), opt->rect.bottomRight()); | - |
| 56 | } else { | 0 |
| 57 | qDrawShadePanel(p, opt->rect.x(), opt->rect.y(), opt->rect.width(), opt->rect.height(), | - |
| 58 | opt->palette, opt->state & (State_Sunken | State_On), 1, | - |
| 59 | &opt->palette.brush(QPalette::Button)); | - |
| 60 | } | 0 |
| 61 | break; | 0 |
| 62 | case PE_IndicatorRadioButton: { | - |
| 63 | QRect ir = opt->rect; | - |
| 64 | p->setPen(opt->palette.dark().color()); | - |
| 65 | p->drawArc(opt->rect, 0, 5760); | - |
| 66 | if (opt->state & (State_Sunken | State_On)) { never evaluated: opt->state & (State_Sunken | State_On) | 0 |
| 67 | ir.adjust(2, 2, -2, -2); | - |
| 68 | p->setBrush(opt->palette.foreground()); | - |
| 69 | bool oldQt4CompatiblePainting = p->testRenderHint(QPainter::Qt4CompatiblePainting); | - |
| 70 | p->setRenderHint(QPainter::Qt4CompatiblePainting); | - |
| 71 | p->drawEllipse(ir); | - |
| 72 | p->setRenderHint(QPainter::Qt4CompatiblePainting, oldQt4CompatiblePainting); | - |
| 73 | } | 0 |
| 74 | break; } | 0 |
| 75 | case PE_FrameFocusRect: | - |
| 76 | if (const QStyleOptionFocusRect *fropt = qstyleoption_cast<const QStyleOptionFocusRect *>(opt)) { never evaluated: const QStyleOptionFocusRect *fropt = qstyleoption_cast<const QStyleOptionFocusRect *>(opt) | 0 |
| 77 | QColor bg = fropt->backgroundColor; | - |
| 78 | QPen oldPen = p->pen(); | - |
| 79 | if (bg.isValid()) { never evaluated: bg.isValid() | 0 |
| 80 | int h, s, v; | - |
| 81 | bg.getHsv(&h, &s, &v); | - |
| 82 | if (v >= 128) never evaluated: v >= 128 | 0 |
| 83 | p->setPen(Qt::black); never executed: p->setPen(Qt::black); | 0 |
| 84 | else | - |
| 85 | p->setPen(Qt::white); never executed: p->setPen(Qt::white); | 0 |
| 86 | } else { | - |
| 87 | p->setPen(opt->palette.foreground().color()); | - |
| 88 | } | 0 |
| 89 | QRect focusRect = opt->rect.adjusted(1, 1, -1, -1); | - |
| 90 | p->drawRect(focusRect.adjusted(0, 0, -1, -1)); | - |
| 91 | p->setPen(oldPen); | - |
| 92 | } | 0 |
| 93 | break; | 0 |
| 94 | case PE_IndicatorMenuCheckMark: { | - |
| 95 | const int markW = opt->rect.width() > 7 ? 7 : opt->rect.width(); never evaluated: opt->rect.width() > 7 | 0 |
| 96 | const int markH = markW; | - |
| 97 | int posX = opt->rect.x() + (opt->rect.width() - markW)/2 + 1; | - |
| 98 | int posY = opt->rect.y() + (opt->rect.height() - markH)/2; | - |
| 99 | | - |
| 100 | QVector<QLineF> a; | - |
| 101 | a.reserve(markH); | - |
| 102 | | - |
| 103 | int i, xx, yy; | - |
| 104 | xx = posX; | - |
| 105 | yy = 3 + posY; | - |
| 106 | for (i = 0; i < markW/2; ++i) { never evaluated: i < markW/2 | 0 |
| 107 | a << QLineF(xx, yy, xx, yy + 2); | - |
| 108 | ++xx; | - |
| 109 | ++yy; | - |
| 110 | } | 0 |
| 111 | yy -= 2; | - |
| 112 | for (; i < markH; ++i) { never evaluated: i < markH | 0 |
| 113 | a << QLineF(xx, yy, xx, yy + 2); | - |
| 114 | ++xx; | - |
| 115 | --yy; | - |
| 116 | } | 0 |
| 117 | if (!(opt->state & State_Enabled) && !(opt->state & State_On)) { never evaluated: !(opt->state & State_Enabled) never evaluated: !(opt->state & State_On) | 0 |
| 118 | p->save(); | - |
| 119 | p->translate(1, 1); | - |
| 120 | p->setPen(opt->palette.light().color()); | - |
| 121 | p->drawLines(a); | - |
| 122 | p->restore(); | - |
| 123 | } | 0 |
| 124 | p->setPen((opt->state & State_On) ? opt->palette.highlightedText().color() : opt->palette.text().color()); | - |
| 125 | p->drawLines(a); | - |
| 126 | break; } | 0 |
| 127 | case PE_Frame: | - |
| 128 | case PE_FrameMenu: | - |
| 129 | if (const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(opt)) { never evaluated: const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(opt) | 0 |
| 130 | if (pe == PE_FrameMenu || (frame->state & State_Sunken) || (frame->state & State_Raised)) { never evaluated: pe == PE_FrameMenu never evaluated: (frame->state & State_Sunken) never evaluated: (frame->state & State_Raised) | 0 |
| 131 | qDrawShadePanel(p, frame->rect, frame->palette, frame->state & State_Sunken, | - |
| 132 | frame->lineWidth); | - |
| 133 | } else { | 0 |
| 134 | qDrawPlainRect(p, frame->rect, frame->palette.foreground().color(), frame->lineWidth); | - |
| 135 | } | 0 |
| 136 | } | - |
| 137 | break; | 0 |
| 138 | | - |
| 139 | case PE_PanelMenuBar: | - |
| 140 | if (widget && qobject_cast<QToolBar *>(widget->parentWidget())) never evaluated: qobject_cast<QToolBar *>(widget->parentWidget()) | 0 |
| 141 | break; | 0 |
| 142 | if (const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(opt)){ never evaluated: const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(opt) | 0 |
| 143 | qDrawShadePanel(p, frame->rect, frame->palette, false, frame->lineWidth, | - |
| 144 | &frame->palette.brush(QPalette::Button)); | - |
| 145 | | - |
| 146 | } | 0 |
| 147 | else if (const QStyleOptionToolBar *frame = qstyleoption_cast<const QStyleOptionToolBar *>(opt)){ never evaluated: const QStyleOptionToolBar *frame = qstyleoption_cast<const QStyleOptionToolBar *>(opt) | 0 |
| 148 | qDrawShadePanel(p, frame->rect, frame->palette, false, frame->lineWidth, | - |
| 149 | &frame->palette.brush(QPalette::Button)); | - |
| 150 | } | 0 |
| 151 | | - |
| 152 | break; | 0 |
| 153 | case PE_PanelMenu: | - |
| 154 | break; executed: break;Execution Count:39 | 39 |
| 155 | case PE_PanelToolBar: | - |
| 156 | break; | 0 |
| 157 | | - |
| 158 | | - |
| 159 | case PE_IndicatorProgressChunk: | - |
| 160 | { | - |
| 161 | bool vertical = false; | - |
| 162 | if (const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt)) never evaluated: const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt) | 0 |
| 163 | vertical = (pb2->orientation == Qt::Vertical); never executed: vertical = (pb2->orientation == Qt::Vertical); | 0 |
| 164 | if (!vertical) { never evaluated: !vertical | 0 |
| 165 | p->fillRect(opt->rect.x(), opt->rect.y() + 3, opt->rect.width() -2, opt->rect.height() - 6, | - |
| 166 | opt->palette.brush(QPalette::Highlight)); | - |
| 167 | } else { | 0 |
| 168 | p->fillRect(opt->rect.x() + 2, opt->rect.y(), opt->rect.width() -6, opt->rect.height() - 2, | - |
| 169 | opt->palette.brush(QPalette::Highlight)); | - |
| 170 | } | 0 |
| 171 | } | - |
| 172 | break; | 0 |
| 173 | | - |
| 174 | case PE_IndicatorBranch: { | - |
| 175 | static const int decoration_size = 9; | - |
| 176 | int mid_h = opt->rect.x() + opt->rect.width() / 2; | - |
| 177 | int mid_v = opt->rect.y() + opt->rect.height() / 2; | - |
| 178 | int bef_h = mid_h; | - |
| 179 | int bef_v = mid_v; | - |
| 180 | int aft_h = mid_h; | - |
| 181 | int aft_v = mid_v; | - |
| 182 | if (opt->state & State_Children) { evaluated: opt->state & State_Children| yes Evaluation Count:831 | yes Evaluation Count:2033 |
| 831-2033 |
| 183 | int delta = decoration_size / 2; | - |
| 184 | bef_h -= delta; | - |
| 185 | bef_v -= delta; | - |
| 186 | aft_h += delta; | - |
| 187 | aft_v += delta; | - |
| 188 | p->drawLine(bef_h + 2, bef_v + 4, bef_h + 6, bef_v + 4); | - |
| 189 | if (!(opt->state & State_Open)) evaluated: !(opt->state & State_Open)| yes Evaluation Count:750 | yes Evaluation Count:81 |
| 81-750 |
| 190 | p->drawLine(bef_h + 4, bef_v + 2, bef_h + 4, bef_v + 6); executed: p->drawLine(bef_h + 4, bef_v + 2, bef_h + 4, bef_v + 6);Execution Count:750 | 750 |
| 191 | QPen oldPen = p->pen(); | - |
| 192 | p->setPen(opt->palette.dark().color()); | - |
| 193 | p->drawRect(bef_h, bef_v, decoration_size - 1, decoration_size - 1); | - |
| 194 | p->setPen(oldPen); | - |
| 195 | } executed: }Execution Count:831 | 831 |
| 196 | QBrush brush(opt->palette.dark().color(), Qt::Dense4Pattern); | - |
| 197 | if (opt->state & State_Item) { evaluated: opt->state & State_Item| yes Evaluation Count:1878 | yes Evaluation Count:986 |
| 986-1878 |
| 198 | if (opt->direction == Qt::RightToLeft) evaluated: opt->direction == Qt::RightToLeft| yes Evaluation Count:7 | yes Evaluation Count:1871 |
| 7-1871 |
| 199 | p->fillRect(opt->rect.left(), mid_v, bef_h - opt->rect.left(), 1, brush); executed: p->fillRect(opt->rect.left(), mid_v, bef_h - opt->rect.left(), 1, brush);Execution Count:7 | 7 |
| 200 | else | - |
| 201 | p->fillRect(aft_h, mid_v, opt->rect.right() - aft_h + 1, 1, brush); executed: p->fillRect(aft_h, mid_v, opt->rect.right() - aft_h + 1, 1, brush);Execution Count:1871 | 1871 |
| 202 | } | - |
| 203 | if (opt->state & State_Sibling) evaluated: opt->state & State_Sibling| yes Evaluation Count:2310 | yes Evaluation Count:554 |
| 554-2310 |
| 204 | p->fillRect(mid_h, aft_v, 1, opt->rect.bottom() - aft_v + 1, brush); executed: p->fillRect(mid_h, aft_v, 1, opt->rect.bottom() - aft_v + 1, brush);Execution Count:2310 | 2310 |
| 205 | if (opt->state & (State_Open | State_Children | State_Item | State_Sibling)) evaluated: opt->state & (State_Open | State_Children | State_Item | State_Sibling)| yes Evaluation Count:2517 | yes Evaluation Count:347 |
| 347-2517 |
| 206 | p->fillRect(mid_h, opt->rect.y(), 1, bef_v - opt->rect.y(), brush); executed: p->fillRect(mid_h, opt->rect.y(), 1, bef_v - opt->rect.y(), brush);Execution Count:2517 | 2517 |
| 207 | break; } executed: break;Execution Count:2864 | 2864 |
| 208 | case PE_FrameStatusBarItem: | - |
| 209 | qDrawShadeRect(p, opt->rect, opt->palette, true, 1, 0, 0); | - |
| 210 | break; | 0 |
| 211 | case PE_IndicatorHeaderArrow: | - |
| 212 | if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt)) { partially evaluated: const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt)| yes Evaluation Count:40 | no Evaluation Count:0 |
| 0-40 |
| 213 | QPen oldPen = p->pen(); | - |
| 214 | if (header->sortIndicator & QStyleOptionHeader::SortUp) { evaluated: header->sortIndicator & QStyleOptionHeader::SortUp| yes Evaluation Count:35 | yes Evaluation Count:5 |
| 5-35 |
| 215 | QPolygon pa(3); | - |
| 216 | p->setPen(QPen(opt->palette.light(), 0)); | - |
| 217 | p->drawLine(opt->rect.x() + opt->rect.width(), opt->rect.y(), | - |
| 218 | opt->rect.x() + opt->rect.width() / 2, opt->rect.y() + opt->rect.height()); | - |
| 219 | p->setPen(QPen(opt->palette.dark(), 0)); | - |
| 220 | pa.setPoint(0, opt->rect.x() + opt->rect.width() / 2, opt->rect.y() + opt->rect.height()); | - |
| 221 | pa.setPoint(1, opt->rect.x(), opt->rect.y()); | - |
| 222 | pa.setPoint(2, opt->rect.x() + opt->rect.width(), opt->rect.y()); | - |
| 223 | p->drawPolyline(pa); | - |
| 224 | } else if (header->sortIndicator & QStyleOptionHeader::SortDown) { partially evaluated: header->sortIndicator & QStyleOptionHeader::SortDown| yes Evaluation Count:5 | no Evaluation Count:0 |
executed: }Execution Count:35 | 0-35 |
| 225 | QPolygon pa(3); | - |
| 226 | p->setPen(QPen(opt->palette.light(), 0)); | - |
| 227 | pa.setPoint(0, opt->rect.x(), opt->rect.y() + opt->rect.height()); | - |
| 228 | pa.setPoint(1, opt->rect.x() + opt->rect.width(), opt->rect.y() + opt->rect.height()); | - |
| 229 | pa.setPoint(2, opt->rect.x() + opt->rect.width() / 2, opt->rect.y()); | - |
| 230 | p->drawPolyline(pa); | - |
| 231 | p->setPen(QPen(opt->palette.dark(), 0)); | - |
| 232 | p->drawLine(opt->rect.x(), opt->rect.y() + opt->rect.height(), | - |
| 233 | opt->rect.x() + opt->rect.width() / 2, opt->rect.y()); | - |
| 234 | } executed: }Execution Count:5 | 5 |
| 235 | p->setPen(oldPen); | - |
| 236 | } executed: }Execution Count:40 | 40 |
| 237 | break; executed: break;Execution Count:40 | 40 |
| 238 | | - |
| 239 | case PE_FrameTabBarBase: | - |
| 240 | if (const QStyleOptionTabBarBase *tbb | 0-4 |
| 241 | = qstyleoption_cast<const QStyleOptionTabBarBase *>(opt)) { partially evaluated: const QStyleOptionTabBarBase *tbb = qstyleoption_cast<const QStyleOptionTabBarBase *>(opt)| yes Evaluation Count:4 | no Evaluation Count:0 |
| 0-4 |
| 242 | p->save(); | - |
| 243 | switch (tbb->shape) { | - |
| 244 | case QTabBar::RoundedNorth: | - |
| 245 | case QTabBar::TriangularNorth: | - |
| 246 | p->setPen(QPen(tbb->palette.light(), 0)); | - |
| 247 | p->drawLine(tbb->rect.topLeft(), tbb->rect.topRight()); | - |
| 248 | break; executed: break;Execution Count:2 | 2 |
| 249 | case QTabBar::RoundedWest: | - |
| 250 | case QTabBar::TriangularWest: | - |
| 251 | p->setPen(QPen(tbb->palette.light(), 0)); | - |
| 252 | p->drawLine(tbb->rect.topLeft(), tbb->rect.bottomLeft()); | - |
| 253 | break; | 0 |
| 254 | case QTabBar::RoundedSouth: | - |
| 255 | case QTabBar::TriangularSouth: | - |
| 256 | p->setPen(QPen(tbb->palette.shadow(), 0)); | - |
| 257 | p->drawLine(tbb->rect.left(), tbb->rect.bottom(), | - |
| 258 | tbb->rect.right(), tbb->rect.bottom()); | - |
| 259 | p->setPen(QPen(tbb->palette.dark(), 0)); | - |
| 260 | p->drawLine(tbb->rect.left(), tbb->rect.bottom() - 1, | - |
| 261 | tbb->rect.right() - 1, tbb->rect.bottom() - 1); | - |
| 262 | break; executed: break;Execution Count:2 | 2 |
| 263 | case QTabBar::RoundedEast: | - |
| 264 | case QTabBar::TriangularEast: | - |
| 265 | p->setPen(QPen(tbb->palette.dark(), 0)); | - |
| 266 | p->drawLine(tbb->rect.topRight(), tbb->rect.bottomRight()); | - |
| 267 | break; | 0 |
| 268 | } | - |
| 269 | p->restore(); | - |
| 270 | } executed: }Execution Count:4 | 4 |
| 271 | break; executed: break;Execution Count:4 | 4 |
| 272 | case PE_IndicatorTabClose: { | - |
| 273 | if (d->tabBarcloseButtonIcon.isNull()) { never evaluated: d->tabBarcloseButtonIcon.isNull() | 0 |
| 274 | d->tabBarcloseButtonIcon.addPixmap(QPixmap( | - |
| 275 | QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-closetab-16.png")), | - |
| 276 | QIcon::Normal, QIcon::Off); | - |
| 277 | d->tabBarcloseButtonIcon.addPixmap(QPixmap( | - |
| 278 | QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-closetab-down-16.png")), | - |
| 279 | QIcon::Normal, QIcon::On); | - |
| 280 | d->tabBarcloseButtonIcon.addPixmap(QPixmap( | - |
| 281 | QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-closetab-hover-16.png")), | - |
| 282 | QIcon::Active, QIcon::Off); | - |
| 283 | } | 0 |
| 284 | | - |
| 285 | int size = proxy()->pixelMetric(QStyle::PM_SmallIconSize); | - |
| 286 | QIcon::Mode mode = opt->state & State_Enabled ? never evaluated: opt->state & State_Enabled | 0 |
| 287 | (opt->state & State_Raised ? QIcon::Active : QIcon::Normal) | - |
| 288 | : QIcon::Disabled; | - |
| 289 | if (!(opt->state & State_Raised) never evaluated: !(opt->state & State_Raised) | 0 |
| 290 | && !(opt->state & State_Sunken) never evaluated: !(opt->state & State_Sunken) | 0 |
| 291 | && !(opt->state & QStyle::State_Selected)) never evaluated: !(opt->state & QStyle::State_Selected) | 0 |
| 292 | mode = QIcon::Disabled; never executed: mode = QIcon::Disabled; | 0 |
| 293 | | - |
| 294 | QIcon::State state = opt->state & State_Sunken ? QIcon::On : QIcon::Off; never evaluated: opt->state & State_Sunken | 0 |
| 295 | QPixmap pixmap = d->tabBarcloseButtonIcon.pixmap(size, mode, state); | - |
| 296 | proxy()->drawItemPixmap(p, opt->rect, Qt::AlignCenter, pixmap); | - |
| 297 | break; | 0 |
| 298 | } | - |
| 299 | | - |
| 300 | case PE_FrameTabWidget: | - |
| 301 | case PE_FrameWindow: | - |
| 302 | qDrawWinPanel(p, opt->rect, opt->palette, false, 0); | - |
| 303 | break; | 0 |
| 304 | case PE_FrameLineEdit: | - |
| 305 | proxy()->drawPrimitive(PE_Frame, opt, p, widget); | - |
| 306 | break; executed: break;Execution Count:514 | 514 |
| 307 | | - |
| 308 | case PE_FrameGroupBox: | - |
| 309 | if (const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(opt)) { partially evaluated: const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(opt)| yes Evaluation Count:32 | no Evaluation Count:0 |
| 0-32 |
| 310 | const QStyleOptionFrameV2 *frame2 = qstyleoption_cast<const QStyleOptionFrameV2 *>(opt); | - |
| 311 | if (frame2 && (frame2->features & QStyleOptionFrameV2::Flat)) { partially evaluated: frame2| yes Evaluation Count:32 | no Evaluation Count:0 |
partially evaluated: (frame2->features & QStyleOptionFrameV2::Flat)| no Evaluation Count:0 | yes Evaluation Count:32 |
| 0-32 |
| 312 | QRect fr = frame->rect; | - |
| 313 | QPoint p1(fr.x(), fr.y() + 1); | - |
| 314 | QPoint p2(fr.x() + fr.width(), p1.y()); | - |
| 315 | qDrawShadeLine(p, p1, p2, frame->palette, true, | - |
| 316 | frame->lineWidth, frame->midLineWidth); | - |
| 317 | } else { | 0 |
| 318 | qDrawShadeRect(p, frame->rect.x(), frame->rect.y(), frame->rect.width(), | - |
| 319 | frame->rect.height(), frame->palette, true, | - |
| 320 | frame->lineWidth, frame->midLineWidth); | - |
| 321 | } executed: }Execution Count:32 | 32 |
| 322 | } | - |
| 323 | break; executed: break;Execution Count:32 | 32 |
| 324 | | - |
| 325 | | - |
| 326 | case PE_FrameDockWidget: | - |
| 327 | if (const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(opt)) { never evaluated: const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(opt) | 0 |
| 328 | int lw = frame->lineWidth; | - |
| 329 | if (lw <= 0) | 0 |
| 330 | lw = proxy()->pixelMetric(PM_DockWidgetFrameWidth); never executed: lw = proxy()->pixelMetric(PM_DockWidgetFrameWidth); | 0 |
| 331 | | - |
| 332 | qDrawShadePanel(p, frame->rect, frame->palette, false, lw); | - |
| 333 | } | 0 |
| 334 | break; | 0 |
| 335 | | - |
| 336 | | - |
| 337 | case PE_IndicatorToolBarHandle: | - |
| 338 | p->save(); | - |
| 339 | p->translate(opt->rect.x(), opt->rect.y()); | - |
| 340 | if (opt->state & State_Horizontal) { never evaluated: opt->state & State_Horizontal | 0 |
| 341 | int x = opt->rect.width() / 3; | - |
| 342 | if (opt->direction == Qt::RightToLeft) never evaluated: opt->direction == Qt::RightToLeft | 0 |
| 343 | x -= 2; | 0 |
| 344 | if (opt->rect.height() > 4) { never evaluated: opt->rect.height() > 4 | 0 |
| 345 | qDrawShadePanel(p, x, 2, 3, opt->rect.height() - 4, | - |
| 346 | opt->palette, false, 1, 0); | - |
| 347 | qDrawShadePanel(p, x+3, 2, 3, opt->rect.height() - 4, | - |
| 348 | opt->palette, false, 1, 0); | - |
| 349 | } | 0 |
| 350 | } else { | 0 |
| 351 | if (opt->rect.width() > 4) { never evaluated: opt->rect.width() > 4 | 0 |
| 352 | int y = opt->rect.height() / 3; | - |
| 353 | qDrawShadePanel(p, 2, y, opt->rect.width() - 4, 3, | - |
| 354 | opt->palette, false, 1, 0); | - |
| 355 | qDrawShadePanel(p, 2, y+3, opt->rect.width() - 4, 3, | - |
| 356 | opt->palette, false, 1, 0); | - |
| 357 | } | 0 |
| 358 | } | 0 |
| 359 | p->restore(); | - |
| 360 | break; | 0 |
| 361 | case PE_IndicatorToolBarSeparator: | - |
| 362 | { | - |
| 363 | QPoint p1, p2; | - |
| 364 | if (opt->state & State_Horizontal) { never evaluated: opt->state & State_Horizontal | 0 |
| 365 | p1 = QPoint(opt->rect.width()/2, 0); | - |
| 366 | p2 = QPoint(p1.x(), opt->rect.height()); | - |
| 367 | } else { | 0 |
| 368 | p1 = QPoint(0, opt->rect.height()/2); | - |
| 369 | p2 = QPoint(opt->rect.width(), p1.y()); | - |
| 370 | } | 0 |
| 371 | qDrawShadeLine(p, p1, p2, opt->palette, 1, 1, 0); | - |
| 372 | break; | 0 |
| 373 | } | - |
| 374 | | - |
| 375 | | - |
| 376 | case PE_IndicatorSpinPlus: | - |
| 377 | case PE_IndicatorSpinMinus: { | - |
| 378 | QRect r = opt->rect; | - |
| 379 | int fw = proxy()->pixelMetric(PM_DefaultFrameWidth, opt, widget); | - |
| 380 | QRect br = r.adjusted(fw, fw, -fw, -fw); | - |
| 381 | | - |
| 382 | int offset = (opt->state & State_Sunken) ? 1 : 0; never evaluated: (opt->state & State_Sunken) | 0 |
| 383 | int step = (br.width() + 4) / 5; | - |
| 384 | p->fillRect(br.x() + offset, br.y() + offset +br.height() / 2 - step / 2, | - |
| 385 | br.width(), step, | - |
| 386 | opt->palette.buttonText()); | - |
| 387 | if (pe == PE_IndicatorSpinPlus) never evaluated: pe == PE_IndicatorSpinPlus | 0 |
| 388 | p->fillRect(br.x() + br.width() / 2 - step / 2 + offset, br.y() + offset, | 0 |
| 389 | step, br.height(), | 0 |
| 390 | opt->palette.buttonText()); never executed: p->fillRect(br.x() + br.width() / 2 - step / 2 + offset, br.y() + offset, step, br.height(), opt->palette.buttonText()); | 0 |
| 391 | | - |
| 392 | break; } | 0 |
| 393 | case PE_IndicatorSpinUp: | - |
| 394 | case PE_IndicatorSpinDown: { | - |
| 395 | QRect r = opt->rect; | - |
| 396 | int fw = proxy()->pixelMetric(PM_DefaultFrameWidth, opt, widget); | - |
| 397 | | - |
| 398 | int x = r.x(), y = r.y(), w = r.width(), h = r.height(); | - |
| 399 | int sw = w-4; | - |
| 400 | if (sw < 3) partially evaluated: sw < 3| no Evaluation Count:0 | yes Evaluation Count:567 |
| 0-567 |
| 401 | break; | 0 |
| 402 | else if (!(sw & 1)) partially evaluated: !(sw & 1)| no Evaluation Count:0 | yes Evaluation Count:567 |
| 0-567 |
| 403 | sw--; | 0 |
| 404 | sw -= (sw / 7) * 2; | - |
| 405 | int sh = sw/2 + 2; | - |
| 406 | | - |
| 407 | int sx = x + w / 2 - sw / 2; | - |
| 408 | int sy = y + h / 2 - sh / 2; | - |
| 409 | | - |
| 410 | if (pe == PE_IndicatorSpinUp && fw) evaluated: pe == PE_IndicatorSpinUp| yes Evaluation Count:210 | yes Evaluation Count:357 |
partially evaluated: fw| yes Evaluation Count:210 | no Evaluation Count:0 |
| 0-357 |
| 411 | --sy; executed: --sy;Execution Count:210 | 210 |
| 412 | | - |
| 413 | QPolygon a; | - |
| 414 | if (pe == PE_IndicatorSpinDown) evaluated: pe == PE_IndicatorSpinDown| yes Evaluation Count:357 | yes Evaluation Count:210 |
| 210-357 |
| 415 | a.setPoints(3, 0, 1, sw-1, 1, sh-2, sh-1); executed: a.setPoints(3, 0, 1, sw-1, 1, sh-2, sh-1);Execution Count:357 | 357 |
| 416 | else | - |
| 417 | a.setPoints(3, 0, sh-1, sw-1, sh-1, sh-2, 1); executed: a.setPoints(3, 0, sh-1, sw-1, sh-1, sh-2, 1);Execution Count:210 | 210 |
| 418 | int bsx = 0; | - |
| 419 | int bsy = 0; | - |
| 420 | if (opt->state & State_Sunken) { partially evaluated: opt->state & State_Sunken| no Evaluation Count:0 | yes Evaluation Count:567 |
| 0-567 |
| 421 | bsx = proxy()->pixelMetric(PM_ButtonShiftHorizontal); | - |
| 422 | bsy = proxy()->pixelMetric(PM_ButtonShiftVertical); | - |
| 423 | } | 0 |
| 424 | p->save(); | - |
| 425 | p->translate(sx + bsx, sy + bsy); | - |
| 426 | p->setPen(opt->palette.buttonText().color()); | - |
| 427 | p->setBrush(opt->palette.buttonText()); | - |
| 428 | p->setRenderHint(QPainter::Qt4CompatiblePainting); | - |
| 429 | p->drawPolygon(a); | - |
| 430 | p->restore(); | - |
| 431 | break; } executed: break;Execution Count:567 | 567 |
| 432 | | - |
| 433 | case PE_PanelTipLabel: { | - |
| 434 | QBrush oldBrush = p->brush(); | - |
| 435 | QPen oldPen = p->pen(); | - |
| 436 | p->setPen(QPen(opt->palette.toolTipText(), 0)); | - |
| 437 | p->setBrush(opt->palette.toolTipBase()); | - |
| 438 | p->drawRect(opt->rect.adjusted(0, 0, -1, -1)); | - |
| 439 | p->setPen(oldPen); | - |
| 440 | p->setBrush(oldBrush); | - |
| 441 | break; executed: break;Execution Count:7 | 7 |
| 442 | } | - |
| 443 | | - |
| 444 | case PE_IndicatorTabTear: | - |
| 445 | if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) { never evaluated: const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt) | 0 |
| 446 | bool rtl = tab->direction == Qt::RightToLeft; | - |
| 447 | QRect rect = tab->rect; | - |
| 448 | QPainterPath path; | - |
| 449 | | - |
| 450 | rect.setTop(rect.top() + ((tab->state & State_Selected) ? 1 : 3)); | - |
| 451 | rect.setBottom(rect.bottom() - ((tab->state & State_Selected) ? 0 : 2)); | - |
| 452 | | - |
| 453 | path.moveTo(QPoint(rtl ? rect.right() : rect.left(), rect.top())); | - |
| 454 | int count = 4; | - |
| 455 | for(int jags = 1; jags <= count; ++jags, rtl = !rtl) never evaluated: jags <= count | 0 |
| 456 | path.lineTo(QPoint(rtl ? rect.left() : rect.right(), rect.top() + jags * rect.height()/count)); never executed: path.lineTo(QPoint(rtl ? rect.left() : rect.right(), rect.top() + jags * rect.height()/count)); | 0 |
| 457 | | - |
| 458 | p->setPen(QPen(tab->palette.light(), qreal(.8))); | - |
| 459 | p->setBrush(tab->palette.background()); | - |
| 460 | p->setRenderHint(QPainter::Antialiasing); | - |
| 461 | p->drawPath(path); | - |
| 462 | } | 0 |
| 463 | break; | 0 |
| 464 | | - |
| 465 | | - |
| 466 | case PE_PanelLineEdit: | - |
| 467 | if (const QStyleOptionFrame *panel = qstyleoption_cast<const QStyleOptionFrame *>(opt)) { partially evaluated: const QStyleOptionFrame *panel = qstyleoption_cast<const QStyleOptionFrame *>(opt)| yes Evaluation Count:760 | no Evaluation Count:0 |
| 0-760 |
| 468 | p->fillRect(panel->rect.adjusted(panel->lineWidth, panel->lineWidth, -panel->lineWidth, -panel->lineWidth), | - |
| 469 | panel->palette.brush(QPalette::Base)); | - |
| 470 | | - |
| 471 | if (panel->lineWidth > 0) evaluated: panel->lineWidth > 0| yes Evaluation Count:515 | yes Evaluation Count:245 |
| 245-515 |
| 472 | proxy()->drawPrimitive(PE_FrameLineEdit, panel, p, widget); executed: proxy()->drawPrimitive(PE_FrameLineEdit, panel, p, widget);Execution Count:515 | 515 |
| 473 | } executed: }Execution Count:760 | 760 |
| 474 | break; executed: break;Execution Count:760 | 760 |
| 475 | | - |
| 476 | | - |
| 477 | case PE_IndicatorColumnViewArrow: { | - |
| 478 | if (const QStyleOptionViewItem *viewOpt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) { never evaluated: const QStyleOptionViewItem *viewOpt = qstyleoption_cast<const QStyleOptionViewItem *>(opt) | 0 |
| 479 | bool reverse = (viewOpt->direction == Qt::RightToLeft); | - |
| 480 | p->save(); | - |
| 481 | QPainterPath path; | - |
| 482 | int x = viewOpt->rect.x() + 1; | - |
| 483 | int offset = (viewOpt->rect.height() / 3); | - |
| 484 | int height = (viewOpt->rect.height()) - offset * 2; | - |
| 485 | if (height % 2 == 1) never evaluated: height % 2 == 1 | 0 |
| 486 | --height; never executed: --height; | 0 |
| 487 | int x2 = x + height - 1; | - |
| 488 | if (reverse) { | 0 |
| 489 | x = viewOpt->rect.x() + viewOpt->rect.width() - 1; | - |
| 490 | x2 = x - height + 1; | - |
| 491 | } | 0 |
| 492 | path.moveTo(x, viewOpt->rect.y() + offset); | - |
| 493 | path.lineTo(x, viewOpt->rect.y() + offset + height); | - |
| 494 | path.lineTo(x2, viewOpt->rect.y() + offset+height/2); | - |
| 495 | path.closeSubpath(); | - |
| 496 | if (viewOpt->state & QStyle::State_Selected ) { never evaluated: viewOpt->state & QStyle::State_Selected | 0 |
| 497 | if (viewOpt->showDecorationSelected) { never evaluated: viewOpt->showDecorationSelected | 0 |
| 498 | QColor color = viewOpt->palette.color(QPalette::Active, QPalette::HighlightedText); | - |
| 499 | p->setPen(color); | - |
| 500 | p->setBrush(color); | - |
| 501 | } else { | 0 |
| 502 | QColor color = viewOpt->palette.color(QPalette::Active, QPalette::WindowText); | - |
| 503 | p->setPen(color); | - |
| 504 | p->setBrush(color); | - |
| 505 | } | 0 |
| 506 | | - |
| 507 | } else { | - |
| 508 | QColor color = viewOpt->palette.color(QPalette::Active, QPalette::Mid); | - |
| 509 | p->setPen(color); | - |
| 510 | p->setBrush(color); | - |
| 511 | } | 0 |
| 512 | p->drawPath(path); | - |
| 513 | | - |
| 514 | | - |
| 515 | if (!(viewOpt->state & QStyle::State_Selected)) { never evaluated: !(viewOpt->state & QStyle::State_Selected) | 0 |
| 516 | QPainterPath lines; | - |
| 517 | lines.moveTo(x, viewOpt->rect.y() + offset); | - |
| 518 | lines.lineTo(x, viewOpt->rect.y() + offset + height); | - |
| 519 | lines.moveTo(x, viewOpt->rect.y() + offset); | - |
| 520 | lines.lineTo(x2, viewOpt->rect.y() + offset+height/2); | - |
| 521 | QColor color = viewOpt->palette.color(QPalette::Active, QPalette::Dark); | - |
| 522 | p->setPen(color); | - |
| 523 | p->drawPath(lines); | - |
| 524 | } | 0 |
| 525 | p->restore(); | - |
| 526 | } | 0 |
| 527 | break; } | 0 |
| 528 | | - |
| 529 | case PE_IndicatorItemViewItemDrop: { | - |
| 530 | QRect rect = opt->rect; | - |
| 531 | if (opt->rect.height() == 0) never evaluated: opt->rect.height() == 0 | 0 |
| 532 | p->drawLine(rect.topLeft(), rect.topRight()); never executed: p->drawLine(rect.topLeft(), rect.topRight()); | 0 |
| 533 | else | - |
| 534 | p->drawRect(rect); never executed: p->drawRect(rect); | 0 |
| 535 | break; } | 0 |
| 536 | | - |
| 537 | case PE_PanelItemViewRow: | - |
| 538 | if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) { partially evaluated: const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)| yes Evaluation Count:12033 | no Evaluation Count:0 |
| 0-12033 |
| 539 | QPalette::ColorGroup cg = (widget ? widget->isEnabled() : (vopt->state & QStyle::State_Enabled)) partially evaluated: widget| yes Evaluation Count:12033 | no Evaluation Count:0 |
| 0-12033 |
| 540 | ? QPalette::Normal : QPalette::Disabled; | - |
| 541 | if (cg == QPalette::Normal && !(vopt->state & QStyle::State_Active)) partially evaluated: cg == QPalette::Normal| yes Evaluation Count:12033 | no Evaluation Count:0 |
evaluated: !(vopt->state & QStyle::State_Active)| yes Evaluation Count:3934 | yes Evaluation Count:8099 |
| 0-12033 |
| 542 | cg = QPalette::Inactive; executed: cg = QPalette::Inactive;Execution Count:3934 | 3934 |
| 543 | | - |
| 544 | if ((vopt->state & QStyle::State_Selected) && proxy()->styleHint(QStyle::SH_ItemView_ShowDecorationSelected, opt, widget)) evaluated: (vopt->state & QStyle::State_Selected)| yes Evaluation Count:486 | yes Evaluation Count:11547 |
partially evaluated: proxy()->styleHint(QStyle::SH_ItemView_ShowDecorationSelected, opt, widget)| no Evaluation Count:0 | yes Evaluation Count:486 |
| 0-11547 |
| 545 | p->fillRect(vopt->rect, vopt->palette.brush(cg, QPalette::Highlight)); never executed: p->fillRect(vopt->rect, vopt->palette.brush(cg, QPalette::Highlight)); | 0 |
| 546 | else if (vopt->features & QStyleOptionViewItem::Alternate) evaluated: vopt->features & QStyleOptionViewItem::Alternate| yes Evaluation Count:89 | yes Evaluation Count:11944 |
| 89-11944 |
| 547 | p->fillRect(vopt->rect, vopt->palette.brush(cg, QPalette::AlternateBase)); executed: p->fillRect(vopt->rect, vopt->palette.brush(cg, QPalette::AlternateBase));Execution Count:89 | 89 |
| 548 | } | - |
| 549 | break; executed: break;Execution Count:12033 | 12033 |
| 550 | case PE_PanelItemViewItem: | - |
| 551 | if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) { partially evaluated: const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)| yes Evaluation Count:13241 | no Evaluation Count:0 |
| 0-13241 |
| 552 | QPalette::ColorGroup cg = (widget ? widget->isEnabled() : (vopt->state & QStyle::State_Enabled)) partially evaluated: widget| yes Evaluation Count:13241 | no Evaluation Count:0 |
| 0-13241 |
| 553 | ? QPalette::Normal : QPalette::Disabled; | - |
| 554 | if (cg == QPalette::Normal && !(vopt->state & QStyle::State_Active)) partially evaluated: cg == QPalette::Normal| yes Evaluation Count:13241 | no Evaluation Count:0 |
evaluated: !(vopt->state & QStyle::State_Active)| yes Evaluation Count:4882 | yes Evaluation Count:8359 |
| 0-13241 |
| 555 | cg = QPalette::Inactive; executed: cg = QPalette::Inactive;Execution Count:4882 | 4882 |
| 556 | | - |
| 557 | if (vopt->showDecorationSelected && (vopt->state & QStyle::State_Selected)) { evaluated: vopt->showDecorationSelected| yes Evaluation Count:11999 | yes Evaluation Count:1242 |
evaluated: (vopt->state & QStyle::State_Selected)| yes Evaluation Count:905 | yes Evaluation Count:11094 |
| 905-11999 |
| 558 | p->fillRect(vopt->rect, vopt->palette.brush(cg, QPalette::Highlight)); | - |
| 559 | } else { executed: }Execution Count:905 | 905 |
| 560 | if (vopt->backgroundBrush.style() != Qt::NoBrush) { partially evaluated: vopt->backgroundBrush.style() != Qt::NoBrush| no Evaluation Count:0 | yes Evaluation Count:12336 |
| 0-12336 |
| 561 | QPointF oldBO = p->brushOrigin(); | - |
| 562 | p->setBrushOrigin(vopt->rect.topLeft()); | - |
| 563 | p->fillRect(vopt->rect, vopt->backgroundBrush); | - |
| 564 | p->setBrushOrigin(oldBO); | - |
| 565 | } | 0 |
| 566 | | - |
| 567 | if (vopt->state & QStyle::State_Selected) { evaluated: vopt->state & QStyle::State_Selected| yes Evaluation Count:96 | yes Evaluation Count:12240 |
| 96-12240 |
| 568 | QRect textRect = subElementRect(QStyle::SE_ItemViewItemText, opt, widget); | - |
| 569 | p->fillRect(textRect, vopt->palette.brush(cg, QPalette::Highlight)); | - |
| 570 | } executed: }Execution Count:96 | 96 |
| 571 | } executed: }Execution Count:12336 | 12336 |
| 572 | } | - |
| 573 | break; executed: break;Execution Count:13241 | 13241 |
| 574 | | - |
| 575 | case PE_PanelScrollAreaCorner: { | - |
| 576 | const QBrush brush(opt->palette.brush(QPalette::Window)); | - |
| 577 | p->fillRect(opt->rect, brush); | - |
| 578 | } break; executed: break;Execution Count:702 | 702 |
| 579 | case PE_IndicatorArrowUp: | - |
| 580 | case PE_IndicatorArrowDown: | - |
| 581 | case PE_IndicatorArrowRight: | - |
| 582 | case PE_IndicatorArrowLeft: | - |
| 583 | { | - |
| 584 | if (opt->rect.width() <= 1 || opt->rect.height() <= 1) partially evaluated: opt->rect.width() <= 1| no Evaluation Count:0 | yes Evaluation Count:6084 |
evaluated: opt->rect.height() <= 1| yes Evaluation Count:24 | yes Evaluation Count:6060 |
| 0-6084 |
| 585 | break; executed: break;Execution Count:24 | 24 |
| 586 | QRect r = opt->rect; | - |
| 587 | int size = qMin(r.height(), r.width()); | - |
| 588 | QPixmap pixmap; | - |
| 589 | QString pixmapName = QStyleHelper::uniqueName(QLatin1String("$qt_ia-") | - |
| 590 | % QLatin1String(metaObject()->className()), opt, QSize(size, size)) | - |
| 591 | % HexString<uint>(pe); | - |
| 592 | if (!QPixmapCache::find(pixmapName, pixmap)) { evaluated: !QPixmapCache::find(pixmapName, pixmap)| yes Evaluation Count:210 | yes Evaluation Count:5850 |
| 210-5850 |
| 593 | int border = size/5; | - |
| 594 | int sqsize = 2*(size/2); | - |
| 595 | QImage image(sqsize, sqsize, QImage::Format_ARGB32_Premultiplied); | - |
| 596 | image.fill(0); | - |
| 597 | QPainter imagePainter(&image); | - |
| 598 | | - |
| 599 | QPolygon a; | - |
| 600 | switch (pe) { | - |
| 601 | case PE_IndicatorArrowUp: | - |
| 602 | a.setPoints(3, border, sqsize/2, sqsize/2, border, sqsize - border, sqsize/2); | - |
| 603 | break; executed: break;Execution Count:38 | 38 |
| 604 | case PE_IndicatorArrowDown: | - |
| 605 | a.setPoints(3, border, sqsize/2, sqsize/2, sqsize - border, sqsize - border, sqsize/2); | - |
| 606 | break; executed: break;Execution Count:95 | 95 |
| 607 | case PE_IndicatorArrowRight: | - |
| 608 | a.setPoints(3, sqsize - border, sqsize/2, sqsize/2, border, sqsize/2, sqsize - border); | - |
| 609 | break; executed: break;Execution Count:41 | 41 |
| 610 | case PE_IndicatorArrowLeft: | - |
| 611 | a.setPoints(3, border, sqsize/2, sqsize/2, border, sqsize/2, sqsize - border); | - |
| 612 | break; executed: break;Execution Count:36 | 36 |
| 613 | default: | - |
| 614 | break; | 0 |
| 615 | } | - |
| 616 | | - |
| 617 | int bsx = 0; | - |
| 618 | int bsy = 0; | - |
| 619 | | - |
| 620 | if (opt->state & State_Sunken) { evaluated: opt->state & State_Sunken| yes Evaluation Count:6 | yes Evaluation Count:204 |
| 6-204 |
| 621 | bsx = proxy()->pixelMetric(PM_ButtonShiftHorizontal, opt, widget); | - |
| 622 | bsy = proxy()->pixelMetric(PM_ButtonShiftVertical, opt, widget); | - |
| 623 | } executed: }Execution Count:6 | 6 |
| 624 | | - |
| 625 | QRect bounds = a.boundingRect(); | - |
| 626 | int sx = sqsize / 2 - bounds.center().x() - 1; | - |
| 627 | int sy = sqsize / 2 - bounds.center().y() - 1; | - |
| 628 | imagePainter.translate(sx + bsx, sy + bsy); | - |
| 629 | imagePainter.setPen(opt->palette.buttonText().color()); | - |
| 630 | imagePainter.setBrush(opt->palette.buttonText()); | - |
| 631 | imagePainter.setRenderHint(QPainter::Qt4CompatiblePainting); | - |
| 632 | | - |
| 633 | if (!(opt->state & State_Enabled)) { evaluated: !(opt->state & State_Enabled)| yes Evaluation Count:11 | yes Evaluation Count:199 |
| 11-199 |
| 634 | imagePainter.translate(1, 1); | - |
| 635 | imagePainter.setBrush(opt->palette.light().color()); | - |
| 636 | imagePainter.setPen(opt->palette.light().color()); | - |
| 637 | imagePainter.drawPolygon(a); | - |
| 638 | imagePainter.translate(-1, -1); | - |
| 639 | imagePainter.setBrush(opt->palette.mid().color()); | - |
| 640 | imagePainter.setPen(opt->palette.mid().color()); | - |
| 641 | } executed: }Execution Count:11 | 11 |
| 642 | | - |
| 643 | imagePainter.drawPolygon(a); | - |
| 644 | imagePainter.end(); | - |
| 645 | pixmap = QPixmap::fromImage(image); | - |
| 646 | QPixmapCache::insert(pixmapName, pixmap); | - |
| 647 | } executed: }Execution Count:210 | 210 |
| 648 | int xOffset = r.x() + (r.width() - size)/2; | - |
| 649 | int yOffset = r.y() + (r.height() - size)/2; | - |
| 650 | p->drawPixmap(xOffset, yOffset, pixmap); | - |
| 651 | } | - |
| 652 | break; executed: break;Execution Count:6060 | 6060 |
| 653 | default: | - |
| 654 | break; executed: break;Execution Count:23 | 23 |
| 655 | } | - |
| 656 | } executed: }Execution Count:36911 | 36911 |
| 657 | | - |
| 658 | | - |
| 659 | static void drawArrow(const QStyle *style, const QStyleOptionToolButton *toolbutton, | - |
| 660 | const QRect &rect, QPainter *painter, const QWidget *widget = 0) | - |
| 661 | { | - |
| 662 | QStyle::PrimitiveElement pe; | - |
| 663 | switch (toolbutton->arrowType) { | - |
| 664 | case Qt::LeftArrow: | - |
| 665 | pe = QStyle::PE_IndicatorArrowLeft; | - |
| 666 | break; | 0 |
| 667 | case Qt::RightArrow: | - |
| 668 | pe = QStyle::PE_IndicatorArrowRight; | - |
| 669 | break; | 0 |
| 670 | case Qt::UpArrow: | - |
| 671 | pe = QStyle::PE_IndicatorArrowUp; | - |
| 672 | break; | 0 |
| 673 | case Qt::DownArrow: | - |
| 674 | pe = QStyle::PE_IndicatorArrowDown; | - |
| 675 | break; | 0 |
| 676 | default: | - |
| 677 | return; | 0 |
| 678 | } | - |
| 679 | QStyleOption arrowOpt; | - |
| 680 | arrowOpt.rect = rect; | - |
| 681 | arrowOpt.palette = toolbutton->palette; | - |
| 682 | arrowOpt.state = toolbutton->state; | - |
| 683 | style->drawPrimitive(pe, &arrowOpt, painter, widget); | - |
| 684 | } | 0 |
| 685 | | - |
| 686 | | - |
| 687 | | - |
| 688 | | - |
| 689 | static QSizeF viewItemTextLayout(QTextLayout &textLayout, int lineWidth) | - |
| 690 | { | - |
| 691 | qreal height = 0; | - |
| 692 | qreal widthUsed = 0; | - |
| 693 | textLayout.beginLayout(); | - |
| 694 | while (true) { partially evaluated: true| yes Evaluation Count:283951 | no Evaluation Count:0 |
| 0-283951 |
| 695 | QTextLine line = textLayout.createLine(); | - |
| 696 | if (!line.isValid()) evaluated: !line.isValid()| yes Evaluation Count:136899 | yes Evaluation Count:147052 |
| 136899-147052 |
| 697 | break; executed: break;Execution Count:136899 | 136899 |
| 698 | line.setLineWidth(lineWidth); | - |
| 699 | line.setPosition(QPointF(0, height)); | - |
| 700 | height += line.height(); | - |
| 701 | widthUsed = qMax(widthUsed, line.naturalTextWidth()); | - |
| 702 | } executed: }Execution Count:147052 | 147052 |
| 703 | textLayout.endLayout(); | - |
| 704 | return QSizeF(widthUsed, height); executed: return QSizeF(widthUsed, height);Execution Count:136899 | 136899 |
| 705 | } | - |
| 706 | | - |
| 707 | QSize QCommonStylePrivate::viewItemSize(const QStyleOptionViewItem *option, int role) const | - |
| 708 | { | - |
| 709 | const QWidget *widget = option->widget; | - |
| 710 | switch (role) { | - |
| 711 | case Qt::CheckStateRole: | - |
| 712 | if (option->features & QStyleOptionViewItem::HasCheckIndicator) evaluated: option->features & QStyleOptionViewItem::HasCheckIndicator| yes Evaluation Count:86 | yes Evaluation Count:163894 |
| 86-163894 |
| 713 | return QSize(proxyStyle->pixelMetric(QStyle::PM_IndicatorWidth, option, widget), | 86 |
| 714 | proxyStyle->pixelMetric(QStyle::PM_IndicatorHeight, option, widget)); executed: return QSize(proxyStyle->pixelMetric(QStyle::PM_IndicatorWidth, option, widget), proxyStyle->pixelMetric(QStyle::PM_IndicatorHeight, option, widget));Execution Count:86 | 86 |
| 715 | break; executed: break;Execution Count:163894 | 163894 |
| 716 | case Qt::DisplayRole: | - |
| 717 | if (option->features & QStyleOptionViewItem::HasDisplay) { evaluated: option->features & QStyleOptionViewItem::HasDisplay| yes Evaluation Count:124580 | yes Evaluation Count:39400 |
| 39400-124580 |
| 718 | QTextOption textOption; | - |
| 719 | textOption.setWrapMode(QTextOption::WordWrap); | - |
| 720 | QTextLayout textLayout(option->text, option->font); | - |
| 721 | textLayout.setTextOption(textOption); | - |
| 722 | const bool wrapText = option->features & QStyleOptionViewItem::WrapText; | - |
| 723 | const int textMargin = proxyStyle->pixelMetric(QStyle::PM_FocusFrameHMargin, option, widget) + 1; | - |
| 724 | QRect bounds = option->rect; | - |
| 725 | switch (option->decorationPosition) { | - |
| 726 | case QStyleOptionViewItem::Left: | - |
| 727 | case QStyleOptionViewItem::Right: | - |
| 728 | bounds.setWidth(wrapText && bounds.isValid() ? bounds.width() - 2 * textMargin : (2147483647/256)); | - |
| 729 | break; executed: break;Execution Count:123962 | 123962 |
| 730 | case QStyleOptionViewItem::Top: | - |
| 731 | case QStyleOptionViewItem::Bottom: | - |
| 732 | bounds.setWidth(wrapText ? option->decorationSize.width() : (2147483647/256)); | - |
| 733 | break; executed: break;Execution Count:618 | 618 |
| 734 | default: | - |
| 735 | break; | 0 |
| 736 | } | - |
| 737 | | - |
| 738 | const int lineWidth = bounds.width(); | - |
| 739 | const QSizeF size = viewItemTextLayout(textLayout, lineWidth); | - |
| 740 | return QSize(qCeil(size.width()) + 2 * textMargin, qCeil(size.height())); executed: return QSize(qCeil(size.width()) + 2 * textMargin, qCeil(size.height()));Execution Count:124580 | 124580 |
| 741 | } | - |
| 742 | break; executed: break;Execution Count:39400 | 39400 |
| 743 | case Qt::DecorationRole: | - |
| 744 | if (option->features & QStyleOptionViewItem::HasDecoration) { evaluated: option->features & QStyleOptionViewItem::HasDecoration| yes Evaluation Count:27524 | yes Evaluation Count:136456 |
| 27524-136456 |
| 745 | return option->decorationSize; executed: return option->decorationSize;Execution Count:27524 | 27524 |
| 746 | } | - |
| 747 | break; executed: break;Execution Count:136456 | 136456 |
| 748 | default: | - |
| 749 | break; | 0 |
| 750 | } | - |
| 751 | | - |
| 752 | return QSize(0, 0); executed: return QSize(0, 0);Execution Count:339750 | 339750 |
| 753 | } | - |
| 754 | | - |
| 755 | void QCommonStylePrivate::viewItemDrawText(QPainter *p, const QStyleOptionViewItem *option, const QRect &rect) const | - |
| 756 | { | - |
| 757 | const QWidget *widget = option->widget; | - |
| 758 | const int textMargin = proxyStyle->pixelMetric(QStyle::PM_FocusFrameHMargin, 0, widget) + 1; | - |
| 759 | | - |
| 760 | QRect textRect = rect.adjusted(textMargin, 0, -textMargin, 0); | - |
| 761 | const bool wrapText = option->features & QStyleOptionViewItem::WrapText; | - |
| 762 | QTextOption textOption; | - |
| 763 | textOption.setWrapMode(wrapText ? QTextOption::WordWrap : QTextOption::ManualWrap); | - |
| 764 | textOption.setTextDirection(option->direction); | - |
| 765 | textOption.setAlignment(QStyle::visualAlignment(option->direction, option->displayAlignment)); | - |
| 766 | QTextLayout textLayout(option->text, option->font); | - |
| 767 | textLayout.setTextOption(textOption); | - |
| 768 | | - |
| 769 | viewItemTextLayout(textLayout, textRect.width()); | - |
| 770 | | - |
| 771 | QString elidedText; | - |
| 772 | qreal height = 0; | - |
| 773 | qreal width = 0; | - |
| 774 | int elidedIndex = -1; | - |
| 775 | const int lineCount = textLayout.lineCount(); | - |
| 776 | for (int j = 0; j < lineCount; ++j) { evaluated: j < lineCount| yes Evaluation Count:13078 | yes Evaluation Count:11473 |
| 11473-13078 |
| 777 | const QTextLine line = textLayout.lineAt(j); | - |
| 778 | if (j + 1 <= lineCount - 1) { evaluated: j + 1 <= lineCount - 1| yes Evaluation Count:812 | yes Evaluation Count:12266 |
| 812-12266 |
| 779 | const QTextLine nextLine = textLayout.lineAt(j + 1); | - |
| 780 | if ((nextLine.y() + nextLine.height()) > textRect.height()) { evaluated: (nextLine.y() + nextLine.height()) > textRect.height()| yes Evaluation Count:53 | yes Evaluation Count:759 |
| 53-759 |
| 781 | int start = line.textStart(); | - |
| 782 | int length = line.textLength() + nextLine.textLength(); | - |
| 783 | const QStackTextEngine engine(textLayout.text().mid(start, length), option->font); | - |
| 784 | elidedText = engine.elidedText(option->textElideMode, textRect.width()); | - |
| 785 | height += line.height(); | - |
| 786 | width = textRect.width(); | - |
| 787 | elidedIndex = j; | - |
| 788 | break; executed: break;Execution Count:53 | 53 |
| 789 | } | - |
| 790 | } executed: }Execution Count:759 | 759 |
| 791 | if (line.naturalTextWidth() > textRect.width()) { evaluated: line.naturalTextWidth() > textRect.width()| yes Evaluation Count:793 | yes Evaluation Count:12232 |
| 793-12232 |
| 792 | int start = line.textStart(); | - |
| 793 | int length = line.textLength(); | - |
| 794 | const QStackTextEngine engine(textLayout.text().mid(start, length), option->font); | - |
| 795 | elidedText = engine.elidedText(option->textElideMode, textRect.width()); | - |
| 796 | height += line.height(); | - |
| 797 | width = textRect.width(); | - |
| 798 | elidedIndex = j; | - |
| 799 | break; executed: break;Execution Count:793 | 793 |
| 800 | } | - |
| 801 | width = qMax<qreal>(width, line.width()); | - |
| 802 | height += line.height(); | - |
| 803 | } executed: }Execution Count:12232 | 12232 |
| 804 | | - |
| 805 | const QRect layoutRect = QStyle::alignedRect(option->direction, option->displayAlignment, | - |
| 806 | QSize(int(width), int(height)), textRect); | - |
| 807 | const QPointF position = layoutRect.topLeft(); | - |
| 808 | for (int i = 0; i < lineCount; ++i) { evaluated: i < lineCount| yes Evaluation Count:13078 | yes Evaluation Count:11473 |
| 11473-13078 |
| 809 | const QTextLine line = textLayout.lineAt(i); | - |
| 810 | if (i == elidedIndex) { evaluated: i == elidedIndex| yes Evaluation Count:846 | yes Evaluation Count:12232 |
| 846-12232 |
| 811 | qreal x = position.x() + line.x(); | - |
| 812 | qreal y = position.y() + line.y() + line.ascent(); | - |
| 813 | p->save(); | - |
| 814 | p->setFont(option->font); | - |
| 815 | p->drawText(QPointF(x, y), elidedText); | - |
| 816 | p->restore(); | - |
| 817 | break; executed: break;Execution Count:846 | 846 |
| 818 | } | - |
| 819 | line.draw(p, position); | - |
| 820 | } executed: }Execution Count:12232 | 12232 |
| 821 | } executed: }Execution Count:12319 | 12319 |
| 822 | void QCommonStylePrivate::viewItemLayout(const QStyleOptionViewItem *opt, QRect *checkRect, | - |
| 823 | QRect *pixmapRect, QRect *textRect, bool sizehint) const | - |
| 824 | { | - |
| 825 | qt_noop(); | - |
| 826 | *pixmapRect = QRect(QPoint(0, 0), viewItemSize(opt, Qt::DecorationRole)); | - |
| 827 | *textRect = QRect(QPoint(0, 0), viewItemSize(opt, Qt::DisplayRole)); | - |
| 828 | *checkRect = QRect(QPoint(0, 0), viewItemSize(opt, Qt::CheckStateRole)); | - |
| 829 | | - |
| 830 | const QWidget *widget = opt->widget; | - |
| 831 | const bool hasCheck = checkRect->isValid(); | - |
| 832 | const bool hasPixmap = pixmapRect->isValid(); | - |
| 833 | const bool hasText = textRect->isValid(); | - |
| 834 | const int textMargin = hasText ? proxyStyle->pixelMetric(QStyle::PM_FocusFrameHMargin, opt, widget) + 1 : 0; evaluated: hasText| yes Evaluation Count:124580 | yes Evaluation Count:39400 |
| 39400-124580 |
| 835 | const int pixmapMargin = hasPixmap ? proxyStyle->pixelMetric(QStyle::PM_FocusFrameHMargin, opt, widget) + 1 : 0; evaluated: hasPixmap| yes Evaluation Count:27524 | yes Evaluation Count:136456 |
| 27524-136456 |
| 836 | const int checkMargin = hasCheck ? proxyStyle->pixelMetric(QStyle::PM_FocusFrameHMargin, opt, widget) + 1 : 0; evaluated: hasCheck| yes Evaluation Count:86 | yes Evaluation Count:163894 |
| 86-163894 |
| 837 | int x = opt->rect.left(); | - |
| 838 | int y = opt->rect.top(); | - |
| 839 | int w, h; | - |
| 840 | | - |
| 841 | if (textRect->height() == 0 && (!hasPixmap || !sizehint)) { evaluated: textRect->height() == 0| yes Evaluation Count:39400 | yes Evaluation Count:124580 |
evaluated: !hasPixmap| yes Evaluation Count:39391 | yes Evaluation Count:9 |
evaluated: !sizehint| yes Evaluation Count:4 | yes Evaluation Count:5 |
| 4-124580 |
| 842 | | - |
| 843 | textRect->setHeight(opt->fontMetrics.height()); | - |
| 844 | } executed: }Execution Count:39395 | 39395 |
| 845 | | - |
| 846 | QSize pm(0, 0); | - |
| 847 | if (hasPixmap) { evaluated: hasPixmap| yes Evaluation Count:27524 | yes Evaluation Count:136456 |
| 27524-136456 |
| 848 | pm = pixmapRect->size(); | - |
| 849 | pm.rwidth() += 2 * pixmapMargin; | - |
| 850 | } executed: }Execution Count:27524 | 27524 |
| 851 | if (sizehint) { evaluated: sizehint| yes Evaluation Count:150673 | yes Evaluation Count:13307 |
| 13307-150673 |
| 852 | h = qMax(checkRect->height(), qMax(textRect->height(), pm.height())); | - |
| 853 | if (opt->decorationPosition == QStyleOptionViewItem::Left evaluated: opt->decorationPosition == QStyleOptionViewItem::Left| yes Evaluation Count:150244 | yes Evaluation Count:429 |
| 429-150244 |
| 854 | || opt->decorationPosition == QStyleOptionViewItem::Right) { partially evaluated: opt->decorationPosition == QStyleOptionViewItem::Right| no Evaluation Count:0 | yes Evaluation Count:429 |
| 0-429 |
| 855 | w = textRect->width() + pm.width(); | - |
| 856 | } else { executed: }Execution Count:150244 | 150244 |
| 857 | w = qMax(textRect->width(), pm.width()); | - |
| 858 | } executed: }Execution Count:429 | 429 |
| 859 | } else { | - |
| 860 | w = opt->rect.width(); | - |
| 861 | h = opt->rect.height(); | - |
| 862 | } executed: }Execution Count:13307 | 13307 |
| 863 | | - |
| 864 | int cw = 0; | - |
| 865 | QRect check; | - |
| 866 | if (hasCheck) { evaluated: hasCheck| yes Evaluation Count:86 | yes Evaluation Count:163894 |
| 86-163894 |
| 867 | cw = checkRect->width() + 2 * checkMargin; | - |
| 868 | if (sizehint) w += cw; evaluated: sizehint| yes Evaluation Count:57 | yes Evaluation Count:29 |
executed: w += cw;Execution Count:57 | 29-57 |
| 869 | if (opt->direction == Qt::RightToLeft) { evaluated: opt->direction == Qt::RightToLeft| yes Evaluation Count:8 | yes Evaluation Count:78 |
| 8-78 |
| 870 | check.setRect(x + w - cw, y, cw, h); | - |
| 871 | } else { executed: }Execution Count:8 | 8 |
| 872 | check.setRect(x, y, cw, h); | - |
| 873 | } executed: }Execution Count:78 | 78 |
| 874 | } | - |
| 875 | | - |
| 876 | QRect display; | - |
| 877 | QRect decoration; | - |
| 878 | switch (opt->decorationPosition) { | - |
| 879 | case QStyleOptionViewItem::Top: { | - |
| 880 | if (hasPixmap) evaluated: hasPixmap| yes Evaluation Count:102 | yes Evaluation Count:517 |
| 102-517 |
| 881 | pm.setHeight(pm.height() + pixmapMargin); executed: pm.setHeight(pm.height() + pixmapMargin);Execution Count:102 | 102 |
| 882 | h = sizehint ? textRect->height() : h - pm.height(); evaluated: sizehint| yes Evaluation Count:429 | yes Evaluation Count:190 |
| 190-429 |
| 883 | | - |
| 884 | if (opt->direction == Qt::RightToLeft) { partially evaluated: opt->direction == Qt::RightToLeft| no Evaluation Count:0 | yes Evaluation Count:619 |
| 0-619 |
| 885 | decoration.setRect(x, y, w - cw, pm.height()); | - |
| 886 | display.setRect(x, y + pm.height(), w - cw, h); | - |
| 887 | } else { | 0 |
| 888 | decoration.setRect(x + cw, y, w - cw, pm.height()); | - |
| 889 | display.setRect(x + cw, y + pm.height(), w - cw, h); | - |
| 890 | } executed: }Execution Count:619 | 619 |
| 891 | break; } executed: break;Execution Count:619 | 619 |
| 892 | case QStyleOptionViewItem::Bottom: { | - |
| 893 | if (hasText) | 0 |
| 894 | textRect->setHeight(textRect->height() + textMargin); never executed: textRect->setHeight(textRect->height() + textMargin); | 0 |
| 895 | h = sizehint ? textRect->height() + pm.height() : h; never evaluated: sizehint | 0 |
| 896 | | - |
| 897 | if (opt->direction == Qt::RightToLeft) { never evaluated: opt->direction == Qt::RightToLeft | 0 |
| 898 | display.setRect(x, y, w - cw, textRect->height()); | - |
| 899 | decoration.setRect(x, y + textRect->height(), w - cw, h - textRect->height()); | - |
| 900 | } else { | 0 |
| 901 | display.setRect(x + cw, y, w - cw, textRect->height()); | - |
| 902 | decoration.setRect(x + cw, y + textRect->height(), w - cw, h - textRect->height()); | - |
| 903 | } | 0 |
| 904 | break; } | 0 |
| 905 | case QStyleOptionViewItem::Left: { | - |
| 906 | if (opt->direction == Qt::LeftToRight) { evaluated: opt->direction == Qt::LeftToRight| yes Evaluation Count:163319 | yes Evaluation Count:42 |
| 42-163319 |
| 907 | decoration.setRect(x + cw, y, pm.width(), h); | - |
| 908 | display.setRect(decoration.right() + 1, y, w - pm.width() - cw, h); | - |
| 909 | } else { executed: }Execution Count:163319 | 163319 |
| 910 | display.setRect(x, y, w - pm.width() - cw, h); | - |
| 911 | decoration.setRect(display.right() + 1, y, pm.width(), h); | - |
| 912 | } executed: }Execution Count:42 | 42 |
| 913 | break; } executed: break;Execution Count:163361 | 163361 |
| 914 | case QStyleOptionViewItem::Right: { | - |
| 915 | if (opt->direction == Qt::LeftToRight) { never evaluated: opt->direction == Qt::LeftToRight | 0 |
| 916 | display.setRect(x + cw, y, w - pm.width() - cw, h); | - |
| 917 | decoration.setRect(display.right() + 1, y, pm.width(), h); | - |
| 918 | } else { | 0 |
| 919 | decoration.setRect(x, y, pm.width(), h); | - |
| 920 | display.setRect(decoration.right() + 1, y, w - pm.width() - cw, h); | - |
| 921 | } | 0 |
| 922 | break; } | 0 |
| 923 | default: | - |
| 924 | QMessageLogger("styles/qcommonstyle.cpp", 1041, __PRETTY_FUNCTION__).warning("doLayout: decoration position is invalid"); | - |
| 925 | decoration = *pixmapRect; | - |
| 926 | break; | 0 |
| 927 | } | - |
| 928 | | - |
| 929 | if (!sizehint) { evaluated: !sizehint| yes Evaluation Count:13307 | yes Evaluation Count:150673 |
| 13307-150673 |
| 930 | *checkRect = QStyle::alignedRect(opt->direction, Qt::AlignCenter, | - |
| 931 | checkRect->size(), check); | - |
| 932 | *pixmapRect = QStyle::alignedRect(opt->direction, opt->decorationAlignment, | - |
| 933 | pixmapRect->size(), decoration); | - |
| 934 | | - |
| 935 | if (opt->showDecorationSelected) evaluated: opt->showDecorationSelected| yes Evaluation Count:12006 | yes Evaluation Count:1301 |
| 1301-12006 |
| 936 | *textRect = display; executed: *textRect = display;Execution Count:12006 | 12006 |
| 937 | else | - |
| 938 | *textRect = QStyle::alignedRect(opt->direction, opt->displayAlignment, | 1301 |
| 939 | textRect->size().boundedTo(display.size()), display); executed: *textRect = QStyle::alignedRect(opt->direction, opt->displayAlignment, textRect->size().boundedTo(display.size()), display);Execution Count:1301 | 1301 |
| 940 | } else { | - |
| 941 | *checkRect = check; | - |
| 942 | *pixmapRect = decoration; | - |
| 943 | *textRect = display; | - |
| 944 | } executed: }Execution Count:150673 | 150673 |
| 945 | } | - |
| 946 | void QCommonStylePrivate::tabLayout(const QStyleOptionTabV3 *opt, const QWidget *widget, QRect *textRect, QRect *iconRect) const | - |
| 947 | { | - |
| 948 | qt_noop(); | - |
| 949 | qt_noop(); | - |
| 950 | QRect tr = opt->rect; | - |
| 951 | bool verticalTabs = opt->shape == QTabBar::RoundedEast evaluated: opt->shape == QTabBar::RoundedEast| yes Evaluation Count:12 | yes Evaluation Count:776 |
| 12-776 |
| 952 | || opt->shape == QTabBar::RoundedWest evaluated: opt->shape == QTabBar::RoundedWest| yes Evaluation Count:12 | yes Evaluation Count:764 |
| 12-764 |
| 953 | || opt->shape == QTabBar::TriangularEast partially evaluated: opt->shape == QTabBar::TriangularEast| no Evaluation Count:0 | yes Evaluation Count:764 |
| 0-764 |
| 954 | || opt->shape == QTabBar::TriangularWest; partially evaluated: opt->shape == QTabBar::TriangularWest| no Evaluation Count:0 | yes Evaluation Count:764 |
| 0-764 |
| 955 | if (verticalTabs) evaluated: verticalTabs| yes Evaluation Count:24 | yes Evaluation Count:764 |
| 24-764 |
| 956 | tr.setRect(0, 0, tr.height(), tr.width()); executed: tr.setRect(0, 0, tr.height(), tr.width());Execution Count:24 | 24 |
| 957 | | - |
| 958 | int verticalShift = proxyStyle->pixelMetric(QStyle::PM_TabBarTabShiftVertical, opt, widget); | - |
| 959 | int horizontalShift = proxyStyle->pixelMetric(QStyle::PM_TabBarTabShiftHorizontal, opt, widget); | - |
| 960 | int hpadding = proxyStyle->pixelMetric(QStyle::PM_TabBarTabHSpace, opt, widget) / 2; | - |
| 961 | int vpadding = proxyStyle->pixelMetric(QStyle::PM_TabBarTabVSpace, opt, widget) / 2; | - |
| 962 | if (opt->shape == QTabBar::RoundedSouth || opt->shape == QTabBar::TriangularSouth) evaluated: opt->shape == QTabBar::RoundedSouth| yes Evaluation Count:52 | yes Evaluation Count:736 |
partially evaluated: opt->shape == QTabBar::TriangularSouth| no Evaluation Count:0 | yes Evaluation Count:736 |
| 0-736 |
| 963 | verticalShift = -verticalShift; executed: verticalShift = -verticalShift;Execution Count:52 | 52 |
| 964 | tr.adjust(hpadding, verticalShift - vpadding, horizontalShift - hpadding, vpadding); | - |
| 965 | bool selected = opt->state & QStyle::State_Selected; | - |
| 966 | if (selected) { evaluated: selected| yes Evaluation Count:418 | yes Evaluation Count:370 |
| 370-418 |
| 967 | tr.setTop(tr.top() - verticalShift); | - |
| 968 | tr.setRight(tr.right() - horizontalShift); | - |
| 969 | } executed: }Execution Count:418 | 418 |
| 970 | | - |
| 971 | | - |
| 972 | if (!opt->leftButtonSize.isEmpty()) { evaluated: !opt->leftButtonSize.isEmpty()| yes Evaluation Count:12 | yes Evaluation Count:776 |
| 12-776 |
| 973 | tr.setLeft(tr.left() + 4 + | - |
| 974 | (verticalTabs ? opt->leftButtonSize.height() : opt->leftButtonSize.width())); | - |
| 975 | } executed: }Execution Count:12 | 12 |
| 976 | | - |
| 977 | if (!opt->rightButtonSize.isEmpty()) { evaluated: !opt->rightButtonSize.isEmpty()| yes Evaluation Count:58 | yes Evaluation Count:730 |
| 58-730 |
| 978 | tr.setRight(tr.right() - 4 - | - |
| 979 | (verticalTabs ? opt->rightButtonSize.height() : opt->rightButtonSize.width())); | - |
| 980 | } executed: }Execution Count:58 | 58 |
| 981 | | - |
| 982 | | - |
| 983 | if (!opt->icon.isNull()) { partially evaluated: !opt->icon.isNull()| no Evaluation Count:0 | yes Evaluation Count:788 |
| 0-788 |
| 984 | QSize iconSize = opt->iconSize; | - |
| 985 | if (!iconSize.isValid()) { never evaluated: !iconSize.isValid() | 0 |
| 986 | int iconExtent = proxyStyle->pixelMetric(QStyle::PM_SmallIconSize); | - |
| 987 | iconSize = QSize(iconExtent, iconExtent); | - |
| 988 | } | 0 |
| 989 | QSize tabIconSize = opt->icon.actualSize(iconSize, | - |
| 990 | (opt->state & QStyle::State_Enabled) ? QIcon::Normal : QIcon::Disabled, | - |
| 991 | (opt->state & QStyle::State_Selected) ? QIcon::On : QIcon::Off ); | - |
| 992 | | - |
| 993 | *iconRect = QRect(tr.left(), tr.center().y() - tabIconSize.height() / 2, | - |
| 994 | tabIconSize.width(), tabIconSize .height()); | - |
| 995 | if (!verticalTabs) never evaluated: !verticalTabs | 0 |
| 996 | *iconRect = proxyStyle->visualRect(opt->direction, opt->rect, *iconRect); never executed: *iconRect = proxyStyle->visualRect(opt->direction, opt->rect, *iconRect); | 0 |
| 997 | tr.setLeft(tr.left() + tabIconSize.width() + 4); | - |
| 998 | } | 0 |
| 999 | | - |
| 1000 | if (!verticalTabs) evaluated: !verticalTabs| yes Evaluation Count:764 | yes Evaluation Count:24 |
| 24-764 |
| 1001 | tr = proxyStyle->visualRect(opt->direction, opt->rect, tr); executed: tr = proxyStyle->visualRect(opt->direction, opt->rect, tr);Execution Count:764 | 764 |
| 1002 | | - |
| 1003 | *textRect = tr; | - |
| 1004 | } executed: }Execution Count:788 | 788 |
| 1005 | | - |
| 1006 | | - |
| 1007 | | - |
| 1008 | QList<const QObject*> QCommonStylePrivate::animationTargets() const | - |
| 1009 | { | - |
| 1010 | return animations.keys(); never executed: return animations.keys(); | 0 |
| 1011 | } | - |
| 1012 | | - |
| 1013 | | - |
| 1014 | QStyleAnimation * QCommonStylePrivate::animation(const QObject *target) const | - |
| 1015 | { | - |
| 1016 | return animations.value(target); executed: return animations.value(target);Execution Count:17 | 17 |
| 1017 | } | - |
| 1018 | | - |
| 1019 | | - |
| 1020 | void QCommonStylePrivate::startAnimation(QStyleAnimation *animation) const | - |
| 1021 | { | - |
| 1022 | const QCommonStyle * const q = q_func(); | - |
| 1023 | stopAnimation(animation->target()); | - |
| 1024 | q->connect(animation, "2""destroyed()", "1""_q_removeAnimation()", Qt::UniqueConnection); | - |
| 1025 | animations.insert(animation->target(), animation); | - |
| 1026 | animation->start(QAbstractAnimation::DeleteWhenStopped); | - |
| 1027 | } executed: }Execution Count:2 | 2 |
| 1028 | | - |
| 1029 | | - |
| 1030 | void QCommonStylePrivate::stopAnimation(const QObject *target) const | - |
| 1031 | { | - |
| 1032 | QStyleAnimation *animation = animations.take(target); | - |
| 1033 | if (animation) { evaluated: animation| yes Evaluation Count:1 | yes Evaluation Count:44 |
| 1-44 |
| 1034 | animation->stop(); | - |
| 1035 | delete animation; | - |
| 1036 | } executed: }Execution Count:1 | 1 |
| 1037 | } executed: }Execution Count:45 | 45 |
| 1038 | | - |
| 1039 | | - |
| 1040 | void QCommonStylePrivate::_q_removeAnimation() | - |
| 1041 | { | - |
| 1042 | QCommonStyle * const q = q_func(); | - |
| 1043 | QObject *animation = q->sender(); | - |
| 1044 | if (animation) partially evaluated: animation| yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
| 1045 | animations.remove(animation->parent()); executed: animations.remove(animation->parent());Execution Count:2 | 2 |
| 1046 | } executed: }Execution Count:2 | 2 |
| 1047 | | - |
| 1048 | | - |
| 1049 | | - |
| 1050 | | - |
| 1051 | void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, | - |
| 1052 | QPainter *p, const QWidget *widget) const | - |
| 1053 | { | - |
| 1054 | const QCommonStylePrivate * const d = d_func(); | - |
| 1055 | switch (element) { | - |
| 1056 | | - |
| 1057 | case CE_PushButton: | - |
| 1058 | if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) { evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)| yes Evaluation Count:799 | yes Evaluation Count:3 |
| 3-799 |
| 1059 | proxy()->drawControl(CE_PushButtonBevel, btn, p, widget); | - |
| 1060 | QStyleOptionButton subopt = *btn; | - |
| 1061 | subopt.rect = subElementRect(SE_PushButtonContents, btn, widget); | - |
| 1062 | proxy()->drawControl(CE_PushButtonLabel, &subopt, p, widget); | - |
| 1063 | if (btn->state & State_HasFocus) { evaluated: btn->state & State_HasFocus| yes Evaluation Count:229 | yes Evaluation Count:570 |
| 229-570 |
| 1064 | QStyleOptionFocusRect fropt; | - |
| 1065 | fropt.QStyleOption::operator=(*btn); | - |
| 1066 | fropt.rect = subElementRect(SE_PushButtonFocusRect, btn, widget); | - |
| 1067 | proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, p, widget); | - |
| 1068 | } executed: }Execution Count:229 | 229 |
| 1069 | } executed: }Execution Count:799 | 799 |
| 1070 | break; executed: break;Execution Count:802 | 802 |
| 1071 | case CE_PushButtonBevel: | - |
| 1072 | if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) { evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)| yes Evaluation Count:821 | yes Evaluation Count:4 |
| 4-821 |
| 1073 | QRect br = btn->rect; | - |
| 1074 | int dbi = proxy()->pixelMetric(PM_ButtonDefaultIndicator, btn, widget); | - |
| 1075 | if (btn->features & QStyleOptionButton::DefaultButton) evaluated: btn->features & QStyleOptionButton::DefaultButton| yes Evaluation Count:234 | yes Evaluation Count:587 |
| 234-587 |
| 1076 | proxy()->drawPrimitive(PE_FrameDefaultButton, opt, p, widget); executed: proxy()->drawPrimitive(PE_FrameDefaultButton, opt, p, widget);Execution Count:234 | 234 |
| 1077 | if (btn->features & QStyleOptionButton::AutoDefaultButton) evaluated: btn->features & QStyleOptionButton::AutoDefaultButton| yes Evaluation Count:489 | yes Evaluation Count:332 |
| 332-489 |
| 1078 | br.setCoords(br.left() + dbi, br.top() + dbi, br.right() - dbi, br.bottom() - dbi); executed: br.setCoords(br.left() + dbi, br.top() + dbi, br.right() - dbi, br.bottom() - dbi);Execution Count:489 | 489 |
| 1079 | if (!(btn->features & (QStyleOptionButton::Flat | QStyleOptionButton::CommandLinkButton)) evaluated: !(btn->features & (QStyleOptionButton::Flat | QStyleOptionButton::CommandLinkButton))| yes Evaluation Count:780 | yes Evaluation Count:41 |
| 41-780 |
| 1080 | || btn->state & (State_Sunken | State_On) evaluated: btn->state & (State_Sunken | State_On)| yes Evaluation Count:17 | yes Evaluation Count:24 |
| 17-24 |
| 1081 | || (btn->features & QStyleOptionButton::CommandLinkButton && btn->state & State_MouseOver)) { partially evaluated: btn->features & QStyleOptionButton::CommandLinkButton| yes Evaluation Count:24 | no Evaluation Count:0 |
evaluated: btn->state & State_MouseOver| yes Evaluation Count:1 | yes Evaluation Count:23 |
| 0-24 |
| 1082 | QStyleOptionButton tmpBtn = *btn; | - |
| 1083 | tmpBtn.rect = br; | - |
| 1084 | proxy()->drawPrimitive(PE_PanelButtonCommand, &tmpBtn, p, widget); | - |
| 1085 | } executed: }Execution Count:798 | 798 |
| 1086 | if (btn->features & QStyleOptionButton::HasMenu) { evaluated: btn->features & QStyleOptionButton::HasMenu| yes Evaluation Count:8 | yes Evaluation Count:813 |
| 8-813 |
| 1087 | int mbi = proxy()->pixelMetric(PM_MenuButtonIndicator, btn, widget); | - |
| 1088 | QRect ir = btn->rect; | - |
| 1089 | QStyleOptionButton newBtn = *btn; | - |
| 1090 | newBtn.rect = QRect(ir.right() - mbi + 2, ir.height()/2 - mbi/2 + 3, mbi - 6, mbi - 6); | - |
| 1091 | proxy()->drawPrimitive(PE_IndicatorArrowDown, &newBtn, p, widget); | - |
| 1092 | } executed: }Execution Count:8 | 8 |
| 1093 | } executed: }Execution Count:821 | 821 |
| 1094 | break; executed: break;Execution Count:825 | 825 |
| 1095 | case CE_PushButtonLabel: | - |
| 1096 | if (const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton *>(opt)) { evaluated: const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton *>(opt)| yes Evaluation Count:799 | yes Evaluation Count:3 |
| 3-799 |
| 1097 | QRect textRect = button->rect; | - |
| 1098 | uint tf = Qt::AlignVCenter | Qt::TextShowMnemonic; | - |
| 1099 | if (!proxy()->styleHint(SH_UnderlineShortcut, button, widget)) partially evaluated: !proxy()->styleHint(SH_UnderlineShortcut, button, widget)| no Evaluation Count:0 | yes Evaluation Count:799 |
| 0-799 |
| 1100 | tf |= Qt::TextHideMnemonic; never executed: tf |= Qt::TextHideMnemonic; | 0 |
| 1101 | | - |
| 1102 | if (!button->icon.isNull()) { partially evaluated: !button->icon.isNull()| no Evaluation Count:0 | yes Evaluation Count:799 |
| 0-799 |
| 1103 | | - |
| 1104 | QRect iconRect; | - |
| 1105 | QIcon::Mode mode = button->state & State_Enabled ? QIcon::Normal : QIcon::Disabled; never evaluated: button->state & State_Enabled | 0 |
| 1106 | if (mode == QIcon::Normal && button->state & State_HasFocus) never evaluated: mode == QIcon::Normal never evaluated: button->state & State_HasFocus | 0 |
| 1107 | mode = QIcon::Active; never executed: mode = QIcon::Active; | 0 |
| 1108 | QIcon::State state = QIcon::Off; | - |
| 1109 | if (button->state & State_On) never evaluated: button->state & State_On | 0 |
| 1110 | state = QIcon::On; never executed: state = QIcon::On; | 0 |
| 1111 | | - |
| 1112 | QPixmap pixmap = button->icon.pixmap(button->iconSize, mode, state); | - |
| 1113 | int labelWidth = pixmap.width(); | - |
| 1114 | int labelHeight = pixmap.height(); | - |
| 1115 | int iconSpacing = 4; | - |
| 1116 | int textWidth = button->fontMetrics.boundingRect(opt->rect, tf, button->text).width(); | - |
| 1117 | if (!button->text.isEmpty()) never evaluated: !button->text.isEmpty() | 0 |
| 1118 | labelWidth += (textWidth + iconSpacing); never executed: labelWidth += (textWidth + iconSpacing); | 0 |
| 1119 | | - |
| 1120 | iconRect = QRect(textRect.x() + (textRect.width() - labelWidth) / 2, | - |
| 1121 | textRect.y() + (textRect.height() - labelHeight) / 2, | - |
| 1122 | pixmap.width(), pixmap.height()); | - |
| 1123 | | - |
| 1124 | iconRect = visualRect(button->direction, textRect, iconRect); | - |
| 1125 | | - |
| 1126 | tf |= Qt::AlignLeft; | - |
| 1127 | | - |
| 1128 | if (button->direction == Qt::RightToLeft) never evaluated: button->direction == Qt::RightToLeft | 0 |
| 1129 | textRect.setRight(iconRect.left() - iconSpacing); never executed: textRect.setRight(iconRect.left() - iconSpacing); | 0 |
| 1130 | else | - |
| 1131 | textRect.setLeft(iconRect.left() + iconRect.width() + iconSpacing); never executed: textRect.setLeft(iconRect.left() + iconRect.width() + iconSpacing); | 0 |
| 1132 | | - |
| 1133 | if (button->state & (State_On | State_Sunken)) never evaluated: button->state & (State_On | State_Sunken) | 0 |
| 1134 | iconRect.translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, opt, widget), | 0 |
| 1135 | proxy()->pixelMetric(PM_ButtonShiftVertical, opt, widget)); never executed: iconRect.translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, opt, widget), proxy()->pixelMetric(PM_ButtonShiftVertical, opt, widget)); | 0 |
| 1136 | p->drawPixmap(iconRect, pixmap); | - |
| 1137 | } else { | 0 |
| 1138 | tf |= Qt::AlignHCenter; | - |
| 1139 | } executed: }Execution Count:799 | 799 |
| 1140 | if (button->state & (State_On | State_Sunken)) evaluated: button->state & (State_On | State_Sunken)| yes Evaluation Count:72 | yes Evaluation Count:727 |
| 72-727 |
| 1141 | textRect.translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, opt, widget), | 72 |
| 1142 | proxy()->pixelMetric(PM_ButtonShiftVertical, opt, widget)); executed: textRect.translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, opt, widget), proxy()->pixelMetric(PM_ButtonShiftVertical, opt, widget));Execution Count:72 | 72 |
| 1143 | | - |
| 1144 | if (button->features & QStyleOptionButton::HasMenu) { evaluated: button->features & QStyleOptionButton::HasMenu| yes Evaluation Count:8 | yes Evaluation Count:791 |
| 8-791 |
| 1145 | int indicatorSize = proxy()->pixelMetric(PM_MenuButtonIndicator, button, widget); | - |
| 1146 | if (button->direction == Qt::LeftToRight) partially evaluated: button->direction == Qt::LeftToRight| yes Evaluation Count:8 | no Evaluation Count:0 |
| 0-8 |
| 1147 | textRect = textRect.adjusted(0, 0, -indicatorSize, 0); executed: textRect = textRect.adjusted(0, 0, -indicatorSize, 0);Execution Count:8 | 8 |
| 1148 | else | - |
| 1149 | textRect = textRect.adjusted(indicatorSize, 0, 0, 0); never executed: textRect = textRect.adjusted(indicatorSize, 0, 0, 0); | 0 |
| 1150 | } | - |
| 1151 | proxy()->drawItemText(p, textRect, tf, button->palette, (button->state & State_Enabled), | - |
| 1152 | button->text, QPalette::ButtonText); | - |
| 1153 | } executed: }Execution Count:799 | 799 |
| 1154 | break; executed: break;Execution Count:802 | 802 |
| 1155 | case CE_RadioButton: | - |
| 1156 | case CE_CheckBox: | - |
| 1157 | if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) { evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)| yes Evaluation Count:38 | yes Evaluation Count:8 |
| 8-38 |
| 1158 | bool isRadio = (element == CE_RadioButton); | - |
| 1159 | QStyleOptionButton subopt = *btn; | - |
| 1160 | subopt.rect = subElementRect(isRadio ? SE_RadioButtonIndicator | - |
| 1161 | : SE_CheckBoxIndicator, btn, widget); | - |
| 1162 | proxy()->drawPrimitive(isRadio ? PE_IndicatorRadioButton : PE_IndicatorCheckBox, | - |
| 1163 | &subopt, p, widget); | - |
| 1164 | subopt.rect = subElementRect(isRadio ? SE_RadioButtonContents | - |
| 1165 | : SE_CheckBoxContents, btn, widget); | - |
| 1166 | proxy()->drawControl(isRadio ? CE_RadioButtonLabel : CE_CheckBoxLabel, &subopt, p, widget); | - |
| 1167 | if (btn->state & State_HasFocus) { evaluated: btn->state & State_HasFocus| yes Evaluation Count:11 | yes Evaluation Count:27 |
| 11-27 |
| 1168 | QStyleOptionFocusRect fropt; | - |
| 1169 | fropt.QStyleOption::operator=(*btn); | - |
| 1170 | fropt.rect = subElementRect(isRadio ? SE_RadioButtonFocusRect | - |
| 1171 | : SE_CheckBoxFocusRect, btn, widget); | - |
| 1172 | proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, p, widget); | - |
| 1173 | } executed: }Execution Count:11 | 11 |
| 1174 | } executed: }Execution Count:38 | 38 |
| 1175 | break; executed: break;Execution Count:46 | 46 |
| 1176 | case CE_RadioButtonLabel: | - |
| 1177 | case CE_CheckBoxLabel: | - |
| 1178 | if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) { evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)| yes Evaluation Count:38 | yes Evaluation Count:8 |
| 8-38 |
| 1179 | uint alignment = visualAlignment(btn->direction, Qt::AlignLeft | Qt::AlignVCenter); | - |
| 1180 | | - |
| 1181 | if (!proxy()->styleHint(SH_UnderlineShortcut, btn, widget)) partially evaluated: !proxy()->styleHint(SH_UnderlineShortcut, btn, widget)| no Evaluation Count:0 | yes Evaluation Count:38 |
| 0-38 |
| 1182 | alignment |= Qt::TextHideMnemonic; never executed: alignment |= Qt::TextHideMnemonic; | 0 |
| 1183 | QPixmap pix; | - |
| 1184 | QRect textRect = btn->rect; | - |
| 1185 | if (!btn->icon.isNull()) { partially evaluated: !btn->icon.isNull()| no Evaluation Count:0 | yes Evaluation Count:38 |
| 0-38 |
| 1186 | pix = btn->icon.pixmap(btn->iconSize, btn->state & State_Enabled ? QIcon::Normal : QIcon::Disabled); | - |
| 1187 | proxy()->drawItemPixmap(p, btn->rect, alignment, pix); | - |
| 1188 | if (btn->direction == Qt::RightToLeft) never evaluated: btn->direction == Qt::RightToLeft | 0 |
| 1189 | textRect.setRight(textRect.right() - btn->iconSize.width() - 4); never executed: textRect.setRight(textRect.right() - btn->iconSize.width() - 4); | 0 |
| 1190 | else | - |
| 1191 | textRect.setLeft(textRect.left() + btn->iconSize.width() + 4); never executed: textRect.setLeft(textRect.left() + btn->iconSize.width() + 4); | 0 |
| 1192 | } | - |
| 1193 | if (!btn->text.isEmpty()){ evaluated: !btn->text.isEmpty()| yes Evaluation Count:31 | yes Evaluation Count:7 |
| 7-31 |
| 1194 | proxy()->drawItemText(p, textRect, alignment | Qt::TextShowMnemonic, | - |
| 1195 | btn->palette, btn->state & State_Enabled, btn->text, QPalette::WindowText); | - |
| 1196 | } executed: }Execution Count:31 | 31 |
| 1197 | } executed: }Execution Count:38 | 38 |
| 1198 | break; executed: break;Execution Count:46 | 46 |
| 1199 | | - |
| 1200 | case CE_MenuScroller: { | - |
| 1201 | p->fillRect(opt->rect, opt->palette.background()); | - |
| 1202 | QStyleOption arrowOpt = *opt; | - |
| 1203 | arrowOpt.state |= State_Enabled; | - |
| 1204 | proxy()->drawPrimitive(((opt->state & State_DownArrow) ? PE_IndicatorArrowDown : PE_IndicatorArrowUp), | - |
| 1205 | &arrowOpt, p, widget); | - |
| 1206 | break; } executed: break;Execution Count:4 | 4 |
| 1207 | case CE_MenuTearoff: | - |
| 1208 | if (opt->state & State_Selected) partially evaluated: opt->state & State_Selected| no Evaluation Count:0 | yes Evaluation Count:5 |
| 0-5 |
| 1209 | p->fillRect(opt->rect, opt->palette.brush(QPalette::Highlight)); never executed: p->fillRect(opt->rect, opt->palette.brush(QPalette::Highlight)); | 0 |
| 1210 | else | - |
| 1211 | p->fillRect(opt->rect, opt->palette.brush(QPalette::Button)); executed: p->fillRect(opt->rect, opt->palette.brush(QPalette::Button));Execution Count:5 | 5 |
| 1212 | p->setPen(QPen(opt->palette.dark().color(), 1, Qt::DashLine)); | - |
| 1213 | p->drawLine(opt->rect.x() + 2, opt->rect.y() + opt->rect.height() / 2 - 1, | - |
| 1214 | opt->rect.x() + opt->rect.width() - 4, | - |
| 1215 | opt->rect.y() + opt->rect.height() / 2 - 1); | - |
| 1216 | p->setPen(QPen(opt->palette.light().color(), 1, Qt::DashLine)); | - |
| 1217 | p->drawLine(opt->rect.x() + 2, opt->rect.y() + opt->rect.height() / 2, | - |
| 1218 | opt->rect.x() + opt->rect.width() - 4, opt->rect.y() + opt->rect.height() / 2); | - |
| 1219 | break; executed: break;Execution Count:5 | 5 |
| 1220 | | - |
| 1221 | | - |
| 1222 | case CE_MenuBarItem: | - |
| 1223 | if (const QStyleOptionMenuItem *mbi = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) { partially evaluated: const QStyleOptionMenuItem *mbi = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)| yes Evaluation Count:46 | no Evaluation Count:0 |
| 0-46 |
| 1224 | uint alignment = Qt::AlignCenter | Qt::TextShowMnemonic | Qt::TextDontClip | - |
| 1225 | | Qt::TextSingleLine; | - |
| 1226 | if (!proxy()->styleHint(SH_UnderlineShortcut, mbi, widget)) partially evaluated: !proxy()->styleHint(SH_UnderlineShortcut, mbi, widget)| no Evaluation Count:0 | yes Evaluation Count:46 |
| 0-46 |
| 1227 | alignment |= Qt::TextHideMnemonic; never executed: alignment |= Qt::TextHideMnemonic; | 0 |
| 1228 | QPixmap pix = mbi->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize), (mbi->state & State_Enabled) ? QIcon::Normal : QIcon::Disabled); | - |
| 1229 | if (!pix.isNull()) partially evaluated: !pix.isNull()| no Evaluation Count:0 | yes Evaluation Count:46 |
| 0-46 |
| 1230 | proxy()->drawItemPixmap(p,mbi->rect, alignment, pix); never executed: proxy()->drawItemPixmap(p,mbi->rect, alignment, pix); | 0 |
| 1231 | else | - |
| 1232 | proxy()->drawItemText(p, mbi->rect, alignment, mbi->palette, mbi->state & State_Enabled, | 46 |
| 1233 | mbi->text, QPalette::ButtonText); executed: proxy()->drawItemText(p, mbi->rect, alignment, mbi->palette, mbi->state & State_Enabled, mbi->text, QPalette::ButtonText);Execution Count:46 | 46 |
| 1234 | } | - |
| 1235 | break; executed: break;Execution Count:46 | 46 |
| 1236 | case CE_MenuBarEmptyArea: | - |
| 1237 | if (widget && !widget->testAttribute(Qt::WA_NoSystemBackground)) never evaluated: !widget->testAttribute(Qt::WA_NoSystemBackground) | 0 |
| 1238 | p->eraseRect(opt->rect); never executed: p->eraseRect(opt->rect); | 0 |
| 1239 | break; | 0 |
| 1240 | | - |
| 1241 | | - |
| 1242 | case CE_ProgressBar: | - |
| 1243 | if (const QStyleOptionProgressBar *pb | 4-63 |
| 1244 | = qstyleoption_cast<const QStyleOptionProgressBar *>(opt)) { evaluated: const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(opt)| yes Evaluation Count:63 | yes Evaluation Count:4 |
| 4-63 |
| 1245 | QStyleOptionProgressBarV2 subopt = *pb; | - |
| 1246 | subopt.rect = subElementRect(SE_ProgressBarGroove, pb, widget); | - |
| 1247 | proxy()->drawControl(CE_ProgressBarGroove, &subopt, p, widget); | - |
| 1248 | subopt.rect = subElementRect(SE_ProgressBarContents, pb, widget); | - |
| 1249 | proxy()->drawControl(CE_ProgressBarContents, &subopt, p, widget); | - |
| 1250 | if (pb->textVisible) { evaluated: pb->textVisible| yes Evaluation Count:62 | yes Evaluation Count:1 |
| 1-62 |
| 1251 | subopt.rect = subElementRect(SE_ProgressBarLabel, pb, widget); | - |
| 1252 | proxy()->drawControl(CE_ProgressBarLabel, &subopt, p, widget); | - |
| 1253 | } executed: }Execution Count:62 | 62 |
| 1254 | } executed: }Execution Count:63 | 63 |
| 1255 | break; executed: break;Execution Count:67 | 67 |
| 1256 | case CE_ProgressBarGroove: | - |
| 1257 | if (opt->rect.isValid()) evaluated: opt->rect.isValid()| yes Evaluation Count:63 | yes Evaluation Count:1 |
| 1-63 |
| 1258 | qDrawShadePanel(p, opt->rect, opt->palette, true, 1, | 63 |
| 1259 | &opt->palette.brush(QPalette::Window)); executed: qDrawShadePanel(p, opt->rect, opt->palette, true, 1, &opt->palette.brush(QPalette::Window));Execution Count:63 | 63 |
| 1260 | break; executed: break;Execution Count:64 | 64 |
| 1261 | case CE_ProgressBarLabel: | - |
| 1262 | if (const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(opt)) { evaluated: const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(opt)| yes Evaluation Count:60 | yes Evaluation Count:3 |
| 3-60 |
| 1263 | bool vertical = false; | - |
| 1264 | if (const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt)) { partially evaluated: const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt)| yes Evaluation Count:60 | no Evaluation Count:0 |
| 0-60 |
| 1265 | vertical = (pb2->orientation == Qt::Vertical); | - |
| 1266 | } executed: }Execution Count:60 | 60 |
| 1267 | if (!vertical) { partially evaluated: !vertical| yes Evaluation Count:60 | no Evaluation Count:0 |
| 0-60 |
| 1268 | QPalette::ColorRole textRole = QPalette::NoRole; | - |
| 1269 | if ((pb->textAlignment & Qt::AlignCenter) && pb->textVisible partially evaluated: (pb->textAlignment & Qt::AlignCenter)| no Evaluation Count:0 | yes Evaluation Count:60 |
never evaluated: pb->textVisible | 0-60 |
| 1270 | && ((qint64(pb->progress) - qint64(pb->minimum)) * 2 >= (qint64(pb->maximum) - qint64(pb->minimum)))) { never evaluated: ((qint64(pb->progress) - qint64(pb->minimum)) * 2 >= (qint64(pb->maximum) - qint64(pb->minimum))) | 0 |
| 1271 | textRole = QPalette::HighlightedText; | - |
| 1272 | | - |
| 1273 | QRect shadowRect(pb->rect); | - |
| 1274 | shadowRect.translate(1,1); | - |
| 1275 | QColor shadowColor = (pb->palette.color(textRole).value() <= 128) never evaluated: (pb->palette.color(textRole).value() <= 128) | 0 |
| 1276 | ? QColor(255,255,255,160) : QColor(0,0,0,160); | - |
| 1277 | QPalette shadowPalette = pb->palette; | - |
| 1278 | shadowPalette.setColor(textRole, shadowColor); | - |
| 1279 | proxy()->drawItemText(p, shadowRect, Qt::AlignCenter | Qt::TextSingleLine, shadowPalette, | - |
| 1280 | pb->state & State_Enabled, pb->text, textRole); | - |
| 1281 | } | 0 |
| 1282 | proxy()->drawItemText(p, pb->rect, Qt::AlignCenter | Qt::TextSingleLine, pb->palette, | - |
| 1283 | pb->state & State_Enabled, pb->text, textRole); | - |
| 1284 | } executed: }Execution Count:60 | 60 |
| 1285 | } executed: }Execution Count:60 | 60 |
| 1286 | break; executed: break;Execution Count:63 | 63 |
| 1287 | case CE_ProgressBarContents: | - |
| 1288 | if (const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(opt)) { partially evaluated: const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(opt)| yes Evaluation Count:43 | no Evaluation Count:0 |
| 0-43 |
| 1289 | | - |
| 1290 | QRect rect = pb->rect; | - |
| 1291 | bool vertical = false; | - |
| 1292 | bool inverted = false; | - |
| 1293 | qint64 minimum = qint64(pb->minimum); | - |
| 1294 | qint64 maximum = qint64(pb->maximum); | - |
| 1295 | qint64 progress = qint64(pb->progress); | - |
| 1296 | | - |
| 1297 | | - |
| 1298 | const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt); | - |
| 1299 | if (pb2) { partially evaluated: pb2| yes Evaluation Count:43 | no Evaluation Count:0 |
| 0-43 |
| 1300 | vertical = (pb2->orientation == Qt::Vertical); | - |
| 1301 | inverted = pb2->invertedAppearance; | - |
| 1302 | } executed: }Execution Count:43 | 43 |
| 1303 | QMatrix m; | - |
| 1304 | | - |
| 1305 | if (vertical) { partially evaluated: vertical| no Evaluation Count:0 | yes Evaluation Count:43 |
| 0-43 |
| 1306 | rect = QRect(rect.y(), rect.x(), rect.height(), rect.width()); | - |
| 1307 | m.rotate(90); | - |
| 1308 | m.translate(0, -(rect.height() + rect.y()*2)); | - |
| 1309 | } | 0 |
| 1310 | | - |
| 1311 | QPalette pal2 = pb->palette; | - |
| 1312 | | - |
| 1313 | if (pal2.highlight() == pal2.background()) partially evaluated: pal2.highlight() == pal2.background()| no Evaluation Count:0 | yes Evaluation Count:43 |
| 0-43 |
| 1314 | pal2.setColor(QPalette::Highlight, pb->palette.color(QPalette::Active, | 0 |
| 1315 | QPalette::Highlight)); never executed: pal2.setColor(QPalette::Highlight, pb->palette.color(QPalette::Active, QPalette::Highlight)); | 0 |
| 1316 | bool reverse = ((!vertical && (pb->direction == Qt::RightToLeft)) || vertical); partially evaluated: !vertical| yes Evaluation Count:43 | no Evaluation Count:0 |
partially evaluated: (pb->direction == Qt::RightToLeft)| no Evaluation Count:0 | yes Evaluation Count:43 |
partially evaluated: vertical| no Evaluation Count:0 | yes Evaluation Count:43 |
| 0-43 |
| 1317 | if (inverted) partially evaluated: inverted| no Evaluation Count:0 | yes Evaluation Count:43 |
| 0-43 |
| 1318 | reverse = !reverse; never executed: reverse = !reverse; | 0 |
| 1319 | int w = rect.width(); | - |
| 1320 | if (pb->minimum == 0 && pb->maximum == 0) { evaluated: pb->minimum == 0| yes Evaluation Count:26 | yes Evaluation Count:17 |
partially evaluated: pb->maximum == 0| no Evaluation Count:0 | yes Evaluation Count:26 |
| 0-26 |
| 1321 | | - |
| 1322 | int x = (progress - minimum) % (w * 2); | - |
| 1323 | if (x > w) | 0 |
| 1324 | x = 2 * w - x; never executed: x = 2 * w - x; | 0 |
| 1325 | x = reverse ? rect.right() - x : x + rect.x(); | 0 |
| 1326 | p->setPen(QPen(pal2.highlight().color(), 4)); | - |
| 1327 | p->drawLine(x, rect.y(), x, rect.height()); | - |
| 1328 | } else { | 0 |
| 1329 | const int unit_width = proxy()->pixelMetric(PM_ProgressBarChunkWidth, pb, widget); | - |
| 1330 | if (!unit_width) partially evaluated: !unit_width| no Evaluation Count:0 | yes Evaluation Count:43 |
| 0-43 |
| 1331 | return; | 0 |
| 1332 | | - |
| 1333 | int u; | - |
| 1334 | if (unit_width > 1) partially evaluated: unit_width > 1| yes Evaluation Count:43 | no Evaluation Count:0 |
| 0-43 |
| 1335 | u = ((rect.width() + unit_width) / unit_width); executed: u = ((rect.width() + unit_width) / unit_width);Execution Count:43 | 43 |
| 1336 | else | - |
| 1337 | u = w / unit_width; never executed: u = w / unit_width; | 0 |
| 1338 | qint64 p_v = progress - minimum; | - |
| 1339 | qint64 t_s = (maximum - minimum) ? (maximum - minimum) : qint64(1); evaluated: (maximum - minimum)| yes Evaluation Count:40 | yes Evaluation Count:3 |
| 3-40 |
| 1340 | | - |
| 1341 | if (u > 0 && p_v >= 2147483647 / u && t_s >= u) { partially evaluated: u > 0| yes Evaluation Count:43 | no Evaluation Count:0 |
partially evaluated: p_v >= 2147483647 / u| no Evaluation Count:0 | yes Evaluation Count:43 |
never evaluated: t_s >= u | 0-43 |
| 1342 | | - |
| 1343 | p_v /= u; | - |
| 1344 | t_s /= u; | - |
| 1345 | } | 0 |
| 1346 | | - |
| 1347 | | - |
| 1348 | int tnu, nu; | - |
| 1349 | tnu = nu = p_v * u / t_s; | - |
| 1350 | | - |
| 1351 | if (nu * unit_width > w) evaluated: nu * unit_width > w| yes Evaluation Count:2 | yes Evaluation Count:41 |
| 2-41 |
| 1352 | --nu; executed: --nu;Execution Count:2 | 2 |
| 1353 | | - |
| 1354 | | - |
| 1355 | | - |
| 1356 | | - |
| 1357 | | - |
| 1358 | int x = 0; | - |
| 1359 | int x0 = reverse ? rect.right() - ((unit_width > 1) ? unit_width : 0) partially evaluated: reverse| no Evaluation Count:0 | yes Evaluation Count:43 |
| 0-43 |
| 1360 | : rect.x(); | - |
| 1361 | | - |
| 1362 | QStyleOptionProgressBarV2 pbBits = *pb; | - |
| 1363 | pbBits.rect = rect; | - |
| 1364 | pbBits.palette = pal2; | - |
| 1365 | int myY = pbBits.rect.y(); | - |
| 1366 | int myHeight = pbBits.rect.height(); | - |
| 1367 | pbBits.state = State_None; | - |
| 1368 | for (int i = 0; i < nu; ++i) { evaluated: i < nu| yes Evaluation Count:197 | yes Evaluation Count:43 |
| 43-197 |
| 1369 | pbBits.rect.setRect(x0 + x, myY, unit_width, myHeight); | - |
| 1370 | pbBits.rect = m.mapRect(QRectF(pbBits.rect)).toRect(); | - |
| 1371 | proxy()->drawPrimitive(PE_IndicatorProgressChunk, &pbBits, p, widget); | - |
| 1372 | x += reverse ? -unit_width : unit_width; partially evaluated: reverse| no Evaluation Count:0 | yes Evaluation Count:197 |
| 0-197 |
| 1373 | } executed: }Execution Count:197 | 197 |
| 1374 | | - |
| 1375 | | - |
| 1376 | | - |
| 1377 | if (nu < tnu) { evaluated: nu < tnu| yes Evaluation Count:2 | yes Evaluation Count:41 |
| 2-41 |
| 1378 | int pixels_left = w - (nu * unit_width); | - |
| 1379 | int offset = reverse ? x0 + x + unit_width-pixels_left : x0 + x; partially evaluated: reverse| no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
| 1380 | pbBits.rect.setRect(offset, myY, pixels_left, myHeight); | - |
| 1381 | pbBits.rect = m.mapRect(QRectF(pbBits.rect)).toRect(); | - |
| 1382 | proxy()->drawPrimitive(PE_IndicatorProgressChunk, &pbBits, p, widget); | - |
| 1383 | } executed: }Execution Count:2 | 2 |
| 1384 | } executed: }Execution Count:43 | 43 |
| 1385 | } | - |
| 1386 | break; executed: break;Execution Count:43 | 43 |
| 1387 | | - |
| 1388 | case CE_HeaderLabel: | - |
| 1389 | if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt)) { evaluated: const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt)| yes Evaluation Count:2103 | yes Evaluation Count:4 |
| 4-2103 |
| 1390 | QRect rect = header->rect; | - |
| 1391 | if (!header->icon.isNull()) { evaluated: !header->icon.isNull()| yes Evaluation Count:34 | yes Evaluation Count:2069 |
| 34-2069 |
| 1392 | QPixmap pixmap | - |
| 1393 | = header->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize), (header->state & State_Enabled) ? QIcon::Normal : QIcon::Disabled); | - |
| 1394 | int pixw = pixmap.width(); | - |
| 1395 | | - |
| 1396 | QRect aligned = alignedRect(header->direction, QFlag(header->iconAlignment), pixmap.size(), rect); | - |
| 1397 | QRect inter = aligned.intersected(rect); | - |
| 1398 | p->drawPixmap(inter.x(), inter.y(), pixmap, inter.x() - aligned.x(), inter.y() - aligned.y(), inter.width(), inter.height()); | - |
| 1399 | | - |
| 1400 | if (header->direction == Qt::LeftToRight) partially evaluated: header->direction == Qt::LeftToRight| yes Evaluation Count:34 | no Evaluation Count:0 |
| 0-34 |
| 1401 | rect.setLeft(rect.left() + pixw + 2); executed: rect.setLeft(rect.left() + pixw + 2);Execution Count:34 | 34 |
| 1402 | else | - |
| 1403 | rect.setRight(rect.right() - pixw - 2); never executed: rect.setRight(rect.right() - pixw - 2); | 0 |
| 1404 | } | - |
| 1405 | if (header->state & QStyle::State_On) { evaluated: header->state & QStyle::State_On| yes Evaluation Count:475 | yes Evaluation Count:1628 |
| 475-1628 |
| 1406 | QFont fnt = p->font(); | - |
| 1407 | fnt.setBold(true); | - |
| 1408 | p->setFont(fnt); | - |
| 1409 | } executed: }Execution Count:475 | 475 |
| 1410 | proxy()->drawItemText(p, rect, header->textAlignment, header->palette, | - |
| 1411 | (header->state & State_Enabled), header->text, QPalette::ButtonText); | - |
| 1412 | } executed: }Execution Count:2103 | 2103 |
| 1413 | break; executed: break;Execution Count:2107 | 2107 |
| 1414 | | - |
| 1415 | case CE_ToolButtonLabel: | - |
| 1416 | if (const QStyleOptionToolButton *toolbutton | 4-451 |
| 1417 | = qstyleoption_cast<const QStyleOptionToolButton *>(opt)) { evaluated: const QStyleOptionToolButton *toolbutton = qstyleoption_cast<const QStyleOptionToolButton *>(opt)| yes Evaluation Count:451 | yes Evaluation Count:4 |
| 4-451 |
| 1418 | QRect rect = toolbutton->rect; | - |
| 1419 | int shiftX = 0; | - |
| 1420 | int shiftY = 0; | - |
| 1421 | if (toolbutton->state & (State_Sunken | State_On)) { evaluated: toolbutton->state & (State_Sunken | State_On)| yes Evaluation Count:54 | yes Evaluation Count:397 |
| 54-397 |
| 1422 | shiftX = proxy()->pixelMetric(PM_ButtonShiftHorizontal, toolbutton, widget); | - |
| 1423 | shiftY = proxy()->pixelMetric(PM_ButtonShiftVertical, toolbutton, widget); | - |
| 1424 | } executed: }Execution Count:54 | 54 |
| 1425 | | - |
| 1426 | bool hasArrow = toolbutton->features & QStyleOptionToolButton::Arrow; | - |
| 1427 | if (((!hasArrow && toolbutton->icon.isNull()) && !toolbutton->text.isEmpty()) partially evaluated: !hasArrow| yes Evaluation Count:451 | no Evaluation Count:0 |
evaluated: toolbutton->icon.isNull()| yes Evaluation Count:111 | yes Evaluation Count:340 |
evaluated: !toolbutton->text.isEmpty()| yes Evaluation Count:102 | yes Evaluation Count:9 |
| 0-451 |
| 1428 | || toolbutton->toolButtonStyle == Qt::ToolButtonTextOnly) { partially evaluated: toolbutton->toolButtonStyle == Qt::ToolButtonTextOnly| no Evaluation Count:0 | yes Evaluation Count:349 |
| 0-349 |
| 1429 | int alignment = Qt::AlignCenter | Qt::TextShowMnemonic; | - |
| 1430 | if (!proxy()->styleHint(SH_UnderlineShortcut, opt, widget)) partially evaluated: !proxy()->styleHint(SH_UnderlineShortcut, opt, widget)| no Evaluation Count:0 | yes Evaluation Count:102 |
| 0-102 |
| 1431 | alignment |= Qt::TextHideMnemonic; never executed: alignment |= Qt::TextHideMnemonic; | 0 |
| 1432 | rect.translate(shiftX, shiftY); | - |
| 1433 | p->setFont(toolbutton->font); | - |
| 1434 | proxy()->drawItemText(p, rect, alignment, toolbutton->palette, | - |
| 1435 | opt->state & State_Enabled, toolbutton->text, | - |
| 1436 | QPalette::ButtonText); | - |
| 1437 | } else { executed: }Execution Count:102 | 102 |
| 1438 | QPixmap pm; | - |
| 1439 | QSize pmSize = toolbutton->iconSize; | - |
| 1440 | if (!toolbutton->icon.isNull()) { evaluated: !toolbutton->icon.isNull()| yes Evaluation Count:340 | yes Evaluation Count:9 |
| 9-340 |
| 1441 | QIcon::State state = toolbutton->state & State_On ? QIcon::On : QIcon::Off; partially evaluated: toolbutton->state & State_On| no Evaluation Count:0 | yes Evaluation Count:340 |
| 0-340 |
| 1442 | QIcon::Mode mode; | - |
| 1443 | if (!(toolbutton->state & State_Enabled)) evaluated: !(toolbutton->state & State_Enabled)| yes Evaluation Count:63 | yes Evaluation Count:277 |
| 63-277 |
| 1444 | mode = QIcon::Disabled; executed: mode = QIcon::Disabled;Execution Count:63 | 63 |
| 1445 | else if ((opt->state & State_MouseOver) && (opt->state & State_AutoRaise)) evaluated: (opt->state & State_MouseOver)| yes Evaluation Count:3 | yes Evaluation Count:274 |
partially evaluated: (opt->state & State_AutoRaise)| yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-274 |
| 1446 | mode = QIcon::Active; executed: mode = QIcon::Active;Execution Count:3 | 3 |
| 1447 | else | - |
| 1448 | mode = QIcon::Normal; executed: mode = QIcon::Normal;Execution Count:274 | 274 |
| 1449 | pm = toolbutton->icon.pixmap(toolbutton->rect.size().boundedTo(toolbutton->iconSize), | - |
| 1450 | mode, state); | - |
| 1451 | pmSize = pm.size(); | - |
| 1452 | } executed: }Execution Count:340 | 340 |
| 1453 | | - |
| 1454 | if (toolbutton->toolButtonStyle != Qt::ToolButtonIconOnly) { partially evaluated: toolbutton->toolButtonStyle != Qt::ToolButtonIconOnly| no Evaluation Count:0 | yes Evaluation Count:349 |
| 0-349 |
| 1455 | p->setFont(toolbutton->font); | - |
| 1456 | QRect pr = rect, | - |
| 1457 | tr = rect; | - |
| 1458 | int alignment = Qt::TextShowMnemonic; | - |
| 1459 | if (!proxy()->styleHint(SH_UnderlineShortcut, opt, widget)) never evaluated: !proxy()->styleHint(SH_UnderlineShortcut, opt, widget) | 0 |
| 1460 | alignment |= Qt::TextHideMnemonic; never executed: alignment |= Qt::TextHideMnemonic; | 0 |
| 1461 | | - |
| 1462 | if (toolbutton->toolButtonStyle == Qt::ToolButtonTextUnderIcon) { never evaluated: toolbutton->toolButtonStyle == Qt::ToolButtonTextUnderIcon | 0 |
| 1463 | pr.setHeight(pmSize.height() + 6); | - |
| 1464 | tr.adjust(0, pr.height() - 1, 0, -2); | - |
| 1465 | pr.translate(shiftX, shiftY); | - |
| 1466 | if (!hasArrow) { never evaluated: !hasArrow | 0 |
| 1467 | proxy()->drawItemPixmap(p, pr, Qt::AlignCenter, pm); | - |
| 1468 | } else { | 0 |
| 1469 | drawArrow(this, toolbutton, pr, p, widget); | - |
| 1470 | } | 0 |
| 1471 | alignment |= Qt::AlignCenter; | - |
| 1472 | } else { | 0 |
| 1473 | pr.setWidth(pmSize.width() + 8); | - |
| 1474 | tr.adjust(pr.width(), 0, 0, 0); | - |
| 1475 | pr.translate(shiftX, shiftY); | - |
| 1476 | if (!hasArrow) { never evaluated: !hasArrow | 0 |
| 1477 | proxy()->drawItemPixmap(p, QStyle::visualRect(opt->direction, rect, pr), Qt::AlignCenter, pm); | - |
| 1478 | } else { | 0 |
| 1479 | drawArrow(this, toolbutton, pr, p, widget); | - |
| 1480 | } | 0 |
| 1481 | alignment |= Qt::AlignLeft | Qt::AlignVCenter; | - |
| 1482 | } | 0 |
| 1483 | tr.translate(shiftX, shiftY); | - |
| 1484 | proxy()->drawItemText(p, QStyle::visualRect(opt->direction, rect, tr), alignment, toolbutton->palette, | - |
| 1485 | toolbutton->state & State_Enabled, toolbutton->text, | - |
| 1486 | QPalette::ButtonText); | - |
| 1487 | } else { | 0 |
| 1488 | rect.translate(shiftX, shiftY); | - |
| 1489 | if (hasArrow) { partially evaluated: hasArrow| no Evaluation Count:0 | yes Evaluation Count:349 |
| 0-349 |
| 1490 | drawArrow(this, toolbutton, rect, p, widget); | - |
| 1491 | } else { | 0 |
| 1492 | proxy()->drawItemPixmap(p, rect, Qt::AlignCenter, pm); | - |
| 1493 | } executed: }Execution Count:349 | 349 |
| 1494 | } | - |
| 1495 | } | - |
| 1496 | } | - |
| 1497 | break; executed: break;Execution Count:455 | 455 |
| 1498 | | - |
| 1499 | | - |
| 1500 | case CE_ToolBoxTab: | - |
| 1501 | if (const QStyleOptionToolBox *tb = qstyleoption_cast<const QStyleOptionToolBox *>(opt)) { partially evaluated: const QStyleOptionToolBox *tb = qstyleoption_cast<const QStyleOptionToolBox *>(opt)| no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
| 1502 | proxy()->drawControl(CE_ToolBoxTabShape, tb, p, widget); | - |
| 1503 | proxy()->drawControl(CE_ToolBoxTabLabel, tb, p, widget); | - |
| 1504 | } | 0 |
| 1505 | break; executed: break;Execution Count:4 | 4 |
| 1506 | case CE_ToolBoxTabShape: | - |
| 1507 | if (const QStyleOptionToolBox *tb = qstyleoption_cast<const QStyleOptionToolBox *>(opt)) { partially evaluated: const QStyleOptionToolBox *tb = qstyleoption_cast<const QStyleOptionToolBox *>(opt)| no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
| 1508 | int d = 20 + tb->rect.height() - 3; | - |
| 1509 | QPolygon a(7); | - |
| 1510 | if (tb->direction != Qt::RightToLeft) { never evaluated: tb->direction != Qt::RightToLeft | 0 |
| 1511 | a.setPoint(0, -1, tb->rect.height() + 1); | - |
| 1512 | a.setPoint(1, -1, 1); | - |
| 1513 | a.setPoint(2, tb->rect.width() - d, 1); | - |
| 1514 | a.setPoint(3, tb->rect.width() - 20, tb->rect.height() - 2); | - |
| 1515 | a.setPoint(4, tb->rect.width() - 1, tb->rect.height() - 2); | - |
| 1516 | a.setPoint(5, tb->rect.width() - 1, tb->rect.height() + 1); | - |
| 1517 | a.setPoint(6, -1, tb->rect.height() + 1); | - |
| 1518 | } else { | 0 |
| 1519 | a.setPoint(0, tb->rect.width(), tb->rect.height() + 1); | - |
| 1520 | a.setPoint(1, tb->rect.width(), 1); | - |
| 1521 | a.setPoint(2, d - 1, 1); | - |
| 1522 | a.setPoint(3, 20 - 1, tb->rect.height() - 2); | - |
| 1523 | a.setPoint(4, 0, tb->rect.height() - 2); | - |
| 1524 | a.setPoint(5, 0, tb->rect.height() + 1); | - |
| 1525 | a.setPoint(6, tb->rect.width(), tb->rect.height() + 1); | - |
| 1526 | } | 0 |
| 1527 | | - |
| 1528 | p->setPen(tb->palette.mid().color().darker(150)); | - |
| 1529 | bool oldQt4CompatiblePainting = p->testRenderHint(QPainter::Qt4CompatiblePainting); | - |
| 1530 | p->setRenderHint(QPainter::Qt4CompatiblePainting); | - |
| 1531 | p->drawPolygon(a); | - |
| 1532 | p->setRenderHint(QPainter::Qt4CompatiblePainting, oldQt4CompatiblePainting); | - |
| 1533 | p->setPen(tb->palette.light().color()); | - |
| 1534 | if (tb->direction != Qt::RightToLeft) { never evaluated: tb->direction != Qt::RightToLeft | 0 |
| 1535 | p->drawLine(0, 2, tb->rect.width() - d, 2); | - |
| 1536 | p->drawLine(tb->rect.width() - d - 1, 2, tb->rect.width() - 21, tb->rect.height() - 1); | - |
| 1537 | p->drawLine(tb->rect.width() - 20, tb->rect.height() - 1, | - |
| 1538 | tb->rect.width(), tb->rect.height() - 1); | - |
| 1539 | } else { | 0 |
| 1540 | p->drawLine(tb->rect.width() - 1, 2, d - 1, 2); | - |
| 1541 | p->drawLine(d, 2, 20, tb->rect.height() - 1); | - |
| 1542 | p->drawLine(19, tb->rect.height() - 1, | - |
| 1543 | -1, tb->rect.height() - 1); | - |
| 1544 | } | 0 |
| 1545 | p->setBrush(Qt::NoBrush); | - |
| 1546 | } | 0 |
| 1547 | break; executed: break;Execution Count:1 | 1 |
| 1548 | | - |
| 1549 | | - |
| 1550 | case CE_TabBarTab: | - |
| 1551 | if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) { evaluated: const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)| yes Evaluation Count:51 | yes Evaluation Count:4 |
| 4-51 |
| 1552 | proxy()->drawControl(CE_TabBarTabShape, tab, p, widget); | - |
| 1553 | proxy()->drawControl(CE_TabBarTabLabel, tab, p, widget); | - |
| 1554 | } executed: }Execution Count:51 | 51 |
| 1555 | break; executed: break;Execution Count:55 | 55 |
| 1556 | case CE_TabBarTabShape: | - |
| 1557 | if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) { never evaluated: const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt) | 0 |
| 1558 | p->save(); | - |
| 1559 | | - |
| 1560 | QRect rect(tab->rect); | - |
| 1561 | bool selected = tab->state & State_Selected; | - |
| 1562 | bool onlyOne = tab->position == QStyleOptionTab::OnlyOneTab; | - |
| 1563 | int tabOverlap = onlyOne ? 0 : proxy()->pixelMetric(PM_TabBarTabOverlap, opt, widget); | 0 |
| 1564 | | - |
| 1565 | if (!selected) { never evaluated: !selected | 0 |
| 1566 | switch (tab->shape) { | - |
| 1567 | case QTabBar::TriangularNorth: | - |
| 1568 | rect.adjust(0, 0, 0, -tabOverlap); | - |
| 1569 | if(!selected) never evaluated: !selected | 0 |
| 1570 | rect.adjust(1, 1, -1, 0); never executed: rect.adjust(1, 1, -1, 0); | 0 |
| 1571 | break; | 0 |
| 1572 | case QTabBar::TriangularSouth: | - |
| 1573 | rect.adjust(0, tabOverlap, 0, 0); | - |
| 1574 | if(!selected) never evaluated: !selected | 0 |
| 1575 | rect.adjust(1, 0, -1, -1); never executed: rect.adjust(1, 0, -1, -1); | 0 |
| 1576 | break; | 0 |
| 1577 | case QTabBar::TriangularEast: | - |
| 1578 | rect.adjust(tabOverlap, 0, 0, 0); | - |
| 1579 | if(!selected) never evaluated: !selected | 0 |
| 1580 | rect.adjust(0, 1, -1, -1); never executed: rect.adjust(0, 1, -1, -1); | 0 |
| 1581 | break; | 0 |
| 1582 | case QTabBar::TriangularWest: | - |
| 1583 | rect.adjust(0, 0, -tabOverlap, 0); | - |
| 1584 | if(!selected) never evaluated: !selected | 0 |
| 1585 | rect.adjust(1, 1, 0, -1); never executed: rect.adjust(1, 1, 0, -1); | 0 |
| 1586 | break; | 0 |
| 1587 | default: | - |
| 1588 | break; | 0 |
| 1589 | } | - |
| 1590 | } | 0 |
| 1591 | | - |
| 1592 | p->setPen(QPen(tab->palette.foreground(), 0)); | - |
| 1593 | if (selected) { never evaluated: selected | 0 |
| 1594 | p->setBrush(tab->palette.base()); | - |
| 1595 | } else { | 0 |
| 1596 | if (widget && widget->parentWidget()) never evaluated: widget->parentWidget() | 0 |
| 1597 | p->setBrush(widget->parentWidget()->palette().background()); never executed: p->setBrush(widget->parentWidget()->palette().background()); | 0 |
| 1598 | else | - |
| 1599 | p->setBrush(tab->palette.background()); never executed: p->setBrush(tab->palette.background()); | 0 |
| 1600 | } | - |
| 1601 | | - |
| 1602 | int y; | - |
| 1603 | int x; | - |
| 1604 | QPolygon a(10); | - |
| 1605 | switch (tab->shape) { | - |
| 1606 | case QTabBar::TriangularNorth: | - |
| 1607 | case QTabBar::TriangularSouth: { | - |
| 1608 | a.setPoint(0, 0, -1); | - |
| 1609 | a.setPoint(1, 0, 0); | - |
| 1610 | y = rect.height() - 2; | - |
| 1611 | x = y / 3; | - |
| 1612 | a.setPoint(2, x++, y - 1); | - |
| 1613 | ++x; | - |
| 1614 | a.setPoint(3, x++, y++); | - |
| 1615 | a.setPoint(4, x, y); | - |
| 1616 | | - |
| 1617 | int i; | - |
| 1618 | int right = rect.width() - 1; | - |
| 1619 | for (i = 0; i < 5; ++i) | 0 |
| 1620 | a.setPoint(9 - i, right - a.point(i).x(), a.point(i).y()); never executed: a.setPoint(9 - i, right - a.point(i).x(), a.point(i).y()); | 0 |
| 1621 | if (tab->shape == QTabBar::TriangularNorth) never evaluated: tab->shape == QTabBar::TriangularNorth | 0 |
| 1622 | for (i = 0; i < 10; ++i) | 0 |
| 1623 | a.setPoint(i, a.point(i).x(), rect.height() - 1 - a.point(i).y()); never executed: a.setPoint(i, a.point(i).x(), rect.height() - 1 - a.point(i).y()); | 0 |
| 1624 | | - |
| 1625 | a.translate(rect.left(), rect.top()); | - |
| 1626 | p->setRenderHint(QPainter::Antialiasing); | - |
| 1627 | p->translate(0, 0.5); | - |
| 1628 | | - |
| 1629 | QPainterPath path; | - |
| 1630 | path.addPolygon(a); | - |
| 1631 | p->drawPath(path); | - |
| 1632 | break; } | 0 |
| 1633 | case QTabBar::TriangularEast: | - |
| 1634 | case QTabBar::TriangularWest: { | - |
| 1635 | a.setPoint(0, -1, 0); | - |
| 1636 | a.setPoint(1, 0, 0); | - |
| 1637 | x = rect.width() - 2; | - |
| 1638 | y = x / 3; | - |
| 1639 | a.setPoint(2, x - 1, y++); | - |
| 1640 | ++y; | - |
| 1641 | a.setPoint(3, x++, y++); | - |
| 1642 | a.setPoint(4, x, y); | - |
| 1643 | int i; | - |
| 1644 | int bottom = rect.height() - 1; | - |
| 1645 | for (i = 0; i < 5; ++i) | 0 |
| 1646 | a.setPoint(9 - i, a.point(i).x(), bottom - a.point(i).y()); never executed: a.setPoint(9 - i, a.point(i).x(), bottom - a.point(i).y()); | 0 |
| 1647 | if (tab->shape == QTabBar::TriangularWest) never evaluated: tab->shape == QTabBar::TriangularWest | 0 |
| 1648 | for (i = 0; i < 10; ++i) | 0 |
| 1649 | a.setPoint(i, rect.width() - 1 - a.point(i).x(), a.point(i).y()); never executed: a.setPoint(i, rect.width() - 1 - a.point(i).x(), a.point(i).y()); | 0 |
| 1650 | a.translate(rect.left(), rect.top()); | - |
| 1651 | p->setRenderHint(QPainter::Antialiasing); | - |
| 1652 | p->translate(0.5, 0); | - |
| 1653 | QPainterPath path; | - |
| 1654 | path.addPolygon(a); | - |
| 1655 | p->drawPath(path); | - |
| 1656 | break; } | 0 |
| 1657 | default: | - |
| 1658 | break; | 0 |
| 1659 | } | - |
| 1660 | p->restore(); | - |
| 1661 | } | 0 |
| 1662 | break; | 0 |
| 1663 | case CE_ToolBoxTabLabel: | - |
| 1664 | if (const QStyleOptionToolBox *tb = qstyleoption_cast<const QStyleOptionToolBox *>(opt)) { partially evaluated: const QStyleOptionToolBox *tb = qstyleoption_cast<const QStyleOptionToolBox *>(opt)| no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
| 1665 | bool enabled = tb->state & State_Enabled; | - |
| 1666 | bool selected = tb->state & State_Selected; | - |
| 1667 | QPixmap pm = tb->icon.pixmap(proxy()->pixelMetric(QStyle::PM_SmallIconSize, tb, widget), | - |
| 1668 | enabled ? QIcon::Normal : QIcon::Disabled); | - |
| 1669 | | - |
| 1670 | QRect cr = subElementRect(QStyle::SE_ToolBoxTabContents, tb, widget); | - |
| 1671 | QRect tr, ir; | - |
| 1672 | int ih = 0; | - |
| 1673 | if (pm.isNull()) { never evaluated: pm.isNull() | 0 |
| 1674 | tr = cr; | - |
| 1675 | tr.adjust(4, 0, -8, 0); | - |
| 1676 | } else { | 0 |
| 1677 | int iw = pm.width() + 4; | - |
| 1678 | ih = pm.height(); | - |
| 1679 | ir = QRect(cr.left() + 4, cr.top(), iw + 2, ih); | - |
| 1680 | tr = QRect(ir.right(), cr.top(), cr.width() - ir.right() - 4, cr.height()); | - |
| 1681 | } | 0 |
| 1682 | | - |
| 1683 | if (selected && proxy()->styleHint(QStyle::SH_ToolBox_SelectedPageTitleBold, tb, widget)) { never evaluated: selected never evaluated: proxy()->styleHint(QStyle::SH_ToolBox_SelectedPageTitleBold, tb, widget) | 0 |
| 1684 | QFont f(p->font()); | - |
| 1685 | f.setBold(true); | - |
| 1686 | p->setFont(f); | - |
| 1687 | } | 0 |
| 1688 | | - |
| 1689 | QString txt = tb->fontMetrics.elidedText(tb->text, Qt::ElideRight, tr.width()); | - |
| 1690 | | - |
| 1691 | if (ih) | 0 |
| 1692 | p->drawPixmap(ir.left(), (tb->rect.height() - ih) / 2, pm); never executed: p->drawPixmap(ir.left(), (tb->rect.height() - ih) / 2, pm); | 0 |
| 1693 | | - |
| 1694 | int alignment = Qt::AlignLeft | Qt::AlignVCenter | Qt::TextShowMnemonic; | - |
| 1695 | if (!proxy()->styleHint(QStyle::SH_UnderlineShortcut, tb, widget)) never evaluated: !proxy()->styleHint(QStyle::SH_UnderlineShortcut, tb, widget) | 0 |
| 1696 | alignment |= Qt::TextHideMnemonic; never executed: alignment |= Qt::TextHideMnemonic; | 0 |
| 1697 | proxy()->drawItemText(p, tr, alignment, tb->palette, enabled, txt, QPalette::ButtonText); | - |
| 1698 | | - |
| 1699 | if (!txt.isEmpty() && opt->state & State_HasFocus) { never evaluated: !txt.isEmpty() never evaluated: opt->state & State_HasFocus | 0 |
| 1700 | QStyleOptionFocusRect opt; | - |
| 1701 | opt.rect = tr; | - |
| 1702 | opt.palette = tb->palette; | - |
| 1703 | opt.state = QStyle::State_None; | - |
| 1704 | proxy()->drawPrimitive(QStyle::PE_FrameFocusRect, &opt, p, widget); | - |
| 1705 | } | 0 |
| 1706 | } | 0 |
| 1707 | break; executed: break;Execution Count:4 | 4 |
| 1708 | case CE_TabBarTabLabel: | - |
| 1709 | if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) { evaluated: const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)| yes Evaluation Count:51 | yes Evaluation Count:4 |
| 4-51 |
| 1710 | QStyleOptionTabV3 tabV2(*tab); | - |
| 1711 | QRect tr = tabV2.rect; | - |
| 1712 | bool verticalTabs = tabV2.shape == QTabBar::RoundedEast evaluated: tabV2.shape == QTabBar::RoundedEast| yes Evaluation Count:2 | yes Evaluation Count:49 |
| 2-49 |
| 1713 | || tabV2.shape == QTabBar::RoundedWest evaluated: tabV2.shape == QTabBar::RoundedWest| yes Evaluation Count:2 | yes Evaluation Count:47 |
| 2-47 |
| 1714 | || tabV2.shape == QTabBar::TriangularEast partially evaluated: tabV2.shape == QTabBar::TriangularEast| no Evaluation Count:0 | yes Evaluation Count:47 |
| 0-47 |
| 1715 | || tabV2.shape == QTabBar::TriangularWest; partially evaluated: tabV2.shape == QTabBar::TriangularWest| no Evaluation Count:0 | yes Evaluation Count:47 |
| 0-47 |
| 1716 | | - |
| 1717 | int alignment = Qt::AlignCenter | Qt::TextShowMnemonic; | - |
| 1718 | if (!proxy()->styleHint(SH_UnderlineShortcut, opt, widget)) partially evaluated: !proxy()->styleHint(SH_UnderlineShortcut, opt, widget)| no Evaluation Count:0 | yes Evaluation Count:51 |
| 0-51 |
| 1719 | alignment |= Qt::TextHideMnemonic; never executed: alignment |= Qt::TextHideMnemonic; | 0 |
| 1720 | | - |
| 1721 | if (verticalTabs) { evaluated: verticalTabs| yes Evaluation Count:4 | yes Evaluation Count:47 |
| 4-47 |
| 1722 | p->save(); | - |
| 1723 | int newX, newY, newRot; | - |
| 1724 | if (tabV2.shape == QTabBar::RoundedEast || tabV2.shape == QTabBar::TriangularEast) { evaluated: tabV2.shape == QTabBar::RoundedEast| yes Evaluation Count:2 | yes Evaluation Count:2 |
partially evaluated: tabV2.shape == QTabBar::TriangularEast| no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
| 1725 | newX = tr.width() + tr.x(); | - |
| 1726 | newY = tr.y(); | - |
| 1727 | newRot = 90; | - |
| 1728 | } else { executed: }Execution Count:2 | 2 |
| 1729 | newX = tr.x(); | - |
| 1730 | newY = tr.y() + tr.height(); | - |
| 1731 | newRot = -90; | - |
| 1732 | } executed: }Execution Count:2 | 2 |
| 1733 | QTransform m = QTransform::fromTranslate(newX, newY); | - |
| 1734 | m.rotate(newRot); | - |
| 1735 | p->setTransform(m, true); | - |
| 1736 | } executed: }Execution Count:4 | 4 |
| 1737 | QRect iconRect; | - |
| 1738 | d->tabLayout(&tabV2, widget, &tr, &iconRect); | - |
| 1739 | tr = proxy()->subElementRect(SE_TabBarTabText, opt, widget); | - |
| 1740 | | - |
| 1741 | if (!tabV2.icon.isNull()) { partially evaluated: !tabV2.icon.isNull()| no Evaluation Count:0 | yes Evaluation Count:51 |
| 0-51 |
| 1742 | QPixmap tabIcon = tabV2.icon.pixmap(tabV2.iconSize, | - |
| 1743 | (tabV2.state & State_Enabled) ? QIcon::Normal | - |
| 1744 | : QIcon::Disabled, | - |
| 1745 | (tabV2.state & State_Selected) ? QIcon::On | - |
| 1746 | : QIcon::Off); | - |
| 1747 | p->drawPixmap(iconRect.x(), iconRect.y(), tabIcon); | - |
| 1748 | } | 0 |
| 1749 | | - |
| 1750 | proxy()->drawItemText(p, tr, alignment, tab->palette, tab->state & State_Enabled, tab->text, QPalette::WindowText); | - |
| 1751 | if (verticalTabs) evaluated: verticalTabs| yes Evaluation Count:4 | yes Evaluation Count:47 |
| 4-47 |
| 1752 | p->restore(); executed: p->restore();Execution Count:4 | 4 |
| 1753 | | - |
| 1754 | if (tabV2.state & State_HasFocus) { evaluated: tabV2.state & State_HasFocus| yes Evaluation Count:16 | yes Evaluation Count:35 |
| 16-35 |
| 1755 | const int OFFSET = 1 + pixelMetric(PM_DefaultFrameWidth); | - |
| 1756 | | - |
| 1757 | int x1, x2; | - |
| 1758 | x1 = tabV2.rect.left(); | - |
| 1759 | x2 = tabV2.rect.right() - 1; | - |
| 1760 | | - |
| 1761 | QStyleOptionFocusRect fropt; | - |
| 1762 | fropt.QStyleOption::operator=(*tab); | - |
| 1763 | fropt.rect.setRect(x1 + 1 + OFFSET, tabV2.rect.y() + OFFSET, | - |
| 1764 | x2 - x1 - 2*OFFSET, tabV2.rect.height() - 2*OFFSET); | - |
| 1765 | drawPrimitive(PE_FrameFocusRect, &fropt, p, widget); | - |
| 1766 | } executed: }Execution Count:16 | 16 |
| 1767 | } executed: }Execution Count:51 | 51 |
| 1768 | break; executed: break;Execution Count:55 | 55 |
| 1769 | | - |
| 1770 | | - |
| 1771 | case CE_SizeGrip: { | - |
| 1772 | p->save(); | - |
| 1773 | int x, y, w, h; | - |
| 1774 | opt->rect.getRect(&x, &y, &w, &h); | - |
| 1775 | | - |
| 1776 | int sw = qMin(h, w); | - |
| 1777 | if (h > w) partially evaluated: h > w| no Evaluation Count:0 | yes Evaluation Count:48 |
| 0-48 |
| 1778 | p->translate(0, h - w); never executed: p->translate(0, h - w); | 0 |
| 1779 | else | - |
| 1780 | p->translate(w - h, 0); executed: p->translate(w - h, 0);Execution Count:48 | 48 |
| 1781 | | - |
| 1782 | int sx = x; | - |
| 1783 | int sy = y; | - |
| 1784 | int s = sw / 3; | - |
| 1785 | | - |
| 1786 | Qt::Corner corner; | - |
| 1787 | if (const QStyleOptionSizeGrip *sgOpt = qstyleoption_cast<const QStyleOptionSizeGrip *>(opt)) evaluated: const QStyleOptionSizeGrip *sgOpt = qstyleoption_cast<const QStyleOptionSizeGrip *>(opt)| yes Evaluation Count:45 | yes Evaluation Count:3 |
| 3-45 |
| 1788 | corner = sgOpt->corner; executed: corner = sgOpt->corner;Execution Count:45 | 45 |
| 1789 | else if (opt->direction == Qt::RightToLeft) partially evaluated: opt->direction == Qt::RightToLeft| no Evaluation Count:0 | yes Evaluation Count:3 |
| 0-3 |
| 1790 | corner = Qt::BottomLeftCorner; never executed: corner = Qt::BottomLeftCorner; | 0 |
| 1791 | else | - |
| 1792 | corner = Qt::BottomRightCorner; executed: corner = Qt::BottomRightCorner;Execution Count:3 | 3 |
| 1793 | | - |
| 1794 | if (corner == Qt::BottomLeftCorner) { evaluated: corner == Qt::BottomLeftCorner| yes Evaluation Count:1 | yes Evaluation Count:47 |
| 1-47 |
| 1795 | sx = x + sw; | - |
| 1796 | for (int i = 0; i < 4; ++i) { evaluated: i < 4| yes Evaluation Count:4 | yes Evaluation Count:1 |
| 1-4 |
| 1797 | p->setPen(QPen(opt->palette.light().color(), 1)); | - |
| 1798 | p->drawLine(x, sy - 1 , sx + 1, sw); | - |
| 1799 | p->setPen(QPen(opt->palette.dark().color(), 1)); | - |
| 1800 | p->drawLine(x, sy, sx, sw); | - |
| 1801 | p->setPen(QPen(opt->palette.dark().color(), 1)); | - |
| 1802 | p->drawLine(x, sy + 1, sx - 1, sw); | - |
| 1803 | sx -= s; | - |
| 1804 | sy += s; | - |
| 1805 | } executed: }Execution Count:4 | 4 |
| 1806 | } else if (corner == Qt::BottomRightCorner) { evaluated: corner == Qt::BottomRightCorner| yes Evaluation Count:44 | yes Evaluation Count:3 |
executed: }Execution Count:1 | 1-44 |
| 1807 | for (int i = 0; i < 4; ++i) { evaluated: i < 4| yes Evaluation Count:176 | yes Evaluation Count:44 |
| 44-176 |
| 1808 | p->setPen(QPen(opt->palette.light().color(), 1)); | - |
| 1809 | p->drawLine(sx - 1, sw, sw, sy - 1); | - |
| 1810 | p->setPen(QPen(opt->palette.dark().color(), 1)); | - |
| 1811 | p->drawLine(sx, sw, sw, sy); | - |
| 1812 | p->setPen(QPen(opt->palette.dark().color(), 1)); | - |
| 1813 | p->drawLine(sx + 1, sw, sw, sy + 1); | - |
| 1814 | sx += s; | - |
| 1815 | sy += s; | - |
| 1816 | } executed: }Execution Count:176 | 176 |
| 1817 | } else if (corner == Qt::TopRightCorner) { partially evaluated: corner == Qt::TopRightCorner| yes Evaluation Count:3 | no Evaluation Count:0 |
executed: }Execution Count:44 | 0-44 |
| 1818 | sy = y + sw; | - |
| 1819 | for (int i = 0; i < 4; ++i) { evaluated: i < 4| yes Evaluation Count:12 | yes Evaluation Count:3 |
| 3-12 |
| 1820 | p->setPen(QPen(opt->palette.light().color(), 1)); | - |
| 1821 | p->drawLine(sx - 1, y, sw, sy + 1); | - |
| 1822 | p->setPen(QPen(opt->palette.dark().color(), 1)); | - |
| 1823 | p->drawLine(sx, y, sw, sy); | - |
| 1824 | p->setPen(QPen(opt->palette.dark().color(), 1)); | - |
| 1825 | p->drawLine(sx + 1, y, sw, sy - 1); | - |
| 1826 | sx += s; | - |
| 1827 | sy -= s; | - |
| 1828 | } executed: }Execution Count:12 | 12 |
| 1829 | } else if (corner == Qt::TopLeftCorner) { never evaluated: corner == Qt::TopLeftCorner executed: }Execution Count:3 | 0-3 |
| 1830 | for (int i = 0; i < 4; ++i) { | 0 |
| 1831 | p->setPen(QPen(opt->palette.light().color(), 1)); | - |
| 1832 | p->drawLine(x, sy - 1, sx - 1, y); | - |
| 1833 | p->setPen(QPen(opt->palette.dark().color(), 1)); | - |
| 1834 | p->drawLine(x, sy, sx, y); | - |
| 1835 | p->setPen(QPen(opt->palette.dark().color(), 1)); | - |
| 1836 | p->drawLine(x, sy + 1, sx + 1, y); | - |
| 1837 | sx += s; | - |
| 1838 | sy += s; | - |
| 1839 | } | 0 |
| 1840 | } | 0 |
| 1841 | p->restore(); | - |
| 1842 | break; } executed: break;Execution Count:48 | 48 |
| 1843 | | - |
| 1844 | | - |
| 1845 | case CE_RubberBand: { | - |
| 1846 | if (const QStyleOptionRubberBand *rbOpt = qstyleoption_cast<const QStyleOptionRubberBand *>(opt)) { never evaluated: const QStyleOptionRubberBand *rbOpt = qstyleoption_cast<const QStyleOptionRubberBand *>(opt) | 0 |
| 1847 | QPixmap tiledPixmap(16, 16); | - |
| 1848 | QPainter pixmapPainter(&tiledPixmap); | - |
| 1849 | pixmapPainter.setPen(Qt::NoPen); | - |
| 1850 | pixmapPainter.setBrush(Qt::Dense4Pattern); | - |
| 1851 | pixmapPainter.setBackground(QBrush(opt->palette.base())); | - |
| 1852 | pixmapPainter.setBackgroundMode(Qt::OpaqueMode); | - |
| 1853 | pixmapPainter.drawRect(0, 0, tiledPixmap.width(), tiledPixmap.height()); | - |
| 1854 | pixmapPainter.end(); | - |
| 1855 | | - |
| 1856 | tiledPixmap = QPixmap::fromImage(tiledPixmap.toImage()); | - |
| 1857 | | - |
| 1858 | p->save(); | - |
| 1859 | QRect r = opt->rect; | - |
| 1860 | QStyleHintReturnMask mask; | - |
| 1861 | if (proxy()->styleHint(QStyle::SH_RubberBand_Mask, opt, widget, &mask)) never evaluated: proxy()->styleHint(QStyle::SH_RubberBand_Mask, opt, widget, &mask) | 0 |
| 1862 | p->setClipRegion(mask.region); never executed: p->setClipRegion(mask.region); | 0 |
| 1863 | p->drawTiledPixmap(r.x(), r.y(), r.width(), r.height(), tiledPixmap); | - |
| 1864 | p->setPen(opt->palette.color(QPalette::Active, QPalette::WindowText)); | - |
| 1865 | p->setBrush(Qt::NoBrush); | - |
| 1866 | p->drawRect(r.adjusted(0, 0, -1, -1)); | - |
| 1867 | if (rbOpt->shape == QRubberBand::Rectangle) never evaluated: rbOpt->shape == QRubberBand::Rectangle | 0 |
| 1868 | p->drawRect(r.adjusted(3, 3, -4, -4)); never executed: p->drawRect(r.adjusted(3, 3, -4, -4)); | 0 |
| 1869 | p->restore(); | - |
| 1870 | } | 0 |
| 1871 | break; } | 0 |
| 1872 | | - |
| 1873 | | - |
| 1874 | case CE_DockWidgetTitle: | - |
| 1875 | if (const QStyleOptionDockWidget *dwOpt = qstyleoption_cast<const QStyleOptionDockWidget *>(opt)) { never evaluated: const QStyleOptionDockWidget *dwOpt = qstyleoption_cast<const QStyleOptionDockWidget *>(opt) | 0 |
| 1876 | QRect r = dwOpt->rect.adjusted(0, 0, -1, -1); | - |
| 1877 | if (dwOpt->movable) { never evaluated: dwOpt->movable | 0 |
| 1878 | p->setPen(dwOpt->palette.color(QPalette::Dark)); | - |
| 1879 | p->drawRect(r); | - |
| 1880 | } | 0 |
| 1881 | | - |
| 1882 | if (!dwOpt->title.isEmpty()) { never evaluated: !dwOpt->title.isEmpty() | 0 |
| 1883 | const QStyleOptionDockWidgetV2 *v2 | - |
| 1884 | = qstyleoption_cast<const QStyleOptionDockWidgetV2*>(opt); | - |
| 1885 | bool verticalTitleBar = v2 == 0 ? false : v2->verticalTitleBar; | 0 |
| 1886 | | - |
| 1887 | if (verticalTitleBar) { never evaluated: verticalTitleBar | 0 |
| 1888 | QSize s = r.size(); | - |
| 1889 | s.transpose(); | - |
| 1890 | r.setSize(s); | - |
| 1891 | | - |
| 1892 | p->save(); | - |
| 1893 | p->translate(r.left(), r.top() + r.width()); | - |
| 1894 | p->rotate(-90); | - |
| 1895 | p->translate(-r.left(), -r.top()); | - |
| 1896 | } | 0 |
| 1897 | | - |
| 1898 | const int indent = p->fontMetrics().descent(); | - |
| 1899 | proxy()->drawItemText(p, r.adjusted(indent + 1, 1, -indent - 1, -1), | - |
| 1900 | Qt::AlignLeft | Qt::AlignVCenter | Qt::TextShowMnemonic, dwOpt->palette, | - |
| 1901 | dwOpt->state & State_Enabled, dwOpt->title, | - |
| 1902 | QPalette::WindowText); | - |
| 1903 | | - |
| 1904 | if (verticalTitleBar) never evaluated: verticalTitleBar | 0 |
| 1905 | p->restore(); never executed: p->restore(); | 0 |
| 1906 | } | 0 |
| 1907 | } | 0 |
| 1908 | break; | 0 |
| 1909 | | - |
| 1910 | case CE_Header: | - |
| 1911 | if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt)) { evaluated: const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt)| yes Evaluation Count:2103 | yes Evaluation Count:4 |
| 4-2103 |
| 1912 | QRegion clipRegion = p->clipRegion(); | - |
| 1913 | p->setClipRect(opt->rect); | - |
| 1914 | proxy()->drawControl(CE_HeaderSection, header, p, widget); | - |
| 1915 | QStyleOptionHeader subopt = *header; | - |
| 1916 | subopt.rect = subElementRect(SE_HeaderLabel, header, widget); | - |
| 1917 | if (subopt.rect.isValid()) partially evaluated: subopt.rect.isValid()| yes Evaluation Count:2103 | no Evaluation Count:0 |
| 0-2103 |
| 1918 | proxy()->drawControl(CE_HeaderLabel, &subopt, p, widget); executed: proxy()->drawControl(CE_HeaderLabel, &subopt, p, widget);Execution Count:2103 | 2103 |
| 1919 | if (header->sortIndicator != QStyleOptionHeader::None) { evaluated: header->sortIndicator != QStyleOptionHeader::None| yes Evaluation Count:40 | yes Evaluation Count:2063 |
| 40-2063 |
| 1920 | subopt.rect = subElementRect(SE_HeaderArrow, opt, widget); | - |
| 1921 | proxy()->drawPrimitive(PE_IndicatorHeaderArrow, &subopt, p, widget); | - |
| 1922 | } executed: }Execution Count:40 | 40 |
| 1923 | p->setClipRegion(clipRegion); | - |
| 1924 | } executed: }Execution Count:2103 | 2103 |
| 1925 | break; executed: break;Execution Count:2107 | 2107 |
| 1926 | case CE_FocusFrame: | - |
| 1927 | p->fillRect(opt->rect, opt->palette.foreground()); | - |
| 1928 | break; executed: break;Execution Count:4 | 4 |
| 1929 | case CE_HeaderSection: | - |
| 1930 | qDrawShadePanel(p, opt->rect, opt->palette, | - |
| 1931 | opt->state & State_Sunken, 1, | - |
| 1932 | &opt->palette.brush(QPalette::Button)); | - |
| 1933 | break; | 0 |
| 1934 | case CE_HeaderEmptyArea: | - |
| 1935 | p->fillRect(opt->rect, opt->palette.background()); | - |
| 1936 | break; executed: break;Execution Count:79 | 79 |
| 1937 | | - |
| 1938 | case CE_ComboBoxLabel: | - |
| 1939 | if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) { evaluated: const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)| yes Evaluation Count:117 | yes Evaluation Count:3 |
| 3-117 |
| 1940 | QRect editRect = proxy()->subControlRect(CC_ComboBox, cb, SC_ComboBoxEditField, widget); | - |
| 1941 | p->save(); | - |
| 1942 | p->setClipRect(editRect); | - |
| 1943 | if (!cb->currentIcon.isNull()) { evaluated: !cb->currentIcon.isNull()| yes Evaluation Count:58 | yes Evaluation Count:59 |
| 58-59 |
| 1944 | QIcon::Mode mode = cb->state & State_Enabled ? QIcon::Normal partially evaluated: cb->state & State_Enabled| yes Evaluation Count:58 | no Evaluation Count:0 |
| 0-58 |
| 1945 | : QIcon::Disabled; | - |
| 1946 | QPixmap pixmap = cb->currentIcon.pixmap(cb->iconSize, mode); | - |
| 1947 | QRect iconRect(editRect); | - |
| 1948 | iconRect.setWidth(cb->iconSize.width() + 4); | - |
| 1949 | iconRect = alignedRect(cb->direction, | - |
| 1950 | Qt::AlignLeft | Qt::AlignVCenter, | - |
| 1951 | iconRect.size(), editRect); | - |
| 1952 | if (cb->editable) partially evaluated: cb->editable| no Evaluation Count:0 | yes Evaluation Count:58 |
| 0-58 |
| 1953 | p->fillRect(iconRect, opt->palette.brush(QPalette::Base)); never executed: p->fillRect(iconRect, opt->palette.brush(QPalette::Base)); | 0 |
| 1954 | proxy()->drawItemPixmap(p, iconRect, Qt::AlignCenter, pixmap); | - |
| 1955 | | - |
| 1956 | if (cb->direction == Qt::RightToLeft) partially evaluated: cb->direction == Qt::RightToLeft| no Evaluation Count:0 | yes Evaluation Count:58 |
| 0-58 |
| 1957 | editRect.translate(-4 - cb->iconSize.width(), 0); never executed: editRect.translate(-4 - cb->iconSize.width(), 0); | 0 |
| 1958 | else | - |
| 1959 | editRect.translate(cb->iconSize.width() + 4, 0); executed: editRect.translate(cb->iconSize.width() + 4, 0);Execution Count:58 | 58 |
| 1960 | } | - |
| 1961 | if (!cb->currentText.isEmpty() && !cb->editable) { evaluated: !cb->currentText.isEmpty()| yes Evaluation Count:109 | yes Evaluation Count:8 |
evaluated: !cb->editable| yes Evaluation Count:106 | yes Evaluation Count:3 |
| 3-109 |
| 1962 | proxy()->drawItemText(p, editRect.adjusted(1, 0, -1, 0), | - |
| 1963 | visualAlignment(cb->direction, Qt::AlignLeft | Qt::AlignVCenter), | - |
| 1964 | cb->palette, cb->state & State_Enabled, cb->currentText); | - |
| 1965 | } executed: }Execution Count:106 | 106 |
| 1966 | p->restore(); | - |
| 1967 | } executed: }Execution Count:117 | 117 |
| 1968 | break; executed: break;Execution Count:120 | 120 |
| 1969 | | - |
| 1970 | | - |
| 1971 | case CE_ToolBar: | - |
| 1972 | if (const QStyleOptionToolBar *toolBar = qstyleoption_cast<const QStyleOptionToolBar *>(opt)) { never evaluated: const QStyleOptionToolBar *toolBar = qstyleoption_cast<const QStyleOptionToolBar *>(opt) | 0 |
| 1973 | | - |
| 1974 | QStyleOptionFrame frame; | - |
| 1975 | frame.QStyleOption::operator=(*toolBar); | - |
| 1976 | frame.lineWidth = toolBar->lineWidth; | - |
| 1977 | frame.midLineWidth = toolBar->midLineWidth; | - |
| 1978 | proxy()->drawPrimitive(PE_PanelToolBar, opt, p, widget); | - |
| 1979 | | - |
| 1980 | if (widget && qobject_cast<QToolBar *>(widget->parentWidget())) never evaluated: qobject_cast<QToolBar *>(widget->parentWidget()) | 0 |
| 1981 | break; | 0 |
| 1982 | qDrawShadePanel(p, toolBar->rect, toolBar->palette, false, toolBar->lineWidth, | - |
| 1983 | &toolBar->palette.brush(QPalette::Button)); | - |
| 1984 | } | 0 |
| 1985 | break; | 0 |
| 1986 | | - |
| 1987 | case CE_ColumnViewGrip: { | - |
| 1988 | | - |
| 1989 | QLinearGradient g(0, 0, opt->rect.width(), 0); | - |
| 1990 | g.setColorAt(0, opt->palette.color(QPalette::Active, QPalette::Mid)); | - |
| 1991 | g.setColorAt(0.5, Qt::white); | - |
| 1992 | p->fillRect(QRect(0, 0, opt->rect.width(), opt->rect.height()), g); | - |
| 1993 | | - |
| 1994 | | - |
| 1995 | QPen pen(p->pen()); | - |
| 1996 | pen.setWidth(opt->rect.width()/20); | - |
| 1997 | pen.setColor(opt->palette.color(QPalette::Active, QPalette::Dark)); | - |
| 1998 | p->setPen(pen); | - |
| 1999 | | - |
| 2000 | int line1starting = opt->rect.width()*8 / 20; | - |
| 2001 | int line2starting = opt->rect.width()*13 / 20; | - |
| 2002 | int top = opt->rect.height()*20/75; | - |
| 2003 | int bottom = opt->rect.height() - 1 - top; | - |
| 2004 | p->drawLine(line1starting, top, line1starting, bottom); | - |
| 2005 | p->drawLine(line2starting, top, line2starting, bottom); | - |
| 2006 | } | - |
| 2007 | break; | 0 |
| 2008 | | - |
| 2009 | | - |
| 2010 | case CE_ItemViewItem: | - |
| 2011 | if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) { partially evaluated: const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)| yes Evaluation Count:13241 | no Evaluation Count:0 |
| 0-13241 |
| 2012 | p->save(); | - |
| 2013 | p->setClipRect(opt->rect); | - |
| 2014 | | - |
| 2015 | QRect checkRect = subElementRect(SE_ItemViewItemCheckIndicator, vopt, widget); | - |
| 2016 | QRect iconRect = subElementRect(SE_ItemViewItemDecoration, vopt, widget); | - |
| 2017 | QRect textRect = subElementRect(SE_ItemViewItemText, vopt, widget); | - |
| 2018 | | - |
| 2019 | | - |
| 2020 | proxy()->drawPrimitive(PE_PanelItemViewItem, opt, p, widget); | - |
| 2021 | | - |
| 2022 | | - |
| 2023 | if (vopt->features & QStyleOptionViewItem::HasCheckIndicator) { evaluated: vopt->features & QStyleOptionViewItem::HasCheckIndicator| yes Evaluation Count:24 | yes Evaluation Count:13217 |
| 24-13217 |
| 2024 | QStyleOptionViewItem option(*vopt); | - |
| 2025 | option.rect = checkRect; | - |
| 2026 | option.state = option.state & ~QStyle::State_HasFocus; | - |
| 2027 | | - |
| 2028 | switch (vopt->checkState) { | - |
| 2029 | case Qt::Unchecked: | - |
| 2030 | option.state |= QStyle::State_Off; | - |
| 2031 | break; executed: break;Execution Count:19 | 19 |
| 2032 | case Qt::PartiallyChecked: | - |
| 2033 | option.state |= QStyle::State_NoChange; | - |
| 2034 | break; | 0 |
| 2035 | case Qt::Checked: | - |
| 2036 | option.state |= QStyle::State_On; | - |
| 2037 | break; executed: break;Execution Count:5 | 5 |
| 2038 | } | - |
| 2039 | proxy()->drawPrimitive(QStyle::PE_IndicatorViewItemCheck, &option, p, widget); | - |
| 2040 | } executed: }Execution Count:24 | 24 |
| 2041 | | - |
| 2042 | | - |
| 2043 | QIcon::Mode mode = QIcon::Normal; | - |
| 2044 | if (!(vopt->state & QStyle::State_Enabled)) evaluated: !(vopt->state & QStyle::State_Enabled)| yes Evaluation Count:611 | yes Evaluation Count:12630 |
| 611-12630 |
| 2045 | mode = QIcon::Disabled; executed: mode = QIcon::Disabled;Execution Count:611 | 611 |
| 2046 | else if (vopt->state & QStyle::State_Selected) evaluated: vopt->state & QStyle::State_Selected| yes Evaluation Count:981 | yes Evaluation Count:11649 |
| 981-11649 |
| 2047 | mode = QIcon::Selected; executed: mode = QIcon::Selected;Execution Count:981 | 981 |
| 2048 | QIcon::State state = vopt->state & QStyle::State_Open ? QIcon::On : QIcon::Off; evaluated: vopt->state & QStyle::State_Open| yes Evaluation Count:279 | yes Evaluation Count:12962 |
| 279-12962 |
| 2049 | vopt->icon.paint(p, iconRect, vopt->decorationAlignment, mode, state); | - |
| 2050 | | - |
| 2051 | | - |
| 2052 | if (!vopt->text.isEmpty()) { evaluated: !vopt->text.isEmpty()| yes Evaluation Count:12319 | yes Evaluation Count:922 |
| 922-12319 |
| 2053 | QPalette::ColorGroup cg = vopt->state & QStyle::State_Enabled evaluated: vopt->state & QStyle::State_Enabled| yes Evaluation Count:11708 | yes Evaluation Count:611 |
| 611-11708 |
| 2054 | ? QPalette::Normal : QPalette::Disabled; | - |
| 2055 | if (cg == QPalette::Normal && !(vopt->state & QStyle::State_Active)) evaluated: cg == QPalette::Normal| yes Evaluation Count:11708 | yes Evaluation Count:611 |
evaluated: !(vopt->state & QStyle::State_Active)| yes Evaluation Count:4516 | yes Evaluation Count:7192 |
| 611-11708 |
| 2056 | cg = QPalette::Inactive; executed: cg = QPalette::Inactive;Execution Count:4516 | 4516 |
| 2057 | | - |
| 2058 | if (vopt->state & QStyle::State_Selected) { evaluated: vopt->state & QStyle::State_Selected| yes Evaluation Count:961 | yes Evaluation Count:11358 |
| 961-11358 |
| 2059 | p->setPen(vopt->palette.color(cg, QPalette::HighlightedText)); | - |
| 2060 | } else { executed: }Execution Count:961 | 961 |
| 2061 | p->setPen(vopt->palette.color(cg, QPalette::Text)); | - |
| 2062 | } executed: }Execution Count:11358 | 11358 |
| 2063 | if (vopt->state & QStyle::State_Editing) { partially evaluated: vopt->state & QStyle::State_Editing| no Evaluation Count:0 | yes Evaluation Count:12319 |
| 0-12319 |
| 2064 | p->setPen(vopt->palette.color(cg, QPalette::Text)); | - |
| 2065 | p->drawRect(textRect.adjusted(0, 0, -1, -1)); | - |
| 2066 | } | 0 |
| 2067 | | - |
| 2068 | d->viewItemDrawText(p, vopt, textRect); | - |
| 2069 | } executed: }Execution Count:12319 | 12319 |
| 2070 | | - |
| 2071 | | - |
| 2072 | if (vopt->state & QStyle::State_HasFocus) { evaluated: vopt->state & QStyle::State_HasFocus| yes Evaluation Count:906 | yes Evaluation Count:12335 |
| 906-12335 |
| 2073 | QStyleOptionFocusRect o; | - |
| 2074 | o.QStyleOption::operator=(*vopt); | - |
| 2075 | o.rect = proxy()->subElementRect(SE_ItemViewItemFocusRect, vopt, widget); | - |
| 2076 | o.state |= QStyle::State_KeyboardFocusChange; | - |
| 2077 | o.state |= QStyle::State_Item; | - |
| 2078 | QPalette::ColorGroup cg = (vopt->state & QStyle::State_Enabled) partially evaluated: (vopt->state & QStyle::State_Enabled)| yes Evaluation Count:906 | no Evaluation Count:0 |
| 0-906 |
| 2079 | ? QPalette::Normal : QPalette::Disabled; | - |
| 2080 | o.backgroundColor = vopt->palette.color(cg, (vopt->state & QStyle::State_Selected) | - |
| 2081 | ? QPalette::Highlight : QPalette::Window); | - |
| 2082 | proxy()->drawPrimitive(QStyle::PE_FrameFocusRect, &o, p, widget); | - |
| 2083 | } executed: }Execution Count:906 | 906 |
| 2084 | | - |
| 2085 | p->restore(); | - |
| 2086 | } executed: }Execution Count:13241 | 13241 |
| 2087 | break; executed: break;Execution Count:13241 | 13241 |
| 2088 | | - |
| 2089 | | - |
| 2090 | | - |
| 2091 | case CE_ShapedFrame: | - |
| 2092 | if (const QStyleOptionFrameV3 *f = qstyleoption_cast<const QStyleOptionFrameV3 *>(opt)) { partially evaluated: const QStyleOptionFrameV3 *f = qstyleoption_cast<const QStyleOptionFrameV3 *>(opt)| yes Evaluation Count:2696 | no Evaluation Count:0 |
| 0-2696 |
| 2093 | int frameShape = f->frameShape; | - |
| 2094 | int frameShadow = QFrame::Plain; | - |
| 2095 | if (f->state & QStyle::State_Sunken) { evaluated: f->state & QStyle::State_Sunken| yes Evaluation Count:1206 | yes Evaluation Count:1490 |
| 1206-1490 |
| 2096 | frameShadow = QFrame::Sunken; | - |
| 2097 | } else if (f->state & QStyle::State_Raised) { evaluated: f->state & QStyle::State_Raised| yes Evaluation Count:50 | yes Evaluation Count:1440 |
executed: }Execution Count:1206 | 50-1440 |
| 2098 | frameShadow = QFrame::Raised; | - |
| 2099 | } executed: }Execution Count:50 | 50 |
| 2100 | | - |
| 2101 | int lw = f->lineWidth; | - |
| 2102 | int mlw = f->midLineWidth; | - |
| 2103 | QPalette::ColorRole foregroundRole = QPalette::WindowText; | - |
| 2104 | if (widget) partially evaluated: widget| yes Evaluation Count:2696 | no Evaluation Count:0 |
| 0-2696 |
| 2105 | foregroundRole = widget->foregroundRole(); executed: foregroundRole = widget->foregroundRole();Execution Count:2696 | 2696 |
| 2106 | | - |
| 2107 | switch (frameShape) { | - |
| 2108 | case QFrame::Box: | - |
| 2109 | if (frameShadow == QFrame::Plain) { evaluated: frameShadow == QFrame::Plain| yes Evaluation Count:198 | yes Evaluation Count:11 |
| 11-198 |
| 2110 | qDrawPlainRect(p, f->rect, f->palette.color(foregroundRole), lw); | - |
| 2111 | } else { executed: }Execution Count:198 | 198 |
| 2112 | qDrawShadeRect(p, f->rect, f->palette, frameShadow == QFrame::Sunken, lw, mlw); | - |
| 2113 | } executed: }Execution Count:11 | 11 |
| 2114 | break; executed: break;Execution Count:209 | 209 |
| 2115 | case QFrame::StyledPanel: | - |
| 2116 | | - |
| 2117 | | - |
| 2118 | if (widget) { partially evaluated: widget| yes Evaluation Count:1586 | no Evaluation Count:0 |
| 0-1586 |
| 2119 | widget->style()->drawPrimitive(QStyle::PE_Frame, opt, p, widget); | - |
| 2120 | } else { executed: }Execution Count:1586 | 1586 |
| 2121 | proxy()->drawPrimitive(QStyle::PE_Frame, opt, p, widget); | - |
| 2122 | } | 0 |
| 2123 | break; executed: break;Execution Count:1586 | 1586 |
| 2124 | case QFrame::Panel: | - |
| 2125 | if (frameShadow == QFrame::Plain) { partially evaluated: frameShadow == QFrame::Plain| no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
| 2126 | qDrawPlainRect(p, f->rect, f->palette.color(foregroundRole), lw); | - |
| 2127 | } else { | 0 |
| 2128 | qDrawShadePanel(p, f->rect, f->palette, frameShadow == QFrame::Sunken, lw); | - |
| 2129 | } executed: }Execution Count:4 | 4 |
| 2130 | break; executed: break;Execution Count:4 | 4 |
| 2131 | case QFrame::WinPanel: | - |
| 2132 | if (frameShadow == QFrame::Plain) { never evaluated: frameShadow == QFrame::Plain | 0 |
| 2133 | qDrawPlainRect(p, f->rect, f->palette.color(foregroundRole), lw); | - |
| 2134 | } else { | 0 |
| 2135 | qDrawWinPanel(p, f->rect, f->palette, frameShadow == QFrame::Sunken); | - |
| 2136 | } | 0 |
| 2137 | break; | 0 |
| 2138 | case QFrame::HLine: | - |
| 2139 | case QFrame::VLine: { | - |
| 2140 | QPoint p1, p2; | - |
| 2141 | if (frameShape == QFrame::HLine) { never evaluated: frameShape == QFrame::HLine | 0 |
| 2142 | p1 = QPoint(opt->rect.x(), opt->rect.height() / 2); | - |
| 2143 | p2 = QPoint(opt->rect.x() + opt->rect.width(), p1.y()); | - |
| 2144 | } else { | 0 |
| 2145 | p1 = QPoint(opt->rect.x()+opt->rect.width() / 2, 0); | - |
| 2146 | p2 = QPoint(p1.x(), opt->rect.height()); | - |
| 2147 | } | 0 |
| 2148 | if (frameShadow == QFrame::Plain) { never evaluated: frameShadow == QFrame::Plain | 0 |
| 2149 | QPen oldPen = p->pen(); | - |
| 2150 | p->setPen(QPen(opt->palette.brush(foregroundRole), lw)); | - |
| 2151 | p->drawLine(p1, p2); | - |
| 2152 | p->setPen(oldPen); | - |
| 2153 | } else { | 0 |
| 2154 | qDrawShadeLine(p, p1, p2, f->palette, frameShadow == QFrame::Sunken, lw, mlw); | - |
| 2155 | } | 0 |
| 2156 | break; | 0 |
| 2157 | } | - |
| 2158 | } | - |
| 2159 | } executed: }Execution Count:2696 | 2696 |
| 2160 | break; executed: break;Execution Count:2696 | 2696 |
| 2161 | | - |
| 2162 | default: | - |
| 2163 | break; executed: break;Execution Count:61 | 61 |
| 2164 | } | - |
| 2165 | } executed: }Execution Count:23850 | 23850 |
| 2166 | | - |
| 2167 | | - |
| 2168 | | - |
| 2169 | | - |
| 2170 | QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt, | - |
| 2171 | const QWidget *widget) const | - |
| 2172 | { | - |
| 2173 | const QCommonStylePrivate * const d = d_func(); | - |
| 2174 | QRect r; | - |
| 2175 | switch (sr) { | - |
| 2176 | case SE_PushButtonContents: | - |
| 2177 | if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) { partially evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)| yes Evaluation Count:821 | no Evaluation Count:0 |
| 0-821 |
| 2178 | int dx1, dx2; | - |
| 2179 | dx1 = proxy()->pixelMetric(PM_DefaultFrameWidth, btn, widget); | - |
| 2180 | if (btn->features & QStyleOptionButton::AutoDefaultButton) evaluated: btn->features & QStyleOptionButton::AutoDefaultButton| yes Evaluation Count:489 | yes Evaluation Count:332 |
| 332-489 |
| 2181 | dx1 += proxy()->pixelMetric(PM_ButtonDefaultIndicator, btn, widget); executed: dx1 += proxy()->pixelMetric(PM_ButtonDefaultIndicator, btn, widget);Execution Count:489 | 489 |
| 2182 | dx2 = dx1 * 2; | - |
| 2183 | r.setRect(opt->rect.x() + dx1, opt->rect.y() + dx1, opt->rect.width() - dx2, | - |
| 2184 | opt->rect.height() - dx2); | - |
| 2185 | r = visualRect(opt->direction, opt->rect, r); | - |
| 2186 | } executed: }Execution Count:821 | 821 |
| 2187 | break; executed: break;Execution Count:821 | 821 |
| 2188 | case SE_PushButtonFocusRect: | - |
| 2189 | if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) { partially evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)| yes Evaluation Count:229 | no Evaluation Count:0 |
| 0-229 |
| 2190 | int dbw1 = 0, dbw2 = 0; | - |
| 2191 | if (btn->features & QStyleOptionButton::AutoDefaultButton){ evaluated: btn->features & QStyleOptionButton::AutoDefaultButton| yes Evaluation Count:89 | yes Evaluation Count:140 |
| 89-140 |
| 2192 | dbw1 = proxy()->pixelMetric(PM_ButtonDefaultIndicator, btn, widget); | - |
| 2193 | dbw2 = dbw1 * 2; | - |
| 2194 | } executed: }Execution Count:89 | 89 |
| 2195 | | - |
| 2196 | int dfw1 = proxy()->pixelMetric(PM_DefaultFrameWidth, btn, widget) + 1, | - |
| 2197 | dfw2 = dfw1 * 2; | - |
| 2198 | | - |
| 2199 | r.setRect(btn->rect.x() + dfw1 + dbw1, btn->rect.y() + dfw1 + dbw1, | - |
| 2200 | btn->rect.width() - dfw2 - dbw2, btn->rect.height()- dfw2 - dbw2); | - |
| 2201 | r = visualRect(opt->direction, opt->rect, r); | - |
| 2202 | } executed: }Execution Count:229 | 229 |
| 2203 | break; executed: break;Execution Count:229 | 229 |
| 2204 | case SE_CheckBoxIndicator: | - |
| 2205 | { | - |
| 2206 | int h = proxy()->pixelMetric(PM_IndicatorHeight, opt, widget); | - |
| 2207 | r.setRect(opt->rect.x(), opt->rect.y() + ((opt->rect.height() - h) / 2), | - |
| 2208 | proxy()->pixelMetric(PM_IndicatorWidth, opt, widget), h); | - |
| 2209 | r = visualRect(opt->direction, opt->rect, r); | - |
| 2210 | } | - |
| 2211 | break; executed: break;Execution Count:44 | 44 |
| 2212 | | - |
| 2213 | case SE_CheckBoxContents: | - |
| 2214 | { | - |
| 2215 | | - |
| 2216 | QRect ir = visualRect(opt->direction, opt->rect, | - |
| 2217 | subElementRect(SE_CheckBoxIndicator, opt, widget)); | - |
| 2218 | int spacing = proxy()->pixelMetric(PM_CheckBoxLabelSpacing, opt, widget); | - |
| 2219 | r.setRect(ir.right() + spacing, opt->rect.y(), opt->rect.width() - ir.width() - spacing, | - |
| 2220 | opt->rect.height()); | - |
| 2221 | r = visualRect(opt->direction, opt->rect, r); | - |
| 2222 | } | - |
| 2223 | break; executed: break;Execution Count:12 | 12 |
| 2224 | | - |
| 2225 | case SE_CheckBoxFocusRect: | - |
| 2226 | if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) { partially evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)| yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
| 2227 | if (btn->icon.isNull() && btn->text.isEmpty()) { partially evaluated: btn->icon.isNull()| yes Evaluation Count:6 | no Evaluation Count:0 |
partially evaluated: btn->text.isEmpty()| yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
| 2228 | r = subElementRect(SE_CheckBoxIndicator, opt, widget); | - |
| 2229 | r.adjust(1, 1, -1, -1); | - |
| 2230 | break; executed: break;Execution Count:6 | 6 |
| 2231 | } | - |
| 2232 | | - |
| 2233 | QRect cr = visualRect(btn->direction, btn->rect, | - |
| 2234 | subElementRect(SE_CheckBoxContents, btn, widget)); | - |
| 2235 | | - |
| 2236 | QRect iconRect, textRect; | - |
| 2237 | if (!btn->text.isEmpty()) { never evaluated: !btn->text.isEmpty() | 0 |
| 2238 | textRect = itemTextRect(opt->fontMetrics, cr, Qt::AlignAbsolute | Qt::AlignLeft | - |
| 2239 | | Qt::AlignVCenter | Qt::TextShowMnemonic, | - |
| 2240 | btn->state & State_Enabled, btn->text); | - |
| 2241 | } | 0 |
| 2242 | if (!btn->icon.isNull()) { never evaluated: !btn->icon.isNull() | 0 |
| 2243 | iconRect = itemPixmapRect(cr, Qt::AlignAbsolute | Qt::AlignLeft | Qt::AlignVCenter | - |
| 2244 | | Qt::TextShowMnemonic, | - |
| 2245 | btn->icon.pixmap(btn->iconSize, QIcon::Normal)); | - |
| 2246 | if (!textRect.isEmpty()) never evaluated: !textRect.isEmpty() | 0 |
| 2247 | textRect.translate(iconRect.right() + 4, 0); never executed: textRect.translate(iconRect.right() + 4, 0); | 0 |
| 2248 | } | 0 |
| 2249 | r = iconRect | textRect; | - |
| 2250 | r.adjust(-3, -2, 3, 2); | - |
| 2251 | r = r.intersected(btn->rect); | - |
| 2252 | r = visualRect(btn->direction, btn->rect, r); | - |
| 2253 | } | 0 |
| 2254 | break; | 0 |
| 2255 | | - |
| 2256 | case SE_RadioButtonIndicator: | - |
| 2257 | { | - |
| 2258 | int h = proxy()->pixelMetric(PM_ExclusiveIndicatorHeight, opt, widget); | - |
| 2259 | r.setRect(opt->rect.x(), opt->rect.y() + ((opt->rect.height() - h) / 2), | - |
| 2260 | proxy()->pixelMetric(PM_ExclusiveIndicatorWidth, opt, widget), h); | - |
| 2261 | r = visualRect(opt->direction, opt->rect, r); | - |
| 2262 | } | - |
| 2263 | break; executed: break;Execution Count:57 | 57 |
| 2264 | | - |
| 2265 | case SE_RadioButtonContents: | - |
| 2266 | { | - |
| 2267 | QRect ir = visualRect(opt->direction, opt->rect, | - |
| 2268 | subElementRect(SE_RadioButtonIndicator, opt, widget)); | - |
| 2269 | int spacing = proxy()->pixelMetric(PM_RadioButtonLabelSpacing, opt, widget); | - |
| 2270 | r.setRect(ir.left() + ir.width() + spacing, opt->rect.y(), opt->rect.width() - ir.width() - spacing, | - |
| 2271 | opt->rect.height()); | - |
| 2272 | r = visualRect(opt->direction, opt->rect, r); | - |
| 2273 | break; executed: break;Execution Count:31 | 31 |
| 2274 | } | - |
| 2275 | | - |
| 2276 | case SE_RadioButtonFocusRect: | - |
| 2277 | if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) { partially evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)| yes Evaluation Count:5 | no Evaluation Count:0 |
| 0-5 |
| 2278 | if (btn->icon.isNull() && btn->text.isEmpty()) { partially evaluated: btn->icon.isNull()| yes Evaluation Count:5 | no Evaluation Count:0 |
partially evaluated: btn->text.isEmpty()| no Evaluation Count:0 | yes Evaluation Count:5 |
| 0-5 |
| 2279 | r = subElementRect(SE_RadioButtonIndicator, opt, widget); | - |
| 2280 | r.adjust(1, 1, -1, -1); | - |
| 2281 | break; | 0 |
| 2282 | } | - |
| 2283 | QRect cr = visualRect(btn->direction, btn->rect, | - |
| 2284 | subElementRect(SE_RadioButtonContents, opt, widget)); | - |
| 2285 | | - |
| 2286 | QRect iconRect, textRect; | - |
| 2287 | if (!btn->text.isEmpty()){ partially evaluated: !btn->text.isEmpty()| yes Evaluation Count:5 | no Evaluation Count:0 |
| 0-5 |
| 2288 | textRect = itemTextRect(opt->fontMetrics, cr, Qt::AlignAbsolute | Qt::AlignLeft | Qt::AlignVCenter | - |
| 2289 | | Qt::TextShowMnemonic, btn->state & State_Enabled, btn->text); | - |
| 2290 | } executed: }Execution Count:5 | 5 |
| 2291 | if (!btn->icon.isNull()) { partially evaluated: !btn->icon.isNull()| no Evaluation Count:0 | yes Evaluation Count:5 |
| 0-5 |
| 2292 | iconRect = itemPixmapRect(cr, Qt::AlignAbsolute | Qt::AlignLeft | Qt::AlignVCenter | Qt::TextShowMnemonic, | - |
| 2293 | btn->icon.pixmap(btn->iconSize, QIcon::Normal)); | - |
| 2294 | if (!textRect.isEmpty()) never evaluated: !textRect.isEmpty() | 0 |
| 2295 | textRect.translate(iconRect.right() + 4, 0); never executed: textRect.translate(iconRect.right() + 4, 0); | 0 |
| 2296 | } | 0 |
| 2297 | r = iconRect | textRect; | - |
| 2298 | r.adjust(-3, -2, 3, 2); | - |
| 2299 | r = r.intersected(btn->rect); | - |
| 2300 | r = visualRect(btn->direction, btn->rect, r); | - |
| 2301 | } executed: }Execution Count:5 | 5 |
| 2302 | break; executed: break;Execution Count:5 | 5 |
| 2303 | | - |
| 2304 | case SE_SliderFocusRect: | - |
| 2305 | if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) { never evaluated: const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt) | 0 |
| 2306 | int tickOffset = proxy()->pixelMetric(PM_SliderTickmarkOffset, slider, widget); | - |
| 2307 | int thickness = proxy()->pixelMetric(PM_SliderControlThickness, slider, widget); | - |
| 2308 | if (slider->orientation == Qt::Horizontal) never evaluated: slider->orientation == Qt::Horizontal | 0 |
| 2309 | r.setRect(0, tickOffset - 1, slider->rect.width(), thickness + 2); never executed: r.setRect(0, tickOffset - 1, slider->rect.width(), thickness + 2); | 0 |
| 2310 | else | - |
| 2311 | r.setRect(tickOffset - 1, 0, thickness + 2, slider->rect.height()); never executed: r.setRect(tickOffset - 1, 0, thickness + 2, slider->rect.height()); | 0 |
| 2312 | r = r.intersected(slider->rect); | - |
| 2313 | r = visualRect(opt->direction, opt->rect, r); | - |
| 2314 | } | 0 |
| 2315 | break; | 0 |
| 2316 | | - |
| 2317 | | - |
| 2318 | case SE_ProgressBarGroove: | - |
| 2319 | case SE_ProgressBarContents: | - |
| 2320 | case SE_ProgressBarLabel: | - |
| 2321 | if (const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(opt)) { partially evaluated: const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(opt)| yes Evaluation Count:189 | no Evaluation Count:0 |
| 0-189 |
| 2322 | int textw = 0; | - |
| 2323 | bool vertical = false; | - |
| 2324 | if (const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt)) { partially evaluated: const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt)| yes Evaluation Count:189 | no Evaluation Count:0 |
| 0-189 |
| 2325 | vertical = (pb2->orientation == Qt::Vertical); | - |
| 2326 | } executed: }Execution Count:189 | 189 |
| 2327 | if (!vertical) { partially evaluated: !vertical| yes Evaluation Count:189 | no Evaluation Count:0 |
| 0-189 |
| 2328 | if (pb->textVisible) evaluated: pb->textVisible| yes Evaluation Count:187 | yes Evaluation Count:2 |
| 2-187 |
| 2329 | textw = qMax(pb->fontMetrics.width(pb->text), pb->fontMetrics.width(QLatin1String("100%"))) + 6; executed: textw = qMax(pb->fontMetrics.width(pb->text), pb->fontMetrics.width(QLatin1String("100%"))) + 6;Execution Count:187 | 187 |
| 2330 | } executed: }Execution Count:189 | 189 |
| 2331 | | - |
| 2332 | if ((pb->textAlignment & Qt::AlignCenter) == 0) { partially evaluated: (pb->textAlignment & Qt::AlignCenter) == 0| yes Evaluation Count:189 | no Evaluation Count:0 |
| 0-189 |
| 2333 | if (sr != SE_ProgressBarLabel) evaluated: sr != SE_ProgressBarLabel| yes Evaluation Count:127 | yes Evaluation Count:62 |
| 62-127 |
| 2334 | r.setCoords(pb->rect.left(), pb->rect.top(), | 127 |
| 2335 | pb->rect.right() - textw, pb->rect.bottom()); executed: r.setCoords(pb->rect.left(), pb->rect.top(), pb->rect.right() - textw, pb->rect.bottom());Execution Count:127 | 127 |
| 2336 | else | - |
| 2337 | r.setCoords(pb->rect.right() - textw, pb->rect.top(), | 62 |
| 2338 | pb->rect.right(), pb->rect.bottom()); executed: r.setCoords(pb->rect.right() - textw, pb->rect.top(), pb->rect.right(), pb->rect.bottom());Execution Count:62 | 62 |
| 2339 | } else { | - |
| 2340 | r = pb->rect; | - |
| 2341 | } | 0 |
| 2342 | r = visualRect(pb->direction, pb->rect, r); | - |
| 2343 | } executed: }Execution Count:189 | 189 |
| 2344 | break; executed: break;Execution Count:189 | 189 |
| 2345 | | - |
| 2346 | | - |
| 2347 | case SE_ComboBoxFocusRect: | - |
| 2348 | if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) { partially evaluated: const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)| yes Evaluation Count:5 | no Evaluation Count:0 |
| 0-5 |
| 2349 | int margin = cb->frame ? 3 : 0; evaluated: cb->frame| yes Evaluation Count:3 | yes Evaluation Count:2 |
| 2-3 |
| 2350 | r.setRect(opt->rect.left() + margin, opt->rect.top() + margin, | - |
| 2351 | opt->rect.width() - 2*margin - 16, opt->rect.height() - 2*margin); | - |
| 2352 | r = visualRect(opt->direction, opt->rect, r); | - |
| 2353 | } executed: }Execution Count:5 | 5 |
| 2354 | break; executed: break;Execution Count:5 | 5 |
| 2355 | | - |
| 2356 | | - |
| 2357 | case SE_ToolBoxTabContents: | - |
| 2358 | r = opt->rect; | - |
| 2359 | r.adjust(0, 0, -30, 0); | - |
| 2360 | break; | 0 |
| 2361 | | - |
| 2362 | case SE_HeaderLabel: { | - |
| 2363 | int margin = proxy()->pixelMetric(QStyle::PM_HeaderMargin, opt, widget); | - |
| 2364 | r.setRect(opt->rect.x() + margin, opt->rect.y() + margin, | - |
| 2365 | opt->rect.width() - margin * 2, opt->rect.height() - margin * 2); | - |
| 2366 | | - |
| 2367 | if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt)) { partially evaluated: const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt)| yes Evaluation Count:2103 | no Evaluation Count:0 |
| 0-2103 |
| 2368 | | - |
| 2369 | if (header->sortIndicator != QStyleOptionHeader::None) { evaluated: header->sortIndicator != QStyleOptionHeader::None| yes Evaluation Count:40 | yes Evaluation Count:2063 |
| 40-2063 |
| 2370 | if (opt->state & State_Horizontal) partially evaluated: opt->state & State_Horizontal| yes Evaluation Count:40 | no Evaluation Count:0 |
| 0-40 |
| 2371 | r.setWidth(r.width() - (opt->rect.height() / 2) - (margin * 2)); executed: r.setWidth(r.width() - (opt->rect.height() / 2) - (margin * 2));Execution Count:40 | 40 |
| 2372 | else | - |
| 2373 | r.setHeight(r.height() - (opt->rect.width() / 2) - (margin * 2)); never executed: r.setHeight(r.height() - (opt->rect.width() / 2) - (margin * 2)); | 0 |
| 2374 | } | - |
| 2375 | } executed: }Execution Count:2103 | 2103 |
| 2376 | r = visualRect(opt->direction, opt->rect, r); | - |
| 2377 | break; } executed: break;Execution Count:2103 | 2103 |
| 2378 | case SE_HeaderArrow: { | - |
| 2379 | int h = opt->rect.height(); | - |
| 2380 | int w = opt->rect.width(); | - |
| 2381 | int x = opt->rect.x(); | - |
| 2382 | int y = opt->rect.y(); | - |
| 2383 | int margin = proxy()->pixelMetric(QStyle::PM_HeaderMargin, opt, widget); | - |
| 2384 | | - |
| 2385 | if (opt->state & State_Horizontal) { partially evaluated: opt->state & State_Horizontal| yes Evaluation Count:40 | no Evaluation Count:0 |
| 0-40 |
| 2386 | int horiz_size = h / 2; | - |
| 2387 | r.setRect(x + w - margin * 2 - horiz_size, y + 5, | - |
| 2388 | horiz_size, h - margin * 2 - 5); | - |
| 2389 | } else { executed: }Execution Count:40 | 40 |
| 2390 | int vert_size = w / 2; | - |
| 2391 | r.setRect(x + 5, y + h - margin * 2 - vert_size, | - |
| 2392 | w - margin * 2 - 5, vert_size); | - |
| 2393 | } | 0 |
| 2394 | r = visualRect(opt->direction, opt->rect, r); | - |
| 2395 | break; } executed: break;Execution Count:40 | 40 |
| 2396 | | - |
| 2397 | case SE_RadioButtonClickRect: | - |
| 2398 | r = subElementRect(SE_RadioButtonFocusRect, opt, widget); | - |
| 2399 | r |= subElementRect(SE_RadioButtonIndicator, opt, widget); | - |
| 2400 | break; | 0 |
| 2401 | case SE_CheckBoxClickRect: | - |
| 2402 | r = subElementRect(SE_CheckBoxFocusRect, opt, widget); | - |
| 2403 | r |= subElementRect(SE_CheckBoxIndicator, opt, widget); | - |
| 2404 | break; | 0 |
| 2405 | | - |
| 2406 | case SE_TabWidgetTabBar: | - |
| 2407 | if (const QStyleOptionTabWidgetFrame *twf | 0-53 |
| 2408 | = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)) { partially evaluated: const QStyleOptionTabWidgetFrame *twf = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)| yes Evaluation Count:53 | no Evaluation Count:0 |
| 0-53 |
| 2409 | r.setSize(twf->tabBarSize); | - |
| 2410 | const uint alingMask = Qt::AlignLeft | Qt::AlignRight | Qt::AlignHCenter; | - |
| 2411 | switch (twf->shape) { | - |
| 2412 | case QTabBar::RoundedNorth: | - |
| 2413 | case QTabBar::TriangularNorth: | - |
| 2414 | | - |
| 2415 | | - |
| 2416 | r.setWidth(qMin(r.width(), twf->rect.width() | - |
| 2417 | - twf->leftCornerWidgetSize.width() | - |
| 2418 | - twf->rightCornerWidgetSize.width())); | - |
| 2419 | switch (proxy()->styleHint(SH_TabBar_Alignment, twf, widget) & alingMask) { | - |
| 2420 | default: | - |
| 2421 | case Qt::AlignLeft: | - |
| 2422 | r.moveTopLeft(QPoint(twf->leftCornerWidgetSize.width(), 0)); | - |
| 2423 | break; executed: break;Execution Count:47 | 47 |
| 2424 | case Qt::AlignHCenter: | - |
| 2425 | r.moveTopLeft(QPoint(twf->rect.center().x() - qRound(r.width() / 2.0f) | - |
| 2426 | + (twf->leftCornerWidgetSize.width() / 2) | - |
| 2427 | - (twf->rightCornerWidgetSize.width() / 2), 0)); | - |
| 2428 | break; | 0 |
| 2429 | case Qt::AlignRight: | - |
| 2430 | r.moveTopLeft(QPoint(twf->rect.width() - twf->tabBarSize.width() | - |
| 2431 | - twf->rightCornerWidgetSize.width(), 0)); | - |
| 2432 | break; | 0 |
| 2433 | } | - |
| 2434 | r = visualRect(twf->direction, twf->rect, r); | - |
| 2435 | break; executed: break;Execution Count:47 | 47 |
| 2436 | case QTabBar::RoundedSouth: | - |
| 2437 | case QTabBar::TriangularSouth: | - |
| 2438 | r.setWidth(qMin(r.width(), twf->rect.width() | - |
| 2439 | - twf->leftCornerWidgetSize.width() | - |
| 2440 | - twf->rightCornerWidgetSize.width())); | - |
| 2441 | switch (proxy()->styleHint(SH_TabBar_Alignment, twf, widget) & alingMask) { | - |
| 2442 | default: | - |
| 2443 | case Qt::AlignLeft: | - |
| 2444 | r.moveTopLeft(QPoint(twf->leftCornerWidgetSize.width(), | - |
| 2445 | twf->rect.height() - twf->tabBarSize.height())); | - |
| 2446 | break; executed: break;Execution Count:2 | 2 |
| 2447 | case Qt::AlignHCenter: | - |
| 2448 | r.moveTopLeft(QPoint(twf->rect.center().x() - qRound(r.width() / 2.0f) | - |
| 2449 | + (twf->leftCornerWidgetSize.width() / 2) | - |
| 2450 | - (twf->rightCornerWidgetSize.width() / 2), | - |
| 2451 | twf->rect.height() - twf->tabBarSize.height())); | - |
| 2452 | break; | 0 |
| 2453 | case Qt::AlignRight: | - |
| 2454 | r.moveTopLeft(QPoint(twf->rect.width() - twf->tabBarSize.width() | - |
| 2455 | - twf->rightCornerWidgetSize.width(), | - |
| 2456 | twf->rect.height() - twf->tabBarSize.height())); | - |
| 2457 | break; | 0 |
| 2458 | } | - |
| 2459 | r = visualRect(twf->direction, twf->rect, r); | - |
| 2460 | break; executed: break;Execution Count:2 | 2 |
| 2461 | case QTabBar::RoundedEast: | - |
| 2462 | case QTabBar::TriangularEast: | - |
| 2463 | r.setHeight(qMin(r.height(), twf->rect.height() | - |
| 2464 | - twf->leftCornerWidgetSize.height() | - |
| 2465 | - twf->rightCornerWidgetSize.height())); | - |
| 2466 | switch (proxy()->styleHint(SH_TabBar_Alignment, twf, widget) & alingMask) { | - |
| 2467 | default: | - |
| 2468 | case Qt::AlignLeft: | - |
| 2469 | r.moveTopLeft(QPoint(twf->rect.width() - twf->tabBarSize.width(), | - |
| 2470 | twf->leftCornerWidgetSize.height())); | - |
| 2471 | break; executed: break;Execution Count:2 | 2 |
| 2472 | case Qt::AlignHCenter: | - |
| 2473 | r.moveTopLeft(QPoint(twf->rect.width() - twf->tabBarSize.width(), | - |
| 2474 | twf->rect.center().y() - r.height() / 2)); | - |
| 2475 | break; | 0 |
| 2476 | case Qt::AlignRight: | - |
| 2477 | r.moveTopLeft(QPoint(twf->rect.width() - twf->tabBarSize.width(), | - |
| 2478 | twf->rect.height() - twf->tabBarSize.height() | - |
| 2479 | - twf->rightCornerWidgetSize.height())); | - |
| 2480 | break; | 0 |
| 2481 | } | - |
| 2482 | break; executed: break;Execution Count:2 | 2 |
| 2483 | case QTabBar::RoundedWest: | - |
| 2484 | case QTabBar::TriangularWest: | - |
| 2485 | r.setHeight(qMin(r.height(), twf->rect.height() | - |
| 2486 | - twf->leftCornerWidgetSize.height() | - |
| 2487 | - twf->rightCornerWidgetSize.height())); | - |
| 2488 | switch (proxy()->styleHint(SH_TabBar_Alignment, twf, widget) & alingMask) { | - |
| 2489 | default: | - |
| 2490 | case Qt::AlignLeft: | - |
| 2491 | r.moveTopLeft(QPoint(0, twf->leftCornerWidgetSize.height())); | - |
| 2492 | break; executed: break;Execution Count:2 | 2 |
| 2493 | case Qt::AlignHCenter: | - |
| 2494 | r.moveTopLeft(QPoint(0, twf->rect.center().y() - r.height() / 2)); | - |
| 2495 | break; | 0 |
| 2496 | case Qt::AlignRight: | - |
| 2497 | r.moveTopLeft(QPoint(0, twf->rect.height() - twf->tabBarSize.height() | - |
| 2498 | - twf->rightCornerWidgetSize.height())); | - |
| 2499 | break; | 0 |
| 2500 | } | - |
| 2501 | break; executed: break;Execution Count:2 | 2 |
| 2502 | } | - |
| 2503 | } executed: }Execution Count:53 | 53 |
| 2504 | break; executed: break;Execution Count:53 | 53 |
| 2505 | case SE_TabWidgetTabPane: | - |
| 2506 | case SE_TabWidgetTabContents: | - |
| 2507 | if (const QStyleOptionTabWidgetFrame *twf = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)) { partially evaluated: const QStyleOptionTabWidgetFrame *twf = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)| yes Evaluation Count:212 | no Evaluation Count:0 |
| 0-212 |
| 2508 | QStyleOptionTab tabopt; | - |
| 2509 | tabopt.shape = twf->shape; | - |
| 2510 | int overlap = proxy()->pixelMetric(PM_TabBarBaseOverlap, &tabopt, widget); | - |
| 2511 | if (twf->lineWidth == 0) partially evaluated: twf->lineWidth == 0| no Evaluation Count:0 | yes Evaluation Count:212 |
| 0-212 |
| 2512 | overlap = 0; never executed: overlap = 0; | 0 |
| 2513 | switch (twf->shape) { | - |
| 2514 | case QTabBar::RoundedNorth: | - |
| 2515 | case QTabBar::TriangularNorth: | - |
| 2516 | r = QRect(QPoint(0,qMax(twf->tabBarSize.height() - overlap, 0)), | - |
| 2517 | QSize(twf->rect.width(), qMin(twf->rect.height() - twf->tabBarSize.height() + overlap, twf->rect.height()))); | - |
| 2518 | break; executed: break;Execution Count:188 | 188 |
| 2519 | case QTabBar::RoundedSouth: | - |
| 2520 | case QTabBar::TriangularSouth: | - |
| 2521 | r = QRect(QPoint(0,0), QSize(twf->rect.width(), qMin(twf->rect.height() - twf->tabBarSize.height() + overlap, twf->rect.height()))); | - |
| 2522 | break; executed: break;Execution Count:8 | 8 |
| 2523 | case QTabBar::RoundedEast: | - |
| 2524 | case QTabBar::TriangularEast: | - |
| 2525 | r = QRect(QPoint(0, 0), QSize(qMin(twf->rect.width() - twf->tabBarSize.width() + overlap, twf->rect.width()), twf->rect.height())); | - |
| 2526 | break; executed: break;Execution Count:8 | 8 |
| 2527 | case QTabBar::RoundedWest: | - |
| 2528 | case QTabBar::TriangularWest: | - |
| 2529 | r = QRect(QPoint(qMax(twf->tabBarSize.width() - overlap, 0), 0), | - |
| 2530 | QSize(qMin(twf->rect.width() - twf->tabBarSize.width() + overlap, twf->rect.width()), twf->rect.height())); | - |
| 2531 | break; executed: break;Execution Count:8 | 8 |
| 2532 | } | - |
| 2533 | if (sr == SE_TabWidgetTabContents && twf->lineWidth > 0) evaluated: sr == SE_TabWidgetTabContents| yes Evaluation Count:53 | yes Evaluation Count:159 |
partially evaluated: twf->lineWidth > 0| yes Evaluation Count:53 | no Evaluation Count:0 |
| 0-159 |
| 2534 | r.adjust(2, 2, -2, -2); executed: r.adjust(2, 2, -2, -2);Execution Count:53 | 53 |
| 2535 | } executed: }Execution Count:212 | 212 |
| 2536 | break; executed: break;Execution Count:212 | 212 |
| 2537 | case SE_TabWidgetLeftCorner: | - |
| 2538 | if (const QStyleOptionTabWidgetFrame *twf = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)) { partially evaluated: const QStyleOptionTabWidgetFrame *twf = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)| yes Evaluation Count:53 | no Evaluation Count:0 |
| 0-53 |
| 2539 | QRect paneRect = subElementRect(SE_TabWidgetTabPane, twf, widget); | - |
| 2540 | switch (twf->shape) { | - |
| 2541 | case QTabBar::RoundedNorth: | - |
| 2542 | case QTabBar::TriangularNorth: | - |
| 2543 | r = QRect(QPoint(paneRect.x(), paneRect.y() - twf->leftCornerWidgetSize.height()), | - |
| 2544 | twf->leftCornerWidgetSize); | - |
| 2545 | break; executed: break;Execution Count:47 | 47 |
| 2546 | case QTabBar::RoundedSouth: | - |
| 2547 | case QTabBar::TriangularSouth: | - |
| 2548 | r = QRect(QPoint(paneRect.x(), paneRect.height()), twf->leftCornerWidgetSize); | - |
| 2549 | break; executed: break;Execution Count:2 | 2 |
| 2550 | default: | - |
| 2551 | break; executed: break;Execution Count:4 | 4 |
| 2552 | } | - |
| 2553 | r = visualRect(twf->direction, twf->rect, r); | - |
| 2554 | } executed: }Execution Count:53 | 53 |
| 2555 | break; executed: break;Execution Count:53 | 53 |
| 2556 | case SE_TabWidgetRightCorner: | - |
| 2557 | if (const QStyleOptionTabWidgetFrame *twf = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)) { partially evaluated: const QStyleOptionTabWidgetFrame *twf = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)| yes Evaluation Count:53 | no Evaluation Count:0 |
| 0-53 |
| 2558 | QRect paneRect = subElementRect(SE_TabWidgetTabPane, twf, widget); | - |
| 2559 | switch (twf->shape) { | - |
| 2560 | case QTabBar::RoundedNorth: | - |
| 2561 | case QTabBar::TriangularNorth: | - |
| 2562 | r = QRect(QPoint(paneRect.width() - twf->rightCornerWidgetSize.width(), | - |
| 2563 | paneRect.y() - twf->rightCornerWidgetSize.height()), | - |
| 2564 | twf->rightCornerWidgetSize); | - |
| 2565 | break; executed: break;Execution Count:47 | 47 |
| 2566 | case QTabBar::RoundedSouth: | - |
| 2567 | case QTabBar::TriangularSouth: | - |
| 2568 | r = QRect(QPoint(paneRect.width() - twf->rightCornerWidgetSize.width(), | - |
| 2569 | paneRect.height()), twf->rightCornerWidgetSize); | - |
| 2570 | break; executed: break;Execution Count:2 | 2 |
| 2571 | default: | - |
| 2572 | break; executed: break;Execution Count:4 | 4 |
| 2573 | } | - |
| 2574 | r = visualRect(twf->direction, twf->rect, r); | - |
| 2575 | } executed: }Execution Count:53 | 53 |
| 2576 | break; executed: break;Execution Count:53 | 53 |
| 2577 | case SE_TabBarTabText: | - |
| 2578 | if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) { partially evaluated: const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)| yes Evaluation Count:737 | no Evaluation Count:0 |
| 0-737 |
| 2579 | QStyleOptionTabV3 tabV3(*tab); | - |
| 2580 | QRect dummyIconRect; | - |
| 2581 | d->tabLayout(&tabV3, widget, &r, &dummyIconRect); | - |
| 2582 | } executed: }Execution Count:737 | 737 |
| 2583 | break; executed: break;Execution Count:737 | 737 |
| 2584 | case SE_TabBarTabLeftButton: | - |
| 2585 | case SE_TabBarTabRightButton: | - |
| 2586 | if (const QStyleOptionTabV3 *tab = qstyleoption_cast<const QStyleOptionTabV3 *>(opt)) { partially evaluated: const QStyleOptionTabV3 *tab = qstyleoption_cast<const QStyleOptionTabV3 *>(opt)| yes Evaluation Count:20 | no Evaluation Count:0 |
| 0-20 |
| 2587 | bool selected = tab->state & State_Selected; | - |
| 2588 | int verticalShift = proxy()->pixelMetric(QStyle::PM_TabBarTabShiftVertical, tab, widget); | - |
| 2589 | int horizontalShift = proxy()->pixelMetric(QStyle::PM_TabBarTabShiftHorizontal, tab, widget); | - |
| 2590 | int hpadding = proxy()->pixelMetric(QStyle::PM_TabBarTabHSpace, opt, widget) / 2; | - |
| 2591 | hpadding = qMax(hpadding, 4); | - |
| 2592 | | - |
| 2593 | bool verticalTabs = tab->shape == QTabBar::RoundedEast partially evaluated: tab->shape == QTabBar::RoundedEast| no Evaluation Count:0 | yes Evaluation Count:20 |
| 0-20 |
| 2594 | || tab->shape == QTabBar::RoundedWest partially evaluated: tab->shape == QTabBar::RoundedWest| no Evaluation Count:0 | yes Evaluation Count:20 |
| 0-20 |
| 2595 | || tab->shape == QTabBar::TriangularEast partially evaluated: tab->shape == QTabBar::TriangularEast| no Evaluation Count:0 | yes Evaluation Count:20 |
| 0-20 |
| 2596 | || tab->shape == QTabBar::TriangularWest; partially evaluated: tab->shape == QTabBar::TriangularWest| no Evaluation Count:0 | yes Evaluation Count:20 |
| 0-20 |
| 2597 | | - |
| 2598 | QRect tr = tab->rect; | - |
| 2599 | if (tab->shape == QTabBar::RoundedSouth || tab->shape == QTabBar::TriangularSouth) partially evaluated: tab->shape == QTabBar::RoundedSouth| no Evaluation Count:0 | yes Evaluation Count:20 |
partially evaluated: tab->shape == QTabBar::TriangularSouth| no Evaluation Count:0 | yes Evaluation Count:20 |
| 0-20 |
| 2600 | verticalShift = -verticalShift; never executed: verticalShift = -verticalShift; | 0 |
| 2601 | if (verticalTabs) { partially evaluated: verticalTabs| no Evaluation Count:0 | yes Evaluation Count:20 |
| 0-20 |
| 2602 | qSwap(horizontalShift, verticalShift); | - |
| 2603 | horizontalShift *= -1; | - |
| 2604 | verticalShift *= -1; | - |
| 2605 | } | 0 |
| 2606 | if (tab->shape == QTabBar::RoundedWest || tab->shape == QTabBar::TriangularWest) partially evaluated: tab->shape == QTabBar::RoundedWest| no Evaluation Count:0 | yes Evaluation Count:20 |
partially evaluated: tab->shape == QTabBar::TriangularWest| no Evaluation Count:0 | yes Evaluation Count:20 |
| 0-20 |
| 2607 | horizontalShift = -horizontalShift; never executed: horizontalShift = -horizontalShift; | 0 |
| 2608 | | - |
| 2609 | tr.adjust(0, 0, horizontalShift, verticalShift); | - |
| 2610 | if (selected) evaluated: selected| yes Evaluation Count:15 | yes Evaluation Count:5 |
| 5-15 |
| 2611 | { | - |
| 2612 | tr.setBottom(tr.bottom() - verticalShift); | - |
| 2613 | tr.setRight(tr.right() - horizontalShift); | - |
| 2614 | } executed: }Execution Count:15 | 15 |
| 2615 | | - |
| 2616 | QSize size = (sr == SE_TabBarTabLeftButton) ? tab->leftButtonSize : tab->rightButtonSize; evaluated: (sr == SE_TabBarTabLeftButton)| yes Evaluation Count:4 | yes Evaluation Count:16 |
| 4-16 |
| 2617 | int w = size.width(); | - |
| 2618 | int h = size.height(); | - |
| 2619 | int midHeight = static_cast<int>(qCeil(float(tr.height() - h) / 2)); | - |
| 2620 | int midWidth = ((tr.width() - w) / 2); | - |
| 2621 | | - |
| 2622 | bool atTheTop = true; | - |
| 2623 | switch (tab->shape) { | - |
| 2624 | case QTabBar::RoundedWest: | - |
| 2625 | case QTabBar::TriangularWest: | - |
| 2626 | atTheTop = (sr == SE_TabBarTabLeftButton); | - |
| 2627 | break; | 0 |
| 2628 | case QTabBar::RoundedEast: | - |
| 2629 | case QTabBar::TriangularEast: | - |
| 2630 | atTheTop = (sr == SE_TabBarTabRightButton); | - |
| 2631 | break; | 0 |
| 2632 | default: | - |
| 2633 | if (sr == SE_TabBarTabLeftButton) evaluated: sr == SE_TabBarTabLeftButton| yes Evaluation Count:4 | yes Evaluation Count:16 |
| 4-16 |
| 2634 | r = QRect(tab->rect.x() + hpadding, midHeight, w, h); executed: r = QRect(tab->rect.x() + hpadding, midHeight, w, h);Execution Count:4 | 4 |
| 2635 | else | - |
| 2636 | r = QRect(tab->rect.right() - w - hpadding, midHeight, w, h); executed: r = QRect(tab->rect.right() - w - hpadding, midHeight, w, h);Execution Count:16 | 16 |
| 2637 | r = visualRect(tab->direction, tab->rect, r); | - |
| 2638 | } executed: }Execution Count:20 | 20 |
| 2639 | if (verticalTabs) { partially evaluated: verticalTabs| no Evaluation Count:0 | yes Evaluation Count:20 |
| 0-20 |
| 2640 | if (atTheTop) never evaluated: atTheTop | 0 |
| 2641 | r = QRect(midWidth, tr.y() + tab->rect.height() - hpadding - h, w, h); never executed: r = QRect(midWidth, tr.y() + tab->rect.height() - hpadding - h, w, h); | 0 |
| 2642 | else | - |
| 2643 | r = QRect(midWidth, tr.y() + hpadding, w, h); never executed: r = QRect(midWidth, tr.y() + hpadding, w, h); | 0 |
| 2644 | } | - |
| 2645 | } executed: }Execution Count:20 | 20 |
| 2646 | | - |
| 2647 | break; executed: break;Execution Count:20 | 20 |
| 2648 | | - |
| 2649 | | - |
| 2650 | case SE_TabBarTearIndicator: | - |
| 2651 | if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) { never evaluated: const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt) | 0 |
| 2652 | switch (tab->shape) { | - |
| 2653 | case QTabBar::RoundedNorth: | - |
| 2654 | case QTabBar::TriangularNorth: | - |
| 2655 | case QTabBar::RoundedSouth: | - |
| 2656 | case QTabBar::TriangularSouth: | - |
| 2657 | r.setRect(tab->rect.left(), tab->rect.top(), 4, opt->rect.height()); | - |
| 2658 | break; | 0 |
| 2659 | case QTabBar::RoundedWest: | - |
| 2660 | case QTabBar::TriangularWest: | - |
| 2661 | case QTabBar::RoundedEast: | - |
| 2662 | case QTabBar::TriangularEast: | - |
| 2663 | r.setRect(tab->rect.left(), tab->rect.top(), opt->rect.width(), 4); | - |
| 2664 | break; | 0 |
| 2665 | default: | - |
| 2666 | break; | 0 |
| 2667 | } | - |
| 2668 | r = visualRect(opt->direction, opt->rect, r); | - |
| 2669 | } | 0 |
| 2670 | break; | 0 |
| 2671 | | - |
| 2672 | case SE_TreeViewDisclosureItem: | - |
| 2673 | r = opt->rect; | - |
| 2674 | break; executed: break;Execution Count:179 | 179 |
| 2675 | case SE_LineEditContents: | - |
| 2676 | if (const QStyleOptionFrame *f = qstyleoption_cast<const QStyleOptionFrame *>(opt)) { partially evaluated: const QStyleOptionFrame *f = qstyleoption_cast<const QStyleOptionFrame *>(opt)| yes Evaluation Count:8451 | no Evaluation Count:0 |
| 0-8451 |
| 2677 | r = f->rect.adjusted(f->lineWidth, f->lineWidth, -f->lineWidth, -f->lineWidth); | - |
| 2678 | r = visualRect(opt->direction, opt->rect, r); | - |
| 2679 | } executed: }Execution Count:8451 | 8451 |
| 2680 | break; executed: break;Execution Count:8451 | 8451 |
| 2681 | case SE_FrameContents: | - |
| 2682 | if (const QStyleOptionFrameV2 *f = qstyleoption_cast<const QStyleOptionFrameV2 *>(opt)) { partially evaluated: const QStyleOptionFrameV2 *f = qstyleoption_cast<const QStyleOptionFrameV2 *>(opt)| yes Evaluation Count:10280 | no Evaluation Count:0 |
| 0-10280 |
| 2683 | int fw = proxy()->pixelMetric(PM_DefaultFrameWidth, f, widget); | - |
| 2684 | r = opt->rect.adjusted(fw, fw, -fw, -fw); | - |
| 2685 | r = visualRect(opt->direction, opt->rect, r); | - |
| 2686 | } executed: }Execution Count:10280 | 10280 |
| 2687 | break; executed: break;Execution Count:10280 | 10280 |
| 2688 | case SE_ShapedFrameContents: | - |
| 2689 | if (const QStyleOptionFrameV3 *f = qstyleoption_cast<const QStyleOptionFrameV3 *>(opt)) { partially evaluated: const QStyleOptionFrameV3 *f = qstyleoption_cast<const QStyleOptionFrameV3 *>(opt)| yes Evaluation Count:18217 | no Evaluation Count:0 |
| 0-18217 |
| 2690 | int frameShape = f->frameShape; | - |
| 2691 | int frameShadow = QFrame::Plain; | - |
| 2692 | if (f->state & QStyle::State_Sunken) { partially evaluated: f->state & QStyle::State_Sunken| no Evaluation Count:0 | yes Evaluation Count:18217 |
| 0-18217 |
| 2693 | frameShadow = QFrame::Sunken; | - |
| 2694 | } else if (f->state & QStyle::State_Raised) { partially evaluated: f->state & QStyle::State_Raised| no Evaluation Count:0 | yes Evaluation Count:18217 |
| 0-18217 |
| 2695 | frameShadow = QFrame::Raised; | - |
| 2696 | } | 0 |
| 2697 | | - |
| 2698 | int frameWidth = 0; | - |
| 2699 | | - |
| 2700 | switch (frameShape) { | - |
| 2701 | case QFrame::NoFrame: | - |
| 2702 | frameWidth = 0; | - |
| 2703 | break; executed: break;Execution Count:7514 | 7514 |
| 2704 | | - |
| 2705 | case QFrame::Box: | - |
| 2706 | case QFrame::HLine: | - |
| 2707 | case QFrame::VLine: | - |
| 2708 | switch (frameShadow) { | - |
| 2709 | case QFrame::Plain: | - |
| 2710 | frameWidth = f->lineWidth; | - |
| 2711 | break; executed: break;Execution Count:413 | 413 |
| 2712 | case QFrame::Raised: | - |
| 2713 | case QFrame::Sunken: | - |
| 2714 | frameWidth = (short)(f->lineWidth*2 + f->midLineWidth); | - |
| 2715 | break; | 0 |
| 2716 | } | - |
| 2717 | break; executed: break;Execution Count:413 | 413 |
| 2718 | | - |
| 2719 | case QFrame::StyledPanel: | - |
| 2720 | | - |
| 2721 | | - |
| 2722 | if (widget) partially evaluated: widget| yes Evaluation Count:10280 | no Evaluation Count:0 |
| 0-10280 |
| 2723 | return widget->style()->subElementRect(QStyle::SE_FrameContents, opt, widget); executed: return widget->style()->subElementRect(QStyle::SE_FrameContents, opt, widget);Execution Count:10280 | 10280 |
| 2724 | else | - |
| 2725 | return subElementRect(QStyle::SE_FrameContents, opt, widget); never executed: return subElementRect(QStyle::SE_FrameContents, opt, widget); | 0 |
| 2726 | | - |
| 2727 | case QFrame::WinPanel: | - |
| 2728 | frameWidth = 2; | - |
| 2729 | break; | 0 |
| 2730 | | - |
| 2731 | case QFrame::Panel: | - |
| 2732 | switch (frameShadow) { | - |
| 2733 | case QFrame::Plain: | - |
| 2734 | case QFrame::Raised: | - |
| 2735 | case QFrame::Sunken: | - |
| 2736 | frameWidth = f->lineWidth; | - |
| 2737 | break; executed: break;Execution Count:10 | 10 |
| 2738 | } | - |
| 2739 | break; executed: break;Execution Count:10 | 10 |
| 2740 | } | - |
| 2741 | r = f->rect.adjusted(frameWidth, frameWidth, -frameWidth, -frameWidth); | - |
| 2742 | } executed: }Execution Count:7937 | 7937 |
| 2743 | break; executed: break;Execution Count:7937 | 7937 |
| 2744 | | - |
| 2745 | case SE_DockWidgetCloseButton: | - |
| 2746 | case SE_DockWidgetFloatButton: | - |
| 2747 | case SE_DockWidgetTitleBarText: | - |
| 2748 | case SE_DockWidgetIcon: { | - |
| 2749 | int iconSize = proxy()->pixelMetric(PM_SmallIconSize, opt, widget); | - |
| 2750 | int buttonMargin = proxy()->pixelMetric(PM_DockWidgetTitleBarButtonMargin, opt, widget); | - |
| 2751 | int margin = proxy()->pixelMetric(QStyle::PM_DockWidgetTitleMargin, opt, widget); | - |
| 2752 | QRect rect = opt->rect; | - |
| 2753 | | - |
| 2754 | const QStyleOptionDockWidget *dwOpt | - |
| 2755 | = qstyleoption_cast<const QStyleOptionDockWidget*>(opt); | - |
| 2756 | bool canClose = dwOpt == 0 ? true : dwOpt->closable; partially evaluated: dwOpt == 0| no Evaluation Count:0 | yes Evaluation Count:151 |
| 0-151 |
| 2757 | bool canFloat = dwOpt == 0 ? false : dwOpt->floatable; partially evaluated: dwOpt == 0| no Evaluation Count:0 | yes Evaluation Count:151 |
| 0-151 |
| 2758 | const QStyleOptionDockWidgetV2 *v2 | - |
| 2759 | = qstyleoption_cast<const QStyleOptionDockWidgetV2*>(opt); | - |
| 2760 | bool verticalTitleBar = v2 == 0 ? false : v2->verticalTitleBar; partially evaluated: v2 == 0| no Evaluation Count:0 | yes Evaluation Count:151 |
| 0-151 |
| 2761 | | - |
| 2762 | | - |
| 2763 | | - |
| 2764 | | - |
| 2765 | if (verticalTitleBar) { partially evaluated: verticalTitleBar| no Evaluation Count:0 | yes Evaluation Count:151 |
| 0-151 |
| 2766 | QSize size = rect.size(); | - |
| 2767 | size.transpose(); | - |
| 2768 | rect.setSize(size); | - |
| 2769 | } | 0 |
| 2770 | | - |
| 2771 | do { | - |
| 2772 | | - |
| 2773 | int right = rect.right(); | - |
| 2774 | int left = rect.left(); | - |
| 2775 | | - |
| 2776 | QRect closeRect; | - |
| 2777 | if (canClose) { partially evaluated: canClose| yes Evaluation Count:151 | no Evaluation Count:0 |
| 0-151 |
| 2778 | QSize sz = standardIcon(QStyle::SP_TitleBarCloseButton, | - |
| 2779 | opt, widget).actualSize(QSize(iconSize, iconSize)); | - |
| 2780 | sz += QSize(buttonMargin, buttonMargin); | - |
| 2781 | if (verticalTitleBar) partially evaluated: verticalTitleBar| no Evaluation Count:0 | yes Evaluation Count:151 |
| 0-151 |
| 2782 | sz.transpose(); never executed: sz.transpose(); | 0 |
| 2783 | closeRect = QRect(right - sz.width(), | - |
| 2784 | rect.center().y() - sz.height()/2, | - |
| 2785 | sz.width(), sz.height()); | - |
| 2786 | right = closeRect.left() - 1; | - |
| 2787 | } executed: }Execution Count:151 | 151 |
| 2788 | if (sr == SE_DockWidgetCloseButton) { evaluated: sr == SE_DockWidgetCloseButton| yes Evaluation Count:71 | yes Evaluation Count:80 |
| 71-80 |
| 2789 | r = closeRect; | - |
| 2790 | break; executed: break;Execution Count:71 | 71 |
| 2791 | } | - |
| 2792 | | - |
| 2793 | QRect floatRect; | - |
| 2794 | if (canFloat) { partially evaluated: canFloat| yes Evaluation Count:80 | no Evaluation Count:0 |
| 0-80 |
| 2795 | QSize sz = standardIcon(QStyle::SP_TitleBarNormalButton, | - |
| 2796 | opt, widget).actualSize(QSize(iconSize, iconSize)); | - |
| 2797 | sz += QSize(buttonMargin, buttonMargin); | - |
| 2798 | if (verticalTitleBar) partially evaluated: verticalTitleBar| no Evaluation Count:0 | yes Evaluation Count:80 |
| 0-80 |
| 2799 | sz.transpose(); never executed: sz.transpose(); | 0 |
| 2800 | floatRect = QRect(right - sz.width(), | - |
| 2801 | rect.center().y() - sz.height()/2, | - |
| 2802 | sz.width(), sz.height()); | - |
| 2803 | right = floatRect.left() - 1; | - |
| 2804 | } executed: }Execution Count:80 | 80 |
| 2805 | if (sr == SE_DockWidgetFloatButton) { evaluated: sr == SE_DockWidgetFloatButton| yes Evaluation Count:72 | yes Evaluation Count:8 |
| 8-72 |
| 2806 | r = floatRect; | - |
| 2807 | break; executed: break;Execution Count:72 | 72 |
| 2808 | } | - |
| 2809 | | - |
| 2810 | QRect iconRect; | - |
| 2811 | if (const QDockWidget *dw = qobject_cast<const QDockWidget*>(widget)) { partially evaluated: const QDockWidget *dw = qobject_cast<const QDockWidget*>(widget)| yes Evaluation Count:8 | no Evaluation Count:0 |
| 0-8 |
| 2812 | QIcon icon; | - |
| 2813 | if (dw->isFloating()) evaluated: dw->isFloating()| yes Evaluation Count:4 | yes Evaluation Count:4 |
| 4 |
| 2814 | icon = dw->windowIcon(); executed: icon = dw->windowIcon();Execution Count:4 | 4 |
| 2815 | if (!icon.isNull() partially evaluated: !icon.isNull()| no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
| 2816 | && icon.cacheKey() != QApplication::windowIcon().cacheKey()) { never evaluated: icon.cacheKey() != QApplication::windowIcon().cacheKey() | 0 |
| 2817 | QSize sz = icon.actualSize(QSize(r.height(), r.height())); | - |
| 2818 | if (verticalTitleBar) never evaluated: verticalTitleBar | 0 |
| 2819 | sz.transpose(); never executed: sz.transpose(); | 0 |
| 2820 | iconRect = QRect(left, rect.center().y() - sz.height()/2, | - |
| 2821 | sz.width(), sz.height()); | - |
| 2822 | left = iconRect.right() + margin; | - |
| 2823 | } | 0 |
| 2824 | } executed: }Execution Count:8 | 8 |
| 2825 | if (sr == SE_DockWidgetIcon) { partially evaluated: sr == SE_DockWidgetIcon| no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
| 2826 | r = iconRect; | - |
| 2827 | break; | 0 |
| 2828 | } | - |
| 2829 | | - |
| 2830 | QRect textRect = QRect(left, rect.top(), | - |
| 2831 | right - left, rect.height()); | - |
| 2832 | if (sr == SE_DockWidgetTitleBarText) { partially evaluated: sr == SE_DockWidgetTitleBarText| yes Evaluation Count:8 | no Evaluation Count:0 |
| 0-8 |
| 2833 | r = textRect; | - |
| 2834 | break; executed: break;Execution Count:8 | 8 |
| 2835 | } | - |
| 2836 | | - |
| 2837 | } while (false); | 0 |
| 2838 | | - |
| 2839 | if (verticalTitleBar) { partially evaluated: verticalTitleBar| no Evaluation Count:0 | yes Evaluation Count:151 |
| 0-151 |
| 2840 | r = QRect(rect.left() + r.top() - rect.top(), | - |
| 2841 | rect.top() + rect.right() - r.right(), | - |
| 2842 | r.height(), r.width()); | - |
| 2843 | } else { | 0 |
| 2844 | r = visualRect(opt->direction, rect, r); | - |
| 2845 | } executed: }Execution Count:151 | 151 |
| 2846 | break; executed: break;Execution Count:151 | 151 |
| 2847 | } | - |
| 2848 | | - |
| 2849 | | - |
| 2850 | case SE_ItemViewItemCheckIndicator: | - |
| 2851 | if (!qstyleoption_cast<const QStyleOptionViewItem *>(opt)) { evaluated: !qstyleoption_cast<const QStyleOptionViewItem *>(opt)| yes Evaluation Count:14 | yes Evaluation Count:13250 |
| 14-13250 |
| 2852 | r = subElementRect(SE_CheckBoxIndicator, opt, widget); | - |
| 2853 | break; executed: break;Execution Count:14 | 14 |
| 2854 | } | - |
| 2855 | case SE_ItemViewItemDecoration: code before this statement executed: case SE_ItemViewItemDecoration:Execution Count:13250 | 13250 |
| 2856 | case SE_ItemViewItemText: | - |
| 2857 | case SE_ItemViewItemFocusRect: | - |
| 2858 | if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) { partially evaluated: const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)| yes Evaluation Count:40845 | no Evaluation Count:0 |
| 0-40845 |
| 2859 | if (!d->isViewItemCached(*vopt)) { evaluated: !d->isViewItemCached(*vopt)| yes Evaluation Count:13307 | yes Evaluation Count:27538 |
| 13307-27538 |
| 2860 | d->viewItemLayout(vopt, &d->checkRect, &d->decorationRect, &d->displayRect, false); | - |
| 2861 | if (d->cachedOption) { evaluated: d->cachedOption| yes Evaluation Count:13292 | yes Evaluation Count:15 |
| 15-13292 |
| 2862 | delete d->cachedOption; | - |
| 2863 | d->cachedOption = 0; | - |
| 2864 | } executed: }Execution Count:13292 | 13292 |
| 2865 | d->cachedOption = new QStyleOptionViewItem(*vopt); | - |
| 2866 | } executed: }Execution Count:13307 | 13307 |
| 2867 | if (sr == SE_ViewItemCheckIndicator) evaluated: sr == SE_ViewItemCheckIndicator| yes Evaluation Count:13250 | yes Evaluation Count:27595 |
| 13250-27595 |
| 2868 | r = d->checkRect; executed: r = d->checkRect;Execution Count:13250 | 13250 |
| 2869 | else if (sr == SE_ItemViewItemDecoration) evaluated: sr == SE_ItemViewItemDecoration| yes Evaluation Count:13241 | yes Evaluation Count:14354 |
| 13241-14354 |
| 2870 | r = d->decorationRect; executed: r = d->decorationRect;Execution Count:13241 | 13241 |
| 2871 | else if (sr == SE_ItemViewItemText || sr == SE_ItemViewItemFocusRect) evaluated: sr == SE_ItemViewItemText| yes Evaluation Count:13448 | yes Evaluation Count:906 |
partially evaluated: sr == SE_ItemViewItemFocusRect| yes Evaluation Count:906 | no Evaluation Count:0 |
| 0-13448 |
| 2872 | r = d->displayRect; executed: r = d->displayRect;Execution Count:14354 | 14354 |
| 2873 | } | - |
| 2874 | break; executed: break;Execution Count:40845 | 40845 |
| 2875 | | - |
| 2876 | | - |
| 2877 | case SE_ToolBarHandle: | - |
| 2878 | if (const QStyleOptionToolBar *tbopt = qstyleoption_cast<const QStyleOptionToolBar *>(opt)) { partially evaluated: const QStyleOptionToolBar *tbopt = qstyleoption_cast<const QStyleOptionToolBar *>(opt)| yes Evaluation Count:7 | no Evaluation Count:0 |
| 0-7 |
| 2879 | if (tbopt->features & QStyleOptionToolBar::Movable) { evaluated: tbopt->features & QStyleOptionToolBar::Movable| yes Evaluation Count:6 | yes Evaluation Count:1 |
| 1-6 |
| 2880 | | - |
| 2881 | | - |
| 2882 | const QToolBar *tb = qobject_cast<const QToolBar*>(widget); | - |
| 2883 | const int margin = tb && tb->layout() ? tb->layout()->margin() : 2; partially evaluated: tb| yes Evaluation Count:6 | no Evaluation Count:0 |
partially evaluated: tb->layout()| yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
| 2884 | const int handleExtent = pixelMetric(QStyle::PM_ToolBarHandleExtent, opt, tb); | - |
| 2885 | if (tbopt->state & QStyle::State_Horizontal) { partially evaluated: tbopt->state & QStyle::State_Horizontal| yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
| 2886 | r = QRect(margin, margin, handleExtent, tbopt->rect.height() - 2*margin); | - |
| 2887 | r = QStyle::visualRect(tbopt->direction, tbopt->rect, r); | - |
| 2888 | } else { executed: }Execution Count:6 | 6 |
| 2889 | r = QRect(margin, margin, tbopt->rect.width() - 2*margin, handleExtent); | - |
| 2890 | } | 0 |
| 2891 | } | - |
| 2892 | } executed: }Execution Count:7 | 7 |
| 2893 | break; executed: break;Execution Count:7 | 7 |
| 2894 | | - |
| 2895 | default: | - |
| 2896 | break; executed: break;Execution Count:32269 | 32269 |
| 2897 | } | - |
| 2898 | return r; executed: return r;Execution Count:104803 | 104803 |
| 2899 | } | - |
| 2900 | | - |
| 2901 | | - |
| 2902 | | - |
| 2903 | static QPolygonF calcArrow(const QStyleOptionSlider *dial, qreal &a) | - |
| 2904 | { | - |
| 2905 | int width = dial->rect.width(); | - |
| 2906 | int height = dial->rect.height(); | - |
| 2907 | int r = qMin(width, height) / 2; | - |
| 2908 | int currentSliderPosition = dial->upsideDown ? dial->sliderPosition : (dial->maximum - dial->sliderPosition); evaluated: dial->upsideDown| yes Evaluation Count:3 | yes Evaluation Count:3 |
| 3 |
| 2909 | | - |
| 2910 | if (dial->maximum == dial->minimum) partially evaluated: dial->maximum == dial->minimum| no Evaluation Count:0 | yes Evaluation Count:6 |
| 0-6 |
| 2911 | a = Q_PI / 2; never executed: a = Q_PI / 2; | 0 |
| 2912 | else if (dial->dialWrapping) partially evaluated: dial->dialWrapping| no Evaluation Count:0 | yes Evaluation Count:6 |
| 0-6 |
| 2913 | a = Q_PI * 3 / 2 - (currentSliderPosition - dial->minimum) * 2 * Q_PI | 0 |
| 2914 | / (dial->maximum - dial->minimum); never executed: a = Q_PI * 3 / 2 - (currentSliderPosition - dial->minimum) * 2 * Q_PI / (dial->maximum - dial->minimum); | 0 |
| 2915 | else | - |
| 2916 | a = (Q_PI * 8 - (currentSliderPosition - dial->minimum) * 10 * Q_PI | 6 |
| 2917 | / (dial->maximum - dial->minimum)) / 6; executed: a = (Q_PI * 8 - (currentSliderPosition - dial->minimum) * 10 * Q_PI / (dial->maximum - dial->minimum)) / 6;Execution Count:6 | 6 |
| 2918 | | - |
| 2919 | int xc = width / 2; | - |
| 2920 | int yc = height / 2; | - |
| 2921 | | - |
| 2922 | int len = r - QStyleHelper::calcBigLineSize(r) - 5; | - |
| 2923 | if (len < 5) partially evaluated: len < 5| no Evaluation Count:0 | yes Evaluation Count:6 |
| 0-6 |
| 2924 | len = 5; | 0 |
| 2925 | int back = len / 2; | - |
| 2926 | | - |
| 2927 | QPolygonF arrow(3); | - |
| 2928 | arrow[0] = QPointF(0.5 + xc + len * qCos(a), | - |
| 2929 | 0.5 + yc - len * qSin(a)); | - |
| 2930 | arrow[1] = QPointF(0.5 + xc + back * qCos(a + Q_PI * 5 / 6), | - |
| 2931 | 0.5 + yc - back * qSin(a + Q_PI * 5 / 6)); | - |
| 2932 | arrow[2] = QPointF(0.5 + xc + back * qCos(a - Q_PI * 5 / 6), | - |
| 2933 | 0.5 + yc - back * qSin(a - Q_PI * 5 / 6)); | - |
| 2934 | return arrow; executed: return arrow;Execution Count:6 | 6 |
| 2935 | } | - |
| 2936 | | - |
| 2937 | | - |
| 2938 | | - |
| 2939 | | - |
| 2940 | | - |
| 2941 | | - |
| 2942 | void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, | - |
| 2943 | QPainter *p, const QWidget *widget) const | - |
| 2944 | { | - |
| 2945 | switch (cc) { | - |
| 2946 | | - |
| 2947 | case CC_Slider: | - |
| 2948 | if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) { partially evaluated: const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)| yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-3 |
| 2949 | if (slider->subControls == SC_SliderTickmarks) { partially evaluated: slider->subControls == SC_SliderTickmarks| yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-3 |
| 2950 | int tickOffset = proxy()->pixelMetric(PM_SliderTickmarkOffset, slider, widget); | - |
| 2951 | int ticks = slider->tickPosition; | - |
| 2952 | int thickness = proxy()->pixelMetric(PM_SliderControlThickness, slider, widget); | - |
| 2953 | int len = proxy()->pixelMetric(PM_SliderLength, slider, widget); | - |
| 2954 | int available = proxy()->pixelMetric(PM_SliderSpaceAvailable, slider, widget); | - |
| 2955 | int interval = slider->tickInterval; | - |
| 2956 | if (interval <= 0) { partially evaluated: interval <= 0| no Evaluation Count:0 | yes Evaluation Count:3 |
| 0-3 |
| 2957 | interval = slider->singleStep; | - |
| 2958 | if (QStyle::sliderPositionFromValue(slider->minimum, slider->maximum, interval, | 0 |
| 2959 | available) | 0 |
| 2960 | - QStyle::sliderPositionFromValue(slider->minimum, slider->maximum, | 0 |
| 2961 | 0, available) < 3) never evaluated: QStyle::sliderPositionFromValue(slider->minimum, slider->maximum, interval, available) - QStyle::sliderPositionFromValue(slider->minimum, slider->maximum, 0, available) < 3 | 0 |
| 2962 | interval = slider->pageStep; never executed: interval = slider->pageStep; | 0 |
| 2963 | } | 0 |
| 2964 | if (!interval) partially evaluated: !interval| no Evaluation Count:0 | yes Evaluation Count:3 |
| 0-3 |
| 2965 | interval = 1; never executed: interval = 1; | 0 |
| 2966 | int fudge = len / 2; | - |
| 2967 | int pos; | - |
| 2968 | | - |
| 2969 | p->save(); | - |
| 2970 | p->translate(slider->rect.x(), slider->rect.y()); | - |
| 2971 | p->setPen(slider->palette.foreground().color()); | - |
| 2972 | int v = slider->minimum; | - |
| 2973 | while (v <= slider->maximum + 1) { evaluated: v <= slider->maximum + 1| yes Evaluation Count:15 | yes Evaluation Count:3 |
| 3-15 |
| 2974 | if (v == slider->maximum + 1 && interval == 1) partially evaluated: v == slider->maximum + 1| no Evaluation Count:0 | yes Evaluation Count:15 |
never evaluated: interval == 1 | 0-15 |
| 2975 | break; | 0 |
| 2976 | const int v_ = qMin(v, slider->maximum); | - |
| 2977 | pos = QStyle::sliderPositionFromValue(slider->minimum, slider->maximum, | - |
| 2978 | v_, available) + fudge; | - |
| 2979 | if (slider->orientation == Qt::Horizontal) { partially evaluated: slider->orientation == Qt::Horizontal| yes Evaluation Count:15 | no Evaluation Count:0 |
| 0-15 |
| 2980 | if (ticks & QSlider::TicksAbove) partially evaluated: ticks & QSlider::TicksAbove| no Evaluation Count:0 | yes Evaluation Count:15 |
| 0-15 |
| 2981 | p->drawLine(pos, 0, pos, tickOffset - 2); never executed: p->drawLine(pos, 0, pos, tickOffset - 2); | 0 |
| 2982 | if (ticks & QSlider::TicksBelow) partially evaluated: ticks & QSlider::TicksBelow| no Evaluation Count:0 | yes Evaluation Count:15 |
| 0-15 |
| 2983 | p->drawLine(pos, tickOffset + thickness + 1, pos, | 0 |
| 2984 | slider->rect.height()-1); never executed: p->drawLine(pos, tickOffset + thickness + 1, pos, slider->rect.height()-1); | 0 |
| 2985 | } else { executed: }Execution Count:15 | 15 |
| 2986 | if (ticks & QSlider::TicksAbove) never evaluated: ticks & QSlider::TicksAbove | 0 |
| 2987 | p->drawLine(0, pos, tickOffset - 2, pos); never executed: p->drawLine(0, pos, tickOffset - 2, pos); | 0 |
| 2988 | if (ticks & QSlider::TicksBelow) never evaluated: ticks & QSlider::TicksBelow | 0 |
| 2989 | p->drawLine(tickOffset + thickness + 1, pos, | 0 |
| 2990 | slider->rect.width()-1, pos); never executed: p->drawLine(tickOffset + thickness + 1, pos, slider->rect.width()-1, pos); | 0 |
| 2991 | } | 0 |
| 2992 | | - |
| 2993 | int nextInterval = v + interval; | - |
| 2994 | if (nextInterval < v) partially evaluated: nextInterval < v| no Evaluation Count:0 | yes Evaluation Count:15 |
| 0-15 |
| 2995 | break; | 0 |
| 2996 | v = nextInterval; | - |
| 2997 | } executed: }Execution Count:15 | 15 |
| 2998 | p->restore(); | - |
| 2999 | } executed: }Execution Count:3 | 3 |
| 3000 | } executed: }Execution Count:3 | 3 |
| 3001 | break; executed: break;Execution Count:3 | 3 |
| 3002 | | - |
| 3003 | | - |
| 3004 | case CC_ScrollBar: | - |
| 3005 | if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(opt)) { partially evaluated: const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(opt)| yes Evaluation Count:2941 | no Evaluation Count:0 |
| 0-2941 |
| 3006 | | - |
| 3007 | QStyleOptionSlider newScrollbar = *scrollbar; | - |
| 3008 | State saveFlags = scrollbar->state; | - |
| 3009 | | - |
| 3010 | if (scrollbar->subControls & SC_ScrollBarSubLine) { partially evaluated: scrollbar->subControls & SC_ScrollBarSubLine| yes Evaluation Count:2941 | no Evaluation Count:0 |
| 0-2941 |
| 3011 | newScrollbar.state = saveFlags; | - |
| 3012 | newScrollbar.rect = proxy()->subControlRect(cc, &newScrollbar, SC_ScrollBarSubLine, widget); | - |
| 3013 | if (newScrollbar.rect.isValid()) { partially evaluated: newScrollbar.rect.isValid()| yes Evaluation Count:2941 | no Evaluation Count:0 |
| 0-2941 |
| 3014 | if (!(scrollbar->activeSubControls & SC_ScrollBarSubLine)) partially evaluated: !(scrollbar->activeSubControls & SC_ScrollBarSubLine)| yes Evaluation Count:2941 | no Evaluation Count:0 |
| 0-2941 |
| 3015 | newScrollbar.state &= ~(State_Sunken | State_MouseOver); executed: newScrollbar.state &= ~(State_Sunken | State_MouseOver);Execution Count:2941 | 2941 |
| 3016 | proxy()->drawControl(CE_ScrollBarSubLine, &newScrollbar, p, widget); | - |
| 3017 | } executed: }Execution Count:2941 | 2941 |
| 3018 | } executed: }Execution Count:2941 | 2941 |
| 3019 | if (scrollbar->subControls & SC_ScrollBarAddLine) { partially evaluated: scrollbar->subControls & SC_ScrollBarAddLine| yes Evaluation Count:2941 | no Evaluation Count:0 |
| 0-2941 |
| 3020 | newScrollbar.rect = scrollbar->rect; | - |
| 3021 | newScrollbar.state = saveFlags; | - |
| 3022 | newScrollbar.rect = proxy()->subControlRect(cc, &newScrollbar, SC_ScrollBarAddLine, widget); | - |
| 3023 | if (newScrollbar.rect.isValid()) { partially evaluated: newScrollbar.rect.isValid()| yes Evaluation Count:2941 | no Evaluation Count:0 |
| 0-2941 |
| 3024 | if (!(scrollbar->activeSubControls & SC_ScrollBarAddLine)) evaluated: !(scrollbar->activeSubControls & SC_ScrollBarAddLine)| yes Evaluation Count:2940 | yes Evaluation Count:1 |
| 1-2940 |
| 3025 | newScrollbar.state &= ~(State_Sunken | State_MouseOver); executed: newScrollbar.state &= ~(State_Sunken | State_MouseOver);Execution Count:2940 | 2940 |
| 3026 | proxy()->drawControl(CE_ScrollBarAddLine, &newScrollbar, p, widget); | - |
| 3027 | } executed: }Execution Count:2941 | 2941 |
| 3028 | } executed: }Execution Count:2941 | 2941 |
| 3029 | if (scrollbar->subControls & SC_ScrollBarSubPage) { partially evaluated: scrollbar->subControls & SC_ScrollBarSubPage| yes Evaluation Count:2941 | no Evaluation Count:0 |
| 0-2941 |
| 3030 | newScrollbar.rect = scrollbar->rect; | - |
| 3031 | newScrollbar.state = saveFlags; | - |
| 3032 | newScrollbar.rect = proxy()->subControlRect(cc, &newScrollbar, SC_ScrollBarSubPage, widget); | - |
| 3033 | if (newScrollbar.rect.isValid()) { evaluated: newScrollbar.rect.isValid()| yes Evaluation Count:2265 | yes Evaluation Count:676 |
| 676-2265 |
| 3034 | if (!(scrollbar->activeSubControls & SC_ScrollBarSubPage)) partially evaluated: !(scrollbar->activeSubControls & SC_ScrollBarSubPage)| yes Evaluation Count:2265 | no Evaluation Count:0 |
| 0-2265 |
| 3035 | newScrollbar.state &= ~(State_Sunken | State_MouseOver); executed: newScrollbar.state &= ~(State_Sunken | State_MouseOver);Execution Count:2265 | 2265 |
| 3036 | proxy()->drawControl(CE_ScrollBarSubPage, &newScrollbar, p, widget); | - |
| 3037 | } executed: }Execution Count:2265 | 2265 |
| 3038 | } executed: }Execution Count:2941 | 2941 |
| 3039 | if (scrollbar->subControls & SC_ScrollBarAddPage) { partially evaluated: scrollbar->subControls & SC_ScrollBarAddPage| yes Evaluation Count:2941 | no Evaluation Count:0 |
| 0-2941 |
| 3040 | newScrollbar.rect = scrollbar->rect; | - |
| 3041 | newScrollbar.state = saveFlags; | - |
| 3042 | newScrollbar.rect = proxy()->subControlRect(cc, &newScrollbar, SC_ScrollBarAddPage, widget); | - |
| 3043 | if (newScrollbar.rect.isValid()) { evaluated: newScrollbar.rect.isValid()| yes Evaluation Count:2744 | yes Evaluation Count:197 |
| 197-2744 |
| 3044 | if (!(scrollbar->activeSubControls & SC_ScrollBarAddPage)) partially evaluated: !(scrollbar->activeSubControls & SC_ScrollBarAddPage)| yes Evaluation Count:2744 | no Evaluation Count:0 |
| 0-2744 |
| 3045 | newScrollbar.state &= ~(State_Sunken | State_MouseOver); executed: newScrollbar.state &= ~(State_Sunken | State_MouseOver);Execution Count:2744 | 2744 |
| 3046 | proxy()->drawControl(CE_ScrollBarAddPage, &newScrollbar, p, widget); | - |
| 3047 | } executed: }Execution Count:2744 | 2744 |
| 3048 | } executed: }Execution Count:2941 | 2941 |
| 3049 | if (scrollbar->subControls & SC_ScrollBarFirst) { partially evaluated: scrollbar->subControls & SC_ScrollBarFirst| yes Evaluation Count:2941 | no Evaluation Count:0 |
| 0-2941 |
| 3050 | newScrollbar.rect = scrollbar->rect; | - |
| 3051 | newScrollbar.state = saveFlags; | - |
| 3052 | newScrollbar.rect = proxy()->subControlRect(cc, &newScrollbar, SC_ScrollBarFirst, widget); | - |
| 3053 | if (newScrollbar.rect.isValid()) { partially evaluated: newScrollbar.rect.isValid()| no Evaluation Count:0 | yes Evaluation Count:2941 |
| 0-2941 |
| 3054 | if (!(scrollbar->activeSubControls & SC_ScrollBarFirst)) never evaluated: !(scrollbar->activeSubControls & SC_ScrollBarFirst) | 0 |
| 3055 | newScrollbar.state &= ~(State_Sunken | State_MouseOver); never executed: newScrollbar.state &= ~(State_Sunken | State_MouseOver); | 0 |
| 3056 | proxy()->drawControl(CE_ScrollBarFirst, &newScrollbar, p, widget); | - |
| 3057 | } | 0 |
| 3058 | } executed: }Execution Count:2941 | 2941 |
| 3059 | if (scrollbar->subControls & SC_ScrollBarLast) { partially evaluated: scrollbar->subControls & SC_ScrollBarLast| yes Evaluation Count:2941 | no Evaluation Count:0 |
| 0-2941 |
| 3060 | newScrollbar.rect = scrollbar->rect; | - |
| 3061 | newScrollbar.state = saveFlags; | - |
| 3062 | newScrollbar.rect = proxy()->subControlRect(cc, &newScrollbar, SC_ScrollBarLast, widget); | - |
| 3063 | if (newScrollbar.rect.isValid()) { partially evaluated: newScrollbar.rect.isValid()| no Evaluation Count:0 | yes Evaluation Count:2941 |
| 0-2941 |
| 3064 | if (!(scrollbar->activeSubControls & SC_ScrollBarLast)) never evaluated: !(scrollbar->activeSubControls & SC_ScrollBarLast) | 0 |
| 3065 | newScrollbar.state &= ~(State_Sunken | State_MouseOver); never executed: newScrollbar.state &= ~(State_Sunken | State_MouseOver); | 0 |
| 3066 | proxy()->drawControl(CE_ScrollBarLast, &newScrollbar, p, widget); | - |
| 3067 | } | 0 |
| 3068 | } executed: }Execution Count:2941 | 2941 |
| 3069 | if (scrollbar->subControls & SC_ScrollBarSlider) { partially evaluated: scrollbar->subControls & SC_ScrollBarSlider| yes Evaluation Count:2941 | no Evaluation Count:0 |
| 0-2941 |
| 3070 | newScrollbar.rect = scrollbar->rect; | - |
| 3071 | newScrollbar.state = saveFlags; | - |
| 3072 | newScrollbar.rect = proxy()->subControlRect(cc, &newScrollbar, SC_ScrollBarSlider, widget); | - |
| 3073 | if (newScrollbar.rect.isValid()) { evaluated: newScrollbar.rect.isValid()| yes Evaluation Count:2929 | yes Evaluation Count:12 |
| 12-2929 |
| 3074 | if (!(scrollbar->activeSubControls & SC_ScrollBarSlider)) partially evaluated: !(scrollbar->activeSubControls & SC_ScrollBarSlider)| yes Evaluation Count:2929 | no Evaluation Count:0 |
| 0-2929 |
| 3075 | newScrollbar.state &= ~(State_Sunken | State_MouseOver); executed: newScrollbar.state &= ~(State_Sunken | State_MouseOver);Execution Count:2929 | 2929 |
| 3076 | proxy()->drawControl(CE_ScrollBarSlider, &newScrollbar, p, widget); | - |
| 3077 | | - |
| 3078 | if (scrollbar->state & State_HasFocus) { partially evaluated: scrollbar->state & State_HasFocus| no Evaluation Count:0 | yes Evaluation Count:2929 |
| 0-2929 |
| 3079 | QStyleOptionFocusRect fropt; | - |
| 3080 | fropt.QStyleOption::operator=(newScrollbar); | - |
| 3081 | fropt.rect.setRect(newScrollbar.rect.x() + 2, newScrollbar.rect.y() + 2, | - |
| 3082 | newScrollbar.rect.width() - 5, | - |
| 3083 | newScrollbar.rect.height() - 5); | - |
| 3084 | proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, p, widget); | - |
| 3085 | } | 0 |
| 3086 | } executed: }Execution Count:2929 | 2929 |
| 3087 | } executed: }Execution Count:2941 | 2941 |
| 3088 | } executed: }Execution Count:2941 | 2941 |
| 3089 | break; executed: break;Execution Count:2941 | 2941 |
| 3090 | | - |
| 3091 | | - |
| 3092 | case CC_SpinBox: | - |
| 3093 | if (const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) { never evaluated: const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(opt) | 0 |
| 3094 | QStyleOptionSpinBox copy = *sb; | - |
| 3095 | PrimitiveElement pe; | - |
| 3096 | | - |
| 3097 | if (sb->frame && (sb->subControls & SC_SpinBoxFrame)) { never evaluated: sb->frame never evaluated: (sb->subControls & SC_SpinBoxFrame) | 0 |
| 3098 | QRect r = proxy()->subControlRect(CC_SpinBox, sb, SC_SpinBoxFrame, widget); | - |
| 3099 | qDrawWinPanel(p, r, sb->palette, true); | - |
| 3100 | } | 0 |
| 3101 | | - |
| 3102 | if (sb->subControls & SC_SpinBoxUp) { never evaluated: sb->subControls & SC_SpinBoxUp | 0 |
| 3103 | copy.subControls = SC_SpinBoxUp; | - |
| 3104 | QPalette pal2 = sb->palette; | - |
| 3105 | if (!(sb->stepEnabled & QAbstractSpinBox::StepUpEnabled)) { never evaluated: !(sb->stepEnabled & QAbstractSpinBox::StepUpEnabled) | 0 |
| 3106 | pal2.setCurrentColorGroup(QPalette::Disabled); | - |
| 3107 | copy.state &= ~State_Enabled; | - |
| 3108 | } | 0 |
| 3109 | | - |
| 3110 | copy.palette = pal2; | - |
| 3111 | | - |
| 3112 | if (sb->activeSubControls == SC_SpinBoxUp && (sb->state & State_Sunken)) { never evaluated: sb->activeSubControls == SC_SpinBoxUp never evaluated: (sb->state & State_Sunken) | 0 |
| 3113 | copy.state |= State_On; | - |
| 3114 | copy.state |= State_Sunken; | - |
| 3115 | } else { | 0 |
| 3116 | copy.state |= State_Raised; | - |
| 3117 | copy.state &= ~State_Sunken; | - |
| 3118 | } | 0 |
| 3119 | pe = (sb->buttonSymbols == QAbstractSpinBox::PlusMinus ? PE_IndicatorSpinPlus never evaluated: sb->buttonSymbols == QAbstractSpinBox::PlusMinus | 0 |
| 3120 | : PE_IndicatorSpinUp); | - |
| 3121 | | - |
| 3122 | copy.rect = proxy()->subControlRect(CC_SpinBox, sb, SC_SpinBoxUp, widget); | - |
| 3123 | proxy()->drawPrimitive(PE_PanelButtonBevel, ©, p, widget); | - |
| 3124 | copy.rect.adjust(3, 0, -4, 0); | - |
| 3125 | proxy()->drawPrimitive(pe, ©, p, widget); | - |
| 3126 | } | 0 |
| 3127 | | - |
| 3128 | if (sb->subControls & SC_SpinBoxDown) { never evaluated: sb->subControls & SC_SpinBoxDown | 0 |
| 3129 | copy.subControls = SC_SpinBoxDown; | - |
| 3130 | copy.state = sb->state; | - |
| 3131 | QPalette pal2 = sb->palette; | - |
| 3132 | if (!(sb->stepEnabled & QAbstractSpinBox::StepDownEnabled)) { never evaluated: !(sb->stepEnabled & QAbstractSpinBox::StepDownEnabled) | 0 |
| 3133 | pal2.setCurrentColorGroup(QPalette::Disabled); | - |
| 3134 | copy.state &= ~State_Enabled; | - |
| 3135 | } | 0 |
| 3136 | copy.palette = pal2; | - |
| 3137 | | - |
| 3138 | if (sb->activeSubControls == SC_SpinBoxDown && (sb->state & State_Sunken)) { never evaluated: sb->activeSubControls == SC_SpinBoxDown never evaluated: (sb->state & State_Sunken) | 0 |
| 3139 | copy.state |= State_On; | - |
| 3140 | copy.state |= State_Sunken; | - |
| 3141 | } else { | 0 |
| 3142 | copy.state |= State_Raised; | - |
| 3143 | copy.state &= ~State_Sunken; | - |
| 3144 | } | 0 |
| 3145 | pe = (sb->buttonSymbols == QAbstractSpinBox::PlusMinus ? PE_IndicatorSpinMinus never evaluated: sb->buttonSymbols == QAbstractSpinBox::PlusMinus | 0 |
| 3146 | : PE_IndicatorSpinDown); | - |
| 3147 | | - |
| 3148 | copy.rect = proxy()->subControlRect(CC_SpinBox, sb, SC_SpinBoxDown, widget); | - |
| 3149 | proxy()->drawPrimitive(PE_PanelButtonBevel, ©, p, widget); | - |
| 3150 | copy.rect.adjust(3, 0, -4, 0); | - |
| 3151 | proxy()->drawPrimitive(pe, ©, p, widget); | - |
| 3152 | } | 0 |
| 3153 | } | 0 |
| 3154 | break; | 0 |
| 3155 | | - |
| 3156 | | - |
| 3157 | case CC_ToolButton: | - |
| 3158 | if (const QStyleOptionToolButton *toolbutton | 0-451 |
| 3159 | = qstyleoption_cast<const QStyleOptionToolButton *>(opt)) { partially evaluated: const QStyleOptionToolButton *toolbutton = qstyleoption_cast<const QStyleOptionToolButton *>(opt)| yes Evaluation Count:451 | no Evaluation Count:0 |
| 0-451 |
| 3160 | QRect button, menuarea; | - |
| 3161 | button = proxy()->subControlRect(cc, toolbutton, SC_ToolButton, widget); | - |
| 3162 | menuarea = proxy()->subControlRect(cc, toolbutton, SC_ToolButtonMenu, widget); | - |
| 3163 | | - |
| 3164 | State bflags = toolbutton->state & ~State_Sunken; | - |
| 3165 | | - |
| 3166 | if (bflags & State_AutoRaise) { evaluated: bflags & State_AutoRaise| yes Evaluation Count:437 | yes Evaluation Count:14 |
| 14-437 |
| 3167 | if (!(bflags & State_MouseOver) || !(bflags & State_Enabled)) { evaluated: !(bflags & State_MouseOver)| yes Evaluation Count:433 | yes Evaluation Count:4 |
evaluated: !(bflags & State_Enabled)| yes Evaluation Count:1 | yes Evaluation Count:3 |
| 1-433 |
| 3168 | bflags &= ~State_Raised; | - |
| 3169 | } executed: }Execution Count:434 | 434 |
| 3170 | } executed: }Execution Count:437 | 437 |
| 3171 | State mflags = bflags; | - |
| 3172 | if (toolbutton->state & State_Sunken) { evaluated: toolbutton->state & State_Sunken| yes Evaluation Count:56 | yes Evaluation Count:395 |
| 56-395 |
| 3173 | if (toolbutton->activeSubControls & SC_ToolButton) evaluated: toolbutton->activeSubControls & SC_ToolButton| yes Evaluation Count:54 | yes Evaluation Count:2 |
| 2-54 |
| 3174 | bflags |= State_Sunken; executed: bflags |= State_Sunken;Execution Count:54 | 54 |
| 3175 | mflags |= State_Sunken; | - |
| 3176 | } executed: }Execution Count:56 | 56 |
| 3177 | | - |
| 3178 | QStyleOption tool(0); | - |
| 3179 | tool.palette = toolbutton->palette; | - |
| 3180 | if (toolbutton->subControls & SC_ToolButton) { evaluated: toolbutton->subControls & SC_ToolButton| yes Evaluation Count:393 | yes Evaluation Count:58 |
| 58-393 |
| 3181 | if (bflags & (State_Sunken | State_On | State_Raised)) { evaluated: bflags & (State_Sunken | State_On | State_Raised)| yes Evaluation Count:63 | yes Evaluation Count:330 |
| 63-330 |
| 3182 | tool.rect = button; | - |
| 3183 | tool.state = bflags; | - |
| 3184 | proxy()->drawPrimitive(PE_PanelButtonTool, &tool, p, widget); | - |
| 3185 | } executed: }Execution Count:63 | 63 |
| 3186 | } executed: }Execution Count:393 | 393 |
| 3187 | | - |
| 3188 | if (toolbutton->state & State_HasFocus) { evaluated: toolbutton->state & State_HasFocus| yes Evaluation Count:5 | yes Evaluation Count:446 |
| 5-446 |
| 3189 | QStyleOptionFocusRect fr; | - |
| 3190 | fr.QStyleOption::operator=(*toolbutton); | - |
| 3191 | fr.rect.adjust(3, 3, -3, -3); | - |
| 3192 | if (toolbutton->features & QStyleOptionToolButton::MenuButtonPopup) partially evaluated: toolbutton->features & QStyleOptionToolButton::MenuButtonPopup| no Evaluation Count:0 | yes Evaluation Count:5 |
| 0-5 |
| 3193 | fr.rect.adjust(0, 0, -proxy()->pixelMetric(QStyle::PM_MenuButtonIndicator, | 0 |
| 3194 | toolbutton, widget), 0); never executed: fr.rect.adjust(0, 0, -proxy()->pixelMetric(QStyle::PM_MenuButtonIndicator, toolbutton, widget), 0); | 0 |
| 3195 | proxy()->drawPrimitive(PE_FrameFocusRect, &fr, p, widget); | - |
| 3196 | } executed: }Execution Count:5 | 5 |
| 3197 | QStyleOptionToolButton label = *toolbutton; | - |
| 3198 | label.state = bflags; | - |
| 3199 | int fw = proxy()->pixelMetric(PM_DefaultFrameWidth, opt, widget); | - |
| 3200 | label.rect = button.adjusted(fw, fw, -fw, -fw); | - |
| 3201 | proxy()->drawControl(CE_ToolButtonLabel, &label, p, widget); | - |
| 3202 | | - |
| 3203 | if (toolbutton->subControls & SC_ToolButtonMenu) { evaluated: toolbutton->subControls & SC_ToolButtonMenu| yes Evaluation Count:7 | yes Evaluation Count:444 |
| 7-444 |
| 3204 | tool.rect = menuarea; | - |
| 3205 | tool.state = mflags; | - |
| 3206 | if (mflags & (State_Sunken | State_On | State_Raised)) evaluated: mflags & (State_Sunken | State_On | State_Raised)| yes Evaluation Count:1 | yes Evaluation Count:6 |
| 1-6 |
| 3207 | proxy()->drawPrimitive(PE_IndicatorButtonDropDown, &tool, p, widget); executed: proxy()->drawPrimitive(PE_IndicatorButtonDropDown, &tool, p, widget);Execution Count:1 | 1 |
| 3208 | proxy()->drawPrimitive(PE_IndicatorArrowDown, &tool, p, widget); | - |
| 3209 | } else if (toolbutton->features & QStyleOptionToolButton::HasMenu) { evaluated: toolbutton->features & QStyleOptionToolButton::HasMenu| yes Evaluation Count:49 | yes Evaluation Count:395 |
executed: }Execution Count:7 | 7-395 |
| 3210 | int mbi = proxy()->pixelMetric(PM_MenuButtonIndicator, toolbutton, widget); | - |
| 3211 | QRect ir = toolbutton->rect; | - |
| 3212 | QStyleOptionToolButton newBtn = *toolbutton; | - |
| 3213 | newBtn.rect = QRect(ir.right() + 5 - mbi, ir.y() + ir.height() - mbi + 4, mbi - 6, mbi - 6); | - |
| 3214 | proxy()->drawPrimitive(PE_IndicatorArrowDown, &newBtn, p, widget); | - |
| 3215 | } executed: }Execution Count:49 | 49 |
| 3216 | } | - |
| 3217 | break; executed: break;Execution Count:451 | 451 |
| 3218 | | - |
| 3219 | case CC_TitleBar: | - |
| 3220 | if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)) { partially evaluated: const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)| yes Evaluation Count:211 | no Evaluation Count:0 |
| 0-211 |
| 3221 | QRect ir; | - |
| 3222 | if (opt->subControls & SC_TitleBarLabel) { partially evaluated: opt->subControls & SC_TitleBarLabel| yes Evaluation Count:211 | no Evaluation Count:0 |
| 0-211 |
| 3223 | QColor left = tb->palette.highlight().color(); | - |
| 3224 | QColor right = tb->palette.base().color(); | - |
| 3225 | | - |
| 3226 | QBrush fillBrush(left); | - |
| 3227 | if (left != right) { evaluated: left != right| yes Evaluation Count:31 | yes Evaluation Count:180 |
| 31-180 |
| 3228 | QPoint p1(tb->rect.x(), tb->rect.top() + tb->rect.height()/2); | - |
| 3229 | QPoint p2(tb->rect.right(), tb->rect.top() + tb->rect.height()/2); | - |
| 3230 | QLinearGradient lg(p1, p2); | - |
| 3231 | lg.setColorAt(0, left); | - |
| 3232 | lg.setColorAt(1, right); | - |
| 3233 | fillBrush = lg; | - |
| 3234 | } executed: }Execution Count:31 | 31 |
| 3235 | | - |
| 3236 | p->fillRect(opt->rect, fillBrush); | - |
| 3237 | | - |
| 3238 | ir = proxy()->subControlRect(CC_TitleBar, tb, SC_TitleBarLabel, widget); | - |
| 3239 | | - |
| 3240 | p->setPen(tb->palette.highlightedText().color()); | - |
| 3241 | p->drawText(ir.x() + 2, ir.y(), ir.width() - 2, ir.height(), | - |
| 3242 | Qt::AlignLeft | Qt::AlignVCenter | Qt::TextSingleLine, tb->text); | - |
| 3243 | } executed: }Execution Count:211 | 211 |
| 3244 | | - |
| 3245 | bool down = false; | - |
| 3246 | QPixmap pm; | - |
| 3247 | | - |
| 3248 | QStyleOption tool(0); | - |
| 3249 | tool.palette = tb->palette; | - |
| 3250 | if (tb->subControls & SC_TitleBarCloseButton && tb->titleBarFlags & Qt::WindowSystemMenuHint) { partially evaluated: tb->subControls & SC_TitleBarCloseButton| yes Evaluation Count:211 | no Evaluation Count:0 |
evaluated: tb->titleBarFlags & Qt::WindowSystemMenuHint| yes Evaluation Count:208 | yes Evaluation Count:3 |
| 0-211 |
| 3251 | ir = proxy()->subControlRect(CC_TitleBar, tb, SC_TitleBarCloseButton, widget); | - |
| 3252 | down = tb->activeSubControls & SC_TitleBarCloseButton && (opt->state & State_Sunken); partially evaluated: tb->activeSubControls & SC_TitleBarCloseButton| no Evaluation Count:0 | yes Evaluation Count:208 |
never evaluated: (opt->state & State_Sunken) | 0-208 |
| 3253 | if ((tb->titleBarFlags & Qt::WindowType_Mask) == Qt::Tool partially evaluated: (tb->titleBarFlags & Qt::WindowType_Mask) == Qt::Tool| no Evaluation Count:0 | yes Evaluation Count:208 |
| 0-208 |
| 3254 | | - |
| 3255 | || qobject_cast<const QDockWidget *>(widget) partially evaluated: qobject_cast<const QDockWidget *>(widget)| no Evaluation Count:0 | yes Evaluation Count:208 |
| 0-208 |
| 3256 | | - |
| 3257 | ) | - |
| 3258 | pm = standardIcon(SP_DockWidgetCloseButton, &tool, widget).pixmap(10, 10); never executed: pm = standardIcon(SP_DockWidgetCloseButton, &tool, widget).pixmap(10, 10); | 0 |
| 3259 | else | - |
| 3260 | pm = standardIcon(SP_TitleBarCloseButton, &tool, widget).pixmap(10, 10); executed: pm = standardIcon(SP_TitleBarCloseButton, &tool, widget).pixmap(10, 10);Execution Count:208 | 208 |
| 3261 | tool.rect = ir; | - |
| 3262 | tool.state = down ? State_Sunken : State_Raised; partially evaluated: down| no Evaluation Count:0 | yes Evaluation Count:208 |
| 0-208 |
| 3263 | proxy()->drawPrimitive(PE_PanelButtonTool, &tool, p, widget); | - |
| 3264 | | - |
| 3265 | p->save(); | - |
| 3266 | if (down) partially evaluated: down| no Evaluation Count:0 | yes Evaluation Count:208 |
| 0-208 |
| 3267 | p->translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, tb, widget), | 0 |
| 3268 | proxy()->pixelMetric(PM_ButtonShiftVertical, tb, widget)); never executed: p->translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, tb, widget), proxy()->pixelMetric(PM_ButtonShiftVertical, tb, widget)); | 0 |
| 3269 | proxy()->drawItemPixmap(p, ir, Qt::AlignCenter, pm); | - |
| 3270 | p->restore(); | - |
| 3271 | } executed: }Execution Count:208 | 208 |
| 3272 | | - |
| 3273 | if (tb->subControls & SC_TitleBarMaxButton evaluated: tb->subControls & SC_TitleBarMaxButton| yes Evaluation Count:183 | yes Evaluation Count:28 |
| 28-183 |
| 3274 | && tb->titleBarFlags & Qt::WindowMaximizeButtonHint evaluated: tb->titleBarFlags & Qt::WindowMaximizeButtonHint| yes Evaluation Count:180 | yes Evaluation Count:3 |
| 3-180 |
| 3275 | && !(tb->titleBarState & Qt::WindowMaximized)) { evaluated: !(tb->titleBarState & Qt::WindowMaximized)| yes Evaluation Count:152 | yes Evaluation Count:28 |
| 28-152 |
| 3276 | ir = proxy()->subControlRect(CC_TitleBar, tb, SC_TitleBarMaxButton, widget); | - |
| 3277 | | - |
| 3278 | down = tb->activeSubControls & SC_TitleBarMaxButton && (opt->state & State_Sunken); partially evaluated: tb->activeSubControls & SC_TitleBarMaxButton| no Evaluation Count:0 | yes Evaluation Count:152 |
never evaluated: (opt->state & State_Sunken) | 0-152 |
| 3279 | pm = standardIcon(SP_TitleBarMaxButton, &tool, widget).pixmap(10, 10); | - |
| 3280 | tool.rect = ir; | - |
| 3281 | tool.state = down ? State_Sunken : State_Raised; partially evaluated: down| no Evaluation Count:0 | yes Evaluation Count:152 |
| 0-152 |
| 3282 | proxy()->drawPrimitive(PE_PanelButtonTool, &tool, p, widget); | - |
| 3283 | | - |
| 3284 | p->save(); | - |
| 3285 | if (down) partially evaluated: down| no Evaluation Count:0 | yes Evaluation Count:152 |
| 0-152 |
| 3286 | p->translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, tb, widget), | 0 |
| 3287 | proxy()->pixelMetric(PM_ButtonShiftVertical, tb, widget)); never executed: p->translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, tb, widget), proxy()->pixelMetric(PM_ButtonShiftVertical, tb, widget)); | 0 |
| 3288 | proxy()->drawItemPixmap(p, ir, Qt::AlignCenter, pm); | - |
| 3289 | p->restore(); | - |
| 3290 | } executed: }Execution Count:152 | 152 |
| 3291 | | - |
| 3292 | if (tb->subControls & SC_TitleBarMinButton evaluated: tb->subControls & SC_TitleBarMinButton| yes Evaluation Count:183 | yes Evaluation Count:28 |
| 28-183 |
| 3293 | && tb->titleBarFlags & Qt::WindowMinimizeButtonHint evaluated: tb->titleBarFlags & Qt::WindowMinimizeButtonHint| yes Evaluation Count:180 | yes Evaluation Count:3 |
| 3-180 |
| 3294 | && !(tb->titleBarState & Qt::WindowMinimized)) { evaluated: !(tb->titleBarState & Qt::WindowMinimized)| yes Evaluation Count:171 | yes Evaluation Count:9 |
| 9-171 |
| 3295 | ir = proxy()->subControlRect(CC_TitleBar, tb, SC_TitleBarMinButton, widget); | - |
| 3296 | down = tb->activeSubControls & SC_TitleBarMinButton && (opt->state & State_Sunken); partially evaluated: tb->activeSubControls & SC_TitleBarMinButton| no Evaluation Count:0 | yes Evaluation Count:171 |
never evaluated: (opt->state & State_Sunken) | 0-171 |
| 3297 | pm = standardIcon(SP_TitleBarMinButton, &tool, widget).pixmap(10, 10); | - |
| 3298 | tool.rect = ir; | - |
| 3299 | tool.state = down ? State_Sunken : State_Raised; partially evaluated: down| no Evaluation Count:0 | yes Evaluation Count:171 |
| 0-171 |
| 3300 | proxy()->drawPrimitive(PE_PanelButtonTool, &tool, p, widget); | - |
| 3301 | | - |
| 3302 | p->save(); | - |
| 3303 | if (down) partially evaluated: down| no Evaluation Count:0 | yes Evaluation Count:171 |
| 0-171 |
| 3304 | p->translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, tb, widget), | 0 |
| 3305 | proxy()->pixelMetric(PM_ButtonShiftVertical, tb, widget)); never executed: p->translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, tb, widget), proxy()->pixelMetric(PM_ButtonShiftVertical, tb, widget)); | 0 |
| 3306 | proxy()->drawItemPixmap(p, ir, Qt::AlignCenter, pm); | - |
| 3307 | p->restore(); | - |
| 3308 | } executed: }Execution Count:171 | 171 |
| 3309 | | - |
| 3310 | bool drawNormalButton = (tb->subControls & SC_TitleBarNormalButton) evaluated: (tb->subControls & SC_TitleBarNormalButton)| yes Evaluation Count:183 | yes Evaluation Count:28 |
| 28-183 |
| 3311 | && (((tb->titleBarFlags & Qt::WindowMinimizeButtonHint) evaluated: (tb->titleBarFlags & Qt::WindowMinimizeButtonHint)| yes Evaluation Count:180 | yes Evaluation Count:3 |
| 3-180 |
| 3312 | && (tb->titleBarState & Qt::WindowMinimized)) evaluated: (tb->titleBarState & Qt::WindowMinimized)| yes Evaluation Count:9 | yes Evaluation Count:171 |
| 9-171 |
| 3313 | || ((tb->titleBarFlags & Qt::WindowMaximizeButtonHint) evaluated: (tb->titleBarFlags & Qt::WindowMaximizeButtonHint)| yes Evaluation Count:171 | yes Evaluation Count:3 |
| 3-171 |
| 3314 | && (tb->titleBarState & Qt::WindowMaximized))); evaluated: (tb->titleBarState & Qt::WindowMaximized)| yes Evaluation Count:28 | yes Evaluation Count:143 |
| 28-143 |
| 3315 | | - |
| 3316 | if (drawNormalButton) { evaluated: drawNormalButton| yes Evaluation Count:37 | yes Evaluation Count:174 |
| 37-174 |
| 3317 | ir = proxy()->subControlRect(CC_TitleBar, tb, SC_TitleBarNormalButton, widget); | - |
| 3318 | down = tb->activeSubControls & SC_TitleBarNormalButton && (opt->state & State_Sunken); partially evaluated: tb->activeSubControls & SC_TitleBarNormalButton| no Evaluation Count:0 | yes Evaluation Count:37 |
never evaluated: (opt->state & State_Sunken) | 0-37 |
| 3319 | pm = standardIcon(SP_TitleBarNormalButton, &tool, widget).pixmap(10, 10); | - |
| 3320 | tool.rect = ir; | - |
| 3321 | tool.state = down ? State_Sunken : State_Raised; partially evaluated: down| no Evaluation Count:0 | yes Evaluation Count:37 |
| 0-37 |
| 3322 | proxy()->drawPrimitive(PE_PanelButtonTool, &tool, p, widget); | - |
| 3323 | | - |
| 3324 | p->save(); | - |
| 3325 | if (down) partially evaluated: down| no Evaluation Count:0 | yes Evaluation Count:37 |
| 0-37 |
| 3326 | p->translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, tb, widget), | 0 |
| 3327 | proxy()->pixelMetric(PM_ButtonShiftVertical, tb, widget)); never executed: p->translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, tb, widget), proxy()->pixelMetric(PM_ButtonShiftVertical, tb, widget)); | 0 |
| 3328 | proxy()->drawItemPixmap(p, ir, Qt::AlignCenter, pm); | - |
| 3329 | p->restore(); | - |
| 3330 | } executed: }Execution Count:37 | 37 |
| 3331 | | - |
| 3332 | if (tb->subControls & SC_TitleBarShadeButton evaluated: tb->subControls & SC_TitleBarShadeButton| yes Evaluation Count:183 | yes Evaluation Count:28 |
| 28-183 |
| 3333 | && tb->titleBarFlags & Qt::WindowShadeButtonHint partially evaluated: tb->titleBarFlags & Qt::WindowShadeButtonHint| no Evaluation Count:0 | yes Evaluation Count:183 |
| 0-183 |
| 3334 | && !(tb->titleBarState & Qt::WindowMinimized)) { never evaluated: !(tb->titleBarState & Qt::WindowMinimized) | 0 |
| 3335 | ir = proxy()->subControlRect(CC_TitleBar, tb, SC_TitleBarShadeButton, widget); | - |
| 3336 | down = (tb->activeSubControls & SC_TitleBarShadeButton && (opt->state & State_Sunken)); never evaluated: tb->activeSubControls & SC_TitleBarShadeButton never evaluated: (opt->state & State_Sunken) | 0 |
| 3337 | pm = standardIcon(SP_TitleBarShadeButton, &tool, widget).pixmap(10, 10); | - |
| 3338 | tool.rect = ir; | - |
| 3339 | tool.state = down ? State_Sunken : State_Raised; | 0 |
| 3340 | proxy()->drawPrimitive(PE_PanelButtonTool, &tool, p, widget); | - |
| 3341 | p->save(); | - |
| 3342 | if (down) | 0 |
| 3343 | p->translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, tb, widget), | 0 |
| 3344 | proxy()->pixelMetric(PM_ButtonShiftVertical, tb, widget)); never executed: p->translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, tb, widget), proxy()->pixelMetric(PM_ButtonShiftVertical, tb, widget)); | 0 |
| 3345 | proxy()->drawItemPixmap(p, ir, Qt::AlignCenter, pm); | - |
| 3346 | p->restore(); | - |
| 3347 | } | 0 |
| 3348 | | - |
| 3349 | if (tb->subControls & SC_TitleBarUnshadeButton evaluated: tb->subControls & SC_TitleBarUnshadeButton| yes Evaluation Count:183 | yes Evaluation Count:28 |
| 28-183 |
| 3350 | && tb->titleBarFlags & Qt::WindowShadeButtonHint partially evaluated: tb->titleBarFlags & Qt::WindowShadeButtonHint| no Evaluation Count:0 | yes Evaluation Count:183 |
| 0-183 |
| 3351 | && tb->titleBarState & Qt::WindowMinimized) { never evaluated: tb->titleBarState & Qt::WindowMinimized | 0 |
| 3352 | ir = proxy()->subControlRect(CC_TitleBar, tb, SC_TitleBarUnshadeButton, widget); | - |
| 3353 | | - |
| 3354 | down = tb->activeSubControls & SC_TitleBarUnshadeButton && (opt->state & State_Sunken); never evaluated: tb->activeSubControls & SC_TitleBarUnshadeButton never evaluated: (opt->state & State_Sunken) | 0 |
| 3355 | pm = standardIcon(SP_TitleBarUnshadeButton, &tool, widget).pixmap(10, 10); | - |
| 3356 | tool.rect = ir; | - |
| 3357 | tool.state = down ? State_Sunken : State_Raised; | 0 |
| 3358 | proxy()->drawPrimitive(PE_PanelButtonTool, &tool, p, widget); | - |
| 3359 | p->save(); | - |
| 3360 | if (down) | 0 |
| 3361 | p->translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, tb, widget), | 0 |
| 3362 | proxy()->pixelMetric(PM_ButtonShiftVertical, tb, widget)); never executed: p->translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, tb, widget), proxy()->pixelMetric(PM_ButtonShiftVertical, tb, widget)); | 0 |
| 3363 | proxy()->drawItemPixmap(p, ir, Qt::AlignCenter, pm); | - |
| 3364 | p->restore(); | - |
| 3365 | } | 0 |
| 3366 | if (tb->subControls & SC_TitleBarContextHelpButton evaluated: tb->subControls & SC_TitleBarContextHelpButton| yes Evaluation Count:183 | yes Evaluation Count:28 |
| 28-183 |
| 3367 | && tb->titleBarFlags & Qt::WindowContextHelpButtonHint) { partially evaluated: tb->titleBarFlags & Qt::WindowContextHelpButtonHint| no Evaluation Count:0 | yes Evaluation Count:183 |
| 0-183 |
| 3368 | ir = proxy()->subControlRect(CC_TitleBar, tb, SC_TitleBarContextHelpButton, widget); | - |
| 3369 | | - |
| 3370 | down = tb->activeSubControls & SC_TitleBarContextHelpButton && (opt->state & State_Sunken); never evaluated: tb->activeSubControls & SC_TitleBarContextHelpButton never evaluated: (opt->state & State_Sunken) | 0 |
| 3371 | pm = standardIcon(SP_TitleBarContextHelpButton, &tool, widget).pixmap(10, 10); | - |
| 3372 | tool.rect = ir; | - |
| 3373 | tool.state = down ? State_Sunken : State_Raised; | 0 |
| 3374 | proxy()->drawPrimitive(PE_PanelButtonTool, &tool, p, widget); | - |
| 3375 | p->save(); | - |
| 3376 | if (down) | 0 |
| 3377 | p->translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, tb, widget), | 0 |
| 3378 | proxy()->pixelMetric(PM_ButtonShiftVertical, tb, widget)); never executed: p->translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, tb, widget), proxy()->pixelMetric(PM_ButtonShiftVertical, tb, widget)); | 0 |
| 3379 | proxy()->drawItemPixmap(p, ir, Qt::AlignCenter, pm); | - |
| 3380 | p->restore(); | - |
| 3381 | } | 0 |
| 3382 | if (tb->subControls & SC_TitleBarSysMenu && tb->titleBarFlags & Qt::WindowSystemMenuHint) { partially evaluated: tb->subControls & SC_TitleBarSysMenu| yes Evaluation Count:211 | no Evaluation Count:0 |
evaluated: tb->titleBarFlags & Qt::WindowSystemMenuHint| yes Evaluation Count:208 | yes Evaluation Count:3 |
| 0-211 |
| 3383 | ir = proxy()->subControlRect(CC_TitleBar, tb, SC_TitleBarSysMenu, widget); | - |
| 3384 | if (!tb->icon.isNull()) { evaluated: !tb->icon.isNull()| yes Evaluation Count:180 | yes Evaluation Count:28 |
| 28-180 |
| 3385 | tb->icon.paint(p, ir); | - |
| 3386 | } else { executed: }Execution Count:180 | 180 |
| 3387 | int iconSize = proxy()->pixelMetric(PM_SmallIconSize, tb, widget); | - |
| 3388 | pm = standardIcon(SP_TitleBarMenuButton, &tool, widget).pixmap(iconSize, iconSize); | - |
| 3389 | tool.rect = ir; | - |
| 3390 | p->save(); | - |
| 3391 | proxy()->drawItemPixmap(p, ir, Qt::AlignCenter, pm); | - |
| 3392 | p->restore(); | - |
| 3393 | } executed: }Execution Count:28 | 28 |
| 3394 | } | - |
| 3395 | } executed: }Execution Count:211 | 211 |
| 3396 | break; executed: break;Execution Count:211 | 211 |
| 3397 | | - |
| 3398 | case CC_Dial: | - |
| 3399 | if (const QStyleOptionSlider *dial = qstyleoption_cast<const QStyleOptionSlider *>(opt)) { partially evaluated: const QStyleOptionSlider *dial = qstyleoption_cast<const QStyleOptionSlider *>(opt)| yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
| 3400 | | - |
| 3401 | p->save(); | - |
| 3402 | | - |
| 3403 | | - |
| 3404 | if (p->paintEngine()->hasFeature(QPaintEngine::Antialiasing)) partially evaluated: p->paintEngine()->hasFeature(QPaintEngine::Antialiasing)| yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
| 3405 | p->setRenderHint(QPainter::Antialiasing); executed: p->setRenderHint(QPainter::Antialiasing);Execution Count:6 | 6 |
| 3406 | | - |
| 3407 | int width = dial->rect.width(); | - |
| 3408 | int height = dial->rect.height(); | - |
| 3409 | qreal r = qMin(width, height) / 2; | - |
| 3410 | qreal d_ = r / 6; | - |
| 3411 | qreal dx = dial->rect.x() + d_ + (width - 2 * r) / 2 + 1; | - |
| 3412 | qreal dy = dial->rect.y() + d_ + (height - 2 * r) / 2 + 1; | - |
| 3413 | QRect br = QRect(int(dx), int(dy), int(r * 2 - 2 * d_ - 2), int(r * 2 - 2 * d_ - 2)); | - |
| 3414 | | - |
| 3415 | QPalette pal = opt->palette; | - |
| 3416 | | - |
| 3417 | if (dial->subControls & QStyle::SC_DialTickmarks) { evaluated: dial->subControls & QStyle::SC_DialTickmarks| yes Evaluation Count:3 | yes Evaluation Count:3 |
| 3 |
| 3418 | p->setPen(pal.foreground().color()); | - |
| 3419 | p->drawLines(QStyleHelper::calcLines(dial)); | - |
| 3420 | } executed: }Execution Count:3 | 3 |
| 3421 | | - |
| 3422 | if (dial->state & State_Enabled) { partially evaluated: dial->state & State_Enabled| yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
| 3423 | p->setBrush(pal.brush(QPalette::ColorRole(proxy()->styleHint(SH_Dial_BackgroundRole, | - |
| 3424 | dial, widget)))); | - |
| 3425 | p->setPen(Qt::NoPen); | - |
| 3426 | p->drawEllipse(br); | - |
| 3427 | p->setBrush(Qt::NoBrush); | - |
| 3428 | } executed: }Execution Count:6 | 6 |
| 3429 | p->setPen(QPen(pal.dark().color())); | - |
| 3430 | p->drawArc(br, 60 * 16, 180 * 16); | - |
| 3431 | p->setPen(QPen(pal.light().color())); | - |
| 3432 | p->drawArc(br, 240 * 16, 180 * 16); | - |
| 3433 | | - |
| 3434 | qreal a; | - |
| 3435 | QPolygonF arrow(calcArrow(dial, a)); | - |
| 3436 | | - |
| 3437 | p->setPen(Qt::NoPen); | - |
| 3438 | p->setBrush(pal.button()); | - |
| 3439 | p->setRenderHint(QPainter::Qt4CompatiblePainting); | - |
| 3440 | p->drawPolygon(arrow); | - |
| 3441 | | - |
| 3442 | a = QStyleHelper::angle(QPointF(width / 2, height / 2), arrow[0]); | - |
| 3443 | p->setBrush(Qt::NoBrush); | - |
| 3444 | | - |
| 3445 | if (a <= 0 || a > 200) { evaluated: a <= 0| yes Evaluation Count:3 | yes Evaluation Count:3 |
partially evaluated: a > 200| yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-3 |
| 3446 | p->setPen(pal.light().color()); | - |
| 3447 | p->drawLine(arrow[2], arrow[0]); | - |
| 3448 | p->drawLine(arrow[1], arrow[2]); | - |
| 3449 | p->setPen(pal.dark().color()); | - |
| 3450 | p->drawLine(arrow[0], arrow[1]); | - |
| 3451 | } else if (a > 0 && a < 45) { executed: }Execution Count:6 | 0-6 |
| 3452 | p->setPen(pal.light().color()); | - |
| 3453 | p->drawLine(arrow[2], arrow[0]); | - |
| 3454 | p->setPen(pal.dark().color()); | - |
| 3455 | p->drawLine(arrow[1], arrow[2]); | - |
| 3456 | p->drawLine(arrow[0], arrow[1]); | - |
| 3457 | } else if (a >= 45 && a < 135) { | 0 |
| 3458 | p->setPen(pal.dark().color()); | - |
| 3459 | p->drawLine(arrow[2], arrow[0]); | - |
| 3460 | p->drawLine(arrow[1], arrow[2]); | - |
| 3461 | p->setPen(pal.light().color()); | - |
| 3462 | p->drawLine(arrow[0], arrow[1]); | - |
| 3463 | } else if (a >= 135 && a < 200) { never evaluated: a >= 135 | 0 |
| 3464 | p->setPen(pal.dark().color()); | - |
| 3465 | p->drawLine(arrow[2], arrow[0]); | - |
| 3466 | p->setPen(pal.light().color()); | - |
| 3467 | p->drawLine(arrow[0], arrow[1]); | - |
| 3468 | p->drawLine(arrow[1], arrow[2]); | - |
| 3469 | } | 0 |
| 3470 | | - |
| 3471 | | - |
| 3472 | QStyleOptionFocusRect fropt; | - |
| 3473 | fropt.rect = dial->rect; | - |
| 3474 | fropt.state = dial->state; | - |
| 3475 | fropt.palette = dial->palette; | - |
| 3476 | if (fropt.state & QStyle::State_HasFocus) { evaluated: fropt.state & QStyle::State_HasFocus| yes Evaluation Count:1 | yes Evaluation Count:5 |
| 1-5 |
| 3477 | br.adjust(0, 0, 2, 2); | - |
| 3478 | if (dial->subControls & SC_DialTickmarks) { partially evaluated: dial->subControls & SC_DialTickmarks| no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
| 3479 | int r = qMin(width, height) / 2; | - |
| 3480 | br.translate(-r / 6, - r / 6); | - |
| 3481 | br.setWidth(br.width() + r / 3); | - |
| 3482 | br.setHeight(br.height() + r / 3); | - |
| 3483 | } | 0 |
| 3484 | fropt.rect = br.adjusted(-2, -2, 2, 2); | - |
| 3485 | proxy()->drawPrimitive(QStyle::PE_FrameFocusRect, &fropt, p, widget); | - |
| 3486 | } executed: }Execution Count:1 | 1 |
| 3487 | p->restore(); | - |
| 3488 | } executed: }Execution Count:6 | 6 |
| 3489 | break; executed: break;Execution Count:6 | 6 |
| 3490 | | - |
| 3491 | | - |
| 3492 | case CC_GroupBox: | - |
| 3493 | if (const QStyleOptionGroupBox *groupBox = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)) { partially evaluated: const QStyleOptionGroupBox *groupBox = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)| yes Evaluation Count:32 | no Evaluation Count:0 |
| 0-32 |
| 3494 | | - |
| 3495 | QRect textRect = proxy()->subControlRect(CC_GroupBox, opt, SC_GroupBoxLabel, widget); | - |
| 3496 | QRect checkBoxRect = proxy()->subControlRect(CC_GroupBox, opt, SC_GroupBoxCheckBox, widget); | - |
| 3497 | if (groupBox->subControls & QStyle::SC_GroupBoxFrame) { partially evaluated: groupBox->subControls & QStyle::SC_GroupBoxFrame| yes Evaluation Count:32 | no Evaluation Count:0 |
| 0-32 |
| 3498 | QStyleOptionFrameV2 frame; | - |
| 3499 | frame.QStyleOption::operator=(*groupBox); | - |
| 3500 | frame.features = groupBox->features; | - |
| 3501 | frame.lineWidth = groupBox->lineWidth; | - |
| 3502 | frame.midLineWidth = groupBox->midLineWidth; | - |
| 3503 | frame.rect = proxy()->subControlRect(CC_GroupBox, opt, SC_GroupBoxFrame, widget); | - |
| 3504 | p->save(); | - |
| 3505 | QRegion region(groupBox->rect); | - |
| 3506 | if (!groupBox->text.isEmpty()) { evaluated: !groupBox->text.isEmpty()| yes Evaluation Count:28 | yes Evaluation Count:4 |
| 4-28 |
| 3507 | bool ltr = groupBox->direction == Qt::LeftToRight; | - |
| 3508 | QRect finalRect; | - |
| 3509 | if (groupBox->subControls & QStyle::SC_GroupBoxCheckBox) { evaluated: groupBox->subControls & QStyle::SC_GroupBoxCheckBox| yes Evaluation Count:5 | yes Evaluation Count:23 |
| 5-23 |
| 3510 | finalRect = checkBoxRect.united(textRect); | - |
| 3511 | finalRect.adjust(ltr ? -4 : 0, 0, ltr ? 0 : 4, 0); | - |
| 3512 | } else { executed: }Execution Count:5 | 5 |
| 3513 | finalRect = textRect; | - |
| 3514 | } executed: }Execution Count:23 | 23 |
| 3515 | region -= finalRect; | - |
| 3516 | } executed: }Execution Count:28 | 28 |
| 3517 | p->setClipRegion(region); | - |
| 3518 | proxy()->drawPrimitive(PE_FrameGroupBox, &frame, p, widget); | - |
| 3519 | p->restore(); | - |
| 3520 | } executed: }Execution Count:32 | 32 |
| 3521 | | - |
| 3522 | | - |
| 3523 | if ((groupBox->subControls & QStyle::SC_GroupBoxLabel) && !groupBox->text.isEmpty()) { evaluated: (groupBox->subControls & QStyle::SC_GroupBoxLabel)| yes Evaluation Count:31 | yes Evaluation Count:1 |
evaluated: !groupBox->text.isEmpty()| yes Evaluation Count:28 | yes Evaluation Count:3 |
| 1-31 |
| 3524 | QColor textColor = groupBox->textColor; | - |
| 3525 | if (textColor.isValid()) partially evaluated: textColor.isValid()| yes Evaluation Count:28 | no Evaluation Count:0 |
| 0-28 |
| 3526 | p->setPen(textColor); executed: p->setPen(textColor);Execution Count:28 | 28 |
| 3527 | int alignment = int(groupBox->textAlignment); | - |
| 3528 | if (!proxy()->styleHint(QStyle::SH_UnderlineShortcut, opt, widget)) partially evaluated: !proxy()->styleHint(QStyle::SH_UnderlineShortcut, opt, widget)| no Evaluation Count:0 | yes Evaluation Count:28 |
| 0-28 |
| 3529 | alignment |= Qt::TextHideMnemonic; never executed: alignment |= Qt::TextHideMnemonic; | 0 |
| 3530 | | - |
| 3531 | proxy()->drawItemText(p, textRect, Qt::TextShowMnemonic | Qt::AlignHCenter | alignment, | - |
| 3532 | groupBox->palette, groupBox->state & State_Enabled, groupBox->text, | - |
| 3533 | textColor.isValid() ? QPalette::NoRole : QPalette::WindowText); | - |
| 3534 | | - |
| 3535 | if (groupBox->state & State_HasFocus) { partially evaluated: groupBox->state & State_HasFocus| no Evaluation Count:0 | yes Evaluation Count:28 |
| 0-28 |
| 3536 | QStyleOptionFocusRect fropt; | - |
| 3537 | fropt.QStyleOption::operator=(*groupBox); | - |
| 3538 | fropt.rect = textRect; | - |
| 3539 | proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, p, widget); | - |
| 3540 | } | 0 |
| 3541 | } executed: }Execution Count:28 | 28 |
| 3542 | | - |
| 3543 | | - |
| 3544 | if (groupBox->subControls & SC_GroupBoxCheckBox) { evaluated: groupBox->subControls & SC_GroupBoxCheckBox| yes Evaluation Count:8 | yes Evaluation Count:24 |
| 8-24 |
| 3545 | QStyleOptionButton box; | - |
| 3546 | box.QStyleOption::operator=(*groupBox); | - |
| 3547 | box.rect = checkBoxRect; | - |
| 3548 | proxy()->drawPrimitive(PE_IndicatorCheckBox, &box, p, widget); | - |
| 3549 | } executed: }Execution Count:8 | 8 |
| 3550 | } executed: }Execution Count:32 | 32 |
| 3551 | break; executed: break;Execution Count:32 | 32 |
| 3552 | | - |
| 3553 | | - |
| 3554 | case CC_MdiControls: | - |
| 3555 | { | - |
| 3556 | QStyleOptionButton btnOpt; | - |
| 3557 | btnOpt.QStyleOption::operator=(*opt); | - |
| 3558 | btnOpt.state &= ~State_MouseOver; | - |
| 3559 | int bsx = 0; | - |
| 3560 | int bsy = 0; | - |
| 3561 | if (opt->subControls & QStyle::SC_MdiCloseButton) { partially evaluated: opt->subControls & QStyle::SC_MdiCloseButton| yes Evaluation Count:24 | no Evaluation Count:0 |
| 0-24 |
| 3562 | if (opt->activeSubControls & QStyle::SC_MdiCloseButton && (opt->state & State_Sunken)) { partially evaluated: opt->activeSubControls & QStyle::SC_MdiCloseButton| no Evaluation Count:0 | yes Evaluation Count:24 |
never evaluated: (opt->state & State_Sunken) | 0-24 |
| 3563 | btnOpt.state |= State_Sunken; | - |
| 3564 | btnOpt.state &= ~State_Raised; | - |
| 3565 | bsx = proxy()->pixelMetric(PM_ButtonShiftHorizontal); | - |
| 3566 | bsy = proxy()->pixelMetric(PM_ButtonShiftVertical); | - |
| 3567 | } else { | 0 |
| 3568 | btnOpt.state |= State_Raised; | - |
| 3569 | btnOpt.state &= ~State_Sunken; | - |
| 3570 | bsx = 0; | - |
| 3571 | bsy = 0; | - |
| 3572 | } executed: }Execution Count:24 | 24 |
| 3573 | btnOpt.rect = proxy()->subControlRect(CC_MdiControls, opt, SC_MdiCloseButton, widget); | - |
| 3574 | proxy()->drawPrimitive(PE_PanelButtonCommand, &btnOpt, p, widget); | - |
| 3575 | QPixmap pm = standardIcon(SP_TitleBarCloseButton).pixmap(16, 16); | - |
| 3576 | proxy()->drawItemPixmap(p, btnOpt.rect.translated(bsx, bsy), Qt::AlignCenter, pm); | - |
| 3577 | } executed: }Execution Count:24 | 24 |
| 3578 | if (opt->subControls & QStyle::SC_MdiNormalButton) { partially evaluated: opt->subControls & QStyle::SC_MdiNormalButton| yes Evaluation Count:24 | no Evaluation Count:0 |
| 0-24 |
| 3579 | if (opt->activeSubControls & QStyle::SC_MdiNormalButton && (opt->state & State_Sunken)) { partially evaluated: opt->activeSubControls & QStyle::SC_MdiNormalButton| no Evaluation Count:0 | yes Evaluation Count:24 |
never evaluated: (opt->state & State_Sunken) | 0-24 |
| 3580 | btnOpt.state |= State_Sunken; | - |
| 3581 | btnOpt.state &= ~State_Raised; | - |
| 3582 | bsx = proxy()->pixelMetric(PM_ButtonShiftHorizontal); | - |
| 3583 | bsy = proxy()->pixelMetric(PM_ButtonShiftVertical); | - |
| 3584 | } else { | 0 |
| 3585 | btnOpt.state |= State_Raised; | - |
| 3586 | btnOpt.state &= ~State_Sunken; | - |
| 3587 | bsx = 0; | - |
| 3588 | bsy = 0; | - |
| 3589 | } executed: }Execution Count:24 | 24 |
| 3590 | btnOpt.rect = proxy()->subControlRect(CC_MdiControls, opt, SC_MdiNormalButton, widget); | - |
| 3591 | proxy()->drawPrimitive(PE_PanelButtonCommand, &btnOpt, p, widget); | - |
| 3592 | QPixmap pm = standardIcon(SP_TitleBarNormalButton).pixmap(16, 16); | - |
| 3593 | proxy()->drawItemPixmap(p, btnOpt.rect.translated(bsx, bsy), Qt::AlignCenter, pm); | - |
| 3594 | } executed: }Execution Count:24 | 24 |
| 3595 | if (opt->subControls & QStyle::SC_MdiMinButton) { partially evaluated: opt->subControls & QStyle::SC_MdiMinButton| yes Evaluation Count:24 | no Evaluation Count:0 |
| 0-24 |
| 3596 | if (opt->activeSubControls & QStyle::SC_MdiMinButton && (opt->state & State_Sunken)) { partially evaluated: opt->activeSubControls & QStyle::SC_MdiMinButton| no Evaluation Count:0 | yes Evaluation Count:24 |
never evaluated: (opt->state & State_Sunken) | 0-24 |
| 3597 | btnOpt.state |= State_Sunken; | - |
| 3598 | btnOpt.state &= ~State_Raised; | - |
| 3599 | bsx = proxy()->pixelMetric(PM_ButtonShiftHorizontal); | - |
| 3600 | bsy = proxy()->pixelMetric(PM_ButtonShiftVertical); | - |
| 3601 | } else { | 0 |
| 3602 | btnOpt.state |= State_Raised; | - |
| 3603 | btnOpt.state &= ~State_Sunken; | - |
| 3604 | bsx = 0; | - |
| 3605 | bsy = 0; | - |
| 3606 | } executed: }Execution Count:24 | 24 |
| 3607 | btnOpt.rect = proxy()->subControlRect(CC_MdiControls, opt, SC_MdiMinButton, widget); | - |
| 3608 | proxy()->drawPrimitive(PE_PanelButtonCommand, &btnOpt, p, widget); | - |
| 3609 | QPixmap pm = standardIcon(SP_TitleBarMinButton).pixmap(16, 16); | - |
| 3610 | proxy()->drawItemPixmap(p, btnOpt.rect.translated(bsx, bsy), Qt::AlignCenter, pm); | - |
| 3611 | } executed: }Execution Count:24 | 24 |
| 3612 | } | - |
| 3613 | break; executed: break;Execution Count:24 | 24 |
| 3614 | | - |
| 3615 | default: | - |
| 3616 | QMessageLogger("styles/qcommonstyle.cpp", 3742, __PRETTY_FUNCTION__).warning("QCommonStyle::drawComplexControl: Control %d not handled", cc); | - |
| 3617 | } | 0 |
| 3618 | } executed: }Execution Count:3668 | 3668 |
| 3619 | | - |
| 3620 | | - |
| 3621 | | - |
| 3622 | | - |
| 3623 | QStyle::SubControl QCommonStyle::hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, | - |
| 3624 | const QPoint &pt, const QWidget *widget) const | - |
| 3625 | { | - |
| 3626 | SubControl sc = SC_None; | - |
| 3627 | switch (cc) { | - |
| 3628 | | - |
| 3629 | case CC_Slider: | - |
| 3630 | if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) { partially evaluated: const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)| yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
| 3631 | QRect r = proxy()->subControlRect(cc, slider, SC_SliderHandle, widget); | - |
| 3632 | if (r.isValid() && r.contains(pt)) { partially evaluated: r.isValid()| yes Evaluation Count:2 | no Evaluation Count:0 |
evaluated: r.contains(pt)| yes Evaluation Count:1 | yes Evaluation Count:1 |
| 0-2 |
| 3633 | sc = SC_SliderHandle; | - |
| 3634 | } else { executed: }Execution Count:1 | 1 |
| 3635 | r = proxy()->subControlRect(cc, slider, SC_SliderGroove ,widget); | - |
| 3636 | if (r.isValid() && r.contains(pt)) partially evaluated: r.isValid()| yes Evaluation Count:1 | no Evaluation Count:0 |
partially evaluated: r.contains(pt)| yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
| 3637 | sc = SC_SliderGroove; executed: sc = SC_SliderGroove;Execution Count:1 | 1 |
| 3638 | } executed: }Execution Count:1 | 1 |
| 3639 | } | - |
| 3640 | break; executed: break;Execution Count:2 | 2 |
| 3641 | | - |
| 3642 | | - |
| 3643 | case CC_ScrollBar: | - |
| 3644 | if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(opt)) { partially evaluated: const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(opt)| yes Evaluation Count:4 | no Evaluation Count:0 |
| 0-4 |
| 3645 | QRect r; | - |
| 3646 | uint ctrl = SC_ScrollBarAddLine; | - |
| 3647 | while (ctrl <= SC_ScrollBarGroove) { partially evaluated: ctrl <= SC_ScrollBarGroove| yes Evaluation Count:12 | no Evaluation Count:0 |
| 0-12 |
| 3648 | r = proxy()->subControlRect(cc, scrollbar, QStyle::SubControl(ctrl), widget); | - |
| 3649 | if (r.isValid() && r.contains(pt)) { evaluated: r.isValid()| yes Evaluation Count:9 | yes Evaluation Count:3 |
evaluated: r.contains(pt)| yes Evaluation Count:4 | yes Evaluation Count:5 |
| 3-9 |
| 3650 | sc = QStyle::SubControl(ctrl); | - |
| 3651 | break; executed: break;Execution Count:4 | 4 |
| 3652 | } | - |
| 3653 | ctrl <<= 1; | - |
| 3654 | } executed: }Execution Count:8 | 8 |
| 3655 | } executed: }Execution Count:4 | 4 |
| 3656 | break; executed: break;Execution Count:4 | 4 |
| 3657 | | - |
| 3658 | | - |
| 3659 | case CC_ToolButton: | - |
| 3660 | if (const QStyleOptionToolButton *toolbutton = qstyleoption_cast<const QStyleOptionToolButton *>(opt)) { never evaluated: const QStyleOptionToolButton *toolbutton = qstyleoption_cast<const QStyleOptionToolButton *>(opt) | 0 |
| 3661 | QRect r; | - |
| 3662 | uint ctrl = SC_ToolButton; | - |
| 3663 | while (ctrl <= SC_ToolButtonMenu) { never evaluated: ctrl <= SC_ToolButtonMenu | 0 |
| 3664 | r = proxy()->subControlRect(cc, toolbutton, QStyle::SubControl(ctrl), widget); | - |
| 3665 | if (r.isValid() && r.contains(pt)) { never evaluated: r.isValid() never evaluated: r.contains(pt) | 0 |
| 3666 | sc = QStyle::SubControl(ctrl); | - |
| 3667 | break; | 0 |
| 3668 | } | - |
| 3669 | ctrl <<= 1; | - |
| 3670 | } | 0 |
| 3671 | } | 0 |
| 3672 | break; | 0 |
| 3673 | | - |
| 3674 | | - |
| 3675 | case CC_SpinBox: | - |
| 3676 | if (const QStyleOptionSpinBox *spinbox = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) { partially evaluated: const QStyleOptionSpinBox *spinbox = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)| yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-3 |
| 3677 | QRect r; | - |
| 3678 | uint ctrl = SC_SpinBoxUp; | - |
| 3679 | while (ctrl <= SC_SpinBoxEditField) { partially evaluated: ctrl <= SC_SpinBoxEditField| yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
| 3680 | r = proxy()->subControlRect(cc, spinbox, QStyle::SubControl(ctrl), widget); | - |
| 3681 | if (r.isValid() && r.contains(pt)) { partially evaluated: r.isValid()| yes Evaluation Count:6 | no Evaluation Count:0 |
evaluated: r.contains(pt)| yes Evaluation Count:3 | yes Evaluation Count:3 |
| 0-6 |
| 3682 | sc = QStyle::SubControl(ctrl); | - |
| 3683 | break; executed: break;Execution Count:3 | 3 |
| 3684 | } | - |
| 3685 | ctrl <<= 1; | - |
| 3686 | } executed: }Execution Count:3 | 3 |
| 3687 | } executed: }Execution Count:3 | 3 |
| 3688 | break; executed: break;Execution Count:3 | 3 |
| 3689 | | - |
| 3690 | case CC_TitleBar: | - |
| 3691 | if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)) { partially evaluated: const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)| yes Evaluation Count:21 | no Evaluation Count:0 |
| 0-21 |
| 3692 | QRect r; | - |
| 3693 | uint ctrl = SC_TitleBarSysMenu; | - |
| 3694 | | - |
| 3695 | while (ctrl <= SC_TitleBarLabel) { evaluated: ctrl <= SC_TitleBarLabel| yes Evaluation Count:189 | yes Evaluation Count:17 |
| 17-189 |
| 3696 | r = proxy()->subControlRect(cc, tb, QStyle::SubControl(ctrl), widget); | - |
| 3697 | if (r.isValid() && r.contains(pt)) { evaluated: r.isValid()| yes Evaluation Count:129 | yes Evaluation Count:60 |
evaluated: r.contains(pt)| yes Evaluation Count:4 | yes Evaluation Count:125 |
| 4-129 |
| 3698 | sc = QStyle::SubControl(ctrl); | - |
| 3699 | break; executed: break;Execution Count:4 | 4 |
| 3700 | } | - |
| 3701 | ctrl <<= 1; | - |
| 3702 | } executed: }Execution Count:185 | 185 |
| 3703 | } executed: }Execution Count:21 | 21 |
| 3704 | break; executed: break;Execution Count:21 | 21 |
| 3705 | | - |
| 3706 | case CC_ComboBox: | - |
| 3707 | if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) { partially evaluated: const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)| yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-3 |
| 3708 | QRect r; | - |
| 3709 | uint ctrl = SC_ComboBoxArrow; | - |
| 3710 | while (ctrl > 0) { partially evaluated: ctrl > 0| yes Evaluation Count:4 | no Evaluation Count:0 |
| 0-4 |
| 3711 | r = proxy()->subControlRect(cc, cb, QStyle::SubControl(ctrl), widget); | - |
| 3712 | if (r.isValid() && r.contains(pt)) { partially evaluated: r.isValid()| yes Evaluation Count:4 | no Evaluation Count:0 |
evaluated: r.contains(pt)| yes Evaluation Count:3 | yes Evaluation Count:1 |
| 0-4 |
| 3713 | sc = QStyle::SubControl(ctrl); | - |
| 3714 | break; executed: break;Execution Count:3 | 3 |
| 3715 | } | - |
| 3716 | ctrl >>= 1; | - |
| 3717 | } executed: }Execution Count:1 | 1 |
| 3718 | } executed: }Execution Count:3 | 3 |
| 3719 | break; executed: break;Execution Count:3 | 3 |
| 3720 | | - |
| 3721 | | - |
| 3722 | case CC_GroupBox: | - |
| 3723 | if (const QStyleOptionGroupBox *groupBox = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)) { partially evaluated: const QStyleOptionGroupBox *groupBox = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)| yes Evaluation Count:23 | no Evaluation Count:0 |
| 0-23 |
| 3724 | QRect r; | - |
| 3725 | uint ctrl = SC_GroupBoxCheckBox; | - |
| 3726 | while (ctrl <= SC_GroupBoxFrame) { partially evaluated: ctrl <= SC_GroupBoxFrame| yes Evaluation Count:45 | no Evaluation Count:0 |
| 0-45 |
| 3727 | r = proxy()->subControlRect(cc, groupBox, QStyle::SubControl(ctrl), widget); | - |
| 3728 | if (r.isValid() && r.contains(pt)) { partially evaluated: r.isValid()| yes Evaluation Count:45 | no Evaluation Count:0 |
evaluated: r.contains(pt)| yes Evaluation Count:23 | yes Evaluation Count:22 |
| 0-45 |
| 3729 | sc = QStyle::SubControl(ctrl); | - |
| 3730 | break; executed: break;Execution Count:23 | 23 |
| 3731 | } | - |
| 3732 | ctrl <<= 1; | - |
| 3733 | } executed: }Execution Count:22 | 22 |
| 3734 | } executed: }Execution Count:23 | 23 |
| 3735 | break; executed: break;Execution Count:23 | 23 |
| 3736 | | - |
| 3737 | case CC_MdiControls: | - |
| 3738 | { | - |
| 3739 | QRect r; | - |
| 3740 | uint ctrl = SC_MdiMinButton; | - |
| 3741 | while (ctrl <= SC_MdiCloseButton) { never evaluated: ctrl <= SC_MdiCloseButton | 0 |
| 3742 | r = proxy()->subControlRect(CC_MdiControls, opt, QStyle::SubControl(ctrl), widget); | - |
| 3743 | if (r.isValid() && r.contains(pt) && (opt->subControls & ctrl)) { never evaluated: r.isValid() never evaluated: r.contains(pt) never evaluated: (opt->subControls & ctrl) | 0 |
| 3744 | sc = QStyle::SubControl(ctrl); | - |
| 3745 | return sc; never executed: return sc; | 0 |
| 3746 | } | - |
| 3747 | ctrl <<= 1; | - |
| 3748 | } | 0 |
| 3749 | } | - |
| 3750 | break; | 0 |
| 3751 | default: | - |
| 3752 | QMessageLogger("styles/qcommonstyle.cpp", 3878, __PRETTY_FUNCTION__).warning("QCommonStyle::hitTestComplexControl: Case %d not handled", cc); | - |
| 3753 | } | 0 |
| 3754 | return sc; executed: return sc;Execution Count:56 | 56 |
| 3755 | } | - |
| 3756 | | - |
| 3757 | | - |
| 3758 | | - |
| 3759 | | - |
| 3760 | QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, | - |
| 3761 | SubControl sc, const QWidget *widget) const | - |
| 3762 | { | - |
| 3763 | QRect ret; | - |
| 3764 | switch (cc) { | - |
| 3765 | | - |
| 3766 | case CC_Slider: | - |
| 3767 | if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) { partially evaluated: const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)| yes Evaluation Count:21 | no Evaluation Count:0 |
| 0-21 |
| 3768 | int tickOffset = proxy()->pixelMetric(PM_SliderTickmarkOffset, slider, widget); | - |
| 3769 | int thickness = proxy()->pixelMetric(PM_SliderControlThickness, slider, widget); | - |
| 3770 | | - |
| 3771 | switch (sc) { | - |
| 3772 | case SC_SliderHandle: { | - |
| 3773 | int sliderPos = 0; | - |
| 3774 | int len = proxy()->pixelMetric(PM_SliderLength, slider, widget); | - |
| 3775 | bool horizontal = slider->orientation == Qt::Horizontal; | - |
| 3776 | sliderPos = sliderPositionFromValue(slider->minimum, slider->maximum, | - |
| 3777 | slider->sliderPosition, | - |
| 3778 | (horizontal ? slider->rect.width() | - |
| 3779 | : slider->rect.height()) - len, | - |
| 3780 | slider->upsideDown); | - |
| 3781 | if (horizontal) evaluated: horizontal| yes Evaluation Count:4 | yes Evaluation Count:8 |
| 4-8 |
| 3782 | ret.setRect(slider->rect.x() + sliderPos, slider->rect.y() + tickOffset, len, thickness); executed: ret.setRect(slider->rect.x() + sliderPos, slider->rect.y() + tickOffset, len, thickness);Execution Count:4 | 4 |
| 3783 | else | - |
| 3784 | ret.setRect(slider->rect.x() + tickOffset, slider->rect.y() + sliderPos, thickness, len); executed: ret.setRect(slider->rect.x() + tickOffset, slider->rect.y() + sliderPos, thickness, len);Execution Count:8 | 8 |
| 3785 | break; } executed: break;Execution Count:12 | 12 |
| 3786 | case SC_SliderGroove: | - |
| 3787 | if (slider->orientation == Qt::Horizontal) evaluated: slider->orientation == Qt::Horizontal| yes Evaluation Count:4 | yes Evaluation Count:5 |
| 4-5 |
| 3788 | ret.setRect(slider->rect.x(), slider->rect.y() + tickOffset, | 4 |
| 3789 | slider->rect.width(), thickness); executed: ret.setRect(slider->rect.x(), slider->rect.y() + tickOffset, slider->rect.width(), thickness);Execution Count:4 | 4 |
| 3790 | else | - |
| 3791 | ret.setRect(slider->rect.x() + tickOffset, slider->rect.y(), | 5 |
| 3792 | thickness, slider->rect.height()); executed: ret.setRect(slider->rect.x() + tickOffset, slider->rect.y(), thickness, slider->rect.height());Execution Count:5 | 5 |
| 3793 | break; executed: break;Execution Count:9 | 9 |
| 3794 | default: | - |
| 3795 | break; | 0 |
| 3796 | } | - |
| 3797 | ret = visualRect(slider->direction, slider->rect, ret); | - |
| 3798 | } executed: }Execution Count:21 | 21 |
| 3799 | break; executed: break;Execution Count:21 | 21 |
| 3800 | | - |
| 3801 | | - |
| 3802 | case CC_ScrollBar: | - |
| 3803 | if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(opt)) { partially evaluated: const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(opt)| yes Evaluation Count:21217 | no Evaluation Count:0 |
| 0-21217 |
| 3804 | const QRect scrollBarRect = scrollbar->rect; | - |
| 3805 | int sbextent = proxy()->pixelMetric(PM_ScrollBarExtent, scrollbar, widget); | - |
| 3806 | int maxlen = ((scrollbar->orientation == Qt::Horizontal) ? evaluated: (scrollbar->orientation == Qt::Horizontal)| yes Evaluation Count:9519 | yes Evaluation Count:11698 |
| 9519-11698 |
| 3807 | scrollBarRect.width() : scrollBarRect.height()) - (sbextent * 2); | - |
| 3808 | int sliderlen; | - |
| 3809 | | - |
| 3810 | | - |
| 3811 | if (scrollbar->maximum != scrollbar->minimum) { evaluated: scrollbar->maximum != scrollbar->minimum| yes Evaluation Count:19605 | yes Evaluation Count:1612 |
| 1612-19605 |
| 3812 | uint range = scrollbar->maximum - scrollbar->minimum; | - |
| 3813 | sliderlen = (qint64(scrollbar->pageStep) * maxlen) / (range + scrollbar->pageStep); | - |
| 3814 | | - |
| 3815 | int slidermin = proxy()->pixelMetric(PM_ScrollBarSliderMin, scrollbar, widget); | - |
| 3816 | if (sliderlen < slidermin || range > 2147483647 / 2) evaluated: sliderlen < slidermin| yes Evaluation Count:4337 | yes Evaluation Count:15268 |
partially evaluated: range > 2147483647 / 2| no Evaluation Count:0 | yes Evaluation Count:15268 |
| 0-15268 |
| 3817 | sliderlen = slidermin; executed: sliderlen = slidermin;Execution Count:4337 | 4337 |
| 3818 | if (sliderlen > maxlen) evaluated: sliderlen > maxlen| yes Evaluation Count:81 | yes Evaluation Count:19524 |
| 81-19524 |
| 3819 | sliderlen = maxlen; executed: sliderlen = maxlen;Execution Count:81 | 81 |
| 3820 | } else { executed: }Execution Count:19605 | 19605 |
| 3821 | sliderlen = maxlen; | - |
| 3822 | } executed: }Execution Count:1612 | 1612 |
| 3823 | | - |
| 3824 | int sliderstart = sbextent + sliderPositionFromValue(scrollbar->minimum, | - |
| 3825 | scrollbar->maximum, | - |
| 3826 | scrollbar->sliderPosition, | - |
| 3827 | maxlen - sliderlen, | - |
| 3828 | scrollbar->upsideDown); | - |
| 3829 | | - |
| 3830 | switch (sc) { | - |
| 3831 | case SC_ScrollBarSubLine: | - |
| 3832 | if (scrollbar->orientation == Qt::Horizontal) { evaluated: scrollbar->orientation == Qt::Horizontal| yes Evaluation Count:1380 | yes Evaluation Count:1712 |
| 1380-1712 |
| 3833 | int buttonWidth = qMin(scrollBarRect.width() / 2, sbextent); | - |
| 3834 | ret.setRect(0, 0, buttonWidth, scrollBarRect.height()); | - |
| 3835 | } else { executed: }Execution Count:1380 | 1380 |
| 3836 | int buttonHeight = qMin(scrollBarRect.height() / 2, sbextent); | - |
| 3837 | ret.setRect(0, 0, scrollBarRect.width(), buttonHeight); | - |
| 3838 | } executed: }Execution Count:1712 | 1712 |
| 3839 | break; executed: break;Execution Count:3092 | 3092 |
| 3840 | case SC_ScrollBarAddLine: | - |
| 3841 | if (scrollbar->orientation == Qt::Horizontal) { evaluated: scrollbar->orientation == Qt::Horizontal| yes Evaluation Count:1382 | yes Evaluation Count:1715 |
| 1382-1715 |
| 3842 | int buttonWidth = qMin(scrollBarRect.width()/2, sbextent); | - |
| 3843 | ret.setRect(scrollBarRect.width() - buttonWidth, 0, buttonWidth, scrollBarRect.height()); | - |
| 3844 | } else { executed: }Execution Count:1382 | 1382 |
| 3845 | int buttonHeight = qMin(scrollBarRect.height()/2, sbextent); | - |
| 3846 | ret.setRect(0, scrollBarRect.height() - buttonHeight, scrollBarRect.width(), buttonHeight); | - |
| 3847 | } executed: }Execution Count:1715 | 1715 |
| 3848 | break; executed: break;Execution Count:3097 | 3097 |
| 3849 | case SC_ScrollBarSubPage: | - |
| 3850 | if (scrollbar->orientation == Qt::Horizontal) evaluated: scrollbar->orientation == Qt::Horizontal| yes Evaluation Count:1331 | yes Evaluation Count:1615 |
| 1331-1615 |
| 3851 | ret.setRect(sbextent, 0, sliderstart - sbextent, scrollBarRect.height()); executed: ret.setRect(sbextent, 0, sliderstart - sbextent, scrollBarRect.height());Execution Count:1331 | 1331 |
| 3852 | else | - |
| 3853 | ret.setRect(0, sbextent, scrollBarRect.width(), sliderstart - sbextent); executed: ret.setRect(0, sbextent, scrollBarRect.width(), sliderstart - sbextent);Execution Count:1615 | 1615 |
| 3854 | break; executed: break;Execution Count:2946 | 2946 |
| 3855 | case SC_ScrollBarAddPage: | - |
| 3856 | if (scrollbar->orientation == Qt::Horizontal) evaluated: scrollbar->orientation == Qt::Horizontal| yes Evaluation Count:1331 | yes Evaluation Count:1618 |
| 1331-1618 |
| 3857 | ret.setRect(sliderstart + sliderlen, 0, | 1331 |
| 3858 | maxlen - sliderstart - sliderlen + sbextent, scrollBarRect.height()); executed: ret.setRect(sliderstart + sliderlen, 0, maxlen - sliderstart - sliderlen + sbextent, scrollBarRect.height());Execution Count:1331 | 1331 |
| 3859 | else | - |
| 3860 | ret.setRect(0, sliderstart + sliderlen, scrollBarRect.width(), | 1618 |
| 3861 | maxlen - sliderstart - sliderlen + sbextent); executed: ret.setRect(0, sliderstart + sliderlen, scrollBarRect.width(), maxlen - sliderstart - sliderlen + sbextent);Execution Count:1618 | 1618 |
| 3862 | break; executed: break;Execution Count:2949 | 2949 |
| 3863 | case SC_ScrollBarGroove: | - |
| 3864 | if (scrollbar->orientation == Qt::Horizontal) evaluated: scrollbar->orientation == Qt::Horizontal| yes Evaluation Count:50 | yes Evaluation Count:100 |
| 50-100 |
| 3865 | ret.setRect(sbextent, 0, scrollBarRect.width() - sbextent * 2, | 50 |
| 3866 | scrollBarRect.height()); executed: ret.setRect(sbextent, 0, scrollBarRect.width() - sbextent * 2, scrollBarRect.height());Execution Count:50 | 50 |
| 3867 | else | - |
| 3868 | ret.setRect(0, sbextent, scrollBarRect.width(), | 100 |
| 3869 | scrollBarRect.height() - sbextent * 2); executed: ret.setRect(0, sbextent, scrollBarRect.width(), scrollBarRect.height() - sbextent * 2);Execution Count:100 | 100 |
| 3870 | break; executed: break;Execution Count:150 | 150 |
| 3871 | case SC_ScrollBarSlider: | - |
| 3872 | if (scrollbar->orientation == Qt::Horizontal) evaluated: scrollbar->orientation == Qt::Horizontal| yes Evaluation Count:1382 | yes Evaluation Count:1716 |
| 1382-1716 |
| 3873 | ret.setRect(sliderstart, 0, sliderlen, scrollBarRect.height()); executed: ret.setRect(sliderstart, 0, sliderlen, scrollBarRect.height());Execution Count:1382 | 1382 |
| 3874 | else | - |
| 3875 | ret.setRect(0, sliderstart, scrollBarRect.width(), sliderlen); executed: ret.setRect(0, sliderstart, scrollBarRect.width(), sliderlen);Execution Count:1716 | 1716 |
| 3876 | break; executed: break;Execution Count:3098 | 3098 |
| 3877 | default: | - |
| 3878 | break; executed: break;Execution Count:5885 | 5885 |
| 3879 | } | - |
| 3880 | ret = visualRect(scrollbar->direction, scrollBarRect, ret); | - |
| 3881 | } executed: }Execution Count:21217 | 21217 |
| 3882 | break; executed: break;Execution Count:21217 | 21217 |
| 3883 | | - |
| 3884 | | - |
| 3885 | case CC_SpinBox: | - |
| 3886 | if (const QStyleOptionSpinBox *spinbox = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) { partially evaluated: const QStyleOptionSpinBox *spinbox = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)| yes Evaluation Count:1502 | no Evaluation Count:0 |
| 0-1502 |
| 3887 | QSize bs; | - |
| 3888 | int fw = spinbox->frame ? proxy()->pixelMetric(PM_SpinBoxFrameWidth, spinbox, widget) : 0; evaluated: spinbox->frame| yes Evaluation Count:1420 | yes Evaluation Count:82 |
| 82-1420 |
| 3889 | bs.setHeight(qMax(8, spinbox->rect.height()/2 - fw)); | - |
| 3890 | | - |
| 3891 | bs.setWidth(qMax(16, qMin(bs.height() * 8 / 5, spinbox->rect.width() / 4))); | - |
| 3892 | bs = bs.expandedTo(QApplication::globalStrut()); | - |
| 3893 | int y = fw + spinbox->rect.y(); | - |
| 3894 | int x, lx, rx; | - |
| 3895 | x = spinbox->rect.x() + spinbox->rect.width() - fw - bs.width(); | - |
| 3896 | lx = fw; | - |
| 3897 | rx = x - fw; | - |
| 3898 | switch (sc) { | - |
| 3899 | case SC_SpinBoxUp: | - |
| 3900 | if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons) partially evaluated: spinbox->buttonSymbols == QAbstractSpinBox::NoButtons| no Evaluation Count:0 | yes Evaluation Count:205 |
| 0-205 |
| 3901 | return QRect(); never executed: return QRect(); | 0 |
| 3902 | ret = QRect(x, y, bs.width(), bs.height()); | - |
| 3903 | break; executed: break;Execution Count:205 | 205 |
| 3904 | case SC_SpinBoxDown: | - |
| 3905 | if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons) partially evaluated: spinbox->buttonSymbols == QAbstractSpinBox::NoButtons| no Evaluation Count:0 | yes Evaluation Count:203 |
| 0-203 |
| 3906 | return QRect(); never executed: return QRect(); | 0 |
| 3907 | | - |
| 3908 | ret = QRect(x, y + bs.height(), bs.width(), bs.height()); | - |
| 3909 | break; executed: break;Execution Count:203 | 203 |
| 3910 | case SC_SpinBoxEditField: | - |
| 3911 | if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons) { evaluated: spinbox->buttonSymbols == QAbstractSpinBox::NoButtons| yes Evaluation Count:1 | yes Evaluation Count:907 |
| 1-907 |
| 3912 | ret = QRect(lx, fw, spinbox->rect.width() - 2*fw, spinbox->rect.height() - 2*fw); | - |
| 3913 | } else { executed: }Execution Count:1 | 1 |
| 3914 | ret = QRect(lx, fw, rx, spinbox->rect.height() - 2*fw); | - |
| 3915 | } executed: }Execution Count:907 | 907 |
| 3916 | break; executed: break;Execution Count:908 | 908 |
| 3917 | case SC_SpinBoxFrame: | - |
| 3918 | ret = spinbox->rect; | - |
| 3919 | default: | - |
| 3920 | break; executed: break;Execution Count:186 | 186 |
| 3921 | } | - |
| 3922 | ret = visualRect(spinbox->direction, spinbox->rect, ret); | - |
| 3923 | } executed: }Execution Count:1502 | 1502 |
| 3924 | break; executed: break;Execution Count:1502 | 1502 |
| 3925 | | - |
| 3926 | | - |
| 3927 | case CC_ToolButton: | - |
| 3928 | if (const QStyleOptionToolButton *tb = qstyleoption_cast<const QStyleOptionToolButton *>(opt)) { partially evaluated: const QStyleOptionToolButton *tb = qstyleoption_cast<const QStyleOptionToolButton *>(opt)| yes Evaluation Count:902 | no Evaluation Count:0 |
| 0-902 |
| 3929 | int mbi = proxy()->pixelMetric(PM_MenuButtonIndicator, tb, widget); | - |
| 3930 | ret = tb->rect; | - |
| 3931 | switch (sc) { | - |
| 3932 | case SC_ToolButton: | - |
| 3933 | if ((tb->features | 3-448 |
| 3934 | & (QStyleOptionToolButton::MenuButtonPopup | QStyleOptionToolButton::PopupDelay)) | 3-448 |
| 3935 | == QStyleOptionToolButton::MenuButtonPopup) evaluated: (tb->features & (QStyleOptionToolButton::MenuButtonPopup | QStyleOptionToolButton::PopupDelay)) == QStyleOptionToolButton::MenuButtonPopup| yes Evaluation Count:3 | yes Evaluation Count:448 |
| 3-448 |
| 3936 | ret.adjust(0, 0, -mbi, 0); executed: ret.adjust(0, 0, -mbi, 0);Execution Count:3 | 3 |
| 3937 | break; executed: break;Execution Count:451 | 451 |
| 3938 | case SC_ToolButtonMenu: | - |
| 3939 | if ((tb->features | 3-448 |
| 3940 | & (QStyleOptionToolButton::MenuButtonPopup | QStyleOptionToolButton::PopupDelay)) | 3-448 |
| 3941 | == QStyleOptionToolButton::MenuButtonPopup) evaluated: (tb->features & (QStyleOptionToolButton::MenuButtonPopup | QStyleOptionToolButton::PopupDelay)) == QStyleOptionToolButton::MenuButtonPopup| yes Evaluation Count:3 | yes Evaluation Count:448 |
| 3-448 |
| 3942 | ret.adjust(ret.width() - mbi, 0, 0, 0); executed: ret.adjust(ret.width() - mbi, 0, 0, 0);Execution Count:3 | 3 |
| 3943 | break; executed: break;Execution Count:451 | 451 |
| 3944 | default: | - |
| 3945 | break; | 0 |
| 3946 | } | - |
| 3947 | ret = visualRect(tb->direction, tb->rect, ret); | - |
| 3948 | } executed: }Execution Count:902 | 902 |
| 3949 | break; executed: break;Execution Count:902 | 902 |
| 3950 | | - |
| 3951 | | - |
| 3952 | case CC_ComboBox: | - |
| 3953 | if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) { partially evaluated: const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)| yes Evaluation Count:1003 | no Evaluation Count:0 |
| 0-1003 |
| 3954 | int x = cb->rect.x(), | - |
| 3955 | y = cb->rect.y(), | - |
| 3956 | wi = cb->rect.width(), | - |
| 3957 | he = cb->rect.height(); | - |
| 3958 | int xpos = x; | - |
| 3959 | int margin = cb->frame ? 3 : 0; evaluated: cb->frame| yes Evaluation Count:994 | yes Evaluation Count:9 |
| 9-994 |
| 3960 | int bmarg = cb->frame ? 2 : 0; evaluated: cb->frame| yes Evaluation Count:994 | yes Evaluation Count:9 |
| 9-994 |
| 3961 | xpos += wi - bmarg - 16; | - |
| 3962 | | - |
| 3963 | | - |
| 3964 | switch (sc) { | - |
| 3965 | case SC_ComboBoxFrame: | - |
| 3966 | ret = cb->rect; | - |
| 3967 | break; | 0 |
| 3968 | case SC_ComboBoxArrow: | - |
| 3969 | ret.setRect(xpos, y + bmarg, 16, he - 2*bmarg); | - |
| 3970 | break; executed: break;Execution Count:128 | 128 |
| 3971 | case SC_ComboBoxEditField: | - |
| 3972 | ret.setRect(x + margin, y + margin, wi - 2 * margin - 16, he - 2 * margin); | - |
| 3973 | break; executed: break;Execution Count:874 | 874 |
| 3974 | case SC_ComboBoxListBoxPopup: | - |
| 3975 | ret = cb->rect; | - |
| 3976 | break; executed: break;Execution Count:1 | 1 |
| 3977 | default: | - |
| 3978 | break; | 0 |
| 3979 | } | - |
| 3980 | ret = visualRect(cb->direction, cb->rect, ret); | - |
| 3981 | } executed: }Execution Count:1003 | 1003 |
| 3982 | break; executed: break;Execution Count:1003 | 1003 |
| 3983 | | - |
| 3984 | case CC_TitleBar: | - |
| 3985 | if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)) { partially evaluated: const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)| yes Evaluation Count:26342 | no Evaluation Count:0 |
| 0-26342 |
| 3986 | const int controlMargin = 2; | - |
| 3987 | const int controlHeight = tb->rect.height() - controlMargin *2; | - |
| 3988 | const int delta = controlHeight + controlMargin; | - |
| 3989 | int offset = 0; | - |
| 3990 | | - |
| 3991 | bool isMinimized = tb->titleBarState & Qt::WindowMinimized; | - |
| 3992 | bool isMaximized = tb->titleBarState & Qt::WindowMaximized; | - |
| 3993 | | - |
| 3994 | switch (sc) { | - |
| 3995 | case SC_TitleBarLabel: | - |
| 3996 | if (tb->titleBarFlags & (Qt::WindowTitleHint | Qt::WindowSystemMenuHint)) { evaluated: tb->titleBarFlags & (Qt::WindowTitleHint | Qt::WindowSystemMenuHint)| yes Evaluation Count:2898 | yes Evaluation Count:4 |
| 4-2898 |
| 3997 | ret = tb->rect; | - |
| 3998 | if (tb->titleBarFlags & Qt::WindowSystemMenuHint) evaluated: tb->titleBarFlags & Qt::WindowSystemMenuHint| yes Evaluation Count:2897 | yes Evaluation Count:1 |
| 1-2897 |
| 3999 | ret.adjust(delta, 0, -delta, 0); executed: ret.adjust(delta, 0, -delta, 0);Execution Count:2897 | 2897 |
| 4000 | if (tb->titleBarFlags & Qt::WindowMinimizeButtonHint) evaluated: tb->titleBarFlags & Qt::WindowMinimizeButtonHint| yes Evaluation Count:2897 | yes Evaluation Count:1 |
| 1-2897 |
| 4001 | ret.adjust(0, 0, -delta, 0); executed: ret.adjust(0, 0, -delta, 0);Execution Count:2897 | 2897 |
| 4002 | if (tb->titleBarFlags & Qt::WindowMaximizeButtonHint) evaluated: tb->titleBarFlags & Qt::WindowMaximizeButtonHint| yes Evaluation Count:2897 | yes Evaluation Count:1 |
| 1-2897 |
| 4003 | ret.adjust(0, 0, -delta, 0); executed: ret.adjust(0, 0, -delta, 0);Execution Count:2897 | 2897 |
| 4004 | if (tb->titleBarFlags & Qt::WindowShadeButtonHint) evaluated: tb->titleBarFlags & Qt::WindowShadeButtonHint| yes Evaluation Count:3 | yes Evaluation Count:2895 |
| 3-2895 |
| 4005 | ret.adjust(0, 0, -delta, 0); executed: ret.adjust(0, 0, -delta, 0);Execution Count:3 | 3 |
| 4006 | if (tb->titleBarFlags & Qt::WindowContextHelpButtonHint) partially evaluated: tb->titleBarFlags & Qt::WindowContextHelpButtonHint| no Evaluation Count:0 | yes Evaluation Count:2898 |
| 0-2898 |
| 4007 | ret.adjust(0, 0, -delta, 0); never executed: ret.adjust(0, 0, -delta, 0); | 0 |
| 4008 | } executed: }Execution Count:2898 | 2898 |
| 4009 | break; executed: break;Execution Count:2902 | 2902 |
| 4010 | case SC_TitleBarContextHelpButton: | - |
| 4011 | if (tb->titleBarFlags & Qt::WindowContextHelpButtonHint) partially evaluated: tb->titleBarFlags & Qt::WindowContextHelpButtonHint| no Evaluation Count:0 | yes Evaluation Count:2833 |
| 0-2833 |
| 4012 | offset += delta; never executed: offset += delta; | 0 |
| 4013 | case SC_TitleBarMinButton: code before this statement executed: case SC_TitleBarMinButton:Execution Count:2833 | 2833 |
| 4014 | if (!isMinimized && (tb->titleBarFlags & Qt::WindowMinimizeButtonHint)) evaluated: !isMinimized| yes Evaluation Count:5573 | yes Evaluation Count:264 |
evaluated: (tb->titleBarFlags & Qt::WindowMinimizeButtonHint)| yes Evaluation Count:5483 | yes Evaluation Count:90 |
| 90-5573 |
| 4015 | offset += delta; executed: offset += delta;Execution Count:5483 | 5483 |
| 4016 | else if (sc == SC_TitleBarMinButton) evaluated: sc == SC_TitleBarMinButton| yes Evaluation Count:177 | yes Evaluation Count:177 |
| 177 |
| 4017 | break; executed: break;Execution Count:177 | 177 |
| 4018 | case SC_TitleBarNormalButton: code before this statement executed: case SC_TitleBarNormalButton:Execution Count:5660 | 5660 |
| 4019 | if (isMinimized && (tb->titleBarFlags & Qt::WindowMinimizeButtonHint)) evaluated: isMinimized| yes Evaluation Count:273 | yes Evaluation Count:8257 |
partially evaluated: (tb->titleBarFlags & Qt::WindowMinimizeButtonHint)| yes Evaluation Count:273 | no Evaluation Count:0 |
| 0-8257 |
| 4020 | offset += delta; executed: offset += delta;Execution Count:273 | 273 |
| 4021 | else if (isMaximized && (tb->titleBarFlags & Qt::WindowMaximizeButtonHint)) evaluated: isMaximized| yes Evaluation Count:1241 | yes Evaluation Count:7016 |
partially evaluated: (tb->titleBarFlags & Qt::WindowMaximizeButtonHint)| yes Evaluation Count:1241 | no Evaluation Count:0 |
| 0-7016 |
| 4022 | offset += delta; executed: offset += delta;Execution Count:1241 | 1241 |
| 4023 | else if (sc == SC_TitleBarNormalButton) evaluated: sc == SC_TitleBarNormalButton| yes Evaluation Count:2306 | yes Evaluation Count:4710 |
| 2306-4710 |
| 4024 | break; executed: break;Execution Count:2306 | 2306 |
| 4025 | case SC_TitleBarMaxButton: code before this statement executed: case SC_TitleBarMaxButton:Execution Count:6224 | 6224 |
| 4026 | if (!isMaximized && (tb->titleBarFlags & Qt::WindowMaximizeButtonHint)) evaluated: !isMaximized| yes Evaluation Count:7573 | yes Evaluation Count:1636 |
evaluated: (tb->titleBarFlags & Qt::WindowMaximizeButtonHint)| yes Evaluation Count:7483 | yes Evaluation Count:90 |
| 90-7573 |
| 4027 | offset += delta; executed: offset += delta;Execution Count:7483 | 7483 |
| 4028 | else if (sc == SC_TitleBarMaxButton) evaluated: sc == SC_TitleBarMaxButton| yes Evaluation Count:440 | yes Evaluation Count:1286 |
| 440-1286 |
| 4029 | break; executed: break;Execution Count:440 | 440 |
| 4030 | case SC_TitleBarShadeButton: code before this statement executed: case SC_TitleBarShadeButton:Execution Count:8769 | 8769 |
| 4031 | if (!isMinimized && (tb->titleBarFlags & Qt::WindowShadeButtonHint)) evaluated: !isMinimized| yes Evaluation Count:11056 | yes Evaluation Count:546 |
evaluated: (tb->titleBarFlags & Qt::WindowShadeButtonHint)| yes Evaluation Count:48 | yes Evaluation Count:11008 |
| 48-11056 |
| 4032 | offset += delta; executed: offset += delta;Execution Count:48 | 48 |
| 4033 | else if (sc == SC_TitleBarShadeButton) evaluated: sc == SC_TitleBarShadeButton| yes Evaluation Count:2821 | yes Evaluation Count:8733 |
| 2821-8733 |
| 4034 | break; executed: break;Execution Count:2821 | 2821 |
| 4035 | case SC_TitleBarUnshadeButton: code before this statement executed: case SC_TitleBarUnshadeButton:Execution Count:8781 | 8781 |
| 4036 | if (isMinimized && (tb->titleBarFlags & Qt::WindowShadeButtonHint)) evaluated: isMinimized| yes Evaluation Count:546 | yes Evaluation Count:11068 |
evaluated: (tb->titleBarFlags & Qt::WindowShadeButtonHint)| yes Evaluation Count:56 | yes Evaluation Count:490 |
| 56-11068 |
| 4037 | offset += delta; executed: offset += delta;Execution Count:56 | 56 |
| 4038 | else if (sc == SC_TitleBarUnshadeButton) evaluated: sc == SC_TitleBarUnshadeButton| yes Evaluation Count:2819 | yes Evaluation Count:8739 |
| 2819-8739 |
| 4039 | break; executed: break;Execution Count:2819 | 2819 |
| 4040 | case SC_TitleBarCloseButton: code before this statement executed: case SC_TitleBarCloseButton:Execution Count:8795 | 8795 |
| 4041 | if (tb->titleBarFlags & Qt::WindowSystemMenuHint) partially evaluated: tb->titleBarFlags & Qt::WindowSystemMenuHint| yes Evaluation Count:11836 | no Evaluation Count:0 |
| 0-11836 |
| 4042 | offset += delta; executed: offset += delta;Execution Count:11836 | 11836 |
| 4043 | else if (sc == SC_TitleBarCloseButton) never evaluated: sc == SC_TitleBarCloseButton | 0 |
| 4044 | break; | 0 |
| 4045 | ret.setRect(tb->rect.right() - offset, tb->rect.top() + controlMargin, | - |
| 4046 | controlHeight, controlHeight); | - |
| 4047 | break; executed: break;Execution Count:11836 | 11836 |
| 4048 | case SC_TitleBarSysMenu: | - |
| 4049 | if (tb->titleBarFlags & Qt::WindowSystemMenuHint) { partially evaluated: tb->titleBarFlags & Qt::WindowSystemMenuHint| yes Evaluation Count:3041 | no Evaluation Count:0 |
| 0-3041 |
| 4050 | ret.setRect(tb->rect.left() + controlMargin, tb->rect.top() + controlMargin, | - |
| 4051 | controlHeight, controlHeight); | - |
| 4052 | } executed: }Execution Count:3041 | 3041 |
| 4053 | break; executed: break;Execution Count:3041 | 3041 |
| 4054 | default: | - |
| 4055 | break; | 0 |
| 4056 | } | - |
| 4057 | ret = visualRect(tb->direction, tb->rect, ret); | - |
| 4058 | } executed: }Execution Count:26342 | 26342 |
| 4059 | break; executed: break;Execution Count:26342 | 26342 |
| 4060 | | - |
| 4061 | case CC_GroupBox: { | - |
| 4062 | if (const QStyleOptionGroupBox *groupBox = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)) { partially evaluated: const QStyleOptionGroupBox *groupBox = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)| yes Evaluation Count:322 | no Evaluation Count:0 |
| 0-322 |
| 4063 | switch (sc) { | - |
| 4064 | case SC_GroupBoxFrame: | - |
| 4065 | | - |
| 4066 | case SC_GroupBoxContents: { | - |
| 4067 | int topMargin = 0; | - |
| 4068 | int topHeight = 0; | - |
| 4069 | int verticalAlignment = proxy()->styleHint(SH_GroupBox_TextLabelVerticalAlignment, groupBox, widget); | - |
| 4070 | if (groupBox->text.size() || (groupBox->subControls & QStyle::SC_GroupBoxCheckBox)) { evaluated: groupBox->text.size()| yes Evaluation Count:122 | yes Evaluation Count:81 |
evaluated: (groupBox->subControls & QStyle::SC_GroupBoxCheckBox)| yes Evaluation Count:13 | yes Evaluation Count:68 |
| 13-122 |
| 4071 | topHeight = groupBox->fontMetrics.height(); | - |
| 4072 | if (verticalAlignment & Qt::AlignVCenter) partially evaluated: verticalAlignment & Qt::AlignVCenter| yes Evaluation Count:135 | no Evaluation Count:0 |
| 0-135 |
| 4073 | topMargin = topHeight / 2; executed: topMargin = topHeight / 2;Execution Count:135 | 135 |
| 4074 | else if (verticalAlignment & Qt::AlignTop) never evaluated: verticalAlignment & Qt::AlignTop | 0 |
| 4075 | topMargin = topHeight; never executed: topMargin = topHeight; | 0 |
| 4076 | } | - |
| 4077 | | - |
| 4078 | QRect frameRect = groupBox->rect; | - |
| 4079 | frameRect.setTop(topMargin); | - |
| 4080 | | - |
| 4081 | if (sc == SC_GroupBoxFrame) { evaluated: sc == SC_GroupBoxFrame| yes Evaluation Count:36 | yes Evaluation Count:167 |
| 36-167 |
| 4082 | ret = frameRect; | - |
| 4083 | break; executed: break;Execution Count:36 | 36 |
| 4084 | } | - |
| 4085 | | - |
| 4086 | int frameWidth = 0; | - |
| 4087 | if ((groupBox->features & QStyleOptionFrameV2::Flat) == 0) partially evaluated: (groupBox->features & QStyleOptionFrameV2::Flat) == 0| yes Evaluation Count:167 | no Evaluation Count:0 |
| 0-167 |
| 4088 | frameWidth = proxy()->pixelMetric(PM_DefaultFrameWidth, groupBox, widget); executed: frameWidth = proxy()->pixelMetric(PM_DefaultFrameWidth, groupBox, widget);Execution Count:167 | 167 |
| 4089 | ret = frameRect.adjusted(frameWidth, frameWidth + topHeight - topMargin, | - |
| 4090 | -frameWidth, -frameWidth); | - |
| 4091 | break; executed: break;Execution Count:167 | 167 |
| 4092 | } | - |
| 4093 | case SC_GroupBoxCheckBox: | - |
| 4094 | | - |
| 4095 | case SC_GroupBoxLabel: { | - |
| 4096 | QFontMetrics fontMetrics = groupBox->fontMetrics; | - |
| 4097 | int h = fontMetrics.height(); | - |
| 4098 | int tw = fontMetrics.size(Qt::TextShowMnemonic, groupBox->text + QLatin1Char(' ')).width(); | - |
| 4099 | int marg = (groupBox->features & QStyleOptionFrameV2::Flat) ? 0 : 8; partially evaluated: (groupBox->features & QStyleOptionFrameV2::Flat)| no Evaluation Count:0 | yes Evaluation Count:116 |
| 0-116 |
| 4100 | ret = groupBox->rect.adjusted(marg, 0, -marg, 0); | - |
| 4101 | ret.setHeight(h); | - |
| 4102 | | - |
| 4103 | int indicatorWidth = proxy()->pixelMetric(PM_IndicatorWidth, opt, widget); | - |
| 4104 | int indicatorSpace = proxy()->pixelMetric(PM_CheckBoxLabelSpacing, opt, widget) - 1; | - |
| 4105 | bool hasCheckBox = groupBox->subControls & QStyle::SC_GroupBoxCheckBox; | - |
| 4106 | int checkBoxSize = hasCheckBox ? (indicatorWidth + indicatorSpace) : 0; evaluated: hasCheckBox| yes Evaluation Count:58 | yes Evaluation Count:58 |
| 58 |
| 4107 | | - |
| 4108 | | - |
| 4109 | QRect totalRect = alignedRect(groupBox->direction, groupBox->textAlignment, | - |
| 4110 | QSize(tw + checkBoxSize, h), ret); | - |
| 4111 | | - |
| 4112 | | - |
| 4113 | if (hasCheckBox) { evaluated: hasCheckBox| yes Evaluation Count:58 | yes Evaluation Count:58 |
| 58 |
| 4114 | bool ltr = groupBox->direction == Qt::LeftToRight; | - |
| 4115 | int left = 0; | - |
| 4116 | | - |
| 4117 | if (sc == SC_GroupBoxCheckBox) { evaluated: sc == SC_GroupBoxCheckBox| yes Evaluation Count:37 | yes Evaluation Count:21 |
| 21-37 |
| 4118 | int indicatorHeight = proxy()->pixelMetric(PM_IndicatorHeight, opt, widget); | - |
| 4119 | left = ltr ? totalRect.left() : (totalRect.right() - indicatorWidth); partially evaluated: ltr| yes Evaluation Count:37 | no Evaluation Count:0 |
| 0-37 |
| 4120 | int top = totalRect.top() + (fontMetrics.height() - indicatorHeight) / 2; | - |
| 4121 | totalRect.setRect(left, top, indicatorWidth, indicatorHeight); | - |
| 4122 | | - |
| 4123 | } else { executed: }Execution Count:37 | 37 |
| 4124 | left = ltr ? (totalRect.left() + checkBoxSize - 2) : totalRect.left(); partially evaluated: ltr| yes Evaluation Count:21 | no Evaluation Count:0 |
| 0-21 |
| 4125 | totalRect.setRect(left, totalRect.top(), | - |
| 4126 | totalRect.width() - checkBoxSize, totalRect.height()); | - |
| 4127 | } executed: }Execution Count:21 | 21 |
| 4128 | } | - |
| 4129 | ret = totalRect; | - |
| 4130 | break; executed: break;Execution Count:116 | 116 |
| 4131 | } | - |
| 4132 | default: | - |
| 4133 | break; executed: break;Execution Count:3 | 3 |
| 4134 | } | - |
| 4135 | } executed: }Execution Count:322 | 322 |
| 4136 | break; executed: break;Execution Count:322 | 322 |
| 4137 | } | - |
| 4138 | | - |
| 4139 | | - |
| 4140 | case CC_MdiControls: | - |
| 4141 | { | - |
| 4142 | int numSubControls = 0; | - |
| 4143 | if (opt->subControls & SC_MdiCloseButton) partially evaluated: opt->subControls & SC_MdiCloseButton| yes Evaluation Count:72 | no Evaluation Count:0 |
| 0-72 |
| 4144 | ++numSubControls; executed: ++numSubControls;Execution Count:72 | 72 |
| 4145 | if (opt->subControls & SC_MdiMinButton) partially evaluated: opt->subControls & SC_MdiMinButton| yes Evaluation Count:72 | no Evaluation Count:0 |
| 0-72 |
| 4146 | ++numSubControls; executed: ++numSubControls;Execution Count:72 | 72 |
| 4147 | if (opt->subControls & SC_MdiNormalButton) partially evaluated: opt->subControls & SC_MdiNormalButton| yes Evaluation Count:72 | no Evaluation Count:0 |
| 0-72 |
| 4148 | ++numSubControls; executed: ++numSubControls;Execution Count:72 | 72 |
| 4149 | if (numSubControls == 0) partially evaluated: numSubControls == 0| no Evaluation Count:0 | yes Evaluation Count:72 |
| 0-72 |
| 4150 | break; | 0 |
| 4151 | | - |
| 4152 | int buttonWidth = opt->rect.width() / numSubControls - 1; | - |
| 4153 | int offset = 0; | - |
| 4154 | switch (sc) { | - |
| 4155 | case SC_MdiCloseButton: | - |
| 4156 | | - |
| 4157 | if (numSubControls == 1) partially evaluated: numSubControls == 1| no Evaluation Count:0 | yes Evaluation Count:24 |
| 0-24 |
| 4158 | break; | 0 |
| 4159 | offset += buttonWidth + 2; | - |
| 4160 | | - |
| 4161 | case SC_MdiNormalButton: code before this statement executed: case SC_MdiNormalButton:Execution Count:24 | 24 |
| 4162 | | - |
| 4163 | | - |
| 4164 | | - |
| 4165 | if (numSubControls == 1 || (numSubControls == 2 && !(opt->subControls & SC_MdiMinButton))) partially evaluated: numSubControls == 1| no Evaluation Count:0 | yes Evaluation Count:48 |
partially evaluated: numSubControls == 2| no Evaluation Count:0 | yes Evaluation Count:48 |
never evaluated: !(opt->subControls & SC_MdiMinButton) | 0-48 |
| 4166 | break; | 0 |
| 4167 | if (opt->subControls & SC_MdiNormalButton) partially evaluated: opt->subControls & SC_MdiNormalButton| yes Evaluation Count:48 | no Evaluation Count:0 |
| 0-48 |
| 4168 | offset += buttonWidth; executed: offset += buttonWidth;Execution Count:48 | 48 |
| 4169 | break; executed: break;Execution Count:48 | 48 |
| 4170 | default: | - |
| 4171 | break; executed: break;Execution Count:24 | 24 |
| 4172 | } | - |
| 4173 | | - |
| 4174 | | - |
| 4175 | | - |
| 4176 | | - |
| 4177 | if (numSubControls == 1) partially evaluated: numSubControls == 1| no Evaluation Count:0 | yes Evaluation Count:72 |
| 0-72 |
| 4178 | --buttonWidth; never executed: --buttonWidth; | 0 |
| 4179 | ret = QRect(offset, 0, buttonWidth, opt->rect.height()); | - |
| 4180 | break; executed: break;Execution Count:72 | 72 |
| 4181 | } | - |
| 4182 | | - |
| 4183 | default: | - |
| 4184 | QMessageLogger("styles/qcommonstyle.cpp", 4310, __PRETTY_FUNCTION__).warning("QCommonStyle::subControlRect: Case %d not handled", cc); | - |
| 4185 | } | 0 |
| 4186 | return ret; executed: return ret;Execution Count:51381 | 51381 |
| 4187 | } | - |
| 4188 | | - |
| 4189 | | - |
| 4190 | int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWidget *widget) const | - |
| 4191 | { | - |
| 4192 | int ret; | - |
| 4193 | | - |
| 4194 | switch (m) { | - |
| 4195 | case PM_FocusFrameVMargin: | - |
| 4196 | case PM_FocusFrameHMargin: | - |
| 4197 | ret = 2; | - |
| 4198 | break; executed: break;Execution Count:317210 | 317210 |
| 4199 | case PM_MenuBarVMargin: | - |
| 4200 | case PM_MenuBarHMargin: | - |
| 4201 | ret = 0; | - |
| 4202 | break; | 0 |
| 4203 | case PM_DialogButtonsSeparator: | - |
| 4204 | ret = int(QStyleHelper::dpiScaled(5.)); | - |
| 4205 | break; executed: break;Execution Count:6 | 6 |
| 4206 | case PM_DialogButtonsButtonWidth: | - |
| 4207 | ret = int(QStyleHelper::dpiScaled(70.)); | - |
| 4208 | break; executed: break;Execution Count:8 | 8 |
| 4209 | case PM_DialogButtonsButtonHeight: | - |
| 4210 | ret = int(QStyleHelper::dpiScaled(30.)); | - |
| 4211 | break; executed: break;Execution Count:8 | 8 |
| 4212 | case PM_TitleBarHeight: { | - |
| 4213 | if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)) { evaluated: const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)| yes Evaluation Count:14194 | yes Evaluation Count:62 |
| 62-14194 |
| 4214 | if ((tb->titleBarFlags & Qt::WindowType_Mask) == Qt::Tool) { evaluated: (tb->titleBarFlags & Qt::WindowType_Mask) == Qt::Tool| yes Evaluation Count:1 | yes Evaluation Count:14193 |
| 1-14193 |
| 4215 | ret = qMax(widget ? widget->fontMetrics().height() : opt->fontMetrics.height(), 16); | - |
| 4216 | | - |
| 4217 | } else if (qobject_cast<const QDockWidget*>(widget)) { partially evaluated: qobject_cast<const QDockWidget*>(widget)| no Evaluation Count:0 | yes Evaluation Count:14193 |
executed: }Execution Count:1 | 0-14193 |
| 4218 | ret = qMax(widget->fontMetrics().height(), int(QStyleHelper::dpiScaled(13))); | - |
| 4219 | | - |
| 4220 | } else { | 0 |
| 4221 | ret = qMax(widget ? widget->fontMetrics().height() : opt->fontMetrics.height(), 18); | - |
| 4222 | } executed: }Execution Count:14193 | 14193 |
| 4223 | } else { | - |
| 4224 | ret = int(QStyleHelper::dpiScaled(18.)); | - |
| 4225 | } executed: }Execution Count:62 | 62 |
| 4226 | | - |
| 4227 | break; } executed: break;Execution Count:14256 | 14256 |
| 4228 | case PM_ScrollBarSliderMin: | - |
| 4229 | ret = int(QStyleHelper::dpiScaled(9.)); | - |
| 4230 | break; executed: break;Execution Count:113119 | 113119 |
| 4231 | | - |
| 4232 | case PM_ButtonMargin: | - |
| 4233 | ret = int(QStyleHelper::dpiScaled(6.)); | - |
| 4234 | break; executed: break;Execution Count:1133 | 1133 |
| 4235 | | - |
| 4236 | case PM_DockWidgetTitleBarButtonMargin: | - |
| 4237 | ret = int(QStyleHelper::dpiScaled(2.)); | - |
| 4238 | break; | 0 |
| 4239 | | - |
| 4240 | case PM_ButtonDefaultIndicator: | - |
| 4241 | ret = 0; | - |
| 4242 | break; | 0 |
| 4243 | | - |
| 4244 | case PM_MenuButtonIndicator: | - |
| 4245 | ret = int(QStyleHelper::dpiScaled(12.)); | - |
| 4246 | break; executed: break;Execution Count:980 | 980 |
| 4247 | | - |
| 4248 | case PM_ButtonShiftHorizontal: | - |
| 4249 | case PM_ButtonShiftVertical: | - |
| 4250 | | - |
| 4251 | case PM_DefaultFrameWidth: | - |
| 4252 | ret = 2; | - |
| 4253 | break; executed: break;Execution Count:24832 | 24832 |
| 4254 | | - |
| 4255 | case PM_ComboBoxFrameWidth: | - |
| 4256 | case PM_SpinBoxFrameWidth: | - |
| 4257 | case PM_MenuPanelWidth: | - |
| 4258 | case PM_TabBarBaseOverlap: | - |
| 4259 | case PM_TabBarBaseHeight: | - |
| 4260 | ret = proxy()->pixelMetric(PM_DefaultFrameWidth, opt, widget); | - |
| 4261 | break; executed: break;Execution Count:3690 | 3690 |
| 4262 | | - |
| 4263 | case PM_MdiSubWindowFrameWidth: | - |
| 4264 | ret = int(QStyleHelper::dpiScaled(4.)); | - |
| 4265 | break; executed: break;Execution Count:11772 | 11772 |
| 4266 | | - |
| 4267 | case PM_MdiSubWindowMinimizedWidth: | - |
| 4268 | ret = int(QStyleHelper::dpiScaled(196.)); | - |
| 4269 | break; executed: break;Execution Count:89 | 89 |
| 4270 | | - |
| 4271 | | - |
| 4272 | case PM_ScrollBarExtent: | - |
| 4273 | if (const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt)) { evaluated: const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt)| yes Evaluation Count:114149 | yes Evaluation Count:6502 |
| 6502-114149 |
| 4274 | int s = sb->orientation == Qt::Horizontal ? evaluated: sb->orientation == Qt::Horizontal| yes Evaluation Count:55711 | yes Evaluation Count:58438 |
| 55711-58438 |
| 4275 | QApplication::globalStrut().height() | - |
| 4276 | : QApplication::globalStrut().width(); | - |
| 4277 | ret = qMax(16, s); | - |
| 4278 | } else { executed: }Execution Count:114149 | 114149 |
| 4279 | ret = int(QStyleHelper::dpiScaled(16.)); | - |
| 4280 | } executed: }Execution Count:6502 | 6502 |
| 4281 | break; executed: break;Execution Count:120651 | 120651 |
| 4282 | | - |
| 4283 | case PM_MaximumDragDistance: | - |
| 4284 | ret = QGuiApplicationPrivate::platformTheme()->themeHint(QPlatformTheme::MaximumScrollBarDragDistance).toInt(); | - |
| 4285 | break; executed: break;Execution Count:6 | 6 |
| 4286 | | - |
| 4287 | | - |
| 4288 | case PM_SliderThickness: | - |
| 4289 | ret = int(QStyleHelper::dpiScaled(16.)); | - |
| 4290 | break; executed: break;Execution Count:13 | 13 |
| 4291 | | - |
| 4292 | case PM_SliderTickmarkOffset: | - |
| 4293 | if (const QStyleOptionSlider *sl = qstyleoption_cast<const QStyleOptionSlider *>(opt)) { evaluated: const QStyleOptionSlider *sl = qstyleoption_cast<const QStyleOptionSlider *>(opt)| yes Evaluation Count:27 | yes Evaluation Count:8 |
| 8-27 |
| 4294 | int space = (sl->orientation == Qt::Horizontal) ? sl->rect.height() evaluated: (sl->orientation == Qt::Horizontal)| yes Evaluation Count:14 | yes Evaluation Count:13 |
| 13-14 |
| 4295 | : sl->rect.width(); | - |
| 4296 | int thickness = proxy()->pixelMetric(PM_SliderControlThickness, sl, widget); | - |
| 4297 | int ticks = sl->tickPosition; | - |
| 4298 | | - |
| 4299 | if (ticks == QSlider::TicksBothSides) partially evaluated: ticks == QSlider::TicksBothSides| no Evaluation Count:0 | yes Evaluation Count:27 |
| 0-27 |
| 4300 | ret = (space - thickness) / 2; never executed: ret = (space - thickness) / 2; | 0 |
| 4301 | else if (ticks == QSlider::TicksAbove) partially evaluated: ticks == QSlider::TicksAbove| no Evaluation Count:0 | yes Evaluation Count:27 |
| 0-27 |
| 4302 | ret = space - thickness; never executed: ret = space - thickness; | 0 |
| 4303 | else | - |
| 4304 | ret = 0; executed: ret = 0;Execution Count:27 | 27 |
| 4305 | } else { | - |
| 4306 | ret = 0; | - |
| 4307 | } executed: }Execution Count:8 | 8 |
| 4308 | break; executed: break;Execution Count:35 | 35 |
| 4309 | | - |
| 4310 | case PM_SliderSpaceAvailable: | - |
| 4311 | if (const QStyleOptionSlider *sl = qstyleoption_cast<const QStyleOptionSlider *>(opt)) { evaluated: const QStyleOptionSlider *sl = qstyleoption_cast<const QStyleOptionSlider *>(opt)| yes Evaluation Count:4 | yes Evaluation Count:8 |
| 4-8 |
| 4312 | if (sl->orientation == Qt::Horizontal) partially evaluated: sl->orientation == Qt::Horizontal| yes Evaluation Count:4 | no Evaluation Count:0 |
| 0-4 |
| 4313 | ret = sl->rect.width() - proxy()->pixelMetric(PM_SliderLength, sl, widget); executed: ret = sl->rect.width() - proxy()->pixelMetric(PM_SliderLength, sl, widget);Execution Count:4 | 4 |
| 4314 | else | - |
| 4315 | ret = sl->rect.height() - proxy()->pixelMetric(PM_SliderLength, sl, widget); never executed: ret = sl->rect.height() - proxy()->pixelMetric(PM_SliderLength, sl, widget); | 0 |
| 4316 | } else { | - |
| 4317 | ret = 0; | - |
| 4318 | } executed: }Execution Count:8 | 8 |
| 4319 | break; executed: break;Execution Count:12 | 12 |
| 4320 | | - |
| 4321 | | - |
| 4322 | case PM_DockWidgetSeparatorExtent: | - |
| 4323 | ret = int(QStyleHelper::dpiScaled(6.)); | - |
| 4324 | break; executed: break;Execution Count:2 | 2 |
| 4325 | | - |
| 4326 | case PM_DockWidgetHandleExtent: | - |
| 4327 | ret = int(QStyleHelper::dpiScaled(8.)); | - |
| 4328 | break; executed: break;Execution Count:6 | 6 |
| 4329 | case PM_DockWidgetTitleMargin: | - |
| 4330 | ret = 0; | - |
| 4331 | break; | 0 |
| 4332 | case PM_DockWidgetFrameWidth: | - |
| 4333 | ret = 1; | - |
| 4334 | break; executed: break;Execution Count:2 | 2 |
| 4335 | | - |
| 4336 | | - |
| 4337 | case PM_SpinBoxSliderHeight: | - |
| 4338 | case PM_MenuBarPanelWidth: | - |
| 4339 | ret = 2; | - |
| 4340 | break; executed: break;Execution Count:8 | 8 |
| 4341 | | - |
| 4342 | case PM_MenuBarItemSpacing: | - |
| 4343 | ret = 0; | - |
| 4344 | break; executed: break;Execution Count:362 | 362 |
| 4345 | | - |
| 4346 | | - |
| 4347 | case PM_ToolBarFrameWidth: | - |
| 4348 | ret = 1; | - |
| 4349 | break; executed: break;Execution Count:180 | 180 |
| 4350 | | - |
| 4351 | case PM_ToolBarItemMargin: | - |
| 4352 | ret = 0; | - |
| 4353 | break; | 0 |
| 4354 | | - |
| 4355 | case PM_ToolBarItemSpacing: | - |
| 4356 | ret = int(QStyleHelper::dpiScaled(4.)); | - |
| 4357 | break; | 0 |
| 4358 | | - |
| 4359 | case PM_ToolBarHandleExtent: | - |
| 4360 | ret = int(QStyleHelper::dpiScaled(8.)); | - |
| 4361 | break; | 0 |
| 4362 | | - |
| 4363 | case PM_ToolBarSeparatorExtent: | - |
| 4364 | ret = int(QStyleHelper::dpiScaled(6.)); | - |
| 4365 | break; executed: break;Execution Count:8 | 8 |
| 4366 | | - |
| 4367 | case PM_ToolBarExtensionExtent: | - |
| 4368 | ret = int(QStyleHelper::dpiScaled(12.)); | - |
| 4369 | break; executed: break;Execution Count:265 | 265 |
| 4370 | | - |
| 4371 | | - |
| 4372 | | - |
| 4373 | case PM_TabBarTabOverlap: | - |
| 4374 | ret = 3; | - |
| 4375 | break; executed: break;Execution Count:6 | 6 |
| 4376 | | - |
| 4377 | case PM_TabBarTabHSpace: | - |
| 4378 | ret = int(QStyleHelper::dpiScaled(24.)); | - |
| 4379 | break; executed: break;Execution Count:1398 | 1398 |
| 4380 | | - |
| 4381 | case PM_TabBarTabShiftHorizontal: | - |
| 4382 | ret = 0; | - |
| 4383 | break; executed: break;Execution Count:62 | 62 |
| 4384 | | - |
| 4385 | case PM_TabBarTabShiftVertical: | - |
| 4386 | ret = 2; | - |
| 4387 | break; executed: break;Execution Count:62 | 62 |
| 4388 | | - |
| 4389 | case PM_TabBarTabVSpace: { | - |
| 4390 | const QStyleOptionTab *tb = qstyleoption_cast<const QStyleOptionTab *>(opt); | - |
| 4391 | if (tb && (tb->shape == QTabBar::RoundedNorth || tb->shape == QTabBar::RoundedSouth evaluated: tb| yes Evaluation Count:1292 | yes Evaluation Count:6 |
evaluated: tb->shape == QTabBar::RoundedNorth| yes Evaluation Count:1154 | yes Evaluation Count:138 |
evaluated: tb->shape == QTabBar::RoundedSouth| yes Evaluation Count:82 | yes Evaluation Count:56 |
| 6-1292 |
| 4392 | || tb->shape == QTabBar::RoundedWest || tb->shape == QTabBar::RoundedEast)) evaluated: tb->shape == QTabBar::RoundedWest| yes Evaluation Count:16 | yes Evaluation Count:40 |
evaluated: tb->shape == QTabBar::RoundedEast| yes Evaluation Count:16 | yes Evaluation Count:24 |
| 16-40 |
| 4393 | ret = 8; executed: ret = 8;Execution Count:1268 | 1268 |
| 4394 | else | - |
| 4395 | if(tb && (tb->shape == QTabBar::TriangularWest || tb->shape == QTabBar::TriangularEast)) evaluated: tb| yes Evaluation Count:24 | yes Evaluation Count:6 |
partially evaluated: tb->shape == QTabBar::TriangularWest| no Evaluation Count:0 | yes Evaluation Count:24 |
partially evaluated: tb->shape == QTabBar::TriangularEast| no Evaluation Count:0 | yes Evaluation Count:24 |
| 0-24 |
| 4396 | ret = 3; | 0 |
| 4397 | else | - |
| 4398 | ret = 2; executed: ret = 2;Execution Count:30 | 30 |
| 4399 | break; } executed: break;Execution Count:1298 | 1298 |
| 4400 | | - |
| 4401 | | - |
| 4402 | case PM_ProgressBarChunkWidth: | - |
| 4403 | ret = 9; | - |
| 4404 | break; executed: break;Execution Count:400 | 400 |
| 4405 | | - |
| 4406 | case PM_IndicatorWidth: | - |
| 4407 | ret = int(QStyleHelper::dpiScaled(13.)); | - |
| 4408 | break; executed: break;Execution Count:272 | 272 |
| 4409 | | - |
| 4410 | case PM_IndicatorHeight: | - |
| 4411 | ret = int(QStyleHelper::dpiScaled(13.)); | - |
| 4412 | break; executed: break;Execution Count:194 | 194 |
| 4413 | | - |
| 4414 | case PM_ExclusiveIndicatorWidth: | - |
| 4415 | ret = int(QStyleHelper::dpiScaled(12.)); | - |
| 4416 | break; executed: break;Execution Count:150 | 150 |
| 4417 | | - |
| 4418 | case PM_ExclusiveIndicatorHeight: | - |
| 4419 | ret = int(QStyleHelper::dpiScaled(12.)); | - |
| 4420 | break; executed: break;Execution Count:98 | 98 |
| 4421 | | - |
| 4422 | case PM_MenuTearoffHeight: | - |
| 4423 | ret = int(QStyleHelper::dpiScaled(10.)); | - |
| 4424 | break; executed: break;Execution Count:14 | 14 |
| 4425 | | - |
| 4426 | case PM_MenuScrollerHeight: | - |
| 4427 | ret = int(QStyleHelper::dpiScaled(10.)); | - |
| 4428 | break; executed: break;Execution Count:8 | 8 |
| 4429 | | - |
| 4430 | case PM_MenuDesktopFrameWidth: | - |
| 4431 | case PM_MenuHMargin: | - |
| 4432 | case PM_MenuVMargin: | - |
| 4433 | ret = 0; | - |
| 4434 | break; executed: break;Execution Count:333 | 333 |
| 4435 | | - |
| 4436 | case PM_HeaderMargin: | - |
| 4437 | ret = int(QStyleHelper::dpiScaled(4.)); | - |
| 4438 | break; executed: break;Execution Count:33280 | 33280 |
| 4439 | case PM_HeaderMarkSize: | - |
| 4440 | ret = int(QStyleHelper::dpiScaled(32.)); | - |
| 4441 | break; executed: break;Execution Count:8 | 8 |
| 4442 | case PM_HeaderGripMargin: | - |
| 4443 | ret = int(QStyleHelper::dpiScaled(4.)); | - |
| 4444 | break; executed: break;Execution Count:342 | 342 |
| 4445 | case PM_TabBarScrollButtonWidth: | - |
| 4446 | ret = int(QStyleHelper::dpiScaled(16.)); | - |
| 4447 | break; executed: break;Execution Count:74 | 74 |
| 4448 | case PM_LayoutLeftMargin: | - |
| 4449 | case PM_LayoutTopMargin: | - |
| 4450 | case PM_LayoutRightMargin: | - |
| 4451 | case PM_LayoutBottomMargin: | - |
| 4452 | { | - |
| 4453 | bool isWindow = false; | - |
| 4454 | if (opt) { evaluated: opt| yes Evaluation Count:16 | yes Evaluation Count:8507 |
| 16-8507 |
| 4455 | isWindow = (opt->state & State_Window); | - |
| 4456 | } else if (widget) { evaluated: widget| yes Evaluation Count:6039 | yes Evaluation Count:2468 |
executed: }Execution Count:16 | 16-6039 |
| 4457 | isWindow = widget->isWindow(); | - |
| 4458 | } executed: }Execution Count:6039 | 6039 |
| 4459 | ret = proxy()->pixelMetric(isWindow ? PM_DefaultTopLevelMargin : PM_DefaultChildMargin); | - |
| 4460 | } | - |
| 4461 | break; executed: break;Execution Count:8523 | 8523 |
| 4462 | case PM_LayoutHorizontalSpacing: | - |
| 4463 | case PM_LayoutVerticalSpacing: | - |
| 4464 | ret = proxy()->pixelMetric(PM_DefaultLayoutSpacing); | - |
| 4465 | break; executed: break;Execution Count:15783 | 15783 |
| 4466 | | - |
| 4467 | case PM_DefaultTopLevelMargin: | - |
| 4468 | ret = int(QStyleHelper::dpiScaled(11.)); | - |
| 4469 | break; executed: break;Execution Count:4919 | 4919 |
| 4470 | case PM_DefaultChildMargin: | - |
| 4471 | ret = int(QStyleHelper::dpiScaled(9.)); | - |
| 4472 | break; executed: break;Execution Count:3424 | 3424 |
| 4473 | case PM_DefaultLayoutSpacing: | - |
| 4474 | ret = int(QStyleHelper::dpiScaled(6.)); | - |
| 4475 | break; executed: break;Execution Count:14883 | 14883 |
| 4476 | | - |
| 4477 | case PM_ToolBarIconSize: | - |
| 4478 | ret = 0; | - |
| 4479 | if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) partially evaluated: const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()| yes Evaluation Count:69 | no Evaluation Count:0 |
| 0-69 |
| 4480 | ret = theme->themeHint(QPlatformTheme::ToolBarIconSize).toInt(); executed: ret = theme->themeHint(QPlatformTheme::ToolBarIconSize).toInt();Execution Count:69 | 69 |
| 4481 | if (ret <= 0) partially evaluated: ret <= 0| yes Evaluation Count:69 | no Evaluation Count:0 |
| 0-69 |
| 4482 | ret = int(QStyleHelper::dpiScaled(24.)); executed: ret = int(QStyleHelper::dpiScaled(24.));Execution Count:69 | 69 |
| 4483 | break; executed: break;Execution Count:69 | 69 |
| 4484 | | - |
| 4485 | case PM_TabBarIconSize: | - |
| 4486 | case PM_ListViewIconSize: | - |
| 4487 | ret = proxy()->pixelMetric(PM_SmallIconSize, opt, widget); | - |
| 4488 | break; executed: break;Execution Count:23003 | 23003 |
| 4489 | | - |
| 4490 | case PM_ButtonIconSize: | - |
| 4491 | case PM_SmallIconSize: | - |
| 4492 | ret = int(QStyleHelper::dpiScaled(16.)); | - |
| 4493 | break; executed: break;Execution Count:7608 | 7608 |
| 4494 | case PM_IconViewIconSize: | - |
| 4495 | ret = proxy()->pixelMetric(PM_LargeIconSize, opt, widget); | - |
| 4496 | break; executed: break;Execution Count:2 | 2 |
| 4497 | | - |
| 4498 | case PM_LargeIconSize: | - |
| 4499 | ret = int(QStyleHelper::dpiScaled(32.)); | - |
| 4500 | break; executed: break;Execution Count:4 | 4 |
| 4501 | | - |
| 4502 | case PM_ToolTipLabelFrameWidth: | - |
| 4503 | ret = 1; | - |
| 4504 | break; executed: break;Execution Count:14 | 14 |
| 4505 | case PM_CheckBoxLabelSpacing: | - |
| 4506 | case PM_RadioButtonLabelSpacing: | - |
| 4507 | ret = int(QStyleHelper::dpiScaled(6.)); | - |
| 4508 | break; executed: break;Execution Count:214 | 214 |
| 4509 | case PM_SizeGripSize: | - |
| 4510 | ret = int(QStyleHelper::dpiScaled(13.)); | - |
| 4511 | break; executed: break;Execution Count:8 | 8 |
| 4512 | case PM_MessageBoxIconSize: | - |
| 4513 | | - |
| 4514 | | - |
| 4515 | | - |
| 4516 | | - |
| 4517 | | - |
| 4518 | { | - |
| 4519 | ret = int(QStyleHelper::dpiScaled(32.)); | - |
| 4520 | } | - |
| 4521 | break; executed: break;Execution Count:46 | 46 |
| 4522 | case PM_TextCursorWidth: | - |
| 4523 | ret = QGuiApplicationPrivate::platformTheme()->themeHint(QPlatformTheme::TextCursorWidth).toInt(); | - |
| 4524 | break; executed: break;Execution Count:1053 | 1053 |
| 4525 | case PM_TabBar_ScrollButtonOverlap: | - |
| 4526 | ret = 1; | - |
| 4527 | break; executed: break;Execution Count:30 | 30 |
| 4528 | case PM_TabCloseIndicatorWidth: | - |
| 4529 | case PM_TabCloseIndicatorHeight: | - |
| 4530 | ret = int(QStyleHelper::dpiScaled(16.)); | - |
| 4531 | break; executed: break;Execution Count:2 | 2 |
| 4532 | case PM_ScrollView_ScrollBarSpacing: | - |
| 4533 | ret = 2 * proxy()->pixelMetric(PM_DefaultFrameWidth, opt, widget); | - |
| 4534 | break; | 0 |
| 4535 | case PM_ScrollView_ScrollBarOverlap: | - |
| 4536 | ret = 0; | - |
| 4537 | break; executed: break;Execution Count:28198 | 28198 |
| 4538 | case PM_SubMenuOverlap: | - |
| 4539 | ret = -proxy()->pixelMetric(QStyle::PM_MenuPanelWidth, opt, widget); | - |
| 4540 | break; executed: break;Execution Count:69 | 69 |
| 4541 | default: | - |
| 4542 | ret = 0; | - |
| 4543 | break; executed: break;Execution Count:9 | 9 |
| 4544 | } | - |
| 4545 | | - |
| 4546 | return ret; executed: return ret;Execution Count:754513 | 754513 |
| 4547 | } | - |
| 4548 | | - |
| 4549 | | - |
| 4550 | | - |
| 4551 | | - |
| 4552 | QSize QCommonStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, | - |
| 4553 | const QSize &csz, const QWidget *widget) const | - |
| 4554 | { | - |
| 4555 | const QCommonStylePrivate * const d = d_func(); | - |
| 4556 | QSize sz(csz); | - |
| 4557 | switch (ct) { | - |
| 4558 | case CT_PushButton: | - |
| 4559 | if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) { partially evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)| yes Evaluation Count:1125 | no Evaluation Count:0 |
| 0-1125 |
| 4560 | int w = csz.width(), | - |
| 4561 | h = csz.height(), | - |
| 4562 | bm = proxy()->pixelMetric(PM_ButtonMargin, btn, widget), | - |
| 4563 | fw = proxy()->pixelMetric(PM_DefaultFrameWidth, btn, widget) * 2; | - |
| 4564 | w += bm + fw; | - |
| 4565 | h += bm + fw; | - |
| 4566 | if (btn->features & QStyleOptionButton::AutoDefaultButton){ evaluated: btn->features & QStyleOptionButton::AutoDefaultButton| yes Evaluation Count:871 | yes Evaluation Count:254 |
| 254-871 |
| 4567 | int dbw = proxy()->pixelMetric(PM_ButtonDefaultIndicator, btn, widget) * 2; | - |
| 4568 | w += dbw; | - |
| 4569 | h += dbw; | - |
| 4570 | } executed: }Execution Count:871 | 871 |
| 4571 | sz = QSize(w, h); | - |
| 4572 | } executed: }Execution Count:1125 | 1125 |
| 4573 | break; executed: break;Execution Count:1125 | 1125 |
| 4574 | case CT_RadioButton: | - |
| 4575 | case CT_CheckBox: | - |
| 4576 | if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) { partially evaluated: const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)| yes Evaluation Count:53 | no Evaluation Count:0 |
| 0-53 |
| 4577 | bool isRadio = (ct == CT_RadioButton); | - |
| 4578 | | - |
| 4579 | int w = proxy()->pixelMetric(isRadio ? PM_ExclusiveIndicatorWidth | - |
| 4580 | : PM_IndicatorWidth, btn, widget); | - |
| 4581 | int h = proxy()->pixelMetric(isRadio ? PM_ExclusiveIndicatorHeight | - |
| 4582 | : PM_IndicatorHeight, btn, widget); | - |
| 4583 | | - |
| 4584 | int margins = 0; | - |
| 4585 | | - |
| 4586 | if (!btn->icon.isNull() || !btn->text.isEmpty()) partially evaluated: !btn->icon.isNull()| no Evaluation Count:0 | yes Evaluation Count:53 |
evaluated: !btn->text.isEmpty()| yes Evaluation Count:35 | yes Evaluation Count:18 |
| 0-53 |
| 4587 | margins = 4 + proxy()->pixelMetric(isRadio ? PM_RadioButtonLabelSpacing | 35 |
| 4588 | : PM_CheckBoxLabelSpacing, opt, widget); executed: margins = 4 + proxy()->pixelMetric(isRadio ? PM_RadioButtonLabelSpacing : PM_CheckBoxLabelSpacing, opt, widget);Execution Count:35 | 35 |
| 4589 | sz += QSize(w + margins, 4); | - |
| 4590 | sz.setHeight(qMax(sz.height(), h)); | - |
| 4591 | } executed: }Execution Count:53 | 53 |
| 4592 | break; executed: break;Execution Count:53 | 53 |
| 4593 | | - |
| 4594 | case CT_MenuItem: | - |
| 4595 | if (const QStyleOptionMenuItem *mi = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) { partially evaluated: const QStyleOptionMenuItem *mi = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)| yes Evaluation Count:1915 | no Evaluation Count:0 |
| 0-1915 |
| 4596 | bool checkable = mi->menuHasCheckableItems; | - |
| 4597 | int maxpmw = mi->maxIconWidth; | - |
| 4598 | int w = sz.width(), h = sz.height(); | - |
| 4599 | if (mi->menuItemType == QStyleOptionMenuItem::Separator) { evaluated: mi->menuItemType == QStyleOptionMenuItem::Separator| yes Evaluation Count:50 | yes Evaluation Count:1865 |
| 50-1865 |
| 4600 | w = 10; | - |
| 4601 | h = 2; | - |
| 4602 | } else { executed: }Execution Count:50 | 50 |
| 4603 | h = mi->fontMetrics.height() + 8; | - |
| 4604 | if (!mi->icon.isNull()) { evaluated: !mi->icon.isNull()| yes Evaluation Count:28 | yes Evaluation Count:1837 |
| 28-1837 |
| 4605 | int iconExtent = proxy()->pixelMetric(PM_SmallIconSize); | - |
| 4606 | h = qMax(h, mi->icon.actualSize(QSize(iconExtent, iconExtent)).height() + 4); | - |
| 4607 | } executed: }Execution Count:28 | 28 |
| 4608 | } executed: }Execution Count:1865 | 1865 |
| 4609 | if (mi->text.contains(QLatin1Char('\t'))) evaluated: mi->text.contains(QLatin1Char('\t'))| yes Evaluation Count:119 | yes Evaluation Count:1796 |
| 119-1796 |
| 4610 | w += 12; executed: w += 12;Execution Count:119 | 119 |
| 4611 | if (maxpmw > 0) evaluated: maxpmw > 0| yes Evaluation Count:52 | yes Evaluation Count:1863 |
| 52-1863 |
| 4612 | w += maxpmw + 6; executed: w += maxpmw + 6;Execution Count:52 | 52 |
| 4613 | if (checkable && maxpmw < 20) evaluated: checkable| yes Evaluation Count:93 | yes Evaluation Count:1822 |
evaluated: maxpmw < 20| yes Evaluation Count:45 | yes Evaluation Count:48 |
| 45-1822 |
| 4614 | w += 20 - maxpmw; executed: w += 20 - maxpmw;Execution Count:45 | 45 |
| 4615 | if (checkable || maxpmw > 0) evaluated: checkable| yes Evaluation Count:93 | yes Evaluation Count:1822 |
evaluated: maxpmw > 0| yes Evaluation Count:4 | yes Evaluation Count:1818 |
| 4-1822 |
| 4616 | w += 2; executed: w += 2;Execution Count:97 | 97 |
| 4617 | w += 12; | - |
| 4618 | sz = QSize(w, h); | - |
| 4619 | } executed: }Execution Count:1915 | 1915 |
| 4620 | break; executed: break;Execution Count:1915 | 1915 |
| 4621 | | - |
| 4622 | | - |
| 4623 | case CT_ToolButton: | - |
| 4624 | sz = QSize(sz.width() + 6, sz.height() + 5); | - |
| 4625 | break; executed: break;Execution Count:2 | 2 |
| 4626 | | - |
| 4627 | | - |
| 4628 | case CT_ComboBox: | - |
| 4629 | if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) { partially evaluated: const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)| yes Evaluation Count:995 | no Evaluation Count:0 |
| 0-995 |
| 4630 | int fw = cmb->frame ? proxy()->pixelMetric(PM_ComboBoxFrameWidth, opt, widget) * 2 : 0; partially evaluated: cmb->frame| yes Evaluation Count:995 | no Evaluation Count:0 |
| 0-995 |
| 4631 | const int textMargins = 2*(proxy()->pixelMetric(PM_FocusFrameHMargin) + 1); | - |
| 4632 | | - |
| 4633 | int other = qMax(23, 2*textMargins + proxy()->pixelMetric(QStyle::PM_ScrollBarExtent, opt, widget)); | - |
| 4634 | sz = QSize(sz.width() + fw + other, sz.height() + fw); | - |
| 4635 | } executed: }Execution Count:995 | 995 |
| 4636 | break; executed: break;Execution Count:995 | 995 |
| 4637 | | - |
| 4638 | case CT_HeaderSection: | - |
| 4639 | if (const QStyleOptionHeader *hdr = qstyleoption_cast<const QStyleOptionHeader *>(opt)) { partially evaluated: const QStyleOptionHeader *hdr = qstyleoption_cast<const QStyleOptionHeader *>(opt)| yes Evaluation Count:24848 | no Evaluation Count:0 |
| 0-24848 |
| 4640 | bool nullIcon = hdr->icon.isNull(); | - |
| 4641 | int margin = proxy()->pixelMetric(QStyle::PM_HeaderMargin, hdr, widget); | - |
| 4642 | int iconSize = nullIcon ? 0 : proxy()->pixelMetric(QStyle::PM_SmallIconSize, hdr, widget); evaluated: nullIcon| yes Evaluation Count:24746 | yes Evaluation Count:102 |
| 102-24746 |
| 4643 | QSize txt = hdr->fontMetrics.size(0, hdr->text); | - |
| 4644 | sz.setHeight(margin + qMax(iconSize, txt.height()) + margin); | - |
| 4645 | sz.setWidth((nullIcon ? 0 : margin) + iconSize | - |
| 4646 | + (hdr->text.isNull() ? 0 : margin) + txt.width() + margin); | - |
| 4647 | } executed: }Execution Count:24848 | 24848 |
| 4648 | break; executed: break;Execution Count:24848 | 24848 |
| 4649 | case CT_TabWidget: | - |
| 4650 | sz += QSize(4, 4); | - |
| 4651 | break; executed: break;Execution Count:103 | 103 |
| 4652 | case CT_LineEdit: | - |
| 4653 | if (const QStyleOptionFrame *f = qstyleoption_cast<const QStyleOptionFrame *>(opt)) partially evaluated: const QStyleOptionFrame *f = qstyleoption_cast<const QStyleOptionFrame *>(opt)| yes Evaluation Count:1523 | no Evaluation Count:0 |
| 0-1523 |
| 4654 | sz += QSize(2*f->lineWidth, 2*f->lineWidth); executed: sz += QSize(2*f->lineWidth, 2*f->lineWidth);Execution Count:1523 | 1523 |
| 4655 | break; executed: break;Execution Count:1523 | 1523 |
| 4656 | | - |
| 4657 | case CT_GroupBox: | - |
| 4658 | if (const QGroupBox *grb = static_cast<const QGroupBox *>(widget)) partially evaluated: const QGroupBox *grb = static_cast<const QGroupBox *>(widget)| yes Evaluation Count:42 | no Evaluation Count:0 |
| 0-42 |
| 4659 | sz += QSize(!grb->isFlat() ? 16 : 0, 0); executed: sz += QSize(!grb->isFlat() ? 16 : 0, 0);Execution Count:42 | 42 |
| 4660 | break; executed: break;Execution Count:42 | 42 |
| 4661 | | - |
| 4662 | case CT_MdiControls: | - |
| 4663 | if (const QStyleOptionComplex *styleOpt = qstyleoption_cast<const QStyleOptionComplex *>(opt)) { partially evaluated: const QStyleOptionComplex *styleOpt = qstyleoption_cast<const QStyleOptionComplex *>(opt)| yes Evaluation Count:200 | no Evaluation Count:0 |
| 0-200 |
| 4664 | int width = 1; | - |
| 4665 | if (styleOpt->subControls & SC_MdiMinButton) partially evaluated: styleOpt->subControls & SC_MdiMinButton| yes Evaluation Count:200 | no Evaluation Count:0 |
| 0-200 |
| 4666 | width += 16 + 1; executed: width += 16 + 1;Execution Count:200 | 200 |
| 4667 | if (styleOpt->subControls & SC_MdiNormalButton) partially evaluated: styleOpt->subControls & SC_MdiNormalButton| yes Evaluation Count:200 | no Evaluation Count:0 |
| 0-200 |
| 4668 | width += 16 + 1; executed: width += 16 + 1;Execution Count:200 | 200 |
| 4669 | if (styleOpt->subControls & SC_MdiCloseButton) partially evaluated: styleOpt->subControls & SC_MdiCloseButton| yes Evaluation Count:200 | no Evaluation Count:0 |
| 0-200 |
| 4670 | width += 16 + 1; executed: width += 16 + 1;Execution Count:200 | 200 |
| 4671 | sz = QSize(width, 16); | - |
| 4672 | } else { executed: }Execution Count:200 | 200 |
| 4673 | sz = QSize(52, 16); | - |
| 4674 | } | 0 |
| 4675 | break; executed: break;Execution Count:200 | 200 |
| 4676 | | - |
| 4677 | case CT_ItemViewItem: | - |
| 4678 | if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) { partially evaluated: const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)| yes Evaluation Count:150673 | no Evaluation Count:0 |
| 0-150673 |
| 4679 | QRect decorationRect, displayRect, checkRect; | - |
| 4680 | d->viewItemLayout(vopt, &checkRect, &decorationRect, &displayRect, true); | - |
| 4681 | sz = (decorationRect|displayRect|checkRect).size(); | - |
| 4682 | } executed: }Execution Count:150673 | 150673 |
| 4683 | break; executed: break;Execution Count:150673 | 150673 |
| 4684 | | - |
| 4685 | case CT_ScrollBar: | - |
| 4686 | case CT_MenuBar: | - |
| 4687 | case CT_Menu: | - |
| 4688 | case CT_MenuBarItem: | - |
| 4689 | case CT_Slider: | - |
| 4690 | case CT_ProgressBar: | - |
| 4691 | case CT_TabBarTab: | - |
| 4692 | | - |
| 4693 | | - |
| 4694 | default: | - |
| 4695 | break; executed: break;Execution Count:105982 | 105982 |
| 4696 | } | - |
| 4697 | return sz; executed: return sz;Execution Count:287461 | 287461 |
| 4698 | } | - |
| 4699 | | - |
| 4700 | | - |
| 4701 | | - |
| 4702 | int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *widget, | - |
| 4703 | QStyleHintReturn *hret) const | - |
| 4704 | { | - |
| 4705 | int ret = 0; | - |
| 4706 | | - |
| 4707 | switch (sh) { | - |
| 4708 | case SH_Menu_KeyboardSearch: | - |
| 4709 | ret = false; | - |
| 4710 | break; executed: break;Execution Count:11 | 11 |
| 4711 | case SH_Slider_AbsoluteSetButtons: | - |
| 4712 | ret = Qt::MidButton; | - |
| 4713 | break; executed: break;Execution Count:11 | 11 |
| 4714 | case SH_Slider_PageSetButtons: | - |
| 4715 | ret = Qt::LeftButton; | - |
| 4716 | break; executed: break;Execution Count:10 | 10 |
| 4717 | case SH_ScrollBar_ContextMenu: | - |
| 4718 | ret = true; | - |
| 4719 | break; executed: break;Execution Count:8 | 8 |
| 4720 | case SH_DialogButtons_DefaultButton: | - |
| 4721 | ret = QDialogButtonBox::AcceptRole; | - |
| 4722 | break; executed: break;Execution Count:8 | 8 |
| 4723 | | - |
| 4724 | case SH_GroupBox_TextLabelVerticalAlignment: | - |
| 4725 | ret = Qt::AlignVCenter; | - |
| 4726 | break; executed: break;Execution Count:211 | 211 |
| 4727 | | - |
| 4728 | case SH_GroupBox_TextLabelColor: | - |
| 4729 | ret = opt ? int(opt->palette.color(QPalette::Text).rgba()) : 0; evaluated: opt| yes Evaluation Count:1013 | yes Evaluation Count:4 |
| 4-1013 |
| 4730 | break; executed: break;Execution Count:1017 | 1017 |
| 4731 | | - |
| 4732 | | - |
| 4733 | case SH_ListViewExpand_SelectMouseType: | - |
| 4734 | case SH_TabBar_SelectMouseType: | - |
| 4735 | ret = QEvent::MouseButtonPress; | - |
| 4736 | break; executed: break;Execution Count:4595 | 4595 |
| 4737 | | - |
| 4738 | | - |
| 4739 | case SH_TabBar_Alignment: | - |
| 4740 | case SH_Header_ArrowAlignment: | - |
| 4741 | ret = Qt::AlignLeft; | - |
| 4742 | break; executed: break;Execution Count:278 | 278 |
| 4743 | | - |
| 4744 | case SH_TitleBar_AutoRaise: | - |
| 4745 | ret = false; | - |
| 4746 | break; executed: break;Execution Count:13927 | 13927 |
| 4747 | | - |
| 4748 | case SH_Menu_SubMenuPopupDelay: | - |
| 4749 | ret = 256; | - |
| 4750 | break; executed: break;Execution Count:6 | 6 |
| 4751 | | - |
| 4752 | case SH_ProgressDialog_TextLabelAlignment: | - |
| 4753 | ret = Qt::AlignCenter; | - |
| 4754 | break; executed: break;Execution Count:12 | 12 |
| 4755 | | - |
| 4756 | case SH_BlinkCursorWhenTextSelected: | - |
| 4757 | ret = 1; | - |
| 4758 | break; executed: break;Execution Count:8178 | 8178 |
| 4759 | | - |
| 4760 | case SH_Table_GridLineColor: | - |
| 4761 | if (opt) evaluated: opt| yes Evaluation Count:373 | yes Evaluation Count:3 |
| 3-373 |
| 4762 | ret = opt->palette.color(QPalette::Mid).rgb(); executed: ret = opt->palette.color(QPalette::Mid).rgb();Execution Count:373 | 373 |
| 4763 | else | - |
| 4764 | ret = -1; executed: ret = -1;Execution Count:3 | 3 |
| 4765 | break; executed: break;Execution Count:376 | 376 |
| 4766 | case SH_LineEdit_PasswordCharacter: { | - |
| 4767 | const QFontMetrics &fm = opt ? opt->fontMetrics evaluated: opt| yes Evaluation Count:5 | yes Evaluation Count:1 |
| 1-5 |
| 4768 | : (widget ? widget->fontMetrics() : QFontMetrics(QFont())); | - |
| 4769 | ret = 0; | - |
| 4770 | if (fm.inFont(QChar(0x25CF))) { partially evaluated: fm.inFont(QChar(0x25CF))| yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
| 4771 | ret = 0x25CF; | - |
| 4772 | } else if (fm.inFont(QChar(0x2022))) { never evaluated: fm.inFont(QChar(0x2022)) executed: }Execution Count:6 | 0-6 |
| 4773 | ret = 0x2022; | - |
| 4774 | } else { | 0 |
| 4775 | ret = '*'; | - |
| 4776 | } | 0 |
| 4777 | break; executed: break;Execution Count:6 | 6 |
| 4778 | } | - |
| 4779 | | - |
| 4780 | | - |
| 4781 | case SH_ToolBox_SelectedPageTitleBold: | - |
| 4782 | ret = 1; | - |
| 4783 | break; | 0 |
| 4784 | | - |
| 4785 | case SH_UnderlineShortcut: | - |
| 4786 | ret = 1; | - |
| 4787 | break; executed: break;Execution Count:2508 | 2508 |
| 4788 | | - |
| 4789 | case SH_SpinBox_ClickAutoRepeatRate: | - |
| 4790 | ret = 150; | - |
| 4791 | break; executed: break;Execution Count:403 | 403 |
| 4792 | | - |
| 4793 | case SH_SpinBox_ClickAutoRepeatThreshold: | - |
| 4794 | ret = 500; | - |
| 4795 | break; executed: break;Execution Count:395 | 395 |
| 4796 | | - |
| 4797 | case SH_SpinBox_KeyPressAutoRepeatRate: | - |
| 4798 | ret = 75; | - |
| 4799 | break; executed: break;Execution Count:8 | 8 |
| 4800 | | - |
| 4801 | case SH_Menu_SelectionWrap: | - |
| 4802 | ret = true; | - |
| 4803 | break; executed: break;Execution Count:8 | 8 |
| 4804 | | - |
| 4805 | case SH_Menu_FillScreenWithScroll: | - |
| 4806 | ret = true; | - |
| 4807 | break; executed: break;Execution Count:8 | 8 |
| 4808 | | - |
| 4809 | case SH_ToolTipLabel_Opacity: | - |
| 4810 | ret = 255; | - |
| 4811 | break; executed: break;Execution Count:16 | 16 |
| 4812 | | - |
| 4813 | case SH_Button_FocusPolicy: | - |
| 4814 | ret = Qt::StrongFocus; | - |
| 4815 | break; executed: break;Execution Count:3990 | 3990 |
| 4816 | | - |
| 4817 | case SH_MessageBox_UseBorderForButtonSpacing: | - |
| 4818 | ret = 0; | - |
| 4819 | break; executed: break;Execution Count:8 | 8 |
| 4820 | | - |
| 4821 | case SH_ToolButton_PopupDelay: | - |
| 4822 | ret = 600; | - |
| 4823 | break; executed: break;Execution Count:1562 | 1562 |
| 4824 | | - |
| 4825 | case SH_FocusFrame_Mask: | - |
| 4826 | ret = 1; | - |
| 4827 | if (widget) { evaluated: widget| yes Evaluation Count:5 | yes Evaluation Count:4 |
| 4-5 |
| 4828 | if(QStyleHintReturnMask *mask = qstyleoption_cast<QStyleHintReturnMask*>(hret)) { evaluated: QStyleHintReturnMask *mask = qstyleoption_cast<QStyleHintReturnMask*>(hret)| yes Evaluation Count:1 | yes Evaluation Count:4 |
| 1-4 |
| 4829 | mask->region = widget->rect(); | - |
| 4830 | int vmargin = proxy()->pixelMetric(QStyle::PM_FocusFrameVMargin), | - |
| 4831 | hmargin = proxy()->pixelMetric(QStyle::PM_FocusFrameHMargin); | - |
| 4832 | mask->region -= QRect(widget->rect().adjusted(hmargin, vmargin, -hmargin, -vmargin)); | - |
| 4833 | } executed: }Execution Count:1 | 1 |
| 4834 | } executed: }Execution Count:5 | 5 |
| 4835 | break; executed: break;Execution Count:9 | 9 |
| 4836 | | - |
| 4837 | case SH_RubberBand_Mask: | - |
| 4838 | if (const QStyleOptionRubberBand *rbOpt = qstyleoption_cast<const QStyleOptionRubberBand *>(opt)) { never evaluated: const QStyleOptionRubberBand *rbOpt = qstyleoption_cast<const QStyleOptionRubberBand *>(opt) | 0 |
| 4839 | ret = 0; | - |
| 4840 | if (rbOpt->shape == QRubberBand::Rectangle) { never evaluated: rbOpt->shape == QRubberBand::Rectangle | 0 |
| 4841 | ret = true; | - |
| 4842 | if(QStyleHintReturnMask *mask = qstyleoption_cast<QStyleHintReturnMask*>(hret)) { never evaluated: QStyleHintReturnMask *mask = qstyleoption_cast<QStyleHintReturnMask*>(hret) | 0 |
| 4843 | mask->region = opt->rect; | - |
| 4844 | int margin = proxy()->pixelMetric(PM_DefaultFrameWidth) * 2; | - |
| 4845 | mask->region -= opt->rect.adjusted(margin, margin, -margin, -margin); | - |
| 4846 | } | 0 |
| 4847 | } | 0 |
| 4848 | } | 0 |
| 4849 | break; | 0 |
| 4850 | | - |
| 4851 | case SH_SpinControls_DisableOnBounds: | - |
| 4852 | ret = 1; | - |
| 4853 | break; executed: break;Execution Count:1659 | 1659 |
| 4854 | | - |
| 4855 | case SH_Dial_BackgroundRole: | - |
| 4856 | ret = QPalette::Window; | - |
| 4857 | break; executed: break;Execution Count:14 | 14 |
| 4858 | | - |
| 4859 | case SH_ComboBox_LayoutDirection: | - |
| 4860 | ret = opt ? opt->direction : Qt::LeftToRight; evaluated: opt| yes Evaluation Count:495 | yes Evaluation Count:4 |
| 4-495 |
| 4861 | break; executed: break;Execution Count:499 | 499 |
| 4862 | | - |
| 4863 | case SH_ItemView_EllipsisLocation: | - |
| 4864 | ret = Qt::AlignTrailing; | - |
| 4865 | break; executed: break;Execution Count:8 | 8 |
| 4866 | | - |
| 4867 | case SH_ItemView_ShowDecorationSelected: | - |
| 4868 | ret = false; | - |
| 4869 | break; | 0 |
| 4870 | | - |
| 4871 | case SH_ItemView_ActivateItemOnSingleClick: | - |
| 4872 | ret = 0; | - |
| 4873 | if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) partially evaluated: const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()| yes Evaluation Count:381 | no Evaluation Count:0 |
| 0-381 |
| 4874 | ret = theme->themeHint(QPlatformTheme::ToolButtonStyle).toBool() ? 1 : 0; partially evaluated: theme->themeHint(QPlatformTheme::ToolButtonStyle).toBool()| no Evaluation Count:0 | yes Evaluation Count:381 |
executed: ret = theme->themeHint(QPlatformTheme::ToolButtonStyle).toBool() ? 1 : 0;Execution Count:381 | 0-381 |
| 4875 | break; executed: break;Execution Count:381 | 381 |
| 4876 | case SH_TitleBar_ModifyNotification: | - |
| 4877 | ret = true; | - |
| 4878 | break; executed: break;Execution Count:8 | 8 |
| 4879 | case SH_ScrollBar_RollBetweenButtons: | - |
| 4880 | ret = false; | - |
| 4881 | break; executed: break;Execution Count:8 | 8 |
| 4882 | case SH_TabBar_ElideMode: | - |
| 4883 | ret = Qt::ElideNone; | - |
| 4884 | break; executed: break;Execution Count:132 | 132 |
| 4885 | case SH_DialogButtonLayout: | - |
| 4886 | ret = QDialogButtonBox::WinLayout; | - |
| 4887 | if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) partially evaluated: const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()| yes Evaluation Count:597 | no Evaluation Count:0 |
| 0-597 |
| 4888 | ret = theme->themeHint(QPlatformTheme::DialogButtonBoxLayout).toInt(); executed: ret = theme->themeHint(QPlatformTheme::DialogButtonBoxLayout).toInt();Execution Count:597 | 597 |
| 4889 | break; executed: break;Execution Count:597 | 597 |
| 4890 | case SH_ComboBox_PopupFrameStyle: | - |
| 4891 | ret = QFrame::StyledPanel | QFrame::Plain; | - |
| 4892 | break; executed: break;Execution Count:349 | 349 |
| 4893 | case SH_MessageBox_TextInteractionFlags: | - |
| 4894 | ret = Qt::LinksAccessibleByMouse; | - |
| 4895 | break; executed: break;Execution Count:49 | 49 |
| 4896 | case SH_DialogButtonBox_ButtonsHaveIcons: | - |
| 4897 | ret = 0; | - |
| 4898 | if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) never evaluated: const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme() | 0 |
| 4899 | ret = theme->themeHint(QPlatformTheme::DialogButtonBoxButtonsHaveIcons).toBool() ? 1 : 0; never executed: ret = theme->themeHint(QPlatformTheme::DialogButtonBoxButtonsHaveIcons).toBool() ? 1 : 0; never evaluated: theme->themeHint(QPlatformTheme::DialogButtonBoxButtonsHaveIcons).toBool() | 0 |
| 4900 | break; | 0 |
| 4901 | case SH_SpellCheckUnderlineStyle: | - |
| 4902 | ret = QTextCharFormat::WaveUnderline; | - |
| 4903 | break; executed: break;Execution Count:8 | 8 |
| 4904 | case SH_MessageBox_CenterButtons: | - |
| 4905 | ret = true; | - |
| 4906 | break; executed: break;Execution Count:47 | 47 |
| 4907 | case SH_ItemView_MovementWithoutUpdatingSelection: | - |
| 4908 | ret = true; | - |
| 4909 | break; executed: break;Execution Count:8 | 8 |
| 4910 | case SH_FocusFrame_AboveWidget: | - |
| 4911 | ret = false; | - |
| 4912 | break; executed: break;Execution Count:11 | 11 |
| 4913 | | - |
| 4914 | case SH_TabWidget_DefaultTabPosition: | - |
| 4915 | ret = QTabWidget::North; | - |
| 4916 | break; executed: break;Execution Count:39 | 39 |
| 4917 | | - |
| 4918 | case SH_ToolBar_Movable: | - |
| 4919 | ret = true; | - |
| 4920 | break; executed: break;Execution Count:16 | 16 |
| 4921 | case SH_TextControl_FocusIndicatorTextCharFormat: | - |
| 4922 | ret = true; | - |
| 4923 | if (QStyleHintReturnVariant *vret = qstyleoption_cast<QStyleHintReturnVariant*>(hret)) { partially evaluated: QStyleHintReturnVariant *vret = qstyleoption_cast<QStyleHintReturnVariant*>(hret)| no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
| 4924 | QPen outline(opt->palette.color(QPalette::Text), 1, Qt::DotLine); | - |
| 4925 | QTextCharFormat fmt; | - |
| 4926 | fmt.setProperty(QTextFormat::OutlinePen, outline); | - |
| 4927 | vret->variant = fmt; | - |
| 4928 | } | 0 |
| 4929 | break; executed: break;Execution Count:8 | 8 |
| 4930 | | - |
| 4931 | case SH_WizardStyle: | - |
| 4932 | ret = QWizard::ClassicStyle; | - |
| 4933 | break; | 0 |
| 4934 | | - |
| 4935 | case SH_FormLayoutWrapPolicy: | - |
| 4936 | ret = QFormLayout::DontWrapRows; | - |
| 4937 | break; executed: break;Execution Count:47 | 47 |
| 4938 | case SH_FormLayoutFieldGrowthPolicy: | - |
| 4939 | ret = QFormLayout::AllNonFixedFieldsGrow; | - |
| 4940 | break; executed: break;Execution Count:7 | 7 |
| 4941 | case SH_FormLayoutFormAlignment: | - |
| 4942 | ret = Qt::AlignLeft | Qt::AlignTop; | - |
| 4943 | break; executed: break;Execution Count:29 | 29 |
| 4944 | case SH_FormLayoutLabelAlignment: | - |
| 4945 | ret = Qt::AlignLeft; | - |
| 4946 | break; executed: break;Execution Count:19 | 19 |
| 4947 | case SH_ItemView_ArrowKeysNavigateIntoChildren: | - |
| 4948 | ret = false; | - |
| 4949 | break; | 0 |
| 4950 | case SH_ItemView_DrawDelegateFrame: | - |
| 4951 | ret = 0; | - |
| 4952 | break; executed: break;Execution Count:85 | 85 |
| 4953 | | - |
| 4954 | case SH_TabBar_CloseButtonPosition: | - |
| 4955 | ret = QTabBar::RightSide; | - |
| 4956 | break; executed: break;Execution Count:4 | 4 |
| 4957 | | - |
| 4958 | case SH_DockWidget_ButtonsHaveFrame: | - |
| 4959 | ret = true; | - |
| 4960 | break; executed: break;Execution Count:58 | 58 |
| 4961 | case SH_ToolButtonStyle: | - |
| 4962 | ret = 0; | - |
| 4963 | if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) never evaluated: const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme() | 0 |
| 4964 | ret = theme->themeHint(QPlatformTheme::ToolButtonStyle).toInt(); never executed: ret = theme->themeHint(QPlatformTheme::ToolButtonStyle).toInt(); | 0 |
| 4965 | break; | 0 |
| 4966 | case SH_RequestSoftwareInputPanel: | - |
| 4967 | ret = RSIP_OnMouseClickAndAlreadyFocused; | - |
| 4968 | break; executed: break;Execution Count:10 | 10 |
| 4969 | case SH_ScrollBar_Transient: | - |
| 4970 | ret = false; | - |
| 4971 | break; executed: break;Execution Count:165497 | 165497 |
| 4972 | default: | - |
| 4973 | ret = 0; | - |
| 4974 | break; executed: break;Execution Count:417940 | 417940 |
| 4975 | } | - |
| 4976 | | - |
| 4977 | return ret; executed: return ret;Execution Count:625106 | 625106 |
| 4978 | } | - |
| 4979 | | - |
| 4980 | | - |
| 4981 | QPixmap QCommonStyle::standardPixmap(StandardPixmap sp, const QStyleOption *option, | - |
| 4982 | const QWidget *widget) const | - |
| 4983 | { | - |
| 4984 | const bool rtl = (option && option->direction == Qt::RightToLeft) || (!option && QApplication::isRightToLeft()); evaluated: option| yes Evaluation Count:1029 | yes Evaluation Count:1295 |
evaluated: option->direction == Qt::RightToLeft| yes Evaluation Count:3 | yes Evaluation Count:1026 |
evaluated: !option| yes Evaluation Count:1295 | yes Evaluation Count:1026 |
evaluated: QApplication::isRightToLeft()| yes Evaluation Count:3 | yes Evaluation Count:1292 |
| 3-1295 |
| 4985 | | - |
| 4986 | | - |
| 4987 | | - |
| 4988 | | - |
| 4989 | QPixmap pixmap; | - |
| 4990 | | - |
| 4991 | if (QApplication::desktopSettingsAware() && !QIcon::themeName().isEmpty()) { partially evaluated: QApplication::desktopSettingsAware()| yes Evaluation Count:2324 | no Evaluation Count:0 |
partially evaluated: !QIcon::themeName().isEmpty()| no Evaluation Count:0 | yes Evaluation Count:2324 |
| 0-2324 |
| 4992 | switch (sp) { | - |
| 4993 | case SP_DialogYesButton: | - |
| 4994 | case SP_DialogOkButton: | - |
| 4995 | pixmap = QIcon::fromTheme(QLatin1String("dialog-ok")).pixmap(16); | - |
| 4996 | break; | 0 |
| 4997 | case SP_DialogApplyButton: | - |
| 4998 | pixmap = QIcon::fromTheme(QLatin1String("dialog-ok-apply")).pixmap(16); | - |
| 4999 | break; | 0 |
| 5000 | case SP_DialogDiscardButton: | - |
| 5001 | pixmap = QIcon::fromTheme(QLatin1String("edit-delete")).pixmap(16); | - |
| 5002 | break; | 0 |
| 5003 | case SP_DialogCloseButton: | - |
| 5004 | pixmap = QIcon::fromTheme(QLatin1String("dialog-close")).pixmap(16); | - |
| 5005 | break; | 0 |
| 5006 | case SP_DirHomeIcon: | - |
| 5007 | pixmap = QIcon::fromTheme(QLatin1String("user-home")).pixmap(16); | - |
| 5008 | break; | 0 |
| 5009 | case SP_MessageBoxInformation: | - |
| 5010 | pixmap = QIcon::fromTheme(QLatin1String("messagebox_info")).pixmap(16); | - |
| 5011 | break; | 0 |
| 5012 | case SP_MessageBoxWarning: | - |
| 5013 | pixmap = QIcon::fromTheme(QLatin1String("messagebox_warning")).pixmap(16); | - |
| 5014 | break; | 0 |
| 5015 | case SP_MessageBoxCritical: | - |
| 5016 | pixmap = QIcon::fromTheme(QLatin1String("messagebox_critical")).pixmap(16); | - |
| 5017 | break; | 0 |
| 5018 | case SP_MessageBoxQuestion: | - |
| 5019 | pixmap = QIcon::fromTheme(QLatin1String("help")).pixmap(16); | - |
| 5020 | break; | 0 |
| 5021 | case SP_DialogOpenButton: | - |
| 5022 | case SP_DirOpenIcon: | - |
| 5023 | pixmap = QIcon::fromTheme(QLatin1String("folder-open")).pixmap(16); | - |
| 5024 | break; | 0 |
| 5025 | case SP_FileIcon: | - |
| 5026 | pixmap = QIcon::fromTheme(QLatin1String("text-x-generic"), | - |
| 5027 | QIcon::fromTheme(QLatin1String("empty"))).pixmap(16); | - |
| 5028 | break; | 0 |
| 5029 | case SP_DirClosedIcon: | - |
| 5030 | case SP_DirIcon: | - |
| 5031 | pixmap = QIcon::fromTheme(QLatin1String("folder")).pixmap(16); | - |
| 5032 | break; | 0 |
| 5033 | case SP_DriveFDIcon: | - |
| 5034 | pixmap = QIcon::fromTheme(QLatin1String("media-floppy"), | - |
| 5035 | QIcon::fromTheme(QLatin1String("3floppy_unmount"))).pixmap(16); | - |
| 5036 | break; | 0 |
| 5037 | case SP_ComputerIcon: | - |
| 5038 | pixmap = QIcon::fromTheme(QLatin1String("computer"), | - |
| 5039 | QIcon::fromTheme(QLatin1String("system"))).pixmap(16); | - |
| 5040 | break; | 0 |
| 5041 | case SP_DesktopIcon: | - |
| 5042 | pixmap = QIcon::fromTheme(QLatin1String("user-desktop"), | - |
| 5043 | QIcon::fromTheme(QLatin1String("desktop"))).pixmap(16); | - |
| 5044 | break; | 0 |
| 5045 | case SP_TrashIcon: | - |
| 5046 | pixmap = QIcon::fromTheme(QLatin1String("user-trash"), | - |
| 5047 | QIcon::fromTheme(QLatin1String("trashcan_empty"))).pixmap(16); | - |
| 5048 | break; | 0 |
| 5049 | case SP_DriveCDIcon: | - |
| 5050 | case SP_DriveDVDIcon: | - |
| 5051 | pixmap = QIcon::fromTheme(QLatin1String("media-optical"), | - |
| 5052 | QIcon::fromTheme(QLatin1String("cdrom_unmount"))).pixmap(16); | - |
| 5053 | break; | 0 |
| 5054 | case SP_DriveHDIcon: | - |
| 5055 | pixmap = QIcon::fromTheme(QLatin1String("drive-harddisk"), | - |
| 5056 | QIcon::fromTheme(QLatin1String("hdd_unmount"))).pixmap(16); | - |
| 5057 | break; | 0 |
| 5058 | case SP_FileDialogToParent: | - |
| 5059 | pixmap = QIcon::fromTheme(QLatin1String("go-up"), | - |
| 5060 | QIcon::fromTheme(QLatin1String("up"))).pixmap(16); | - |
| 5061 | break; | 0 |
| 5062 | case SP_FileDialogNewFolder: | - |
| 5063 | pixmap = QIcon::fromTheme(QLatin1String("folder_new")).pixmap(16); | - |
| 5064 | break; | 0 |
| 5065 | case SP_ArrowUp: | - |
| 5066 | pixmap = QIcon::fromTheme(QLatin1String("go-up"), | - |
| 5067 | QIcon::fromTheme(QLatin1String("up"))).pixmap(16); | - |
| 5068 | break; | 0 |
| 5069 | case SP_ArrowDown: | - |
| 5070 | pixmap = QIcon::fromTheme(QLatin1String("go-down"), | - |
| 5071 | QIcon::fromTheme(QLatin1String("down"))).pixmap(16); | - |
| 5072 | break; | 0 |
| 5073 | case SP_ArrowRight: | - |
| 5074 | pixmap = QIcon::fromTheme(QLatin1String("go-next"), | - |
| 5075 | QIcon::fromTheme(QLatin1String("forward"))).pixmap(16); | - |
| 5076 | break; | 0 |
| 5077 | case SP_ArrowLeft: | - |
| 5078 | pixmap = QIcon::fromTheme(QLatin1String("go-previous"), | - |
| 5079 | QIcon::fromTheme(QLatin1String("back"))).pixmap(16); | - |
| 5080 | break; | 0 |
| 5081 | case SP_FileDialogDetailedView: | - |
| 5082 | pixmap = QIcon::fromTheme(QLatin1String("view_detailed")).pixmap(16); | - |
| 5083 | break; | 0 |
| 5084 | case SP_FileDialogListView: | - |
| 5085 | pixmap = QIcon::fromTheme(QLatin1String("view_icon")).pixmap(16); | - |
| 5086 | break; | 0 |
| 5087 | case SP_BrowserReload: | - |
| 5088 | pixmap = QIcon::fromTheme(QLatin1String("reload")).pixmap(16); | - |
| 5089 | break; | 0 |
| 5090 | case SP_BrowserStop: | - |
| 5091 | pixmap = QIcon::fromTheme(QLatin1String("process-stop")).pixmap(16); | - |
| 5092 | break; | 0 |
| 5093 | case SP_MediaPlay: | - |
| 5094 | pixmap = QIcon::fromTheme(QLatin1String("media-playback-start")).pixmap(16); | - |
| 5095 | break; | 0 |
| 5096 | case SP_MediaPause: | - |
| 5097 | pixmap = QIcon::fromTheme(QLatin1String("media-playback-pause")).pixmap(16); | - |
| 5098 | break; | 0 |
| 5099 | case SP_MediaStop: | - |
| 5100 | pixmap = QIcon::fromTheme(QLatin1String("media-playback-stop")).pixmap(16); | - |
| 5101 | break; | 0 |
| 5102 | case SP_MediaSeekForward: | - |
| 5103 | pixmap = QIcon::fromTheme(QLatin1String("media-seek-forward")).pixmap(16); | - |
| 5104 | break; | 0 |
| 5105 | case SP_MediaSeekBackward: | - |
| 5106 | pixmap = QIcon::fromTheme(QLatin1String("media-seek-backward")).pixmap(16); | - |
| 5107 | break; | 0 |
| 5108 | case SP_MediaSkipForward: | - |
| 5109 | pixmap = QIcon::fromTheme(QLatin1String("media-skip-forward")).pixmap(16); | - |
| 5110 | break; | 0 |
| 5111 | case SP_MediaSkipBackward: | - |
| 5112 | pixmap = QIcon::fromTheme(QLatin1String("media-skip-backward")).pixmap(16); | - |
| 5113 | break; | 0 |
| 5114 | case SP_DialogResetButton: | - |
| 5115 | pixmap = QIcon::fromTheme(QLatin1String("edit-clear")).pixmap(24); | - |
| 5116 | break; | 0 |
| 5117 | case SP_DialogHelpButton: | - |
| 5118 | pixmap = QIcon::fromTheme(QLatin1String("help-contents")).pixmap(24); | - |
| 5119 | break; | 0 |
| 5120 | case SP_DialogNoButton: | - |
| 5121 | case SP_DialogCancelButton: | - |
| 5122 | pixmap = QIcon::fromTheme(QLatin1String("dialog-cancel"), | - |
| 5123 | QIcon::fromTheme(QLatin1String("process-stop"))).pixmap(24); | - |
| 5124 | break; | 0 |
| 5125 | case SP_DialogSaveButton: | - |
| 5126 | pixmap = QIcon::fromTheme(QLatin1String("document-save")).pixmap(24); | - |
| 5127 | break; | 0 |
| 5128 | case SP_FileLinkIcon: | - |
| 5129 | pixmap = QIcon::fromTheme(QLatin1String("emblem-symbolic-link")).pixmap(16); | - |
| 5130 | if (!pixmap.isNull()) { never evaluated: !pixmap.isNull() | 0 |
| 5131 | QPixmap fileIcon = QIcon::fromTheme(QLatin1String("text-x-generic")).pixmap(16); | - |
| 5132 | if (fileIcon.isNull()) never evaluated: fileIcon.isNull() | 0 |
| 5133 | fileIcon = QIcon::fromTheme(QLatin1String("empty")).pixmap(16); never executed: fileIcon = QIcon::fromTheme(QLatin1String("empty")).pixmap(16); | 0 |
| 5134 | if (!fileIcon.isNull()) { never evaluated: !fileIcon.isNull() | 0 |
| 5135 | QPainter painter(&fileIcon); | - |
| 5136 | painter.drawPixmap(0, 0, 16, 16, pixmap); | - |
| 5137 | return fileIcon; never executed: return fileIcon; | 0 |
| 5138 | } | - |
| 5139 | } | 0 |
| 5140 | break; | 0 |
| 5141 | case SP_DirLinkIcon: | - |
| 5142 | pixmap = QIcon::fromTheme(QLatin1String("emblem-symbolic-link")).pixmap(16); | - |
| 5143 | if (!pixmap.isNull()) { never evaluated: !pixmap.isNull() | 0 |
| 5144 | QPixmap dirIcon = QIcon::fromTheme(QLatin1String("folder")).pixmap(16); | - |
| 5145 | if (!dirIcon.isNull()) { never evaluated: !dirIcon.isNull() | 0 |
| 5146 | QPainter painter(&dirIcon); | - |
| 5147 | painter.drawPixmap(0, 0, 16, 16, pixmap); | - |
| 5148 | return dirIcon; never executed: return dirIcon; | 0 |
| 5149 | } | - |
| 5150 | } | 0 |
| 5151 | break; | 0 |
| 5152 | default: | - |
| 5153 | break; | 0 |
| 5154 | } | - |
| 5155 | } | 0 |
| 5156 | | - |
| 5157 | if (!pixmap.isNull()) partially evaluated: !pixmap.isNull()| no Evaluation Count:0 | yes Evaluation Count:2324 |
| 0-2324 |
| 5158 | return pixmap; never executed: return pixmap; | 0 |
| 5159 | | - |
| 5160 | switch (sp) { | - |
| 5161 | | - |
| 5162 | case SP_ToolBarHorizontalExtensionButton: | - |
| 5163 | if (rtl) { partially evaluated: rtl| no Evaluation Count:0 | yes Evaluation Count:47 |
| 0-47 |
| 5164 | QImage im(tb_extension_arrow_h_xpm); | - |
| 5165 | im = im.convertToFormat(QImage::Format_ARGB32).mirrored(true, false); | - |
| 5166 | return QPixmap::fromImage(im); never executed: return QPixmap::fromImage(im); | 0 |
| 5167 | } | - |
| 5168 | return QPixmap(tb_extension_arrow_h_xpm); executed: return QPixmap(tb_extension_arrow_h_xpm);Execution Count:47 | 47 |
| 5169 | case SP_ToolBarVerticalExtensionButton: | - |
| 5170 | return QPixmap(tb_extension_arrow_v_xpm); never executed: return QPixmap(tb_extension_arrow_v_xpm); | 0 |
| 5171 | case SP_FileDialogStart: | - |
| 5172 | return QPixmap(filedialog_start_xpm); never executed: return QPixmap(filedialog_start_xpm); | 0 |
| 5173 | case SP_FileDialogEnd: | - |
| 5174 | return QPixmap(filedialog_end_xpm); never executed: return QPixmap(filedialog_end_xpm); | 0 |
| 5175 | | - |
| 5176 | | - |
| 5177 | case SP_CommandLink: | - |
| 5178 | case SP_ArrowForward: | - |
| 5179 | if (rtl) partially evaluated: rtl| no Evaluation Count:0 | yes Evaluation Count:12 |
| 0-12 |
| 5180 | return proxy()->standardPixmap(SP_ArrowLeft, option, widget); never executed: return proxy()->standardPixmap(SP_ArrowLeft, option, widget); | 0 |
| 5181 | return proxy()->standardPixmap(SP_ArrowRight, option, widget); executed: return proxy()->standardPixmap(SP_ArrowRight, option, widget);Execution Count:12 | 12 |
| 5182 | case SP_ArrowBack: | - |
| 5183 | if (rtl) | 0 |
| 5184 | return proxy()->standardPixmap(SP_ArrowRight, option, widget); never executed: return proxy()->standardPixmap(SP_ArrowRight, option, widget); | 0 |
| 5185 | return proxy()->standardPixmap(SP_ArrowLeft, option, widget); never executed: return proxy()->standardPixmap(SP_ArrowLeft, option, widget); | 0 |
| 5186 | case SP_ArrowLeft: | - |
| 5187 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/left-16.png")); never executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/left-16.png")); | 0 |
| 5188 | case SP_ArrowRight: | - |
| 5189 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/right-16.png")); executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/right-16.png"));Execution Count:12 | 12 |
| 5190 | case SP_ArrowUp: | - |
| 5191 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/up-16.png")); never executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/up-16.png")); | 0 |
| 5192 | case SP_ArrowDown: | - |
| 5193 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/down-16.png")); never executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/down-16.png")); | 0 |
| 5194 | case SP_FileDialogToParent: | - |
| 5195 | return proxy()->standardPixmap(SP_ArrowUp, option, widget); never executed: return proxy()->standardPixmap(SP_ArrowUp, option, widget); | 0 |
| 5196 | case SP_FileDialogNewFolder: | - |
| 5197 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/newdirectory-16.png")); never executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/newdirectory-16.png")); | 0 |
| 5198 | case SP_FileDialogDetailedView: | - |
| 5199 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/viewdetailed-16.png")); never executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/viewdetailed-16.png")); | 0 |
| 5200 | case SP_FileDialogInfoView: | - |
| 5201 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/fileinfo-16.png")); never executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/fileinfo-16.png")); | 0 |
| 5202 | case SP_FileDialogContentsView: | - |
| 5203 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/filecontents-16.png")); never executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/filecontents-16.png")); | 0 |
| 5204 | case SP_FileDialogListView: | - |
| 5205 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/viewlist-16.png")); never executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/viewlist-16.png")); | 0 |
| 5206 | case SP_FileDialogBack: | - |
| 5207 | return proxy()->standardPixmap(SP_ArrowBack, option, widget); never executed: return proxy()->standardPixmap(SP_ArrowBack, option, widget); | 0 |
| 5208 | case SP_DriveHDIcon: | - |
| 5209 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/harddrive-16.png")); executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/harddrive-16.png"));Execution Count:37 | 37 |
| 5210 | case SP_TrashIcon: | - |
| 5211 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/trash-16.png")); executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/trash-16.png"));Execution Count:4 | 4 |
| 5212 | case SP_DriveFDIcon: | - |
| 5213 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/floppy-16.png")); executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/floppy-16.png"));Execution Count:8 | 8 |
| 5214 | case SP_DriveNetIcon: | - |
| 5215 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/networkdrive-16.png")); executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/networkdrive-16.png"));Execution Count:9 | 9 |
| 5216 | case SP_DesktopIcon: | - |
| 5217 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/desktop-16.png")); executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/desktop-16.png"));Execution Count:9 | 9 |
| 5218 | case SP_ComputerIcon: | - |
| 5219 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/computer-16.png")); executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/computer-16.png"));Execution Count:200 | 200 |
| 5220 | case SP_DriveCDIcon: | - |
| 5221 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/cdr-16.png")); executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/cdr-16.png"));Execution Count:4 | 4 |
| 5222 | case SP_DriveDVDIcon: | - |
| 5223 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/dvd-16.png")); executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/dvd-16.png"));Execution Count:4 | 4 |
| 5224 | case SP_DirHomeIcon: | - |
| 5225 | case SP_DirOpenIcon: | - |
| 5226 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/diropen-16.png")); executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/diropen-16.png"));Execution Count:8 | 8 |
| 5227 | case SP_DirIcon: | - |
| 5228 | case SP_DirClosedIcon: | - |
| 5229 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/dirclosed-16.png")); executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/dirclosed-16.png"));Execution Count:8 | 8 |
| 5230 | case SP_DirLinkIcon: | - |
| 5231 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/dirlink-16.png")); executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/dirlink-16.png"));Execution Count:20 | 20 |
| 5232 | case SP_FileIcon: | - |
| 5233 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/file-16.png")); executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/file-16.png"));Execution Count:4 | 4 |
| 5234 | case SP_FileLinkIcon: | - |
| 5235 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/filelink-16.png")); executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/filelink-16.png"));Execution Count:4 | 4 |
| 5236 | case SP_DialogOkButton: | - |
| 5237 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-ok-16.png")); never executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-ok-16.png")); | 0 |
| 5238 | case SP_DialogCancelButton: | - |
| 5239 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-cancel-16.png")); never executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-cancel-16.png")); | 0 |
| 5240 | case SP_DialogHelpButton: | - |
| 5241 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-help-16.png")); never executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-help-16.png")); | 0 |
| 5242 | case SP_DialogOpenButton: | - |
| 5243 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-open-16.png")); never executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-open-16.png")); | 0 |
| 5244 | case SP_DialogSaveButton: | - |
| 5245 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-save-16.png")); never executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-save-16.png")); | 0 |
| 5246 | case SP_DialogCloseButton: | - |
| 5247 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-close-16.png")); never executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-close-16.png")); | 0 |
| 5248 | case SP_DialogApplyButton: | - |
| 5249 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-apply-16.png")); never executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-apply-16.png")); | 0 |
| 5250 | case SP_DialogResetButton: | - |
| 5251 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-clear-16.png")); never executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-clear-16.png")); | 0 |
| 5252 | case SP_DialogDiscardButton: | - |
| 5253 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-delete-16.png")); never executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-delete-16.png")); | 0 |
| 5254 | case SP_DialogYesButton: | - |
| 5255 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-yes-16.png")); never executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-yes-16.png")); | 0 |
| 5256 | case SP_DialogNoButton: | - |
| 5257 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-no-16.png")); never executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-no-16.png")); | 0 |
| 5258 | case SP_BrowserReload: | - |
| 5259 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/refresh-24.png")); never executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/refresh-24.png")); | 0 |
| 5260 | case SP_BrowserStop: | - |
| 5261 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/stop-24.png")); never executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/stop-24.png")); | 0 |
| 5262 | case SP_MediaPlay: | - |
| 5263 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-play-32.png")); never executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-play-32.png")); | 0 |
| 5264 | case SP_MediaPause: | - |
| 5265 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-pause-32.png")); never executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-pause-32.png")); | 0 |
| 5266 | case SP_MediaStop: | - |
| 5267 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-stop-32.png")); never executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-stop-32.png")); | 0 |
| 5268 | case SP_MediaSeekForward: | - |
| 5269 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-seek-forward-32.png")); never executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-seek-forward-32.png")); | 0 |
| 5270 | case SP_MediaSeekBackward: | - |
| 5271 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-seek-backward-32.png")); never executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-seek-backward-32.png")); | 0 |
| 5272 | case SP_MediaSkipForward: | - |
| 5273 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-skip-forward-32.png")); never executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-skip-forward-32.png")); | 0 |
| 5274 | case SP_MediaSkipBackward: | - |
| 5275 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-skip-backward-32.png")); never executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-skip-backward-32.png")); | 0 |
| 5276 | case SP_MediaVolume: | - |
| 5277 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-volume-16.png")); never executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-volume-16.png")); | 0 |
| 5278 | case SP_MediaVolumeMuted: | - |
| 5279 | return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-volume-muted-16.png")); never executed: return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-volume-muted-16.png")); | 0 |
| 5280 | | - |
| 5281 | default: | - |
| 5282 | break; executed: break;Execution Count:1934 | 1934 |
| 5283 | } | - |
| 5284 | | - |
| 5285 | | - |
| 5286 | switch (sp) { | - |
| 5287 | case SP_TitleBarMenuButton: | - |
| 5288 | return QPixmap(qt_menu_xpm); executed: return QPixmap(qt_menu_xpm);Execution Count:344 | 344 |
| 5289 | case SP_TitleBarShadeButton: | - |
| 5290 | return QPixmap(qt_shade_xpm); executed: return QPixmap(qt_shade_xpm);Execution Count:9 | 9 |
| 5291 | case SP_TitleBarUnshadeButton: | - |
| 5292 | return QPixmap(qt_unshade_xpm); executed: return QPixmap(qt_unshade_xpm);Execution Count:9 | 9 |
| 5293 | case SP_TitleBarNormalButton: | - |
| 5294 | return QPixmap(qt_normalizeup_xpm); executed: return QPixmap(qt_normalizeup_xpm);Execution Count:331 | 331 |
| 5295 | case SP_TitleBarMinButton: | - |
| 5296 | return QPixmap(qt_minimize_xpm); executed: return QPixmap(qt_minimize_xpm);Execution Count:304 | 304 |
| 5297 | case SP_TitleBarMaxButton: | - |
| 5298 | return QPixmap(qt_maximize_xpm); executed: return QPixmap(qt_maximize_xpm);Execution Count:263 | 263 |
| 5299 | case SP_TitleBarCloseButton: | - |
| 5300 | return QPixmap(qt_close_xpm); executed: return QPixmap(qt_close_xpm);Execution Count:578 | 578 |
| 5301 | case SP_TitleBarContextHelpButton: | - |
| 5302 | return QPixmap(qt_help_xpm); executed: return QPixmap(qt_help_xpm);Execution Count:9 | 9 |
| 5303 | case SP_DockWidgetCloseButton: | - |
| 5304 | return QPixmap(dock_widget_close_xpm); executed: return QPixmap(dock_widget_close_xpm);Execution Count:7 | 7 |
| 5305 | case SP_MessageBoxInformation: | - |
| 5306 | return QPixmap(information_xpm); executed: return QPixmap(information_xpm);Execution Count:25 | 25 |
| 5307 | case SP_MessageBoxWarning: | - |
| 5308 | return QPixmap(warning_xpm); executed: return QPixmap(warning_xpm);Execution Count:15 | 15 |
| 5309 | case SP_MessageBoxCritical: | - |
| 5310 | return QPixmap(critical_xpm); executed: return QPixmap(critical_xpm);Execution Count:16 | 16 |
| 5311 | case SP_MessageBoxQuestion: | - |
| 5312 | return QPixmap(question_xpm); executed: return QPixmap(question_xpm);Execution Count:16 | 16 |
| 5313 | default: | - |
| 5314 | break; executed: break;Execution Count:8 | 8 |
| 5315 | } | - |
| 5316 | | - |
| 5317 | | - |
| 5318 | | - |
| 5319 | return QPixmap(); executed: return QPixmap();Execution Count:8 | 8 |
| 5320 | } | - |
| 5321 | | - |
| 5322 | | - |
| 5323 | | - |
| 5324 | | - |
| 5325 | QIcon QCommonStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption *option, | - |
| 5326 | const QWidget *widget) const | - |
| 5327 | { | - |
| 5328 | QIcon icon; | - |
| 5329 | const bool rtl = (option && option->direction == Qt::RightToLeft) || (!option && QApplication::isRightToLeft()); evaluated: option| yes Evaluation Count:1017 | yes Evaluation Count:3514 |
evaluated: option->direction == Qt::RightToLeft| yes Evaluation Count:3 | yes Evaluation Count:1014 |
evaluated: !option| yes Evaluation Count:3514 | yes Evaluation Count:1014 |
evaluated: QApplication::isRightToLeft()| yes Evaluation Count:5 | yes Evaluation Count:3509 |
| 3-3514 |
| 5330 | if (QApplication::desktopSettingsAware() && !QIcon::themeName().isEmpty()) { partially evaluated: QApplication::desktopSettingsAware()| yes Evaluation Count:4531 | no Evaluation Count:0 |
partially evaluated: !QIcon::themeName().isEmpty()| no Evaluation Count:0 | yes Evaluation Count:4531 |
| 0-4531 |
| 5331 | switch (standardIcon) { | - |
| 5332 | case SP_DirHomeIcon: | - |
| 5333 | icon = QIcon::fromTheme(QLatin1String("user-home")); | - |
| 5334 | break; | 0 |
| 5335 | case SP_MessageBoxInformation: | - |
| 5336 | icon = QIcon::fromTheme(QLatin1String("dialog-information")); | - |
| 5337 | break; | 0 |
| 5338 | case SP_MessageBoxWarning: | - |
| 5339 | icon = QIcon::fromTheme(QLatin1String("dialog-warning")); | - |
| 5340 | break; | 0 |
| 5341 | case SP_MessageBoxCritical: | - |
| 5342 | icon = QIcon::fromTheme(QLatin1String("dialog-error")); | - |
| 5343 | break; | 0 |
| 5344 | case SP_MessageBoxQuestion: | - |
| 5345 | icon = QIcon::fromTheme(QLatin1String("dialog-question")); | - |
| 5346 | break; | 0 |
| 5347 | case SP_DialogOpenButton: | - |
| 5348 | case SP_DirOpenIcon: | - |
| 5349 | icon = QIcon::fromTheme(QLatin1String("folder-open")); | - |
| 5350 | break; | 0 |
| 5351 | case SP_DialogSaveButton: | - |
| 5352 | icon = QIcon::fromTheme(QLatin1String("document-save")); | - |
| 5353 | break; | 0 |
| 5354 | case SP_DialogApplyButton: | - |
| 5355 | icon = QIcon::fromTheme(QLatin1String("dialog-ok-apply")); | - |
| 5356 | break; | 0 |
| 5357 | case SP_DialogYesButton: | - |
| 5358 | case SP_DialogOkButton: | - |
| 5359 | icon = QIcon::fromTheme(QLatin1String("dialog-ok")); | - |
| 5360 | break; | 0 |
| 5361 | case SP_DialogDiscardButton: | - |
| 5362 | icon = QIcon::fromTheme(QLatin1String("edit-delete")); | - |
| 5363 | break; | 0 |
| 5364 | case SP_DialogResetButton: | - |
| 5365 | icon = QIcon::fromTheme(QLatin1String("edit-clear")); | - |
| 5366 | break; | 0 |
| 5367 | case SP_DialogHelpButton: | - |
| 5368 | icon = QIcon::fromTheme(QLatin1String("help-contents")); | - |
| 5369 | break; | 0 |
| 5370 | case SP_FileIcon: | - |
| 5371 | icon = QIcon::fromTheme(QLatin1String("text-x-generic")); | - |
| 5372 | break; | 0 |
| 5373 | case SP_DirClosedIcon: | - |
| 5374 | case SP_DirIcon: | - |
| 5375 | icon = QIcon::fromTheme(QLatin1String("folder")); | - |
| 5376 | break; | 0 |
| 5377 | case SP_DriveFDIcon: | - |
| 5378 | icon = QIcon::fromTheme(QLatin1String("floppy_unmount")); | - |
| 5379 | break; | 0 |
| 5380 | case SP_ComputerIcon: | - |
| 5381 | icon = QIcon::fromTheme(QLatin1String("computer"), | - |
| 5382 | QIcon::fromTheme(QLatin1String("system"))); | - |
| 5383 | break; | 0 |
| 5384 | case SP_DesktopIcon: | - |
| 5385 | icon = QIcon::fromTheme(QLatin1String("user-desktop")); | - |
| 5386 | break; | 0 |
| 5387 | case SP_TrashIcon: | - |
| 5388 | icon = QIcon::fromTheme(QLatin1String("user-trash")); | - |
| 5389 | break; | 0 |
| 5390 | case SP_DriveCDIcon: | - |
| 5391 | case SP_DriveDVDIcon: | - |
| 5392 | icon = QIcon::fromTheme(QLatin1String("media-optical")); | - |
| 5393 | break; | 0 |
| 5394 | case SP_DriveHDIcon: | - |
| 5395 | icon = QIcon::fromTheme(QLatin1String("drive-harddisk")); | - |
| 5396 | break; | 0 |
| 5397 | case SP_FileDialogToParent: | - |
| 5398 | icon = QIcon::fromTheme(QLatin1String("go-up")); | - |
| 5399 | break; | 0 |
| 5400 | case SP_FileDialogNewFolder: | - |
| 5401 | icon = QIcon::fromTheme(QLatin1String("folder-new")); | - |
| 5402 | break; | 0 |
| 5403 | case SP_ArrowUp: | - |
| 5404 | icon = QIcon::fromTheme(QLatin1String("go-up")); | - |
| 5405 | break; | 0 |
| 5406 | case SP_ArrowDown: | - |
| 5407 | icon = QIcon::fromTheme(QLatin1String("go-down")); | - |
| 5408 | break; | 0 |
| 5409 | case SP_ArrowRight: | - |
| 5410 | icon = QIcon::fromTheme(QLatin1String("go-next")); | - |
| 5411 | break; | 0 |
| 5412 | case SP_ArrowLeft: | - |
| 5413 | icon = QIcon::fromTheme(QLatin1String("go-previous")); | - |
| 5414 | break; | 0 |
| 5415 | case SP_DialogCancelButton: | - |
| 5416 | icon = QIcon::fromTheme(QLatin1String("dialog-cancel"), | - |
| 5417 | QIcon::fromTheme(QLatin1String("process-stop"))); | - |
| 5418 | break; | 0 |
| 5419 | case SP_DialogCloseButton: | - |
| 5420 | icon = QIcon::fromTheme(QLatin1String("window-close")); | - |
| 5421 | break; | 0 |
| 5422 | case SP_FileDialogDetailedView: | - |
| 5423 | icon = QIcon::fromTheme(QLatin1String("view-list-details")); | - |
| 5424 | break; | 0 |
| 5425 | case SP_FileDialogListView: | - |
| 5426 | icon = QIcon::fromTheme(QLatin1String("view-list-icons")); | - |
| 5427 | break; | 0 |
| 5428 | case SP_BrowserReload: | - |
| 5429 | icon = QIcon::fromTheme(QLatin1String("view-refresh")); | - |
| 5430 | break; | 0 |
| 5431 | case SP_BrowserStop: | - |
| 5432 | icon = QIcon::fromTheme(QLatin1String("process-stop")); | - |
| 5433 | break; | 0 |
| 5434 | case SP_MediaPlay: | - |
| 5435 | icon = QIcon::fromTheme(QLatin1String("media-playback-start")); | - |
| 5436 | break; | 0 |
| 5437 | case SP_MediaPause: | - |
| 5438 | icon = QIcon::fromTheme(QLatin1String("media-playback-pause")); | - |
| 5439 | break; | 0 |
| 5440 | case SP_MediaStop: | - |
| 5441 | icon = QIcon::fromTheme(QLatin1String("media-playback-stop")); | - |
| 5442 | break; | 0 |
| 5443 | case SP_MediaSeekForward: | - |
| 5444 | icon = QIcon::fromTheme(QLatin1String("media-seek-forward")); | - |
| 5445 | break; | 0 |
| 5446 | case SP_MediaSeekBackward: | - |
| 5447 | icon = QIcon::fromTheme(QLatin1String("media-seek-backward")); | - |
| 5448 | break; | 0 |
| 5449 | case SP_MediaSkipForward: | - |
| 5450 | icon = QIcon::fromTheme(QLatin1String("media-skip-forward")); | - |
| 5451 | break; | 0 |
| 5452 | case SP_MediaSkipBackward: | - |
| 5453 | icon = QIcon::fromTheme(QLatin1String("media-skip-backward")); | - |
| 5454 | break; | 0 |
| 5455 | case SP_MediaVolume: | - |
| 5456 | icon = QIcon::fromTheme(QLatin1String("audio-volume-medium")); | - |
| 5457 | break; | 0 |
| 5458 | case SP_MediaVolumeMuted: | - |
| 5459 | icon = QIcon::fromTheme(QLatin1String("audio-volume-muted")); | - |
| 5460 | break; | 0 |
| 5461 | case SP_ArrowForward: | - |
| 5462 | if (rtl) | 0 |
| 5463 | return QCommonStyle::standardIcon(SP_ArrowLeft, option, widget); never executed: return QCommonStyle::standardIcon(SP_ArrowLeft, option, widget); | 0 |
| 5464 | return QCommonStyle::standardIcon(SP_ArrowRight, option, widget); never executed: return QCommonStyle::standardIcon(SP_ArrowRight, option, widget); | 0 |
| 5465 | case SP_ArrowBack: | - |
| 5466 | if (rtl) | 0 |
| 5467 | return QCommonStyle::standardIcon(SP_ArrowRight, option, widget); never executed: return QCommonStyle::standardIcon(SP_ArrowRight, option, widget); | 0 |
| 5468 | return QCommonStyle::standardIcon(SP_ArrowLeft, option, widget); never executed: return QCommonStyle::standardIcon(SP_ArrowLeft, option, widget); | 0 |
| 5469 | case SP_FileLinkIcon: | - |
| 5470 | { | - |
| 5471 | QIcon linkIcon = QIcon::fromTheme(QLatin1String("emblem-symbolic-link")); | - |
| 5472 | if (!linkIcon.isNull()) { never evaluated: !linkIcon.isNull() | 0 |
| 5473 | QIcon baseIcon = QCommonStyle::standardIcon(SP_FileIcon, option, widget); | - |
| 5474 | const QList<QSize> sizes = baseIcon.availableSizes(QIcon::Normal, QIcon::Off); | - |
| 5475 | for (int i = 0 ; i < sizes.size() ; ++i) { never evaluated: i < sizes.size() | 0 |
| 5476 | int size = sizes[i].width(); | - |
| 5477 | QPixmap basePixmap = baseIcon.pixmap(size); | - |
| 5478 | QPixmap linkPixmap = linkIcon.pixmap(size/2); | - |
| 5479 | QPainter painter(&basePixmap); | - |
| 5480 | painter.drawPixmap(size/2, size/2, linkPixmap); | - |
| 5481 | icon.addPixmap(basePixmap); | - |
| 5482 | } | 0 |
| 5483 | } | 0 |
| 5484 | } | - |
| 5485 | break; | 0 |
| 5486 | case SP_DirLinkIcon: | - |
| 5487 | { | - |
| 5488 | QIcon linkIcon = QIcon::fromTheme(QLatin1String("emblem-symbolic-link")); | - |
| 5489 | if (!linkIcon.isNull()) { never evaluated: !linkIcon.isNull() | 0 |
| 5490 | QIcon baseIcon = QCommonStyle::standardIcon(SP_DirIcon, option, widget); | - |
| 5491 | const QList<QSize> sizes = baseIcon.availableSizes(QIcon::Normal, QIcon::Off); | - |
| 5492 | for (int i = 0 ; i < sizes.size() ; ++i) { never evaluated: i < sizes.size() | 0 |
| 5493 | int size = sizes[i].width(); | - |
| 5494 | QPixmap basePixmap = baseIcon.pixmap(size); | - |
| 5495 | QPixmap linkPixmap = linkIcon.pixmap(size/2); | - |
| 5496 | QPainter painter(&basePixmap); | - |
| 5497 | painter.drawPixmap(size/2, size/2, linkPixmap); | - |
| 5498 | icon.addPixmap(basePixmap); | - |
| 5499 | } | 0 |
| 5500 | } | 0 |
| 5501 | } | - |
| 5502 | break; | 0 |
| 5503 | default: | - |
| 5504 | break; | 0 |
| 5505 | } | - |
| 5506 | } | 0 |
| 5507 | | - |
| 5508 | if (!icon.isNull()) partially evaluated: !icon.isNull()| no Evaluation Count:0 | yes Evaluation Count:4531 |
| 0-4531 |
| 5509 | return icon; never executed: return icon; | 0 |
| 5510 | switch (standardIcon) { | - |
| 5511 | | - |
| 5512 | case SP_FileDialogNewFolder: | - |
| 5513 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/newdirectory-16.png"), QSize(16, 16)); | - |
| 5514 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/newdirectory-32.png"), QSize(32, 32)); | - |
| 5515 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/newdirectory-128.png"), QSize(128, 128)); | - |
| 5516 | break; executed: break;Execution Count:189 | 189 |
| 5517 | case SP_FileDialogBack: | - |
| 5518 | return QCommonStyle::standardIcon(SP_ArrowBack, option, widget); never executed: return QCommonStyle::standardIcon(SP_ArrowBack, option, widget); | 0 |
| 5519 | case SP_FileDialogToParent: | - |
| 5520 | return QCommonStyle::standardIcon(SP_ArrowUp, option, widget); executed: return QCommonStyle::standardIcon(SP_ArrowUp, option, widget);Execution Count:189 | 189 |
| 5521 | case SP_FileDialogDetailedView: | - |
| 5522 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/viewdetailed-16.png"), QSize(16, 16)); | - |
| 5523 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/viewdetailed-32.png"), QSize(32, 32)); | - |
| 5524 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/viewdetailed-128.png"), QSize(128, 128)); | - |
| 5525 | break; executed: break;Execution Count:189 | 189 |
| 5526 | case SP_FileDialogInfoView: | - |
| 5527 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/fileinfo-16.png"), QSize(16, 16)); | - |
| 5528 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/fileinfo-32.png"), QSize(32, 32)); | - |
| 5529 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/fileinfo-128.png"), QSize(128, 128)); | - |
| 5530 | break; | 0 |
| 5531 | case SP_FileDialogContentsView: | - |
| 5532 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/filecontents-16.png"), QSize(16, 16)); | - |
| 5533 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/filecontents-32.png"), QSize(32, 32)); | - |
| 5534 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/filecontents-128.png"), QSize(128, 128)); | - |
| 5535 | break; | 0 |
| 5536 | case SP_FileDialogListView: | - |
| 5537 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/viewlist-16.png"), QSize(16, 16)); | - |
| 5538 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/viewlist-32.png"), QSize(32, 32)); | - |
| 5539 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/viewlist-128.png"), QSize(128, 128)); | - |
| 5540 | break; executed: break;Execution Count:189 | 189 |
| 5541 | case SP_DialogOkButton: | - |
| 5542 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-ok-16.png"), QSize(16, 16)); | - |
| 5543 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-ok-32.png"), QSize(32, 32)); | - |
| 5544 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-ok-128.png"), QSize(128, 128)); | - |
| 5545 | break; | 0 |
| 5546 | case SP_DialogCancelButton: | - |
| 5547 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-cancel-16.png"), QSize(16, 16)); | - |
| 5548 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-cancel-32.png"), QSize(32, 32)); | - |
| 5549 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-cancel-128.png"), QSize(128, 128)); | - |
| 5550 | break; | 0 |
| 5551 | case SP_DialogHelpButton: | - |
| 5552 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-help-16.png"), QSize(16, 16)); | - |
| 5553 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-help-32.png"), QSize(32, 32)); | - |
| 5554 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-help-128.png"), QSize(128, 128)); | - |
| 5555 | break; | 0 |
| 5556 | case SP_DialogOpenButton: | - |
| 5557 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-open-16.png"), QSize(16, 16)); | - |
| 5558 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-open-32.png"), QSize(32, 32)); | - |
| 5559 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-open-128.png"), QSize(128, 128)); | - |
| 5560 | break; | 0 |
| 5561 | case SP_DialogSaveButton: | - |
| 5562 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-save-16.png"), QSize(16, 16)); | - |
| 5563 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-save-32.png"), QSize(32, 32)); | - |
| 5564 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-save-128.png"), QSize(128, 128)); | - |
| 5565 | break; | 0 |
| 5566 | case SP_DialogCloseButton: | - |
| 5567 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-close-16.png"), QSize(16, 16)); | - |
| 5568 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-close-32.png"), QSize(32, 32)); | - |
| 5569 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-close-128.png"), QSize(128, 128)); | - |
| 5570 | break; | 0 |
| 5571 | case SP_DialogApplyButton: | - |
| 5572 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-apply-16.png"), QSize(16, 16)); | - |
| 5573 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-apply-32.png"), QSize(32, 32)); | - |
| 5574 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-apply-128.png"), QSize(128, 128)); | - |
| 5575 | break; | 0 |
| 5576 | case SP_DialogResetButton: | - |
| 5577 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-clear-16.png"), QSize(16, 16)); | - |
| 5578 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-clear-32.png"), QSize(32, 32)); | - |
| 5579 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-clear-128.png"), QSize(128, 128)); | - |
| 5580 | break; | 0 |
| 5581 | case SP_DialogDiscardButton: | - |
| 5582 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-delete-16.png"), QSize(16, 16)); | - |
| 5583 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-delete-32.png"), QSize(32, 32)); | - |
| 5584 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-delete-128.png"), QSize(128, 128)); | - |
| 5585 | break; | 0 |
| 5586 | case SP_DialogYesButton: | - |
| 5587 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-yes-16.png"), QSize(16, 16)); | - |
| 5588 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-yes-32.png"), QSize(32, 32)); | - |
| 5589 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-yes-128.png"), QSize(128, 128)); | - |
| 5590 | break; | 0 |
| 5591 | case SP_DialogNoButton: | - |
| 5592 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-no-16.png"), QSize(16, 16)); | - |
| 5593 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-no-32.png"), QSize(32, 32)); | - |
| 5594 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-no-128.png"), QSize(128, 128)); | - |
| 5595 | break; | 0 |
| 5596 | case SP_ArrowForward: | - |
| 5597 | if (rtl) partially evaluated: rtl| no Evaluation Count:0 | yes Evaluation Count:189 |
| 0-189 |
| 5598 | return QCommonStyle::standardIcon(SP_ArrowLeft, option, widget); never executed: return QCommonStyle::standardIcon(SP_ArrowLeft, option, widget); | 0 |
| 5599 | return QCommonStyle::standardIcon(SP_ArrowRight, option, widget); executed: return QCommonStyle::standardIcon(SP_ArrowRight, option, widget);Execution Count:189 | 189 |
| 5600 | case SP_ArrowBack: | - |
| 5601 | if (rtl) partially evaluated: rtl| no Evaluation Count:0 | yes Evaluation Count:190 |
| 0-190 |
| 5602 | return QCommonStyle::standardIcon(SP_ArrowRight, option, widget); never executed: return QCommonStyle::standardIcon(SP_ArrowRight, option, widget); | 0 |
| 5603 | return QCommonStyle::standardIcon(SP_ArrowLeft, option, widget); executed: return QCommonStyle::standardIcon(SP_ArrowLeft, option, widget);Execution Count:190 | 190 |
| 5604 | case SP_ArrowLeft: | - |
| 5605 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/left-16.png"), QSize(16, 16)); | - |
| 5606 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/left-32.png"), QSize(32, 32)); | - |
| 5607 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/left-128.png"), QSize(128, 128)); | - |
| 5608 | break; executed: break;Execution Count:219 | 219 |
| 5609 | case SP_ArrowRight: | - |
| 5610 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/right-16.png"), QSize(16, 16)); | - |
| 5611 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/right-32.png"), QSize(32, 32)); | - |
| 5612 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/right-128.png"), QSize(128, 128)); | - |
| 5613 | break; executed: break;Execution Count:218 | 218 |
| 5614 | case SP_ArrowUp: | - |
| 5615 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/up-16.png"), QSize(16, 16)); | - |
| 5616 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/up-32.png"), QSize(32, 32)); | - |
| 5617 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/up-128.png"), QSize(128, 128)); | - |
| 5618 | break; executed: break;Execution Count:189 | 189 |
| 5619 | case SP_ArrowDown: | - |
| 5620 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/down-16.png"), QSize(16, 16)); | - |
| 5621 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/down-32.png"), QSize(32, 32)); | - |
| 5622 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/down-128.png"), QSize(128, 128)); | - |
| 5623 | break; | 0 |
| 5624 | case SP_DirHomeIcon: | - |
| 5625 | case SP_DirIcon: | - |
| 5626 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/dirclosed-16.png"), | - |
| 5627 | QSize(), QIcon::Normal, QIcon::Off); | - |
| 5628 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/diropen-16.png"), | - |
| 5629 | QSize(), QIcon::Normal, QIcon::On); | - |
| 5630 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/dirclosed-32.png"), | - |
| 5631 | QSize(32, 32), QIcon::Normal, QIcon::Off); | - |
| 5632 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/diropen-32.png"), | - |
| 5633 | QSize(32, 32), QIcon::Normal, QIcon::On); | - |
| 5634 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/dirclosed-128.png"), | - |
| 5635 | QSize(128, 128), QIcon::Normal, QIcon::Off); | - |
| 5636 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/diropen-128.png"), | - |
| 5637 | QSize(128, 128), QIcon::Normal, QIcon::On); | - |
| 5638 | break; executed: break;Execution Count:448 | 448 |
| 5639 | case SP_DriveCDIcon: | - |
| 5640 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/cdr-16.png"), QSize(16, 16)); | - |
| 5641 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/cdr-32.png"), QSize(32, 32)); | - |
| 5642 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/cdr-128.png"), QSize(128, 128)); | - |
| 5643 | break; executed: break;Execution Count:4 | 4 |
| 5644 | case SP_DriveDVDIcon: | - |
| 5645 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/dvd-16.png"), QSize(16, 16)); | - |
| 5646 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/dvd-32.png"), QSize(32, 32)); | - |
| 5647 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/dvd-128.png"), QSize(128, 128)); | - |
| 5648 | break; executed: break;Execution Count:5 | 5 |
| 5649 | case SP_FileIcon: | - |
| 5650 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/file-16.png"), QSize(16, 16)); | - |
| 5651 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/file-32.png"), QSize(32, 32)); | - |
| 5652 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/file-128.png"), QSize(128, 128)); | - |
| 5653 | break; executed: break;Execution Count:93 | 93 |
| 5654 | case SP_FileLinkIcon: | - |
| 5655 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/filelink-16.png"), QSize(16, 16)); | - |
| 5656 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/filelink-32.png"), QSize(32, 32)); | - |
| 5657 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/filelink-128.png"), QSize(128, 128)); | - |
| 5658 | break; executed: break;Execution Count:17 | 17 |
| 5659 | case SP_TrashIcon: | - |
| 5660 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/trash-16.png"), QSize(16, 16)); | - |
| 5661 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/trash-32.png"), QSize(32, 32)); | - |
| 5662 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/trash-128.png"), QSize(128, 128)); | - |
| 5663 | break; executed: break;Execution Count:5 | 5 |
| 5664 | case SP_BrowserReload: | - |
| 5665 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/refresh-24.png"), QSize(24, 24)); | - |
| 5666 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/refresh-32.png"), QSize(32, 32)); | - |
| 5667 | break; | 0 |
| 5668 | case SP_BrowserStop: | - |
| 5669 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/stop-24.png"), QSize(24, 24)); | - |
| 5670 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/stop-32.png"), QSize(32, 32)); | - |
| 5671 | break; | 0 |
| 5672 | case SP_MediaPlay: | - |
| 5673 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-play-16.png"), QSize(16, 16)); | - |
| 5674 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-play-32.png"), QSize(32, 32)); | - |
| 5675 | break; | 0 |
| 5676 | case SP_MediaPause: | - |
| 5677 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-pause-16.png"), QSize(16, 16)); | - |
| 5678 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-pause-32.png"), QSize(32, 32)); | - |
| 5679 | break; | 0 |
| 5680 | case SP_MediaStop: | - |
| 5681 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-stop-16.png"), QSize(16, 16)); | - |
| 5682 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-stop-32.png"), QSize(32, 32)); | - |
| 5683 | break; | 0 |
| 5684 | case SP_MediaSeekForward: | - |
| 5685 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-seek-forward-16.png"), QSize(16, 16)); | - |
| 5686 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-seek-forward-32.png"), QSize(32, 32)); | - |
| 5687 | break; | 0 |
| 5688 | case SP_MediaSeekBackward: | - |
| 5689 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-seek-backward-16.png"), QSize(16, 16)); | - |
| 5690 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-seek-backward-32.png"), QSize(32, 32)); | - |
| 5691 | break; | 0 |
| 5692 | case SP_MediaSkipForward: | - |
| 5693 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-skip-forward-16.png"), QSize(16, 16)); | - |
| 5694 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-skip-forward-32.png"), QSize(32, 32)); | - |
| 5695 | break; | 0 |
| 5696 | case SP_MediaSkipBackward: | - |
| 5697 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-skip-backward-16.png"), QSize(16, 16)); | - |
| 5698 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-skip-backward-32.png"), QSize(32, 32)); | - |
| 5699 | break; | 0 |
| 5700 | case SP_MediaVolume: | - |
| 5701 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-volume-16.png"), QSize(16, 16)); | - |
| 5702 | break; | 0 |
| 5703 | case SP_MediaVolumeMuted: | - |
| 5704 | icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-volume-muted-16.png"), QSize(16, 16)); | - |
| 5705 | break; | 0 |
| 5706 | | - |
| 5707 | default: | - |
| 5708 | icon.addPixmap(proxy()->standardPixmap(standardIcon, option, widget)); | - |
| 5709 | break; executed: break;Execution Count:2198 | 2198 |
| 5710 | } | - |
| 5711 | return icon; executed: return icon;Execution Count:3963 | 3963 |
| 5712 | } | - |
| 5713 | | - |
| 5714 | static inline uint qt_intensity(uint r, uint g, uint b) | - |
| 5715 | { | - |
| 5716 | | - |
| 5717 | return (77 * r + 150 * g + 28 * b) / 255; executed: return (77 * r + 150 * g + 28 * b) / 255;Execution Count:18 | 18 |
| 5718 | } | - |
| 5719 | | - |
| 5720 | | - |
| 5721 | QPixmap QCommonStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, | - |
| 5722 | const QStyleOption *opt) const | - |
| 5723 | { | - |
| 5724 | switch (iconMode) { | - |
| 5725 | case QIcon::Disabled: { | - |
| 5726 | QImage im = pixmap.toImage().convertToFormat(QImage::Format_ARGB32); | - |
| 5727 | | - |
| 5728 | | - |
| 5729 | QColor bg = opt->palette.color(QPalette::Disabled, QPalette::Window); | - |
| 5730 | int red = bg.red(); | - |
| 5731 | int green = bg.green(); | - |
| 5732 | int blue = bg.blue(); | - |
| 5733 | uchar reds[256], greens[256], blues[256]; | - |
| 5734 | for (int i=0; i<128; ++i) { evaluated: i<128| yes Evaluation Count:2304 | yes Evaluation Count:18 |
| 18-2304 |
| 5735 | reds[i] = uchar((red * (i<<1)) >> 8); | - |
| 5736 | greens[i] = uchar((green * (i<<1)) >> 8); | - |
| 5737 | blues[i] = uchar((blue * (i<<1)) >> 8); | - |
| 5738 | } executed: }Execution Count:2304 | 2304 |
| 5739 | for (int i=0; i<128; ++i) { evaluated: i<128| yes Evaluation Count:2304 | yes Evaluation Count:18 |
| 18-2304 |
| 5740 | reds[i+128] = uchar(qMin(red + (i << 1), 255)); | - |
| 5741 | greens[i+128] = uchar(qMin(green + (i << 1), 255)); | - |
| 5742 | blues[i+128] = uchar(qMin(blue + (i << 1), 255)); | - |
| 5743 | } executed: }Execution Count:2304 | 2304 |
| 5744 | | - |
| 5745 | int intensity = qt_intensity(red, green, blue); | - |
| 5746 | const int factor = 191; | - |
| 5747 | | - |
| 5748 | | - |
| 5749 | | - |
| 5750 | | - |
| 5751 | if ((red - factor > green && red - factor > blue) partially evaluated: red - factor > green| no Evaluation Count:0 | yes Evaluation Count:18 |
never evaluated: red - factor > blue | 0-18 |
| 5752 | || (green - factor > red && green - factor > blue) partially evaluated: green - factor > red| no Evaluation Count:0 | yes Evaluation Count:18 |
never evaluated: green - factor > blue | 0-18 |
| 5753 | || (blue - factor > red && blue - factor > green)) partially evaluated: blue - factor > red| no Evaluation Count:0 | yes Evaluation Count:18 |
never evaluated: blue - factor > green | 0-18 |
| 5754 | intensity = qMin(255, intensity + 91); never executed: intensity = qMin(255, intensity + 91); | 0 |
| 5755 | else if (intensity <= 128) partially evaluated: intensity <= 128| no Evaluation Count:0 | yes Evaluation Count:18 |
| 0-18 |
| 5756 | intensity -= 51; never executed: intensity -= 51; | 0 |
| 5757 | | - |
| 5758 | for (int y=0; y<im.height(); ++y) { evaluated: y<im.height()| yes Evaluation Count:219 | yes Evaluation Count:18 |
| 18-219 |
| 5759 | QRgb *scanLine = (QRgb*)im.scanLine(y); | - |
| 5760 | for (int x=0; x<im.width(); ++x) { evaluated: x<im.width()| yes Evaluation Count:3643 | yes Evaluation Count:219 |
| 219-3643 |
| 5761 | QRgb pixel = *scanLine; | - |
| 5762 | | - |
| 5763 | | - |
| 5764 | uint ci = uint(qGray(pixel)/3 + (130 - intensity / 3)); | - |
| 5765 | *scanLine = qRgba(reds[ci], greens[ci], blues[ci], qAlpha(pixel)); | - |
| 5766 | ++scanLine; | - |
| 5767 | } executed: }Execution Count:3643 | 3643 |
| 5768 | } executed: }Execution Count:219 | 219 |
| 5769 | | - |
| 5770 | return QPixmap::fromImage(im); executed: return QPixmap::fromImage(im);Execution Count:18 | 18 |
| 5771 | } | - |
| 5772 | case QIcon::Selected: { | - |
| 5773 | QImage img = pixmap.toImage().convertToFormat(QImage::Format_ARGB32_Premultiplied); | - |
| 5774 | QColor color = opt->palette.color(QPalette::Normal, QPalette::Highlight); | - |
| 5775 | color.setAlphaF(qreal(0.3)); | - |
| 5776 | QPainter painter(&img); | - |
| 5777 | painter.setCompositionMode(QPainter::CompositionMode_SourceAtop); | - |
| 5778 | painter.fillRect(0, 0, img.width(), img.height(), color); | - |
| 5779 | painter.end(); | - |
| 5780 | return QPixmap::fromImage(img); } executed: return QPixmap::fromImage(img);Execution Count:14 | 14 |
| 5781 | case QIcon::Active: | - |
| 5782 | return pixmap; executed: return pixmap;Execution Count:13 | 13 |
| 5783 | default: | - |
| 5784 | break; executed: break;Execution Count:3 | 3 |
| 5785 | } | - |
| 5786 | return pixmap; executed: return pixmap;Execution Count:3 | 3 |
| 5787 | } | - |
| 5788 | | - |
| 5789 | | - |
| 5790 | | - |
| 5791 | | - |
| 5792 | int QCommonStyle::layoutSpacing(QSizePolicy::ControlType , QSizePolicy::ControlType , | - |
| 5793 | Qt::Orientation , const QStyleOption * , | - |
| 5794 | const QWidget * ) const | - |
| 5795 | { | - |
| 5796 | return -1; never executed: return -1; | 0 |
| 5797 | } | - |
| 5798 | | - |
| 5799 | | - |
| 5800 | | - |
| 5801 | | - |
| 5802 | void QCommonStyle::polish(QPalette &pal) | - |
| 5803 | { | - |
| 5804 | QStyle::polish(pal); | - |
| 5805 | } executed: }Execution Count:284 | 284 |
| 5806 | | - |
| 5807 | | - |
| 5808 | | - |
| 5809 | | - |
| 5810 | void QCommonStyle::polish(QWidget *widget) | - |
| 5811 | { | - |
| 5812 | QStyle::polish(widget); | - |
| 5813 | } executed: }Execution Count:41006 | 41006 |
| 5814 | | - |
| 5815 | | - |
| 5816 | | - |
| 5817 | | - |
| 5818 | void QCommonStyle::unpolish(QWidget *widget) | - |
| 5819 | { | - |
| 5820 | QStyle::unpolish(widget); | - |
| 5821 | } executed: }Execution Count:3772 | 3772 |
| 5822 | | - |
| 5823 | | - |
| 5824 | | - |
| 5825 | | - |
| 5826 | void QCommonStyle::polish(QApplication *app) | - |
| 5827 | { | - |
| 5828 | QStyle::polish(app); | - |
| 5829 | } executed: }Execution Count:279 | 279 |
| 5830 | | - |
| 5831 | | - |
| 5832 | | - |
| 5833 | | - |
| 5834 | void QCommonStyle::unpolish(QApplication *application) | - |
| 5835 | { | - |
| 5836 | const QCommonStylePrivate * const d = d_func(); | - |
| 5837 | d->tabBarcloseButtonIcon = QIcon(); | - |
| 5838 | QStyle::unpolish(application); | - |
| 5839 | } executed: }Execution Count:64 | 64 |
| 5840 | | - |
| 5841 | | - |
| 5842 | | - |
| 5843 | | - |
| 5844 | | - |
| | |