Hi everyone,
I’m a little bit confused on how I set up View and Scene sizes in comparison to eachother.
What I’m trying to achieve is a QGraphicsView main widget with a QGraphicsScene that spawns a QWebView that overlays the graphics view with 3/4 of its width, and all of its height. However, when I resize the QGraphicsView using showMaximized(), it doesn’t look like it’s actually updating the size, even though it appears maximized. Here’s what I’m doing:
graphicsView->showMaximized(); //maximize the graphics scene so the window is maximized
graphicsScene->setSceneRect(QRect(QPoint(0, 0), QPoint(graphicsView->width(), graphicsView->height()))); //make the scene fill up the graphics view
graphicsView->setScene(graphicsScene);
At this point, the graphicsView object says that it is 256×192 using width() and height().
However, it’s obviously maximized and definitely bigger than that. If these numbers were accurate, then I’d like to create my QWebView, and set it to be 3/4 the width of the graphics view, and 100% of the height, centered.
Any idea on where I’m going wrong? This is my first time at Qt so it’s probably something stupid :)
↧