Hi!

I'm developing a customer library. I have a model and a view class:

Qt Code:
  1. class CustomerLibrary : public QAbstractTableModel
  2. {
  3. //...
  4. public slots:
  5. void setSeachString (const QString & str){
  6. _vec_restricted.clear();
  7. foreach(Customer * c, _vec_all)
  8. if(c->contains(str)) _vec_restricted.append(c);
  9. }
  10. private:
  11. QVector<Customer*> _vec_all;
  12. QVector<Customer*> _vec_restricted;
  13. }
  14. class CustomerTableView : public QTableView
  15. {
  16. //...
  17. }
To copy to clipboard, switch view to plain text mode 
Ok, in order to find quickly an entry, I have a LineEdit whose textChanged signal is connected to the setSearchString(...) method.

So anytime the text changes, drastic changes happen to my model.

How can I inform the view that an update is necessary?
Also I do not want to remove the rows one by one.

Thnaks in advance,
Olli