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. Grid layout and QGroupBox

Grid layout and QGroupBox

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 567 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.
  • U Offline
    U Offline
    Ucn_
    wrote on last edited by Ucn_
    #1

    hello
    I am following an example at riptutorial about Grid layout and QGroupBox and I add it to my QTabWidget. It works, but not as expected or not like the example. For me it gives extra spaces between the QLineEdit (see picture). How can I remove the spaces between the QLineEdit? Thanks
    alt text

    JonBJ 1 Reply Last reply
    0
    • U Ucn_

      hello
      I am following an example at riptutorial about Grid layout and QGroupBox and I add it to my QTabWidget. It works, but not as expected or not like the example. For me it gives extra spaces between the QLineEdit (see picture). How can I remove the spaces between the QLineEdit? Thanks
      alt text

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

      @Ucn_

      I add it to my QTabWidget

      I think/assume the difference is your QTabWidget's pages, which I guess stretches its content to fit? Put a layout on the QTabWidget pages to lay out without stretching? Show how you added what onto your QTabWidget?

      1 Reply Last reply
      1
      • U Offline
        U Offline
        Ucn_
        wrote on last edited by Ucn_
        #3

        @JonB I added stretching to the lay out but

        boxLayout->addStretch(1);
        

        It removed the spaces, but everything is at bottom now.
        alt text

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

          Hi,

          Can you show the code you are currently using to setup your widgets ?

          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
          • U Offline
            U Offline
            Ucn_
            wrote on last edited by
            #5

            @SGaist this is the example I'm following riptutorial then I add widget to my tab.

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

              If I may, I'd recommend using QFormLayout in place of QGridLayout in this case. That will simplify your life.

              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
              2

              • Login

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