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 Resizing children

Qt Resizing children

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

    Is there a standard way of adding an a widget to a window then, setting its initial position and size then if the window is resized having it automatically adjust the size of the children in the window?

    I'm asking this because I've spent quite a lot of time doing it myself when the resize event occurs I then adjust children of the window however I thought I'd ask is there is a defined way of getting the system to do this for me?

    Kind Regards,
    Sy

    jsulmJ 1 Reply Last reply
    0
    • SPlattenS SPlatten

      Is there a standard way of adding an a widget to a window then, setting its initial position and size then if the window is resized having it automatically adjust the size of the children in the window?

      I'm asking this because I've spent quite a lot of time doing it myself when the resize event occurs I then adjust children of the window however I thought I'd ask is there is a defined way of getting the system to do this for me?

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

      @SPlatten Any reason why you don't use layouts?

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

      1 Reply Last reply
      2
      • SPlattenS Offline
        SPlattenS Offline
        SPlatten
        wrote on last edited by
        #3

        @jsulm, the only reason is that my experience with Qt has been on the job where I've learnt it by using it and haven't had any formal instruction.

        When I first started working with Qt I created an application that didn't use Qt Creator to define where everything went as the application itself was supposed to be completely dynamic and position widgets at run-time.

        I'm keen to learn if there is a way to do what I need using Layouts, I need to be able to place widgets anywhere in the window.

        Kind Regards,
        Sy

        jsulmJ 1 Reply Last reply
        0
        • SPlattenS SPlatten

          @jsulm, the only reason is that my experience with Qt has been on the job where I've learnt it by using it and haven't had any formal instruction.

          When I first started working with Qt I created an application that didn't use Qt Creator to define where everything went as the application itself was supposed to be completely dynamic and position widgets at run-time.

          I'm keen to learn if there is a way to do what I need using Layouts, I need to be able to place widgets anywhere in the window.

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

          @SPlatten You should really learn to use layouts instead of messing up with manual positioning/sizing.
          https://doc.qt.io/qt-5/layout.html

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

          1 Reply Last reply
          4
          • SPlattenS Offline
            SPlattenS Offline
            SPlatten
            wrote on last edited by
            #5

            Thank you, i'll take a look.

            Kind Regards,
            Sy

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

              Just for the record.
              The layouts will fix/arrange and scale widgets.

              You cannot place widgets freely on the form
              when in a layout as that would completely goes against of what layout does :)
              but you can place the layout as you wish to some degree.

              1 Reply Last reply
              1

              • Login

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