PDA

View Full Version : why QAbstractItemDelegate provide a interface "painting"?



hashb
22nd October 2009, 02:57
From the QT manual of QAbstractItemDelegate,we can see:
"The QAbstractItemDelegate class is used to display and edit data items from a model"

But what confusing me is :
I think It should be view’s job to display the data rather than delegate,because in MVC , “view ” is responsible for presenting the data to the user ,”control ” converting user actions into requests to navigate or edit data.

So QT let delegate to display data ,is it confusing ? if so ,what should view do ?

Thanks advance,
hb

caduel
22nd October 2009, 08:08
the view displays data, it uses delegates to do (part of) the work.

hashb
22nd October 2009, 08:22
Hi,Caduel,

Thanks for your answer!
I studied QAbstractItemView again,and found that it seemed "view" only care about
"represent", but it does not care about represent "what" .
"what" is delegated to "delegator" .
is this the mechanism between view and delegator?

Best regards,
hb