This is a discussion on Re: Freeform widget layouting - KDE ; On Thursday 04 August 2005 03:38, Leo Spalteholz wrote: > Hello, > = > I've been thinking about how to layout widgets in a sort of freeform > way with QT and haven't figured out a good way to do ...
On Thursday 04 August 2005 03:38, Leo Spalteholz wrote:
> I've been thinking about how to layout widgets in a sort of freeform
> way with QT and haven't figured out a good way to do it (I'm new at
> this whole thing).
> There are several QLayouts available but none of them seem to do what
> I need them to. That is, several rectangular (maybe polygonal in the
> future) widgets that may be overlapping, and the widget that is
> currently under the mouse pointer and on top in the z order receives
> mouse events.
> The attached image is basically what I want. every rounded rectangle
> is a widget, and each widget may be completely or partially inside
> another widget. =
Well that's what child widgets are for. In your diagram I see
a parent widget, widget 1, with 5 children. You could use a QVBoxLayout
and two QHBoxLayouts inside it to lay out those children.
> Is there a way to easily put widgets in a window at =
> arbitrary locations =
Yes, widget->move() and widget->resize(). But be careful if the contents
of the widgets can change (e.g. due to fonts or internationalization), don't
hardcode positions and sizes.
> or do I need to code my own QLayout derived class? =
I would recommend not doing that.
David Faure, email@example.com, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscrib=