QRect is a little weird.
The size is actually with 1 pxiel smaller in each direction( 639x479).
So you have to adjust it a bit.
Also, I used setFixedxSize since if you resize it, the scroll bars appear again.
int main(int argc, char* argv[])
{
view->setFixedSize(640, 480);
r.adjust(1,1,-1,-1);
//scene->addItem(new QGraphicsSvgItem("ball.svg"));
view->setScene(scene);
view->show();
return app.exec();
}
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
QGraphicsView *view = new QGraphicsView;
view->setFixedSize(640, 480);
QRect r = view->rect();
r.adjust(1,1,-1,-1);
QGraphicsScene *scene = new QGraphicsScene(r);
//scene->addItem(new QGraphicsSvgItem("ball.svg"));
view->setScene(scene);
view->show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Regards
Bookmarks