[Development] QTreeView: vertical bar between columns

Scott Bloom scott at towel42.com
Tue May 17 18:36:49 CEST 2022


Adding a +1 here.

Where I have created a “similar” treeview with tableview similarities is when viewing SQL data results.

The tree aspect, represents the sorted on column with duplicate data.  For instance, say you had a model that was
Firstaname, lastname, address, city, state, zipcode and country.  A standard address book from CS 101

If you didn’t group, it would look like a table view.  If you grouped by city you would get:

City1
  |- fn1 | ln1| add1 | s1 | z1 | country1
  |- fn2 | ln2| add2 | s2 | z2 | country2
  |- fn3 | ln3| add3 | s3 | z3 | country3
City2
  |- fn1 | ln1| add1 | s1 | z1 | country1
  |- fn2 | ln2| add2 | s2 | z2 | country2
  |- fn3 | ln3| add3 | s3 | z3 | country3

Etc etc etc

My ideal view, basically looked like a tree but when expanded the rows under the parent node simply looked like a tree view.

I got it mostly working, however I was never really happy with the look of it, it just looked like a treeview with an attempt to get the rows to look like a table.

Just my 2 bits.
Scott

From: Development <development-bounces at qt-project.org> On Behalf Of Laszlo Papp
Sent: Tuesday, May 17, 2022 9:07 AM
To: Konrad Rosenbaum <konrad at silmor.de>
Cc: development at qt-project.org
Subject: Re: [Development] QTreeView: vertical bar between columns

On Tue, May 17, 2022 at 4:51 PM Laszlo Papp <lpapp at kde.org<mailto:lpapp at kde.org>> wrote:

What is required is a widget or mode of a widget that combines both abilities.
QTreeView already sort of does that, although badly. Basically, a header makes it look like a table, but it is also a tree. That is why I think the feature request is valid. It should either not have a header or header formatting for this, and then you can argue body formatting is moot, or if it has header and header formatting, then the body formatting ought to be consistent.

Just googled an image: https://docs.unity3d.com/uploads/Main/TreeViewAPI-0.png (Unity, fairly common software)

They say "multiple columns". As far as I am concerned, a QTreeView is a special QTableView. You can see on the above image that it is column and row based and as a direct consequence, you have "cells" of data. It is just that the tree visual expand into the first column a bit more due to its graphical nature, but it eventually is column-based.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20220517/5994c03b/attachment.htm>


More information about the Development mailing list