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. Allow user to resize column to contents in QTableWidget
Forum Updated to NodeBB v4.3 + New Features

Allow user to resize column to contents in QTableWidget

Scheduled Pinned Locked Moved General and Desktop
qtablewidgetqtableviewresizecontentscolumn
2 Posts 2 Posters 2.9k 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.
  • B Offline
    B Offline
    bharath144
    wrote on 24 Apr 2015, 10:46 last edited by
    #1

    Hello,

    I have a QTableWidget with a bunch of rows and 4 columns. Table is added with rows when data comes (at periodic intervals) from a backend server. All the column display text data, however there are times when the text is long enough to get truncated.

    Is there way that I can allow the user to click on the edge of a column and drag it so that the cells get resized? This something similar to what we see in a spreadsheet application.

    Cheers!
    ಮೈ ಗೋ ಭರತ ನಾರಾಯಣ
    Bharath Narayan M G

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 24 Apr 2015, 23:43 last edited by
      #2

      Hi,

      Take a look at QHeaderView::setResizeMode

      Hope it helps

      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

      2/2

      24 Apr 2015, 23:43

      • Login

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