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. Designer an central widget layout
Forum Updated to NodeBB v4.3 + New Features

Designer an central widget layout

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 360 Views 1 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.
  • O Offline
    O Offline
    ofmrew
    wrote on last edited by
    #1

    I have a widget that is promoted to MyCanvas and some buttons. I want all the object to resize when I resize the MainWindow. I know that need a horizontal layout for the button and a vertical layout for the button layout and the promoted widget. I follow the instructions in the Qt documentation, but nothing works. I know that I have this problem in the past and I was missing a step. What am I missing?

    1 Reply Last reply
    0
    • Axel SpoerlA Offline
      Axel SpoerlA Offline
      Axel Spoerl
      Moderators
      wrote on last edited by
      #2

      Please post your code.

      Software Engineer
      The Qt Company, Oslo

      O 1 Reply Last reply
      0
      • Axel SpoerlA Axel Spoerl

        Please post your code.

        O Offline
        O Offline
        ofmrew
        wrote on last edited by
        #3

        @Axel-Spoerl There is no code as it is done in Designer.
        I deleted all objects so only MainWindow and its child centralWidget remain. Then I added a Widget, with AutoBackgroundFilled checked and select VerticalLayout. That resizes. Now I am stuck as everything I add does not resize.

        1 Reply Last reply
        0
        • Axel SpoerlA Offline
          Axel SpoerlA Offline
          Axel Spoerl
          Moderators
          wrote on last edited by
          #4

          Please post the ui file and the code you run it with.

          Software Engineer
          The Qt Company, Oslo

          1 Reply Last reply
          0
          • C Offline
            C Offline
            ChrisW67
            wrote on last edited by
            #5

            You are probably missing a layout on the top most widget of you MyCanvas design

            1 Reply Last reply
            0
            • O Offline
              O Offline
              ofmrew
              wrote on last edited by
              #6

              I feel like a real idiot. The last time I created a program that had resizing was over two years ago and I had forgotten two very important point: First for my desired UI add pushbuttons and spacers, put then in a horizontal layout, then add the Widget and select the MainWindow and add vertical layout, and Second ignore the UI shown, try it to see if you like it. I executed it and it was what I wanted. My mistake was that I looked at the documentation and the Web for help and they always started with adding a widget, usually a pushbutton. I did that and I dug myself into a hole from which I could not extricate myself. There must be a warning what you see in Designer, execute it as that is the real test. Sorry to have wasted everyone's time.

              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