Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 6

Qt-interest Archive, July 2006
proxy models and signals


Message 1 in thread

Hi,

I have a question concerning proxy models. The QSortFilterProxyModel
doesn't delegate some signals (e.g. rowsInserted) from its source model.
This leads to a lot of problems (at least for me) because it means that
one cannot use real models and proxy models interchangeably. Also, it
might lead to performance issues because a view cannot be updated where
changes occur, but has to be completely refreshed (e.g. rowsInserted is
converted to layoutChanged).

I'd appreciate any comments on this, e.g. why the proxy models have been
designed that way.

Thanks,
M

--
 [ signature omitted ] 

Message 2 in thread

On 27.07.06 16:42:23, Martin wrote:
> I have a question concerning proxy models. The QSortFilterProxyModel
> doesn't delegate some signals (e.g. rowsInserted) from its source model.

If that is the case, consider writing a bugreport to TT.

> This leads to a lot of problems (at least for me) because it means that
> one cannot use real models and proxy models interchangeably. Also, it
> might lead to performance issues because a view cannot be updated where
> changes occur, but has to be completely refreshed (e.g. rowsInserted is
> converted to layoutChanged).

The latter does make sense as "simple" implementation. When a row is
inserted into a table this might lead to a layout change for the proxy
model, however I'd still consider this a bug, because Qt should be
smarter than that and the proxy model should be able to calculate the
proxy-row that is being inserted and emit the apropriate signal.

I also remember seeing one or two bugreports in the task tracker wrt
proxy models and emitting signals.

Andreas

-- 
 [ signature omitted ] 

Message 3 in thread

Andreas Pakulat wrote:
> On 27.07.06 16:42:23, Martin wrote:
>> I have a question concerning proxy models. The QSortFilterProxyModel
>> doesn't delegate some signals (e.g. rowsInserted) from its source model.
> 
> If that is the case, consider writing a bugreport to TT.
> 
>> This leads to a lot of problems (at least for me) because it means that
>> one cannot use real models and proxy models interchangeably. Also, it
>> might lead to performance issues because a view cannot be updated where
>> changes occur, but has to be completely refreshed (e.g. rowsInserted is
>> converted to layoutChanged).
> 
> The latter does make sense as "simple" implementation. When a row is
> inserted into a table this might lead to a layout change for the proxy
> model, however I'd still consider this a bug, because Qt should be
> smarter than that and the proxy model should be able to calculate the
> proxy-row that is being inserted and emit the apropriate signal.
> 
> I also remember seeing one or two bugreports in the task tracker wrt
> proxy models and emitting signals.
> 
> Andreas
> 

Thanks for your reply. I'll have a look at the task tracker and consider
posting a bug report.

M

--
 [ signature omitted ]