Qt Forum

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

    Allow user to resize column to contents in QTableWidget

    General and Desktop
    qtablewidget qtableview resize contents column
    2
    2
    2424
    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.
    • B
      bharath144 last edited by

      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 Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        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 Reply Quote 0
        • First post
          Last post