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. Resizing Not Visible Columns
Forum Updated to NodeBB v4.3 + New Features

Resizing Not Visible Columns

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 504 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.
  • H Offline
    H Offline
    hershey
    wrote on last edited by
    #1

    Hello I have a TreeView with about 20 Columns. I have implemented a context menu to be able to show or hide each column. However when I show new columns they are very small and I have to resize them manually. I'd like to be able to do this in code. I've tried resizeSection() and resizeColumnToContents(). These functions don't seem to work unless there is visible space for the columns to be added.

    I want to show the new columns and be able to resize the column even though it's not being shown. This was a user can scroll over and see the new column without resizing it.

    Can anyone help? This seems like a simple problem, but I can't figure it out.

    ANSWER:

    Well this took forever to find but here's something that worked for me. Hopefully this can help someone in the future.

    Turns out the headerview has a setMinimumSectionSize function. This was sufficient for my purposes. It will make the column a minimum of a fixed width (passed in to the function).

    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