QCompleter does not call data method from model
Hi,
I done a model inherited from QStandardItemModel. It has QVector of items and overloads data and rowCount methods.
I fiil this model with some items and then i used setModel on QCompleter and setCompleter on a QLineEdit.
When i write some letters to QLineEdit the model does not work, it means that the data method is never call. Do you know what could be a reason of that behaviour?
BR,
Luca
Re: QCompleter does not call data method from model
Quote:
it means that the data method is never call
How do you know? Did you run your program in the debugger and set a breakpoint at the start of the data() method?
By default, QCompleter calls data() only for column 0 of the model, and for the EditRole. Does your data method handle these?
Re: QCompleter does not call data method from model
Maybe a stupid question, but why inherit from QStandardItemModel if you have your own data vector?
Cheers,
_