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. Resize Objects With Mainwindow Resize
Forum Updated to NodeBB v4.3 + New Features

Resize Objects With Mainwindow Resize

Scheduled Pinned Locked Moved Solved General and Desktop
resizewindowobject
4 Posts 3 Posters 2.3k Views 2 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.
  • M Offline
    M Offline
    M4RZB4Ni
    wrote on 19 Apr 2016, 22:26 last edited by
    #1

    hi,
    i dropped 3 button and a label in my window
    but i want when i resize my window,
    my objects resize with it too,
    how i can do this?
    tnx

    Thanks
    M4RZB4Ni

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 19 Apr 2016, 23:02 last edited by
      #2

      Hi,

      Use layouts. Look in the documentation for QHBoxLayout, QVBoxLayout and friends. For designer, there's the Using Layouts in Qt Designer chapter of Qt's documentation.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • M Offline
        M Offline
        M4RZB4Ni
        wrote on 20 Apr 2016, 04:31 last edited by
        #3

        hi,

        but in documentation dose Not explained this and just referred Layouts
        i have a code that do this(resize),
        but i want to question that it is possible to do this in visual design?
        tnx a lot

        Thanks
        M4RZB4Ni

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 20 Apr 2016, 06:12 last edited by
          #4

          Hi
          If you use layouts and put the buttons in one. Then no need
          for any code to do resize.

          So using layouts is how you do in Visual Design.

          Try this :
          Make new project
          open the mainwindow UI
          Place a button in the empty mainwindow.
          Right click empty spot on form
          Select the Layout menu (bottom)
          Select Layout Horizontally

          1 Reply Last reply
          0

          3/4

          20 Apr 2016, 04:31

          • Login

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