Hi
I am trying to create a GraphicsView where I can draw using the entire window. To do this I create a GraphicsScene with the view's rect as constructor. The result is that I get scrollbars (although it shouldnt be needed as the scene should be the same size as the view) that are pre-scrolled (why does it scroll by itself?) a few pixels in both directions. What am I doing wrong here?
Qt Code:
#include <QApplication>#include <QGraphicsView>#include <QGraphicsScene>#include <QGraphicsSvgItem>int main(int argc, char* argv[]){QApplication app(argc, argv);QGraphicsView *view = new QGraphicsView;view->resize(640, 480);QGraphicsScene *scene = new QGraphicsScene(view->rect());scene->addItem(new QGraphicsSvgItem("ball.svg"));view->setScene(scene);view->show();return app.exec();}
To copy to clipboard, switch view to plain text mode