View Single Post
Posts: 1,414 | Thanked: 7,547 times | Joined on Aug 2016 @ Estonia
#5
Originally Posted by Markkyboy View Post
Simple answer - I don't - but when I add the new data it is all clumped at the bottom of the list in the Stations search window.

As per comment from coderus, I have read the documentation for sqlite3, there isn't much to read, the commands seem quite simple, but I've ended up with the same result as last time - the new stations are NOT listed alphabetically and are at the end of the list and so, when the app is used, the user is presented initially with all stations listed in alphabetical order, that is until the user scrolls to the bottom and finds a handful of stations in no particular order at all.
I would suggest to start with some SQL tutorial, for example https://en.wikibooks.org/wiki/Structured_Query_Language.

In short, you insert your data into the database and, when you fetch it, you need to get it in sorted form. So, your SELECT statement should have ORDER BY specified. To make it fast, you need to create an INDEX that would depend on the field used for sorting.

SQL is rather simple and applicable to SQLite nicely. QtSql provides the interface that you could also use for it.
 

The Following 7 Users Say Thank You to rinigus For This Useful Post: