Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    QSqlTableModel slow fetch results

    General and Desktop
    1
    3
    1369
    Loading More Posts
    • 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.
    • W
      whhfly2003 last edited by

      I found that QSqlTableModel is very slow when there is network delay. I use ms sql server and I found that after QSqlTableModel select() method is executed. I get all the data(the dataset is very small only 100 lines) I want. But if I get the value by row I found that it keeps on fetch from database which make the software very slow. If anyone have suggestion for this. Thanks

      1 Reply Last reply Reply Quote 0
      • W
        whhfly2003 last edited by

        By the way if I use QSqlQuery and setForwardOnly. it is very fast. How can I fix this because QSqlTableModel is very convenient to a QTableView

        1 Reply Last reply Reply Quote 0
        • W
          whhfly2003 last edited by

          I also found that in sql server profiler. If you get data from the model there will be sp_cursorfectch in the log. Why?? I think maybe qsqltablemodel is just useful in locat db like qsqlite. Has any one use qsqltablemodel with sql server??

          1 Reply Last reply Reply Quote 0
          • First post
            Last post