Qt Designer This File contains top level spacers
-
Hello, I was trying to make my UI scalable by adding layouts, and some spacers as showing in the 2nd screenshot.
However, I keep getting this error when I try to save. As far as I can see, everything I have is on a layout. Can anyone help me? I am lost and I cant save my progress.
-
Here's all the spacers I have, showing that they are indeed within a layout
-
@DouglinhasZN said in Qt Designer This File contains top level spacers:
As far as I can see, everything I have is on a layout.
You do have multiple layouts, but they are all "floating".
You must apply one top-level layout to your whole widget. See https://doc.qt.io/qt-5/designer-layouts.html#setting-a-top-level-layout
After that, you can nest however many sub-layouts you want inside the top-level layout.
-
@JKSH Hey, thanks for the reply. I have used that link and did what it suggested but still didnt work. I then closed and reopened the designer and now it saves just fine with the spacers.
Now, with my other post ("https://forum.qt.io/topic/112654/designer-layout-not-scaling-properly/2") I dont see how its a duplicate, as the issue is a separate one. I am still getting that issue even after all the scaling/layout has been put in place. -
@DouglinhasZN said in Qt Designer This File contains top level spacers:
now it saves just fine with the spacers
so is this issue solved? please don't forget to mark your post as such then.
-
@DouglinhasZN said in Qt Designer This File contains top level spacers:
I then closed and reopened the designer and now it saves just fine with the spacers.
If I'm not mistaken, the top-level spacers were discarded when you closed without saving.
Now, with my other post ("https://forum.qt.io/topic/112654/designer-layout-not-scaling-properly/2") I dont see how its a duplicate, as the issue is a separate one. I am still getting that issue even after all the scaling/layout has been put in place.
I still think this issue and you other post have the same underlying root cause in the layouts. I've unlocked your other post; please have a look and post your XML code there.
-
Hi
Apply layouts using right-click on the widgets then layout menu.
The red layouts are for inserting into "right click layouts" and wont work
if used alone. That fooled me alot in the beginning as you insert
all other elements using the Widget menu/list :=)