void paintEvent(QPaintEvent *event) { QPainter painter(this); QPen blackpen( Qt::black ); blackpen.setWidth(1); QPen greenpen( Qt::green ); blackpen.setWidth(1); QBrush br( Qt::white ); painter.setPen(blackpen); painter.setBrush(br); painter.drawRect(QRect(50, 50, 200, 200)); painter.setPen(greenpen); QRect rct(50, 100, 200, 100); painter.drawRect(rct); painter.setPen(blackpen); painter.drawLine(50, 50, 250, 250); painter.drawLine(50, 250, 250, 50); painter.drawLine(50, 150, 250, 150); painter.setPen(greenpen); painter.drawLine(150, 150, 250, 100); painter.drawLine(150, 150, 50, 100); painter.drawArc(rct, 45 * 16, 90 * 16); }