Hello everyone,
is there a cross-platform way of restraining the width/height ratio of a top-level widget to a fixed value in Qt 4.2 ?
thanks
André
Hello everyone,
is there a cross-platform way of restraining the width/height ratio of a top-level widget to a fixed value in Qt 4.2 ?
thanks
André
Maybe you can use a QBoxLayout with a single toplevel widget in it, and play with the horizontalStretch / verticalStretch parameters of the layout.
Sorry for the double post !
Maybe you can use a QGridLayout with a single toplevel widget in it, and play with the stretch factors for column / row !
http://doc.trolltech.com/4.2/qgridla...tColumnStretch
thanks, but unfortunately that's not what I want. If I'm not mistaken, your suggestions would only affect the inner layout of widgets. What I want is to constrain top-level widgets, ie actually the windows themselves. Qt should tell the windowing system that the widget's window has a special resizing policy.
What I tried until now was setting the resize policy for my widget to hasHeightForWidth() and reimplementing heightForWidth() (works only for child widgets) and issuing resizes by either calling QCoreApplication:ostEvent or resize() in my resizeEvent-handler (infinite calling of resizeEvent(), as stated in the manual).
Bookmarks