Qt 6.12 LTS is out! See what's new in the release
blog
Coordinates for QGraphicsView
-
Hi,
When are you requesting these values ?
-
Until the widgets are shown they have no "physical" dimensions.
Also note that the size of the scene and the view do not necessarily match unless you made it so.
-
This is what I did when I created the scene.
//create the scene
scene_ = new QGraphicsScene(sceneStartCornerX_,
sceneStartCornerY_,
sceneEndCornerX,
sceneEndCornerY,
ui->testGridGraphicsView);ui->testGridGraphicsView->setScene(scene_); //attach the scene to the view (QGraphicsView)
//smooth graphics ui->testGridGraphicsView->setRenderHints(QPainter::SmoothPixmapTransform | QPainter::Antialiasing | QPainter::TextAntialiasing); -
Why not just build a "size less" scene ?
-
How are you placing the items on your scene ?
-
Please provide a minimal compilable example that reproduces that issue.