[Qt-interest] QCompleter with QAbstractTableModel or QSortFilterProxyModel ?

Anders Bakken abakken at netflix.com
Thu Sep 9 18:12:27 CEST 2010


Why don't you just make up some additional roles for the other data? I am thinking a table model would work fine though. 

--

Anders

On Sep 9, 2010, at 8:40 AM, "Till Priemer" <till.priemer at kerdos.de> wrote:

> Hello,
> 
> I use QCompleter with QAbstractListModel in QLineEdit. Works fine. Now I
> want to reduce the Number of Items dynamically in the model seen by the
> QCompleter based on additional attributes (e.g. I have a list of names as
> QStringListModel but now I want to use the male ones within the completer
> only). My Idea was to use a QTableModel instead of QStringModel and store
> the name in the first column and the other attributes (gender, age, ...) in
> the following columns. Then I use a QSortFilterProxyModel for filtering the
> attribute I want. The QCompleter gets the proxyModel as model(). 
> But the documentation of QCompleter says the only models allowed are list-
> and tree-models !?
> 
> why isn't it possible to use QSortFilterProxyModel?
> 
> 
> Till
> 
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
> 




More information about the Qt-interest-old mailing list