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. problem with layout
QtWS25 Last Chance

problem with layout

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

    Hello everybody,
    i'm designing an app using C++ Qt (not Qt designer) ,
    my problem is when i change the size of the my window, there are somme space in between my layouts (look at screen 1 )
    0_1568898655031_merde.png

    how can i remove this space ( i put it in red rectangle on the screen )
    Thanks

    my english is average, please use simple words and try to be the most explicit, thank you

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Did you put all these items in layouts ?
      Either a QGridLayout or a combo of QHBoxLayout and QVBoxLayout ?

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

      Z 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        Did you put all these items in layouts ?
        Either a QGridLayout or a combo of QHBoxLayout and QVBoxLayout ?

        Z Offline
        Z Offline
        Zunneh
        wrote on last edited by
        #3

        @sgaist yeah a i did it

        my english is average, please use simple words and try to be the most explicit, thank you

        J.HilkJ 1 Reply Last reply
        0
        • Z Zunneh

          @sgaist yeah a i did it

          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by
          #4

          @zunneh
          did you set the spacing to 0?
          https://doc.qt.io/qt-5/qlayout.html#spacing-prop


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          Z 1 Reply Last reply
          0
          • J.HilkJ J.Hilk

            @zunneh
            did you set the spacing to 0?
            https://doc.qt.io/qt-5/qlayout.html#spacing-prop

            Z Offline
            Z Offline
            Zunneh
            wrote on last edited by Zunneh
            #5

            @j-hilk i tried it but it's not the result i want, what i want is when i resize my app manually, this block does not create spacer 0_1568969580329_70645900_476813663165769_2199328550417334272_n.png

            my english is average, please use simple words and try to be the most explicit, thank you

            J.HilkJ 1 Reply Last reply
            0
            • Z Zunneh

              @j-hilk i tried it but it's not the result i want, what i want is when i resize my app manually, this block does not create spacer 0_1568969580329_70645900_476813663165769_2199328550417334272_n.png

              J.HilkJ Offline
              J.HilkJ Offline
              J.Hilk
              Moderators
              wrote on last edited by
              #6

              @zunneh ah sorry, now I understand your issue :)

              for such cases Qt has Spacers
              https://doc.qt.io/qt-5/qspaceritem.html

              that you can place inside layouts. those than will fill up all available space and therefore groups other objects together(geometry speaking), when your widget is being resized


              Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


              Q: What's that?
              A: It's blue light.
              Q: What does it do?
              A: It turns blue.

              Z 1 Reply Last reply
              2
              • J.HilkJ J.Hilk

                @zunneh ah sorry, now I understand your issue :)

                for such cases Qt has Spacers
                https://doc.qt.io/qt-5/qspaceritem.html

                that you can place inside layouts. those than will fill up all available space and therefore groups other objects together(geometry speaking), when your widget is being resized

                Z Offline
                Z Offline
                Zunneh
                wrote on last edited by Zunneh
                #7

                @j-hilk it work, my grid layout is now fixed to the top of my widget,
                now, I do not want any space below the widget, how can i do it ? thanks

                my english is average, please use simple words and try to be the most explicit, thank you

                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