[Kde-games-devel] Constraining window size by widget size
Kleag
kleag at free.fr
Thu Mar 29 00:09:13 CEST 2007
Le mercredi 28 mars 2007, Albert Astals Cid a écrit :
> A Diumenge 25 Març 2007, Kleag va escriure:
> > Hello,
> >
> > In KsirK, I want to constraint the maximum size of the window by the size
> > of its contained QGraphicsView (knowing that there is also status and
> > tool bars and the chat/info widget that need some place). So, if the user
> > tries to resize the window in either direction thus obtaining too much
> > space around the main widget, it would be blocked.
> >
> > But I cannot find how to handle this kind of thing with th Qt API.
> >
> > Any idea ?
>
> What about setting a fixed size (setFixedSize) to the main widget?
No, that does not work as I don't want a minimum size equal to the size of the
map. Furthermore, I tried, and it effectively fixed the minimum size but not
the maximum size of the "main widget area". As currently, when growing larger
than the main widget (the QGraphicsView), it just adds gray zones around the
widget.
Kleag
--
KsirK - a turn-based strategy game for KDE
http://gna.org/projects/ksirk
KGraphViewer - a GraphViz dot graphs viewer
http://extragear.kde.org/apps/kgraphviewer
More information about the kde-games-devel
mailing list