[Development] QTreeView: vertical bar between columns

Volker Hilsheimer volker.hilsheimer at qt.io
Tue May 17 10:49:17 CEST 2022


> On 16 May 2022, at 23:26, Laszlo Papp <lpapp at kde.org> wrote:
> 
> Hi,
> 
> Was just wondering if it was okay to add a property for drawing vertical bar between columns in the body of the QTreeView. Our customer has requested this as otherwise it was challenging to visually separate the columns.
> 
> It looks like jpn had a fairly trivial paintEvent implementation for this, so should not be hard to add: https://www.qtcentre.org/threads/8684-how-to-show-vertical-lines-between-colums
> 
> Kind regards,
> László

Hi László,

Knee-jerk reaction is that I’m sceptical that this belongs into QTreeView itself, given how hard it is to make this look good for all the different styles, and how easy it evidently is to do this in a subclass that can solve a specific problem and doesn’t have to worry about making this look right with every style.

Not to speak about being testing yet another property in combination with all other properties, which makes the number of visual tests we have to have for this grow exponentially.

At the very least, start with writing up a suggestion as a JIRA ticket so that we can see if anyone votes for this to be part of upstream Qt and so that we can discuss what this should look like with different styles, style sheets, scale factors etc.

Volker



More information about the Development mailing list