This forum has been archived. All content is frozen. Please use KDE Discuss instead.

qtreeview show root node

Tags: None
(comma "," separated)
deadeyes
Registered Member
Posts
34
Karma
0

qtreeview show root node

Thu Jan 13, 2011 9:38 pm
Hi all,

I have successfully implemented QAbstractItemModel.
The tree behaves correctly.

However the "root" node is not shown.
how can I accomplish this?
Or is it just not possible? (I need to add another subnode for the root node then?)

Thanks in advance!
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: qtreeview show root node

Fri Jan 14, 2011 9:52 pm


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
deadeyes
Registered Member
Posts
34
Karma
0

Re: qtreeview show root node

Fri Jan 14, 2011 10:02 pm


I looked at the link and the default for this value should be true.
And as I never have set it to false this probably solve my problem.

I am rather thinking that I maybe might have build my tree incorrect.
However it is only the top root item (which has 2 childs) that is not shown.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: qtreeview show root node  Topic is solved

Fri Jan 14, 2011 10:23 pm
You will likely need to add a sub-node to act as the root in this case. I checked my code (for the Device Actions KCM) and it does the same.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
deadeyes
Registered Member
Posts
34
Karma
0

Re: qtreeview show root node

Sun Jan 16, 2011 9:59 pm
bcooksley wrote:You will likely need to add a sub-node to act as the root in this case. I checked my code (for the Device Actions KCM) and it does the same.


That indeed did the trick.
I have to say this works in an unlogical way:)

Thanks!


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], markhm, rblackwell, sethaaaa, Sogou [Bot], Yahoo [Bot]