[Interest] QSqlTableModel::setFilter()
Sviatoslav Feshchenko
sviatoslav at outlook.com
Sat Mar 16 04:52:18 CET 2013
Dear Qt community,
Please excuse if you consider this to be a basic question, admittedly I am not a Qt expert, tasked with my first Qt application.
Could someone recommend to me please the best way to remove, or clear, a filter set with QSqlTableModel::setFilter() function? There doesn't appear to be any Qt function with this behaviour. I experimented with calling QSqlTabeModel::setTable() and then QSqlTabeModel::select(). This seems to achieve the desired behavior, but I am not sure if this is the best approach, especially with QSqlRelationalTableModel, as I would then need to set all the relations again.
As an alternative, I experimented clearing the filter with QSqlTableModel::setFilter() and using % as the wildcard character on a primary key field and then calling select(), but with no success.
Kindly, please let me know what the best approach might be and whether you would suggest making a recommendation to Qt developers to add a function along the lines of QSqlTableModel::clearFilter().
Warm regards,
Sviatoslav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130315/7f72d9d4/attachment.html>
More information about the Interest
mailing list