Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to insert new data rows to QSqlQueryModel?

How to insert new data rows to QSqlQueryModel?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 5.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    zither
    wrote on last edited by
    #1

    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 Last reply
    0
    • L Offline
      L Offline
      lgeyer
      wrote on last edited by
      #2

      "QSqlQueryModel":http://doc.qt.nokia.com/latest/qsqlquerymodel.html#details

      bq. 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
      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved