@nagesh Haha :boom: I knew it was something along these lines:
"select combo box and expand horizontally in right direction it should occupy the
empty space right to it"
Shame on me and awesome! Thank you very much! lol
I never asked that question, right? :D
If you look for ideal elements fit, like in form in QTCreator, You don't have to use Layout.
Just put widgets on place, make it ALL proportional etc.
include class I put below, I put example too at the end
It works like a charm, if you will have to use QLayouts, make them MaxMin constraint, but results may be strange. When you use it, better forget about layouts ;)
As the solution suggested by @hskoglund is Windows-specific, I decided to first investigate a bit deeper the other options presented by @J-Hilk
It turned out that the Qt::WindowStaysOnTopHint flag was not set for our main window. I am now setting that flag in our main windows's constructor, and afterwards show it full screen. This seems to work.
I see you used a QVBoxLayout, but if I understand things correctly, it could've as well been a QHBoxLayout or QGridLayout because there's only one widget added?
Yes of course, you can use whatever layout suits your needs. Also there is no restriction that you have to put one single widget in it, it can as easily accomodate many child widgets. QMainWindow is bit different in that respect, as it doesn't have a layout itself, but instead relies on a central widget (the client area) to do the laying out. I hope that clears things. :)
Hi, this is old now but in case someone else finds this:
I managed to solve this problem by using
for a layout holding the QLineEdit widget. Actually it wasn't the layout holding the widget, but the layout holding that layout, so you may need to experiment to find out where you need to make this update (or just use SetNoConstraint for all your layouts)
I hope this helps someone!