QCompleter on Plasma::LineEdit not working properly

Cyrill Helg phlogsmailinglists at gmail.com
Tue Jan 19 16:34:19 CET 2010


Hi there

I'm working on a simple plasmoid that should be able to send sms over an http 
gateway in the end :)

I want to fetch the contacts and their phone numbers from akonadi and use 
autocompletion to let the user select it.

Now this is how I'm trying to do this:

m_numberEdit = new Plasma::LineEdit();
 
---
//construct completer and attach it to the underlying native Widget of the 
LineEdit
m_completer = new QCompleter(Akonadi::ContactCompletionModel::self(), this);
    
m_completer->setCompletionColumn( Akonadi::ContactCompletionModel::NameColumn 
);
m_completer->setCaseSensitivity(Qt::CaseInsensitive);
    
connect( m_completer, SIGNAL( activated( const QModelIndex& ) ), 
			SLOT( slotCompletionCompleted( const QModelIndex& ) ) );
m_numberEdit->nativeWidget()->setCompleter(m_completer);
---

I changed the Akonadi::ContactCompletionMode (yes I need to change the 
namespace..) for my needs, the cpp file can be found here if its relevant: 
http://paste.pocoo.org/show/167143/
(Its almost the same used in group edit in new addressbook and working there)

Now the problem is:

The completion stops after first char and the completion popup is shown 
"somewhere" in the left top of the screen and not near my LineEdit. I can't 
even delete the first char after typing, the whole LineEdit somehow is 
freezed.

Am I doing this right by using the native underlying widget? Where could the 
problem be? Is this is a Plasma bug?


Thanks a lot for your help
Cyrill


More information about the Plasma-devel mailing list