PDA

View Full Version : Tip for DB querying and table output?



adutzu89
27th January 2014, 13:29
I have database which I would require to query it and output as table.
The thing is fairly simple as I would use table models etc.

The problem is when I encounter huge amount of rows(speaking of 5000+ rows of data);
Can anyone recommend me a way?

I've done something similar in php/jquery, but there I was able to paginate the results which is a simple process while in qt I couldn't find a succesful example/tutorial.

I am not expecting someone to write me the code and post it here, just tell me where to look or what is a preffered way to do it.

ChrisW67
28th January 2014, 02:26
QTableModel and QTableView. QTableView does lazy retrieval of rows (256 at a time).

adutzu89
28th January 2014, 10:22
Your link to QTableModel is broken, do you refer to QSqlTableModel?
I am looking to make a Table that will return a specific number(let's limit it to 15), and let the user toggle between first 15 rows,next 15 rows,previous 15 etc.

Lesiok
28th January 2014, 12:27
Simple use QSqlTableModel and set limits in SQL query. After user action change query.