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. Delete a row from SqlTableModel
Forum Updated to NodeBB v4.3 + New Features

Delete a row from SqlTableModel

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.2k Views 1 Watching
  • 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.
  • D Offline
    D Offline
    deepakkakkeel
    wrote on last edited by
    #1

    Hi,

    I have a QSqlTableModel* sqlTableModel;

    In a function i have done sqlTableModel->removeRows(rowNumber,1);

    But when i print the number of rows in QSqlTableModel using sqlTableModel->rowCounts() i am getting the same number of rows before and after sqlTableModel->removeRows(rowNumber,1); .Its not deleting the rows i think. May i know why is it?

    Deepak

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Santosh Reddy
      wrote on last edited by
      #2

      Check the value of rowNumber, and what if the return value of the function removeRows()?

      SS

      1 Reply Last reply
      0
      • D Offline
        D Offline
        deepakkakkeel
        wrote on last edited by
        #3

        Hi,

        I have an SqlTableModel. If i change a cell in the sqlTableModel and try to delete the row where change has been made i am not able to delete the row. May i know why is it not deleting?

        Deepak

        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