[Qt-interest] QAbstractItemModel::endRemoveRows

Andreas Pakulat apaku at gmx.de
Thu Jul 16 22:53:57 CEST 2009


On 16.07.09 19:46:47, Eric Clark wrote:
> Hello All,
> 
> I have a situation where I am unsure if I need to call endRemoveRows()
> on my QAbstractItemModel. If I make a call to endRemoveRows() and
> there was not a previous call to beginRemoveRows(), Qt crashes when
> trying to pop the call off the internal stack. My question is: Is
> there some way for me to know if the stack has items or not. Or is
> there any intention of fixing the call to endRemoveRows, such that it
> does not crash if the stack is empty?

Neither, you're supposed to have begin/end in a very short piece of code
that only does the actual change in your internal data representation.
Any checks for validity of the removal or other things should be
executed before the begin.

Andreas

-- 
Tomorrow will be cancelled due to lack of interest.



More information about the Qt-interest-old mailing list