From kde-panel-devel Tue Jan 17 10:03:35 2012 From: Sebastian =?utf-8?q?K=C3=BCgler?= Date: Tue, 17 Jan 2012 10:03:35 +0000 To: kde-panel-devel Subject: Re: Heads up, working on autocompletion and breadcrumbbar! Message-Id: <201201171103.36081.sebas () kde ! org> X-MARC-Message: https://marc.info/?l=kde-panel-devel&m=132679479722684 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