[Qt-interest] Please help me understand resizing...

Bartosh Wroblevksy bartosh at live.com
Sat Jul 25 05:31:36 CEST 2009


Please don't laugh! All I can say is that your requirements are respected ( I think ).


> Date: Fri, 24 Jul 2009 11:30:19 +0200
> From: strayer at olle-orks.org
> To: qt-interest at trolltech.com
> Subject: Re: [Qt-interest] Please help me understand resizing...
> 
> Hi,
> 
> thanks for the link! When I change the testcase from QMainWindow to 
> QDialog and set the sizeConstraint of the Layout to SetFixedSize, it 
> works as expected.
> 
> This has two major problems though:
> 1. It only works with QDialog and NOT with QMainWindow (I guess it has 
> something to do with the centralWidget)
> 2. SetFixedSize enforces a specific size, so the user can't resize the 
> window, which is not what I want.
> 
> Regards,
> Sven Grunewaldt
> 
> Am 24.07.2009 00:21, schrieb Diego Schulz:
> > On Thu, Jul 23, 2009 at 3:31 PM, Sven Grunewaldt<strayer at olle-orks.org>  wrote:
> >    
> >> Hi,
> >>
> >> I don't really know how to explain my problem, so I will describe what I
> >> want to do and attach a testcase which shows what I'm doing (and hopefully
> >> tells you what I'm doing wrong...)
> >>
> >> I have a QMainWindow with a QPushButton and a QPlainTextEdit inside a
> >> QVBoxLayout. When I click on the button, the QPlainTextEdit is hidden and I
> >> call resize(sizeHint()); to remove the unneeded space in the Layout. Sadly,
> >> this doesn't work. It seems like resize(...) is doing nothing at all.
> >> After clicking the button, it looks like this:
> >> http://www.abload.de/img/resize18brt.jpg
> >>
> >> But it should look like this:
> >> http://www.abload.de/img/resize2dbi0.jpg
> >>
> >> Maybe someone could look into the attached code and give me a hint what I
> >> should do.
> >>      
> > There's a nice example in the docs that [I hope] you might find useful.
> > http://doc.trolltech.com/4.5/dialogs-extension.html
> >
> > regards,
> >
> > diego
> >
> >    
> >> Regards,
> >> Sven Grunewaldt
> >>      
> > _______________________________________________
> > Qt-interest mailing list
> > Qt-interest at trolltech.com
> > http://lists.trolltech.com/mailman/listinfo/qt-interest
> >    
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest

_________________________________________________________________
More storage. Better anti-spam and antivirus protection. Hotmail makes it simple.
http://go.microsoft.com/?linkid=9671357
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090724/2a21dc69/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kindofahack.7z
Type: application/octet-stream
Size: 805 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090724/2a21dc69/attachment.obj 


More information about the Qt-interest-old mailing list