5354 a[pnt].translate(offset.x(), offset.y()); |
5354 a[pnt].translate(offset.x(), offset.y()); |
5355 } |
5355 } |
5356 painter->setPen(option->palette.text().color()); |
5356 painter->setPen(option->palette.text().color()); |
5357 painter->drawLines(a); |
5357 painter->drawLines(a); |
5358 break; } |
5358 break; } |
|
5359 case PE_IndicatorBranch: { |
|
5360 // Copied from the Windows style. |
|
5361 static const int decoration_size = d->doubleControls ? 18 : 9; |
|
5362 static const int ofsA = d->doubleControls ? 4 : 2; |
|
5363 static const int ofsB = d->doubleControls ? 8 : 4; |
|
5364 static const int ofsC = d->doubleControls ? 12 : 6; |
|
5365 static const int ofsD = d->doubleControls ? 1 : 0; |
|
5366 int mid_h = option->rect.x() + option->rect.width() / 2; |
|
5367 int mid_v = option->rect.y() + option->rect.height() / 2; |
|
5368 int bef_h = mid_h; |
|
5369 int bef_v = mid_v; |
|
5370 int aft_h = mid_h; |
|
5371 int aft_v = mid_v; |
|
5372 if (option->state & State_Children) { |
|
5373 int delta = decoration_size / 2; |
|
5374 bef_h -= delta; |
|
5375 bef_v -= delta; |
|
5376 aft_h += delta; |
|
5377 aft_v += delta; |
|
5378 QPen oldPen = painter->pen(); |
|
5379 QPen crossPen = oldPen; |
|
5380 crossPen.setWidth(2); |
|
5381 painter->setPen(crossPen); |
|
5382 painter->drawLine(bef_h + ofsA + ofsD, bef_v + ofsB + ofsD, bef_h + ofsC + ofsD, bef_v + ofsB + ofsD); |
|
5383 if (!(option->state & State_Open)) |
|
5384 painter->drawLine(bef_h + ofsB + ofsD, bef_v + ofsA + ofsD, bef_h + ofsB + ofsD, bef_v + ofsC + ofsD); |
|
5385 painter->setPen(option->palette.dark().color()); |
|
5386 painter->drawRect(bef_h, bef_v, decoration_size - 1, decoration_size - 1); |
|
5387 if (d->doubleControls) |
|
5388 painter->drawRect(bef_h + 1, bef_v + 1, decoration_size - 3, decoration_size - 3); |
|
5389 painter->setPen(oldPen); |
|
5390 } |
|
5391 QBrush brush(option->palette.dark().color(), Qt::Dense4Pattern); |
|
5392 if (option->state & State_Item) { |
|
5393 if (option->direction == Qt::RightToLeft) |
|
5394 painter->fillRect(option->rect.left(), mid_v, bef_h - option->rect.left(), 1, brush); |
|
5395 else |
|
5396 painter->fillRect(aft_h, mid_v, option->rect.right() - aft_h + 1, 1, brush); |
|
5397 } |
|
5398 if (option->state & State_Sibling) |
|
5399 painter->fillRect(mid_h, aft_v, 1, option->rect.bottom() - aft_v + 1, brush); |
|
5400 if (option->state & (State_Open | State_Children | State_Item | State_Sibling)) |
|
5401 painter->fillRect(mid_h, option->rect.y(), 1, bef_v - option->rect.y(), brush); |
|
5402 break; } |
5359 case PE_Frame: |
5403 case PE_Frame: |
5360 qDrawPlainRect(painter, option->rect, option->palette.shadow().color(), |
5404 qDrawPlainRect(painter, option->rect, option->palette.shadow().color(), |
5361 d->doubleControls ? 2 : 1, &option->palette.background()); |
5405 d->doubleControls ? 2 : 1, &option->palette.background()); |
5362 break; |
5406 break; |
5363 case PE_FrameLineEdit: |
5407 case PE_FrameLineEdit: |