QSqlQuery for SQLite in forward iteration with next() will only find one row

江枫思渺然 提交于 2019-12-05 15:12:48

It is simply false that the following problem has been discussed here several times. The references you provide have nothing to do with the behavior that you're seeing.

You likely have bugs in the code that replaces // Do something with row.... You need to show that code in its entirety. You may also simply see the fact that there is in fact just a single row in your table at the time the problem occurs. This would be due to interaction with other code that modifies the database, but you never share that code, so how can we know?

If you're only iterating forward, you should call q.setForwardOnly(true) as this will make things faster on some database backends.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!