[Interest] Issue with QSqlModel and QSortFilterModel

Jason H jhihn at gmx.com
Fri Apr 19 16:17:17 CEST 2019


I think they mean in the sense that Qt doesn't manage query construction and allow the proxy to tell model what it's filters are.

AFAICT, the Qt Model/View stack always assumed local, resident data was being displayed and filtered. SQL Models came after, but were assumed to be quick enough that the filter/sort parameters were to be pushed to the model.

I would expect, in an ideal world, that QSqlTableModel and QSqlQueryModel would have a proxyList() member that the model classes could reference to modify their query so that no data coming over the wire needs to be discarded or sorted.

That sort of sounds like something a ORM library would handle...

> Sent: Thursday, April 18, 2019 at 5:44 AM
> From: "Giuseppe D'Angelo via Interest" <interest at qt-project.org>
> To: interest at qt-project.org
> Subject: Re: [Interest] Issue with QSqlModel and QSortFilterModel
>
> Il 17/04/19 23:40, Scott Bloom ha scritto:
> > I have a source model, which is QSqlModel based, and a filter proxy model.
> > 
> > Its not possible to make the filter part of the SQL query.. been down 
> > that road…
> > 
> 
> Mind elaborating? Why not?
> 
> Cheers,
> 
> -- 
> Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Senior Software Engineer
> KDAB (France) S.A.S., a KDAB Group company
> Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
> KDAB - The Qt, C++ and OpenGL Experts
> 
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> https://lists.qt-project.org/listinfo/interest
>



More information about the Interest mailing list