Hi,
I have a widget which always needs to be square in shape. Therefore when user resizes the widget how can i make it square while he is resizing it (not after he is finished resizing)?
Thanks
Hi,
I have a widget which always needs to be square in shape. Therefore when user resizes the widget how can i make it square while he is resizing it (not after he is finished resizing)?
Thanks
Did you try heightForWidth?
Can you please give me a simple example?
Thanks
And http://doc.trolltech.com/qq/qq04-height-for-width.htmlint QWidget::heightForWidth ( int w ) const [virtual]
Returns the preferred height for this widget, given the width w.
If this widget has a layout, the default implementation returns the layout's preferred height. if there is no layout, the default implementation returns -1 indicating that the preferred height does not depend on the width.
Hi,
Thanks for reply. I have already read it, but how would i use this and reimplement the resizeEvent and achieve my goal.
I have already tries this. Bu the problem is only after the user finishes resizing the widget resizes itself again and only then it is a square. What is want is that when user drags the edge of the widget, the widget should resize itself in such a way that it is always square.
For example when the width is incresed the height should also increase along with the width and thr vice-versa.
Thanks
I don't think you can do that... It is the window manager who is responsible for this. The resize event is generated when the resize finishes.Originally Posted by munna
But an application which is written using pascal is doing it and i want to reproduce the same effect in my application also.
If it was windows manager that was responsible for it then how is it possible using pascal?
Thanks
It is probably window-manager dependent Or it causes a resize event to be generated with every mouse move while changing size (it's probably the same as opaque window sizing).Originally Posted by munna
You could handle the mouse down, move and up events yourself. I did this when I needed the illusion of a main window but did not want the standard windows capation bar. So essentially, the window was a frameless window. When a mouse down occurred in a predefined region of window, it moved the window around until a mouse up occured. Worked very well. I am certain the same could be done for resizeing the window.Originally Posted by munna
I want to resize a frameless window with adding 8 squers in the 8 sides of window. please help me!
Bookmarks