title: QGraphicsItem Border Styles
body: <p>How can I draw a rectangle shape and oval shape like this image.In this code which creates rectangle shape and oval shape with a single line border.But I need to change there border style like this given image.</p>
  
  <pre><code>Widget::Widget(QWidget *parent) :
      QWidget(parent),
      ui(new Ui::Widget)
  {
      ui-&gt;setupUi(this);
      scene = new QGraphicsScene(this);
      ui-&gt;graphicsView-&gt;setScene(scene);
  
      QBrush redBrush(Qt::red);
      QBrush blueBrush(Qt::blue);
      QPen blackPen(Qt::black);
      blackPen.setWidth(6);
  
      //rect = scene-&gt;addRect(25,25,Qt::RelativeSize);
      elipse = scene-&gt;addEllipse(20,20,100,100,blackPen,redBrush);
      elipse-&gt;setFlag(QGraphicsItem::ItemIsMovable, true);
      rect = scene-&gt;addRect(-20,-10,200,100,blackPen,blueBrush);
      rect-&gt;setFlag(QGraphicsItem::ItemIsMovable, true);
      rect-&gt;setFlag(QGraphicsItem::ItemIsSelectable,true);
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/ho3xX.png" alt="Expected Result image"></p>