PDA

View Full Version : keeping aspect ratio while resizing



franco.amato
17th November 2009, 23:39
Hi to all,
I have a QMainWindow with a custom central widget. I set a background image for that
central widget.
I would keep the aspect ratio while resizing to preserve the aspect ratio of the background image.
How can I do?

Best Regards,
Franco

franco.amato
19th November 2009, 19:49
Hi to all,
I have a QMainWindow with a custom central widget. I set a background image for that
central widget.
I would keep the aspect ratio while resizing to preserve the aspect ratio of the background image.
How can I do?

Best Regards,
Franco

Is there anyone? I got too many replies

rknowles
19th November 2009, 20:12
Will an implementation of QWidget::heightForWidth(int) (http://doc.trolltech.com/latest/qwidget.html#heightForWidth) help you? If not, then maybe a custom layout manager.