The default list view in QT is really too basic to satisfy me.And the delegate isn't enough.I want to fully custom it,just like rendering a custom widget in a list.Take twitter as an example.I have a timeline with 70 tweets.I want to show them in a fashion style.
Here's my few thoughts:
1.Subclass the QListView,override the paintEvent(),draw everything by myself.
2.Use Graphics View Framework.The 40000 chips demo really shows its power.I think managing only a list of tweet widgets would be a piece of cake to it.
3.I take use of the QScrollBar.Since the tweet widget will have a minimum size(say 40*100),So if the viewport's size is(160*100),then I can only see 5 widgets at most(3 of them will totally visible,while the other two will be seen partly).Then I create 5 widgets(instead of creating 70 widgets to save memory).Every time the user drag the scrollbar,I adjust these 5 widgets' content & position.
Also I have the 6th widget to calculate each of the 70 tweet widgets' actual size.Then I do some math and assign the value to the scollbar,so it knows the scrolling range.
I'm a newbie to Qt,so I don't know which one would be better.But obviously,the first one would suck.I hope you guys can tell me more about this.All the pros and cons.
This is not totally a question.And I think bring up a topic is better than just ask and answer.
Bookmarks