Hi,
I want to insert a batch of objects into a SelectableEventedList, but I want to fire corresponding signals only once, not for each object. The purpose is to reduce update calls in widgets down the line.
I thought I'd use paused() with a reducer to collect all indexes. But inserting currently only takes an index: int, not a tuple.
Question: How can I defer signal emission properly, such that Qt models update properly?
I tried blocking, but then you need to decide what to emit when done.
Or should I rather try to throttle the model functions?
Suggestion: inserting etc. could accept tuples as well, such that Qt's beginInsertRows() and endInsertRows() can be used to reduce update calls. extend() could then make use of this directly, such that it only emits the inserted signal once.
Thanks in advance,
ndxmrb
Hi,
I want to insert a batch of objects into a
SelectableEventedList, but I want to fire corresponding signals only once, not for each object. The purpose is to reduce update calls in widgets down the line.I thought I'd use
paused()with a reducer to collect all indexes. Butinsertingcurrently only takes anindex: int, not a tuple.Question: How can I defer signal emission properly, such that Qt models update properly?
I tried blocking, but then you need to decide what to emit when done.
Or should I rather try to throttle the model functions?
Suggestion:
insertingetc. could accept tuples as well, such that Qt'sbeginInsertRows()andendInsertRows()can be used to reduce update calls.extend()could then make use of this directly, such that it only emits theinsertedsignal once.Thanks in advance,
ndxmrb