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. Adding a layout inside an existing layout
Forum Updated to NodeBB v4.3 + New Features

Adding a layout inside an existing layout

Scheduled Pinned Locked Moved Solved General and Desktop
9 Posts 4 Posters 129 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.
  • N Offline
    N Offline
    Nmatan
    wrote last edited by
    #1

    Hi all,

    I'm new to QT Design, using it mostly to generate UIs for Python.
    Using QT Design only - not the studio version that gives access to the code (I think that's what it's called anyway).
    Something I encountered that I'm unsure how to resolve 'cleanly':

    I worked on a UI and added various buttons and layouts.
    Now, I want to add a new button, and have it aligned with an existing LineEdit widget:

    d4265917-471a-4494-9b6a-28e3ef725a45-image.png

    My issue, is that when I try to add a new button and align them, the only available option is to break the layout:

    e62306a6-2dd8-40a2-9039-270daba69c2b-image.png

    That is usually very messy. How do I 'cleanly' add another layout and then move both widgets into it?
    I tried to add another layout and 'drag' the buttons into it, but it's thin, and you can't actually drag anything into it. It doesn't look like I can re-order items in the object inspector either:
    f5f98448-7190-4032-b3df-6928b483c6c7-image.png

    Just to demonstrate, I did break the layout and re-create it just to explain better what I wanted it to look like, but again, breaking the layout every time isn't comfortable:
    9be42720-ac8f-4aae-bc5f-076ab62ff48f-image.png

    Any advice would be appreciated!

    JonBJ Pl45m4P 2 Replies Last reply
    0
    • N Nmatan

      Hi all,

      I'm new to QT Design, using it mostly to generate UIs for Python.
      Using QT Design only - not the studio version that gives access to the code (I think that's what it's called anyway).
      Something I encountered that I'm unsure how to resolve 'cleanly':

      I worked on a UI and added various buttons and layouts.
      Now, I want to add a new button, and have it aligned with an existing LineEdit widget:

      d4265917-471a-4494-9b6a-28e3ef725a45-image.png

      My issue, is that when I try to add a new button and align them, the only available option is to break the layout:

      e62306a6-2dd8-40a2-9039-270daba69c2b-image.png

      That is usually very messy. How do I 'cleanly' add another layout and then move both widgets into it?
      I tried to add another layout and 'drag' the buttons into it, but it's thin, and you can't actually drag anything into it. It doesn't look like I can re-order items in the object inspector either:
      f5f98448-7190-4032-b3df-6928b483c6c7-image.png

      Just to demonstrate, I did break the layout and re-create it just to explain better what I wanted it to look like, but again, breaking the layout every time isn't comfortable:
      9be42720-ac8f-4aae-bc5f-076ab62ff48f-image.png

      Any advice would be appreciated!

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote last edited by JonB
      #2

      @Nmatan said in Adding a layout inside an existing layout:

      I tried to add another layout and 'drag' the buttons into it, but it's thin, and you can't actually drag anything into it. It doesn't look like I can re-order items in the object inspector either:

      This is the way to do it! If it's narrow I temporarily set the new layout's "minimum height" to 50 or similar while I get widgets onto it. Then you can remove that setting.

      I will try not to say too much. I am a big fan of Qt. I sometimes use Designer but IMHO it's far weaker than, say, Visual Studio was 20 years. Similar-ish for Creator itself. Ho hum.

      You cannot copy/paste objects in Designer to move around where they are. Crazy. There is a way to copy/paste, if you need it, but it's so "secret" I doubt most people even know about it....

      N 1 Reply Last reply
      2
      • JonBJ JonB

        @Nmatan said in Adding a layout inside an existing layout:

        I tried to add another layout and 'drag' the buttons into it, but it's thin, and you can't actually drag anything into it. It doesn't look like I can re-order items in the object inspector either:

        This is the way to do it! If it's narrow I temporarily set the new layout's "minimum height" to 50 or similar while I get widgets onto it. Then you can remove that setting.

        I will try not to say too much. I am a big fan of Qt. I sometimes use Designer but IMHO it's far weaker than, say, Visual Studio was 20 years. Similar-ish for Creator itself. Ho hum.

        You cannot copy/paste objects in Designer to move around where they are. Crazy. There is a way to copy/paste, if you need it, but it's so "secret" I doubt most people even know about it....

        N Offline
        N Offline
        Nmatan
        wrote last edited by
        #3

        @JonB Oh my god I feel like such an idiot, I never thought to try and increase the margin for the layout from the property editor, I assumed it's like that since you can't resize anything inside a layout.

        The one I use is "Designer" I think which is the 'simple' one? Since all I needed was an easy way to generate UI files for Pycharm, I figured creator should be fine, and this topic was my main 'beef' with it - which you've helped me navigate :)

        Thanks again!

        JonBJ 1 Reply Last reply
        0
        • N Nmatan has marked this topic as solved
        • N Nmatan

          @JonB Oh my god I feel like such an idiot, I never thought to try and increase the margin for the layout from the property editor, I assumed it's like that since you can't resize anything inside a layout.

          The one I use is "Designer" I think which is the 'simple' one? Since all I needed was an easy way to generate UI files for Pycharm, I figured creator should be fine, and this topic was my main 'beef' with it - which you've helped me navigate :)

          Thanks again!

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote last edited by
          #4

          @Nmatan
          Yes, Designer is the UI designer (producing a .ui file) component in Creator, which is the rest of the code editor/building/running/debugging IDE. When I did Python stuff I too just generated the .ui from Designer/Creator and used PyCharm as my preferred Python IDE. Nowadays Creator has some support for Python coding and PySide, but I don't know how it compares to PyCharm, doubtless that is better.

          1 Reply Last reply
          0
          • N Nmatan

            Hi all,

            I'm new to QT Design, using it mostly to generate UIs for Python.
            Using QT Design only - not the studio version that gives access to the code (I think that's what it's called anyway).
            Something I encountered that I'm unsure how to resolve 'cleanly':

            I worked on a UI and added various buttons and layouts.
            Now, I want to add a new button, and have it aligned with an existing LineEdit widget:

            d4265917-471a-4494-9b6a-28e3ef725a45-image.png

            My issue, is that when I try to add a new button and align them, the only available option is to break the layout:

            e62306a6-2dd8-40a2-9039-270daba69c2b-image.png

            That is usually very messy. How do I 'cleanly' add another layout and then move both widgets into it?
            I tried to add another layout and 'drag' the buttons into it, but it's thin, and you can't actually drag anything into it. It doesn't look like I can re-order items in the object inspector either:
            f5f98448-7190-4032-b3df-6928b483c6c7-image.png

            Just to demonstrate, I did break the layout and re-create it just to explain better what I wanted it to look like, but again, breaking the layout every time isn't comfortable:
            9be42720-ac8f-4aae-bc5f-076ab62ff48f-image.png

            Any advice would be appreciated!

            Pl45m4P Offline
            Pl45m4P Offline
            Pl45m4
            wrote last edited by Pl45m4
            #5

            @Nmatan said in Adding a layout inside an existing layout:

            I tried to add another layout and 'drag' the buttons into it, but it's thin, and you can't actually drag anything into it

            Another way is dragging the elements in the object inspector list.
            If you have a layout which appears too tiny to edit in the form editor on the left, dragging the element to some existing layout helps.

            For the rest: what @JonB said :)

            @JonB said in Adding a layout inside an existing layout:

            There is a way to copy/paste, if you need it, but it's so "secret" I doubt most people even know about it....

            Isn't this just Ctrl + C/V-'ing a selection of widgets on the form?
            Haven't done anything with Designer for quite some time, but IIRC I've even managed to copy whole forms (including all child widgets) from one UI file to another ?! Not 100% sure though...


            If debugging is the process of removing software bugs, then programming must be the process of putting them in.

            ~E. W. Dijkstra

            JonBJ 1 Reply Last reply
            0
            • Pl45m4P Pl45m4

              @Nmatan said in Adding a layout inside an existing layout:

              I tried to add another layout and 'drag' the buttons into it, but it's thin, and you can't actually drag anything into it

              Another way is dragging the elements in the object inspector list.
              If you have a layout which appears too tiny to edit in the form editor on the left, dragging the element to some existing layout helps.

              For the rest: what @JonB said :)

              @JonB said in Adding a layout inside an existing layout:

              There is a way to copy/paste, if you need it, but it's so "secret" I doubt most people even know about it....

              Isn't this just Ctrl + C/V-'ing a selection of widgets on the form?
              Haven't done anything with Designer for quite some time, but IIRC I've even managed to copy whole forms (including all child widgets) from one UI file to another ?! Not 100% sure though...

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote last edited by
              #6

              @Pl45m4 said in Adding a layout inside an existing layout:

              Isn't this just Ctrl + C/V-'ing a selection of widgets on the form?

              Have you tried this...? :)

              Pl45m4P 1 Reply Last reply
              0
              • JonBJ JonB

                @Pl45m4 said in Adding a layout inside an existing layout:

                Isn't this just Ctrl + C/V-'ing a selection of widgets on the form?

                Have you tried this...? :)

                Pl45m4P Offline
                Pl45m4P Offline
                Pl45m4
                wrote last edited by Pl45m4
                #7

                @JonB said in Adding a layout inside an existing layout:

                Have you tried this...? :)

                Yup, now, it works. The obvious way.
                You can even clone a selection of widgets in the object inspector.

                @JonB said in Adding a layout inside an existing layout:

                There is a way to copy/paste, if you need it, but it's so "secret" I doubt most people even know about it....

                So that was ironic?! :D
                Because Ctrl C, Ctrl V is not "secret"?! :D
                If so, I missed that, because, well... we all know QtDesigner has some useless features, things that you should avoid and sometimes "feels" kinda weird.


                If debugging is the process of removing software bugs, then programming must be the process of putting them in.

                ~E. W. Dijkstra

                JonBJ 1 Reply Last reply
                0
                • Kent-DorfmanK Offline
                  Kent-DorfmanK Offline
                  Kent-Dorfman
                  wrote last edited by
                  #8

                  I posted in an unanswered thread a while back my frustration that designer would sometimes grey-out certain widget fields unless I made copies of those widgets, and then those copies would allow editing, but not the master they were cloned from. So yes, designer is not great, but I suppose it's better than nothing for RAD/RAP.

                  1 Reply Last reply
                  0
                  • Pl45m4P Pl45m4

                    @JonB said in Adding a layout inside an existing layout:

                    Have you tried this...? :)

                    Yup, now, it works. The obvious way.
                    You can even clone a selection of widgets in the object inspector.

                    @JonB said in Adding a layout inside an existing layout:

                    There is a way to copy/paste, if you need it, but it's so "secret" I doubt most people even know about it....

                    So that was ironic?! :D
                    Because Ctrl C, Ctrl V is not "secret"?! :D
                    If so, I missed that, because, well... we all know QtDesigner has some useless features, things that you should avoid and sometimes "feels" kinda weird.

                    JonBJ Offline
                    JonBJ Offline
                    JonB
                    wrote last edited by
                    #9

                    @Pl45m4
                    It was not intended ironically. It was like that when I last investigated, maybe copy/paste etc. is available now. I will check next time I am in Designer.

                    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