Congratulations to our 2022 Qt Champions!

QTreeView Loses Highlight when clicking on empty space

  • Re: QTreeView loses highlight when clicking on empty space.

    I finally figured this out. My original problem was I have dead buttons that come to life when a cell is clicked. However if you had not filled the entire QTreeView widget and had blank rows when you clicked in the blank area the TreeView would lose focus but the buttons would stay active. As it turns out, the viewport of the QTreeView is the one generating the event. So I installed a eventfilter on the viewport to handle the event when a user clicks on a blank area.


Log in to reply