PDA

View Full Version : How does resizing work in QWidgets in general and QGraphicsView in particular?



Ellyl
4th April 2016, 08:54
I've looked through the QT documentation and there doesn't seem to be a set size () function for QWidgets as I imagine there would be. Where the auto layout looks decent, it's annoying being unable to specify the exact size of existing QWidgets. Say I created a pixmap and want to toggle between viewing its actual size in pixels and a zoomed view in a QGraphicsView. What is the best way to resize a QGraphicsView (filling the layout and being a fixed size according to the pixmap dimensions)?

anda_skoa
4th April 2016, 10:04
There are QWidget::resize() and QWidget::setGeometry(), but having sizes layout controlled is almost always better.

Cheers,
_