[SailfishDevel] SearchField and focus

Benoît HERVIER khertan at khertan.net
Thu Aug 8 15:10:26 UTC 2013


Hi,

I'm trying to use SearchField to have a .... suspense ... a search 
field for my list view.
So i try to filter in realtime ... and i notice that SearchField lose 
focus

Basically, i do a reset on the ListModel and append data

This could come from the use i made from SearchField, so here a snippet 
of the code :

     SilicaListView {
         id: notesView
         model: notesModel
         anchors.fill: parent
         header: Column {
             width: parent.width
             PageHeader {
                 title: "ownNotes"
             }
             SearchField {
                 id: searchField
                 placeholderText: "Search"
                 width: parent.width
                 onTextChanged: {
                     searchText = searchField.text;
                     notesModel.applyFilter(searchText)
                 }

             }
         }
         section {
             property: 'category'
             delegate: SectionHeader {
                 text: section
             }
         }

Any advices ?
Thanks for your help.
-- 
Benoît HERVIER - http://khertan.net/


More information about the Devel mailing list