[solved] QGraphicsView to fill main window with QT Designer
-
Hi:
I'm new here, so forgive me if this is answered already...
I am trying to create a main window filled with a QGraphicsView that expands and contracts with the window.
I can do this programmatically in the main window constructor as follows:
@theGraphicsView = new QGraphicsView(this);
setCentralWidget(theGraphicsView);@I can't seem to replicate this using QT Designer?
When I drag a QGraphicsView into the main window, it adds it to the CentralWidget... but it doesn't change size with the window. I have tried various settings of maximum sizes and sizePolicy. I'm probably missing something really obvious, but I am stumped.
Thanks for any suggestions.
Glenn
-
You should add it into layout. In QtDesigner you can put QGraphicsView into central widget , than right click on it and layout it horizontally or vertically.
-
Try next steps:
Put GraphicsView into centralWidget
Right click on empty space in centralWidget
Layout
Vertically