Re: writing a layout manager
Qt's layouts should work with your custom widgets just fine... if you coded them properly.
All you generally need to do is reimplement:
QSize minimumSizeHint() const;
QSize sizeHint() const;
Also, in your constructor it would be best to call setSizePolicy. You may also need to call setMaximumSize() if your widget needs it.
I make lots of custom widgets, make them into designer plugins, and then look and work great with all of Qt's layouts.
Re: writing a layout manager
Quote:
All you generally need to do is reimplement:
QSize minimumSizeHint() const;
QSize sizeHint() const;
Also, in your constructor it would be best to call setSizePolicy. You may also need to call setMaximumSize() if your widget needs it.
I'm not saying they don't do anything, but my widgets have unique alignment needs that aren't addressed by layouts. I've reimplemented everything I can, but that doesn't fit my needs. So, I'm forced to customize the wheel for my own needs.
I see that Qt4 has a couple of more examples of custom layouts, but I only have Qt 3.3.4 and it appears some of the functions are missing. I've changed as much as I could, but stuff's missing and it won't compile.
http://support.informatik.uni-freibu...qt/layout.html
Does anyone know how to make this code work in Qt 3?
Thank you!
Jay