Insert row to model from inside QML

Forum for posting problems using QxOrm library

Insert row to model from inside QML

Postby algogr » Sat Aug 13, 2016 11:05 am

Hello everyone,

I cannot find a function to insert records to QML model derived from qx::IxModel from inside QML. Am i something missing?

Thanks in advance
algogr
 
Posts: 3
Joined: Fri Jul 08, 2016 7:39 pm

Re: Insert row to model from inside QML

Postby qxorm » Tue Aug 16, 2016 7:14 am

Hello,

1- From QML model to database :
All functions available in QML which interact with databases are listed in the manual here : https://www.qxorm.com/qxorm_en/manual.html#manual_90

There is :
qxInsert_() : insert all model entities (all model rows) to database ;
qxInsertRow_() : insert a model row to database ;


2- Insert new row to QML model :
Since qx::IxModel interface is a Qt model and derived from QAbstractItemModel, I think you can find the solution in Qt documentation : http://doc.qt.io/qt-5/qabstractitemmodel.html
For example, you can use the insertRows() method : http://doc.qt.io/qt-5/qabstractitemmode ... insertRows
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am


Return to QxOrm - Help

Who is online

Users browsing this forum: No registered users and 3 guests