Adding several records to the QSqlTableModel serially
I'm trying to add several records to the QSqlTableModel, serially. But when I'm call insertRow method second time without submitting changes, model forgets previous changes. I don't know how many inserts user will make (so I can not call insertRows(n)) and I must have opportunities to roll back changes, so I can't call submit method after each inserting.
Re: Adding several records to the QSqlTableModel serially
Hello,
That's what transactions are used for. Haven't worked with them myself yet, but I guess it's not so hard.
Best regards,
Marc
Re: Adding several records to the QSqlTableModel serially
Thank you so much. Transactions really helps me to solve my problem.