[PyQt] Qcompleter,dateEdit popup questions.

Igor Prischepoff igor at tyumbit.ru
Wed Feb 6 11:25:39 GMT 2008




-----Original Message-----
From: pyqt-bounces at riverbankcomputing.com
[mailto:pyqt-bounces at riverbankcomputing.com] On Behalf Of Andreas Pakulat
Sent: Wednesday, February 06, 2008 2:40 PM
To: pyqt at riverbankcomputing.com
Subject: Re: [PyQt] Qcompleter,dateEdit popup questions.

On 06.02.08 11:53:14, Igor Prischepoff wrote:
> Hello,everybody!
> I'm new to PyQt and in process of
> converting my application from wxPython to PyQt.
> 
> I'd like to ask couple of question about nice QCompleter class in Qt 
> and PyQt.
> 
> Question #1:
> How can I build my own custom completer which completes on any char in 
> the item word?
> It seems that default Qcompleter completes only if my items starts 
> with letters that I've started typing.
> For example: here is my abstract model data:
> 
> Item10
> Item110
> Item20
> Item220
> 
> If I type for example 'm10' then completer should provide only 2 
> matches Item10 Item110 because 'm10' chars is found only in this two
items.
> 
> I've read documentation about QCompleter in Qt docs but can not find a 
> clue about methods used by Qcompleter when deciding which item from 
> model is matched to my typed word.

Hi, Andreas!
First of all, thank you for answering my question.
 
> 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.
So seems like Qcompleter is not intended for a job like this...
May be I can work around with another widget.
Btw, can I add some kind of custom popup widget to TextEdit control for
example?
---
igor at tyumbit.ru



More information about the PyQt mailing list