July 15, 2011

zither zither
Lab Rat
147 posts

How to insert new data rows to QSqlQueryModel?

 

Dear all,

I made QSqlQueryModel link with SQLite database.
I would like to add new data rows to that model before setting to ModelView.

Plz guide me how to do that.

Thanks all

1 reply

July 15, 2011

Lukas Geyer Lukas Geyer
Dinosaur Breeder
2074 posts

QSqlQueryModel [doc.qt.nokia.com]

The QSqlQueryModel class provides a read-only data model for SQL result sets.

However, you can

  • use a QSqlTableModel instead or
  • insert the data to the database first or
  • create your own QAbstractItemModel which incorporates a QSqlQueryModel and allows for adding rows

 
  ‹‹ KGlobal::Locale Warning      QDebug messages don’T appear in static library ››

You must log in to post a reply. Not a member yet? Register here!