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. [Reworded question :)] How to set minimum (but still expandable) size for column?
QtWS25 Last Chance

[Reworded question :)] How to set minimum (but still expandable) size for column?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 954 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.
  • M Offline
    M Offline
    Moschops
    wrote on last edited by
    #1

    I have a QTreeView with four columns. Sometimes, on the Solaris build, the first column shrinks to the width of the little tree-navigation buttons (those little buttons next to a row that expand the row to show its children). Just on the Solaris version.

    I call setStretchLastSection(false) after setting the model, as advised elsewhere, but it doesn't seem to make a difference.

    @ ui->projectExplorerTreeView->setModel(model.data());
    ui->projectExplorerTreeView->header()->setStretchLastSection(false);@

    I'd rather not have to manually force the first column to have a minimum size, as it's very conceivable that the user might want to shrink the column size - it's just very bad for it to happen by itself. Are there any other settings I could fiddle with that anyone knows of?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      Moschops
      wrote on last edited by
      #2

      Okay, no response to this question; how about changing it a bit. How can I set a minimum size for the first column, such that the user can resize it manually but not below a certain width? Hopefully, if I can do this, whatever is causing the Solaris version to shrink it to almost zero will also obey the minimum size.

      I see functions for setting the size, but I don't see one for setting a minimum allowed size.

      Edit: I have a headerMinimumSectionSize set in the header's properties, but this seems to be ignored sometimes on the Solaris version; from reading the documentation, I can't tell if the headerMinimumSectonSize is meant to be an absolute, always on minimum value no matter what, or if it's something that could be ignored.

      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