PDA

View Full Version : Aborting a query set on a TableModel



Quid
5th July 2006, 17:14
Greetings,

I would like to allow the user to abort a query that is set on a TableModel for a table with millions of records. I am only currently warning them about how many records the query will pull up but I am unable to allow them to abort if the user accidentally starts the query.

Any solutions or suggestions would be appreciated.

~Cheers

Big Duck
5th July 2006, 20:55
I am a Qt beginer Quid,
The only thing I can think of is using a QThread, so that the application can kill the thread at some time.
Perhaps this wont work when the thread is doing a sql query - I really dont know if it would work or not.

Quid
5th July 2006, 22:36
I think the thread would allow the user to go ahead and use the app but the query would still be executing on the database in the background filling up memory with data.

I need to figure how to fetch 100 rows and then check an abort flag and do this continually until I have all the data the user requested.

I know someone has a solution out there. I really do not want to start tinkering with the Qt source.