[Qt-interest] QSql(Query|Table)Model without caching possible?

Andre Somers andre at familiesomers.nl
Thu Feb 25 12:42:51 CET 2010


Davor J. wrote:
> Thanks Andre. It's an interesting suggestions which I have overlooked. But 
> it's not the case.
>
> Even if I set up the model without the view:
> -----------------------------------------------------------
>     QSqlTableModel m(0 /*, dbConnction*/);
>     m.setTable("test01");
>     m.select();
> -----------------------------------------------------------
> ... the application freezes and the network connection peaks for some 10 
> seconds. So there is no difference whether there is a view or not.
>
> (I know... this could be solved with threading or allowing the app events to 
> pass, but then it also goes beyond my initial question. I don not need to 
> cache all the data if I only need a few.)
>
> Regards,
> Davor
>   
OK, so that's one obvious suspect out of the way :-)
I know there has been some discussion on similar (the same?) issues 
quite recently on this list. Perhaps that discussion, which started on 
februari 1 this year and is called "Model/View delayed loading for large 
datasets" gives you some useful hints. However, I also understand that 
QSql*Model should do some of this stuff internally already. I have never 
used it myself in this way, so I don't have much detail on that. Sorry. 
Perhaps the sources can enlighten you there?

André




More information about the Qt-interest-old mailing list