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

problem with layout

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 610 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.
  • Z Offline
    Z Offline
    Zunneh
    wrote on 19 Sept 2019, 13:12 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
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 19 Sept 2019, 18:44 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 20 Sept 2019, 08:42
      1
      • S SGaist
        19 Sept 2019, 18:44

        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 20 Sept 2019, 08:42 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 1 Reply Last reply 20 Sept 2019, 08:45
        0
        • Z Zunneh
          20 Sept 2019, 08:42

          @sgaist yeah a i did it

          J Offline
          J Offline
          J.Hilk
          Moderators
          wrote on 20 Sept 2019, 08:45 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 20 Sept 2019, 08:53
          0
          • J J.Hilk
            20 Sept 2019, 08:45

            @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 20 Sept 2019, 08:53 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 1 Reply Last reply 20 Sept 2019, 08:57
            0
            • Z Zunneh
              20 Sept 2019, 08:53

              @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 Offline
              J Offline
              J.Hilk
              Moderators
              wrote on 20 Sept 2019, 08:57 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 20 Sept 2019, 10:06
              2
              • J J.Hilk
                20 Sept 2019, 08:57

                @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 20 Sept 2019, 10:06 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

                2/7

                19 Sept 2019, 18:44

                topic:navigator.unread, 5
                • Login

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