Nominate our 2022 Qt Champions!

Column background in QTreeView

  • How can one set the background color of just one specific column in a QTreeView?
    I tried using the Qt::BackgroundRole in my model but the result is not satisfying as this only affects the rectangle of the item. Screenshot:

    What want is that the entire column has a solid background color. Basically the same as QTreeView::setAlternatingRowColors() would fill the entire row with a solid background color.

    Any ideas?

Log in to reply