[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    Re: Heads up, working on autocompletion and breadcrumbbar!
From:       Sebastian =?utf-8?q?K=C3=BCgler?= <sebas () kde ! org>
Date:       2012-01-17 10:03:35
Message-ID: 201201171103.36081.sebas () kde ! org
[Download RAW message or body]

On Monday, January 16, 2012 22:41:58 Mark wrote:
> > I would go for an API like this (just doing it out of my head..):
>  > AutoCompleter
>  > {
>  >   id: autoCompleter
>  > }
>  > 
>  > TextField
>  > {
>  >   completer: autoCompleter
>  > }
> 
> what is the advantage of declaring autocompleter independent and outside
> the textfield?
> 
>  (apart being close to impossible to make a c++ based component private :/)
> 
> 
> I honestly don't know. I don't even know how to get that working. Kinda
> discovering that as i go.. I never made such a complex QML part before.
> 
> The idea however is to have one component wich holds the data
> (AutoCompleter) and another component to use that data (TextField). How
> else would you do it? 

You write your autocompleter in C++, register it to the QML runtime using 
qmlRegisterType<>(), and then use it *inside* TextArea.qml and TextField.qml. 
So basically you compose it inside the components, instead of telling the user 
of your API to instantiate their own AutoCompleter. Would make it a bit harder 
to share it between elements, not sure how important that is, though...

See http://doc.qt.nokia.com/4.8-snapshot/qml-extending.html

Cheers,
-- 
sebas

http://www.kde.org | http://vizZzion.org | GPG Key ID: 9119 0EF9
_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic