Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt Designer This File contains top level spacers
Forum Updated to NodeBB v4.3 + New Features

Qt Designer This File contains top level spacers

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 15.9k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DouglinhasZN
    wrote on last edited by DouglinhasZN
    #1

    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.
    qtdesigner saving issue.png qt designer saving issue.PNG

    JKSHJ 1 Reply Last reply
    0
    • D Offline
      D Offline
      DouglinhasZN
      wrote on last edited by
      #2

      Here's all the spacers I have, showing that they are indeed within a layoutqt designer spacer.PNG

      1 Reply Last reply
      0
      • D DouglinhasZN

        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.
        qtdesigner saving issue.png qt designer saving issue.PNG

        JKSHJ Offline
        JKSHJ Offline
        JKSH
        Moderators
        wrote on last edited by
        #3

        @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.

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

        D 1 Reply Last reply
        3
        • JKSHJ JKSH

          @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.

          D Offline
          D Offline
          DouglinhasZN
          wrote on last edited by
          #4

          @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.

          Pablo J. RoginaP JKSHJ 2 Replies Last reply
          0
          • D DouglinhasZN

            @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.

            Pablo J. RoginaP Offline
            Pablo J. RoginaP Offline
            Pablo J. Rogina
            wrote on last edited by
            #5

            @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.

            Upvote the answer(s) that helped you solve the issue
            Use "Topic Tools" button to mark your post as Solved
            Add screenshots via postimage.org
            Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

            1 Reply Last reply
            1
            • D DouglinhasZN

              @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.

              JKSHJ Offline
              JKSHJ Offline
              JKSH
              Moderators
              wrote on last edited by
              #6

              @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.

              Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

              1 Reply Last reply
              2
              • mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by mrjj
                #7

                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 :=)

                1 Reply Last reply
                2

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved