Hi,
Is there anyway to get the height of the frame of the window(frame where there is the close button,...)?
Thanks,
Hi,
Is there anyway to get the height of the frame of the window(frame where there is the close button,...)?
Thanks,
Òscar Llarch i Galán
Yes, you can:
but may I ask what do you intend to do with it?Qt Code:
To copy to clipboard, switch view to plain text mode
J-P Nurmi
Hi,
My application has toolbars, menus and docks, and I want that the central widget use all the avaiable space. So I take the application height less toolbars,menus,docks and upper frame.
Thanks,
Òscar Llarch i Galán
Hmm.. You shouldnt have to do that. Qt will handle the sizing for you. How are you setting up your UI?
Hi,
Could you tell me how? I reimplemented the method "resizeEvent" to resize the centralWidget to the maximum width and height. Note that if Docks are resized, the centralWidget will be resized too.Hmm.. You shouldnt have to do that. Qt will handle the sizing for you. How are you setting up your UI?
My UI is a centralWidget (the main window was done with Designer) and it has a QGridLayout that manages some windows (like OpenGL windows). So, depending on the size of the main Window and the size of the Docks, toolBars, ..., the size of the internal widget have to be resized.
Thanks,
Òscar Llarch i Galán
Hmm? But QMainWindow does that automatically (of course, provided that all the central widget, docks etc. are properly added via suitable methods in QMainWindow API). Size policies, stretch factors and such are there if you need to adjust resizing.
J-P Nurmi
Hi,
So, I have to adjust the Size policies to get it automatically be done. I am right? I will read abou it. I supose that my problem is that I always try to do it myself without thinking that maybe it is done yet(maybe I have to read a little more, but sometimes I really don't know where to find the information, Qt is great but it has a lot of classes and sometimes I don't know where to find what I want).Size policies, stretch factors and such are there if you need to adjust resizing.
Thanks,
Òscar Llarch i Galán
Hi,
Well, the only that I need is that the centralWidget of the mainWindow occupies all tha avaiable space.
I had inserted a QSrollArea instead of the centralWidget because time ago I did'n need this behavior and the scrollBars were a good solution. Now I don't want to use scrollArea, and I want to use the maximum centralWidget size avaiable.
Thanks,
Òscar Llarch i Galán
Did you apply a top level layout? Unselect child widgets, open up context menu over the background of the form and select a layout. See this thread for a screenshot: http://www.qtcentre.org/forum/f-qt-d...lved-9897.html
J-P Nurmi
Hi,
Sorry, I didn't said that I have a QGridLayout (all the code is handwritten). And I don't do it with Designer because the number of columns and rows of windows(like OpenGL widgets) can be modified.Did you apply a top level layout?
Thanks for replies, but it works using
as you told me.Qt Code:
To copy to clipboard, switch view to plain text mode
Next time I will try to try using size policies.
Thanks,
Òscar Llarch i Galán
Bookmarks