qt-interest@trolltech.com
[Top] [All Lists]

Re: [Qt-interest] Showing a "Please wait" dialog during sql query

Subject: Re: [Qt-interest] Showing a "Please wait" dialog during sql query
From: Scott Bloom
Date: Tue, 08 Jun 2010 08:25:27 -0700
The problem is, the ownership and affinety of the QSqlQuery must be the same
as the QSqlDatabase (This from Bill King of Nokia who is the/one of Nokia's
Qt database guys)

So what I got working, is creating the QSqlDatabase and its connection
inside the thread (during the run phase), running the exec and emitting a
signal when finished.

Once its finished, then you can use the QSqlQuery from the other thread
safely.

Note, I have NOT tried modifying the QSqlQueyrModel, I would expect that if
you got the QSqlRecord from the thread it would be ok..

Scott


On 6/8/10 1:16 AM, "Linos" <info@xxxxxxxx> wrote:

> I am using something like this with pyqt, the only difference it is that i
> emit 
> the QSqlQuery in a signal when the query has finished instead of return it
> from 
> a method, but when later i execute other query in the same sql QThread with a
> new created QSqlQuery in the same QSqlDatabase connection of the thread, the
> first model get corrupted and gets the values of the last query.
> 
> Miguel Angel
> 
> El 08/06/10 07:53, Scott Bloom escribió:
>> It got stripped.. My sent items has it attached...
>> 
>> It was/is a zip file...
>> 
>> Scott
>> 
>> 
>> On 6/7/10 10:23 PM, "Andre Somers"<andre@xxxxxxxxxxxxxxxx>  wrote:
>> 
>>> Op 8-6-2010 0:22, Scott Aron Bloom schreef:
>>>> I have attached a working solution.  Its not fully vetted, so bugs
>>>> probably exist :) but it works in the case shown...
>>>> 
>>>> 
>>> Unfortunately, you have attached nothing...
>>> 
>>> André
>>> 
>>> _______________________________________________
>>> Qt-interest mailing list
>>> Qt-interest@xxxxxxxxxxxxx
>>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>> 
>> 
>> 
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest@xxxxxxxxxxxxx
>> http://lists.trolltech.com/mailman/listinfo/qt-interest
> 


_______________________________________________
Qt-interest mailing list
Qt-interest@xxxxxxxxxxxxx
http://lists.trolltech.com/mailman/listinfo/qt-interest

<Prev in Thread] Current Thread [Next in Thread>