1 Attachment(s)
Problem with resizing dialog
Hi all,
I have written a small app and tried to align the controles in the layout properly. When app comes up it looks good. But when I resize the window using mouse making it smaller layout is messed up. Can some body please explain am I wrong here. I have attached the sample.
Thanks in advance,
Seema Rao
Attachment 349
Re: Problem with resizing dialog
Quote:
Originally Posted by Seema Rao
when I resize the window using mouse making it smaller layout is messed up.
But what exactly is wrong? Maybe it's just a matter of setting a minimum size for the central label?
Note that layouts will ignore everything you have set with setGeometry().
Re: Problem with resizing dialog
Its not only matter with centered QLabel, even buttons that I have subclassed fail to adapt to Layout when resizing!!
Can some body please help!!
Re: Problem with resizing dialog
Quote:
Originally Posted by Seema Rao
Its not only matter with centered QLabel, even buttons that I have subclassed fail to adapt to Layout when resizing!!
Could you post an image that shows the correct behavior or at least describe it?
2 Attachment(s)
Re: Problem with resizing dialog
Attachment 351
Attachment 352
here is the screen shots of image I got when window is created, but when I resized it, it looks like second one. why this happens even I have bound the controls to the layout?
Re: Problem with resizing dialog
Can you post the code to this dialog and the custom buttons? I think you have a bad sizeHint() somewhere. What's your baseclass for thses buttons? You may need to override sizeHint()const and minimumSizeHint()const in your button class.
--Justin Noel
justin@ics.com
Re: Problem with resizing dialog
I have posted the whole sample's source files in the first thread!!
Re: Problem with resizing dialog
Quote:
Originally Posted by Seema Rao
when I resized it, it looks like second one.
What is wrong with that? I'm not sure what do you want to achieve.
Re: Problem with resizing dialog
I read your code.
The tool buttons are disappearing because thier sizeHint() and minuminSizeHint() are returning QSize(0,0) whcih is the default inherited from QWidget. QAbstractButton implements no sizeHint().
I suggest implementing minimumSizeHint() in TooButton to return the size of your pixmap. Then habd sizeHint() return that valut too so...
ToolButton::minimumSizeHint() const
{
return m_myPixmap.size(); //Or wheverever you are getting the pixmap from.
}
ToolButton::sizeHint() const
{
return minimumSizeHint();
}
--Justin Noel
justin@ics.com