[Qt-interest] Full Screen stretch widgets
Andre Somers
andre at familiesomers.nl
Fri Aug 21 10:29:14 CEST 2009
Andreas Neuhauser wrote:
> Hi,
>
> I added a layout but it is not working. I have QLabels and QPushButtons in the tab widget that should be resized. Furthermore the QLabels should not be in a layout because I have to set the geometry during runtime as they should be movable.
> At the moment only the main window gets full screen and not the parts inside.
> Does anybody know how to do it? Perhaps with a code example ;-).
>
You may want to investigate using a QGraphicsView as your base widget.
It allows you to easily move and scale your view as well as the
individual items on it, and you are able to put widgets on it as well.
Having said that, a custom layout manager is also an option. I guess it
depends on what kind of behaviour you want to achieve and how scalable
it should be. Just moving around a couple of buttons is hardly worth the
trouble if you need to support two layouts (use a QStackedWidget
instead, and just create those two layouts seperately), but if you need
to be way more flexible, it may be worth creating a custom layout or
using QGraphicsView or something like that.
André
More information about the Qt-interest-old
mailing list