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. Expand middle column of table to fit contents

Expand middle column of table to fit contents

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 653 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.
  • xopheriraX Offline
    xopheriraX Offline
    xopherira
    wrote on last edited by
    #1

    I have a QTableWidget and would like the contents to expand to fit the middle column, I have three columns total. I can get ot to do this for the last column but how do I set for the middle column?
    Thanks for any help

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by VRonin
      #2

      tableWidget->horizontalHeader()->setSectionResizeMode(column,QHeaderView::ResizeToContents);

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      xopheriraX 1 Reply Last reply
      3
      • VRoninV VRonin

        tableWidget->horizontalHeader()->setSectionResizeMode(column,QHeaderView::ResizeToContents);

        xopheriraX Offline
        xopheriraX Offline
        xopherira
        wrote on last edited by
        #3

        @VRonin Thanks, that did the trick.

        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