[PyQt] Qcompleter,dateEdit popup questions.

Andreas Pakulat apaku at gmx.de
Wed Feb 6 12:03:06 GMT 2008


On 06.02.08 16:25:39, Igor Prischepoff wrote:
> > As far as I can see, what you need to do is to also provide "m10" as an
> entry in your completion model.
> Sorry,but my users can type anything and I have not possibilities to predict
> and add any possible combination of chars into completion list.

I think you misunderstood. Fore sure you have a list of possible items
"somewhere". So all you need to do, to be able to complete when a
"middle" part of such an item is typed, is to extend that list by
removing characters from the start and end of each item until the length
is 1. For example, suppose I have two possible items which can be
completed:

foo
bar

then you'd create a model that returns

f
fo
foo
o
oo
b
ba
bar
a
ar

And with that QCompleter should complete "bar" for a, ar, ba, b and bar.

Andreas

-- 
Avoid gunfire in the bathroom tonight.


More information about the PyQt mailing list