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



  • 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?



  • 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.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.