Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Somehow the layout got messed up in Qt Creator. Hints?

Somehow the layout got messed up in Qt Creator. Hints?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
7 Posts 3 Posters 715 Views
  • 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.
  • A Online
    A Online
    andi456
    wrote on last edited by andi456
    #1

    Hi,

    for some reason the layout of my little program got all but messed up after I played around with the layout of the central widget and then reverted the changes. I guess there are code remains left in the .ui file, but I'm not sure, what I should do now. Maybe I should remove all layouts step by step. So any hint would be appreciated.

    Kind regards,

    Andreas

    jsulmJ A 2 Replies Last reply
    0
    • A andi456

      Hi,

      for some reason the layout of my little program got all but messed up after I played around with the layout of the central widget and then reverted the changes. I guess there are code remains left in the .ui file, but I'm not sure, what I should do now. Maybe I should remove all layouts step by step. So any hint would be appreciated.

      Kind regards,

      Andreas

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @andi456 A version control system like Git is very helpful in such situations :-)
      Did you try to simply undo your changes (Ctrl-Z)?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A Online
        A Online
        andi456
        wrote on last edited by andi456
        #3

        Well, other problems prevented this approach because of which I had to restart Qt Creator. (Keyboard shortcuts not working anymore for some unknown reason...) There must be some code left that is being compiled without my permission.
        ;-)

        mainwindow.ui contains the following lines about a layout that is not accessible in visual mode:

          <widget class="QWidget" name="centralwidget">
           <widget class="QWidget" name="layoutWidget">
            <property name="geometry">
             <rect>
              <x>30</x>
              <y>300</y>
              <width>998</width>
              <height>412</height>
             </rect>
            </property>
        
        
        1 Reply Last reply
        0
        • A andi456

          Hi,

          for some reason the layout of my little program got all but messed up after I played around with the layout of the central widget and then reverted the changes. I guess there are code remains left in the .ui file, but I'm not sure, what I should do now. Maybe I should remove all layouts step by step. So any hint would be appreciated.

          Kind regards,

          Andreas

          A Offline
          A Offline
          Anonymous_Banned275
          wrote on last edited by Anonymous_Banned275
          #4

          @andi456 Have you try "break layout" ?
          No need for git , just make another copy of your full layout before you start moving / removing stuff. Also if possible "group" your widgets in sort of puzzle style blocks. . It gets little more manageable - I look at that as a "comments" in code , it looks cluttered but stuff can be easy to move around in case of mishap.

          1 Reply Last reply
          0
          • A Online
            A Online
            andi456
            wrote on last edited by
            #5

            Yes I broke up the layout of the central widget, but it didn't really work and messed up the whole layout.

            A 1 Reply Last reply
            0
            • A andi456

              Yes I broke up the layout of the central widget, but it didn't really work and messed up the whole layout.

              A Offline
              A Offline
              Anonymous_Banned275
              wrote on last edited by
              #6

              @andi456 That is pretty "normal" - loosing the layout. As long as you have the "piece parts" you can put it back together.
              Does the project still compile / build? Would it help to post the form here ?

              1 Reply Last reply
              0
              • A Online
                A Online
                andi456
                wrote on last edited by
                #7

                Well, I started from scratch, as I can use the old code. But, what do you mean by "puzzle style blocks"? The way I want to proceed is by grouping together those widgets that belong together (a label and a lineedit for example) in a horizontal or vertical layout and put those layouts in a group layout. This time I will make a backup of the .ui file before I experiment with the layout of the central widget....

                1 Reply Last reply
                0

                • Login

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