If you need a true row count, which is often the reason for the while loop, then it will be more efficient to run a specific query to get the row count and then let Qt's lazy fetching fetch the actual rows only when/if they are needed in a view.
If you need a true row count, which is often the reason for the while loop, then it will be more efficient to run a specific query to get the row count and then let Qt's lazy fetching fetch the actual rows only when/if they are needed in a view.
You can also use setForwardOnly() to make some queries faster.
Regards,
Marc
Bookmarks