Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved QTableWidget filling out whole QGroupBox

    General and Desktop
    qtablewidget qwidget
    2
    5
    545
    Loading More Posts
    • 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.
    • T
      TUStudi last edited by

      Hey, I have a QGroupBox with a Grid-Layout. in that GroupBox I habe a QWidget for a Plot, another GroupBox with Checkboxes and a QTableWidget. I would like to fill out the whole QGroupBox with the QTableWidget horizontally, but it does not work:

      8d24dc4c-1f58-4db9-9751-adc16aaa5398-image.png

      This is the size Policy of my Table:

      8418acf9-068a-49e8-b4fd-7ac003b3b119-image.png

      If i change the minimum size Width, then the table is gonna stretched horizontally, but only the second column is getting bigger.
      I want both columns to be the same size

      1 Reply Last reply Reply Quote 0
      • mrjj
        mrjj Lifetime Qt Champion last edited by mrjj

        Hi
        If the layout is a grid one, then you should be able to grab right side of the QTableWidget and drag it out
        over the right edge and it should jump into place , covering that area too.

        alt text

        T 1 Reply Last reply Reply Quote 2
        • mrjj
          mrjj Lifetime Qt Champion last edited by mrjj

          Hi
          If the layout is a grid one, then you should be able to grab right side of the QTableWidget and drag it out
          over the right edge and it should jump into place , covering that area too.

          alt text

          T 1 Reply Last reply Reply Quote 2
          • T
            TUStudi @mrjj last edited by TUStudi

            @mrjj Hey, this works, thanks, but only the right column is getting stretched. Is it possible to let both columns have the same size when stretching the table?

            mrjj 1 Reply Last reply Reply Quote 0
            • mrjj
              mrjj Lifetime Qt Champion @TUStudi last edited by mrjj

              @TUStudi
              Hi
              you mean inside the table ?

              like
              table->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
              so they both are same size ?

              T 1 Reply Last reply Reply Quote 2
              • T
                TUStudi @mrjj last edited by

                @mrjj That's it, thanks :)

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post