How can I set QGraphicsScene's size ?
-
Hi,
Might be a silly question but why a QGraphicsScene/View combo to only have a video played in it ? Why not just use a QVideoPlayer directly ?
-
@onurcevik
Take a look at the docs for the setSceneRect() function for the scene and the graphics view object. You will understand their relation ship to the size of the scene.
scene here
viewport here
The part of the scene you see is viewed inside the viewport of the QGraphicsView. The actual extents of the data in the scene can be larger or smaller than what you actually see through the viewport. -
Hi,
Might be a silly question but why a QGraphicsScene/View combo to only have a video played in it ? Why not just use a QVideoPlayer directly ?
-
@onurcevik
Take a look at the docs for the setSceneRect() function for the scene and the graphics view object. You will understand their relation ship to the size of the scene.
scene here
viewport here
The part of the scene you see is viewed inside the viewport of the QGraphicsView. The actual extents of the data in the scene can be larger or smaller than what you actually see through the viewport. -
@kenchan Hey I tried to set QGraphicsScene size equal to QGraphicsView's size with this code :
scene->setSceneRect(ui->graphicsView->sceneRect());But it didn't change anything. What am I doing wrong ?
@onurcevik didn't change anything how. Since the original post was deleted I can't refer to you original post!