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. [Solved]QTableView resizeRowsToContents()

[Solved]QTableView resizeRowsToContents()

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.7k Views 1 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.
  • S Offline
    S Offline
    Sam
    wrote on last edited by
    #1

    I have created a custom delegate that subclasses QStyledItemDelegate. I have a QTableView for which i am setting my custom delegate as

    @tableView->setItemDelegate(myCustomDelegate);@

    Now the Items that are stored in the tableView varies in width and height. So i tried to use resizeRowsToContents() and resizeColumnsToContent(), but nothing changes. It does not update the tableView row and column width/height. Also if i override the sizeHint() function then also it does not work.

    Thanks for your time.

    This is how it looks "image":http://imageshack.us/photo/my-images/163/captureykl.png/

    This is what i want "image":http://imageshack.us/photo/my-images/823/capturejyr.png/

    Edit: Did some changes and it works fine !!!!!

    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