[Qt5-feedback] Adding better data access method to QAbstractItemModel?

Stephen Kelly steveire at gmail.com
Mon Jul 11 15:19:38 CEST 2011


André Pönitz wrote:

> On Monday 11 July 2011 14:43:41 ext Stephen Kelly wrote:
>> That means this is source compatible for the emitter but not the
>> receiver, ie,
>> 
>> emit dataChanged(foo, bar);
>> 
>> still works, but
>> 
>> connect(model, SIGNAL(dataChanged(QMI,QMI)),
>> SLOT(onDataChanged(QMI,QMI));
>> 
>> Needs to be changed to at least:
>> 
>> connect(model, SIGNAL(dataChanged(QMI,QMI,QSet<int>)),
>> SLOT(onDataChanged(QMI,QMI));
>> 
>> The (source compatible) alternative would be to add a roleDataChanged
>> signal with the signature I proposed instead of changing dataChanged (and
>> possibly deprecating dataChanged).
>> 
>> What are your thoughts? Are small source incompatibilities like that
>> acceptible?
> 
> Having to touch all dataChanged() receivers looks quite intrusive.
> 
> Andre'

Just for clarity, the receivers don't need to be touched, but the actual 
connect() lines. A slot like 

onDataChanged(QMI, QMI)

would not need to be changed.

The signal dataChanged(QMI, QMI, QSet) can be connected to slots like:

* onDataChanged(QMI, QMI, QSet)
* onDataChanged(QMI, QMI)
* onDataChanged(QMI)
* onDataChanged()

Thanks,

Steve.



More information about the Qt5-feedback mailing list