I am trying to design a custom widget with a QGraphicsScene and a pixmap item in it. I can see my item but there is a rectangle outside the scene. I found out that this is the scene rectangle. How can I prevent Qt from drawing scene rectangle?
QGraphicsView* view = new QGraphicsView(this);
QGraphicsScene* scene = new QGraphicsScene(view);
QGraphicsPixmapItem* pix1 = new QGraphicsPixmapItem(QPixmap(":/images/img/img1.png"));
scene->addItem(pix1);
view->setScene(scene);
scene->setSceneRect(0, 0, 250, 150);