- roundRectPath.moveTo(br.x() + br .width() - offset, br.y() + roundingY);
- roundRectPath.arcTo(br.x() + br .width() - roundingX - offset, br.y(), roundingX, roundingY, 0.0, 90.0);
- roundRectPath.lineTo(br.x() + roundingX, br.y());
- roundRectPath.arcTo(br.x() + offset, br.y(), roundingX, roundingY, 90.0, 90.0);
- roundRectPath.lineTo(br.x() + offset, br.y() + br.height() - roundingY);
- roundRectPath.arcTo(br.x() + offset, br.y() + br.height() - roundingY - offset, roundingX, roundingY, 180.0, 90.0);
- roundRectPath.lineTo(br.x() + br .width() - roundingX, br.y() + br.height() - offset);
- roundRectPath.arcTo(br.x() + br .width() - roundingX - offset, br.y() + br.height() - roundingY - offset, roundingX, roundingY, 270.0, 90.0);
- roundRectPath.closeSubpath();
- painter->setClipPath(roundRectPath, Qt::IntersectClip);
+ roundRectPathUpper.moveTo(br.x() + br .width() - offset, br.y() + br.height()/2 - offset);
+ roundRectPathUpper.arcTo(br.x() + br .width() - roundingX - offset, br.y(), roundingX, roundingY, 0.0, 90.0);
+ roundRectPathUpper.lineTo(br.x() + roundingX, br.y());
+ roundRectPathUpper.arcTo(br.x() + offset, br.y(), roundingX, roundingY, 90.0, 90.0);
+ roundRectPathUpper.lineTo(br.x() + offset, br.y() + br.height()/2 - offset);
+ roundRectPathUpper.closeSubpath();
+
+ roundRectPathLower.moveTo(br.x() + offset, br.y() + br.height()/2 - offset);
+ roundRectPathLower.arcTo(br.x() + offset, br.y() + br.height() - roundingY - offset, roundingX, roundingY, 180.0, 90.0);
+ roundRectPathLower.lineTo(br.x() + br .width() - roundingX, br.y() + br.height() - offset);
+ roundRectPathLower.arcTo(br.x() + br .width() - roundingX - offset, br.y() + br.height() - roundingY - offset, roundingX, roundingY, 270.0, 90.0);
+ roundRectPathLower.lineTo(br.x() + br .width() - offset, br.y()+ br.height()/2 - offset);
+ roundRectPathLower.closeSubpath();
+
+ painter->setClipPath(roundRectPathUpper.united(roundRectPathLower), Qt::IntersectClip);