Did you ever wonder why applications like nautilus display a node called »(empty)« in the tree? I didn't. There are several reasons that could be brought up here, but in my opinion the Windows Explorer just got it right:
- if you don't know, display an expander
- if you look at it and it's empty, just remove the expander
So I tried to implement this behaviour in GQ. It wasn't very easy, but it works. As I wrote last week, I suspected a bug in that code, so I developed a small test case to play with that feature. If you're interested in it for your application, take my example and build your own tree model.