JonMorehouse
JonMorehouse

Reputation: 1383

QtGraphicsView size in QTGraphicsScene

I'm having trouble getting my QtGraphicsView to take up 100% of the window I'm working in. Is there a way to set the view size to take up 100% of the graphics window that is created?

QApplication app(argc, argv);

QGraphicsScene * scene = new QGraphicsScene();

int counter = 1000;


scene->setSceneRect(0, 0, counter, counter);//scene size

QGraphicsEllipseItem * item = new QGraphicsEllipseItem(0, scene);

item->setRect(0,0, 1000.0, 1000.0);

QGraphicsView view(scene);

view.setRect(100, 100);
view.setRenderHints(QPainter::Antialiasing);
view.show();

Upvotes: 0

Views: 85

Answers (1)

AquilaRapax
AquilaRapax

Reputation: 1099

QGraphicsView should have a method(slot) called showFullScreen since it inherits QWidget , which should do what you want.

Upvotes: 1

Related Questions