[Qt-interest] QLayout: Overlay?
Andre Somers
andre at familiesomers.nl
Fri Dec 3 12:20:27 CET 2010
Hi,
Op Vr, 3 december, 2010 11:59 am, schreef micu:
> Am Freitag, 3. Dezember 2010, 07:49:04 schrieb Andre Somers:
>> You may have to resort to manual positioning of widgets.
>
> In fact, I started with manual positioning (I already feared layouts
> won't help me here). But I found it *really* cumbersome, and it soon
> gets quite messy with even a little more complex custom widgets. So, in
> a diskussion with a friend, we figured out that layouts would be the
> right way to go for me.
Perhaps some middle ground can be found. You might combine manual
positioning with layout based positioning. Like, if you have the names
layed out as is, you could align the radio buttons vertically to the
appropriate name label manually. I never claimed it wasn't messy :-(
>> That means that you'll have to rethink the construction of your
>> form a bit. Keep the names in a layout with their connector, and
>> build up from there.
>
> Well, that was actually the second thing I tried ;) --- I thought about
> creating one single QGridLayout. But then I ended up with the problem of
> having no idea on how to overlay (or better: "underlay") the connector
> name QLabels with the QFrame :/. Sure, I could do this manually, but
> this isn't anything but ugly, I guess. And then, the connector name
> QLabels aren't aligned with the inside of the QFrame.
I guess in terms of messyness, it would be comparable with working the
other way around as described above.
One last solution you may contemplate is to create your own custom layout.
In the end, the messyness has to go somewhere...
> A quite similar problem is described here:
> http://lists.trolltech.com/pipermail/qt-interest/2010-
> November/029520.html
>> The layoutsystem that you can use in QGraphicsView
>> (QGraphicsAnchorLayout) and QML seem to be better suited for this
>> kind of use case.
>
> Thanks for the tips! I think, I have to investigate those two options.
Hope you figure it out!
André
More information about the Qt-interest-old
mailing list