[Qt-interest] Resize QMdiSubWindow to fit its contents

Renaud guezennec renaud.guezennec at gmail.com
Sat Jun 26 23:30:27 CEST 2010


Hi all,

I'm trying to display pictures into QMdiSubWindows. I'd like to resize
windows to show the picture without scrollbars.
So, I tried many ways without success.

//in the QMdiSubWindows subclass.
setGeometry(m_labelImage->rect());
or
resize(m_labelImage->size());
or
widget()->resize(m_labelImage->size());


all ways I've tried modify the frame Geometry instead of client area
geometry. The size is a little bit too small. Scrollbars are displayed.
My aim is to show the picture with a frame which fit picture dimensions.
(I calculate an appropriate zoomlevel)

The frameGeometry and geometry functions return the same value. I read
in the documentation it's the usual behavior. Only decorated top-level
widgets have frameGeometry and geometry. I thought MdiSubWindows were
decorated top-level widgets but apparently they aren't. 

So, I need to know how to modify the client area geometry. 
http://doc.trolltech.com/4.6/application-windows.html#window-geometry

My design: QMdiSubWindows > QWidget > layout > QScrollBarArea > label
>Pixmap

Qt.4.6.0 
GNU/Linux : ubuntu 9.10 64bits


Thank you!
Regards


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100626/8d8ae8af/attachment.html 


More information about the Qt-interest-old mailing list