[Interest] Aborting `begin*` with QAbstractItemModels

Vlad Stelmahovsky vladstelmahovsky at gmail.com
Fri Feb 28 06:58:57 CET 2020


Hello

I'd suggest 1st check if its fails or not and then update the model with
begin/end

br,
Vlad

On Thu, Feb 27, 2020 at 10:29 PM Jonathan Purol <contact at folling.de> wrote:

> What would be the recommended way to abort a `begin*` calls from
> `QAbstractItemModel`?
>
> I have a model where inserting/removing items can fail, in which case I
> would like to abort the removal.
> What would be the best way to approach this? I've found a few rather
> useless threads regarding this online, but haven't found any hint in the
> documentation/example projects.
>
> Is it save to just ignore the `begin*Rows` if it fails? From what I've
> seen from the source that shouldn't be the case. And simply calling
> `end*Rows` would probably result in similar unwanted behaviour.
>
> Sincerely,
> Jonathan Purol
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> https://lists.qt-project.org/listinfo/interest
>


-- 
Best regards,
Vlad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200228/e623d06b/attachment.html>


More information about the Interest mailing list