Qt-interest Archive, December 2006
Problem with deleting currentItem
Message 1 in thread
Hi,
I am using a QListView to display data, gatherd by a custom Model
(inheriting QAbstractListModel). The model is frequently polling some
hardware and displaying the currently connected devices. I also use a
custom selection model (inheriting QItemSelectionModel). The selection
model takes care of selecting the first item, whenever the item-count
increases from zero to a bigger number.
In my model I am using beginInsertRows()/endInsertRows() and
beginRemoveRows()/endRemoveRows() correctly.
Now often when deleting the currently selected item (selected && current)
I get the following warning:
intersectingStaticSet: row 0 was invalid
Do I have to take some special care to unselect the item before removing
it in a beginRemoveRows()/endRemoveRows()-block?
Maybe I am all the way on the wrong track - maybe someone can bring a
little light into my darkness?
Regards,
Malte
--
[ signature omitted ]
Message 2 in thread
Monday 04 December 2006 10:26 Malte Witt wrote:
> Hi,
>
> I am using a QListView to display data, gatherd by a custom Model
> (inheriting QAbstractListModel). The model is frequently polling some
> hardware and displaying the currently connected devices. I also use a
> custom selection model (inheriting QItemSelectionModel). The selection
> model takes care of selecting the first item, whenever the item-count
> increases from zero to a bigger number.
> In my model I am using beginInsertRows()/endInsertRows() and
> beginRemoveRows()/endRemoveRows() correctly.
> Now often when deleting the currently selected item (selected && current)
> I get the following warning:
>
> intersectingStaticSet: row 0 was invalid
>
> Do I have to take some special care to unselect the item before removing
> it in a beginRemoveRows()/endRemoveRows()-block?
>
> Maybe I am all the way on the wrong track - maybe someone can bring a
> little light into my darkness?
Without your code, it's a bit difficult to figure out if what you are doing
with (begin,end)RemoveRows() is correct. But if it is, I guess this is a Qt
problem. You should not get a warning from this.
I suggest you file a bug report in the bug tracker.
Bo.
--
[ signature omitted ]
Message 3 in thread
> Without your code, it's a bit difficult to figure out if what you are
doing
> with (begin,end)RemoveRows() is correct. But if it is, I guess this is a
Qt
> problem. You should not get a warning from this.
I am trying to generate a small example to reproduce this, but since I
have no idea about the origin, it seems to be difficult.
> I suggest you file a bug report in the bug tracker.
Yeah. Once I have a running example, I will do so.
Regards,
Malte
--
[ signature omitted ]