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. QSqlRelationalTable does not delete row in SQLite [SOLVED]
Forum Update on Monday, May 27th 2025

QSqlRelationalTable does not delete row in SQLite [SOLVED]

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.2k 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.
  • R Offline
    R Offline
    rutger
    wrote on 21 Dec 2012, 13:39 last edited by
    #1

    It took me a day to find out and look through the QSqlTableModel source code.

    I had QSortFilterProxyModel working on a QSqlRelationalTableModel connected to a SQLite database. This database was a copy made with my own application from a MySQL database. When working on this copy SQLite database I found that the removeRows() was not working, the row was not deleted.

    After a day struggling with Signal Spy and checking my own code for the deletion of the row I found my stupid error. In the SQLite database NO PRIMARY KEYS WERE SET! Without a primary key the removeRows() does not work.

    Unfortunately this did not create an error message when debugging the application. The additional error message could be a suggestion for the developers of Qt.

    1 Reply Last reply
    0

    1/1

    21 Dec 2012, 13:39

    • Login

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