Quote Originally Posted by FS Lover View Post
for what reason do you think it is special?
Because here you don't care that it is a proxy, you just want your original model index back. It's a shortcut over using the activated() signal that carries a string and finding that string in your model. So the same functionality could be obtained without qobject_cast with one or two additional lines of code.

what difference does it make regarding such uses we need?
This is not a need where you want to use the completionModel for anything. You just want the original model index back.

you wanted an example case and I showed you one clear, simple, standard, and completely official one.
No, you didn't.

I think its clear enough to everyone.
So file a bug report to Qt Software. They won't change the API because it would break compatibility with existing applications but they might say "you're right, it should have been a QAbstractProxyModel".

so you have the responsibility to prove any further claim you make here.
I don't have a reponsibility to prove anything. You should always use the most general interface to an object and that's a rule of a thumb in OO Software Engineering.

base model may be any model that can be potentially complex, costly to process, harder to work with, etc.
but regarding auto completion's suggestions and user's choice among them, many times we need only simple features without any further/external dependencies,
so a simple and shortened model that contains only the relevant items is the best to work with. that is what completionModel gives to us (a simple list model).
I take it that in your implementation of Qt the source of QCompleter::setModel() doesn't contain a line:
Qt Code:
  1. d->proxy->setSourceModel(mode);
To copy to clipboard, switch view to plain text mode 
which sets the source model of the completion model to the model you pass to it. So sorry, but there is no "simple list model" here. You have all the drawbacks of your original model plus an additional layer that returns the currently used list model to the user. And still you shouldn't care what it does. To you this is just "some" model that can be completely unrelated to your base model, especially if you subclass QCompleter and reimplement setModel - there might not be any proxy there anymore.

maybe I don't understand your meaning clearly.
can you explain more?
clearly, some feature of the example will not work without that functionality.
Examples often use hacks or simplifications. This is one of them.