[Qt-interest] Layout issue
Carlos Smith
CSmith at stonewedge.net
Fri Nov 19 17:16:28 CET 2010
Hi,
Calling
adjustSize(); // QWidget::adjustSize(); "Adjusts the size of the widget to fit its contents."
at the very end of adjustWidgets()
seems to fix the problem, at least on Windows. Why this isn't automatic on a top level widget is strange. This is actually something I needed to figure out for my own app, so thanks for asking!
Carlos
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Sajjad
Sent: Thursday, November 18, 2010 3:22 PM
To: qt-interest at trolltech.com
Subject: [Qt-interest] Layout issue
Hello forum,
I have a label and line edit which is horizontal layout and this layout is in turn inside the grid layout.
I have declared a private slot that responds to text changed signal of the line edit.
The slots adds check boxes dynamically to the grid layout. Grid layout is the main layout of the class that i have sub-classed form QWidget.
When i press 4, two four check boxes added dynamically to the layout. Then again when i press 1 , previously added 4 check boxes are removed and the new one
check box is added to the layout. But there is the extra space which was allocated while adding 4 check boxes. Those spaces remains ?
Any hint to maintain the size of the widget dynamically while adding and removing check boxes from the layout?
Regards
Sajjad
________________________________
This electronic message is intended only for the use of the individual or entity named above and may contain information which is privileged and/or confidential. If you are not the intended recipient, be aware that any disclosure, copying, distribution, dissemination or use of the contents of this message is prohibited. If you have received this message in error, please notify the sender immediately.
________________________________
This electronic message is intended only for the use of the individual or entity named above and may contain information which is privileged and/or confidential. If you are not the intended recipient, be aware that any disclosure, copying, distribution, dissemination or use of the contents of this message is prohibited. If you have received this message in error, please notify the sender immediately.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20101119/27e5b5c2/attachment.html
More information about the Qt-interest-old
mailing list