[Qt-interest] running QSqlQuery's in a worker thread?

Scott Aron Bloom Scott.Bloom at sabgroup.com
Fri Jun 5 21:32:37 CEST 2009


> -----Original Message-----
> From: qt-interest-bounces at trolltech.com [mailto:qt-interest-
> bounces at trolltech.com] On Behalf Of Kaleb Pederson
> Sent: Friday, June 05, 2009 12:29 PM
> To: qt-interest at trolltech.com
> Subject: Re: [Qt-interest] running QSqlQuery's in a worker thread?
> 
> On Fri, Jun 5, 2009 at 12:19 PM, Scott Aron
> Bloom<Scott.Bloom at sabgroup.com> wrote:
> > So here is my problem, Im working on an app, where an individual sql query
> > can take up to 10 seconds (sometimes longer if the system is really getting
> > hammered)..
> >
> > The problem is, the system is an inventory search system, so its “very” open
> > in the types of searches that can be done.   Sometimes, a search cant take
> > 2-3 minutes.
> >
> > The problem of course, is that the GUI freezes while the SQL query is being
> > executed.
> >
> > What I was thinking was something like this, and I wanted to know if anyone
> > has a better solution..
> 
> I've done something similar.
> 
> I changed my status bar to indicate that a query was in progress and
> then disabled all further queries while that was running.  It allowed
> the users to navigate and do (certain) other things while waiting for
> the query, but didn't block the Gui and allowed them to cancel the
> operation.
> 
> I'm sure there are other possibilities as well.
> 
> --Kaleb
> 

Thanks for your solution..     I kind of have to go with a  modal blocking dialog... (for UI reasons not SQL reasons) but I like the idea of a status bar update...  I wish I could use it :)

Scott




More information about the Qt-interest-old mailing list