// 填充方式
QPainterPath GraphicsRectItem::shape() const
{
if (brush().style() != Qt::NoBrush)
{
return QGraphicsRectItem::shape();
}
QPainterPathStroker stroker;
QPainterPath lpath;
stroker.setWidth(4.0);
lpath.addRect(boundingRect());
return stroker.createStroke(lpath);
}
就这样了,结贴。。