[SailfishDevel] Search Field Component

Joona Petrell joona.petrell at jollamobile.com
Wed Aug 14 12:15:32 UTC 2013


Hi Dimitris,

Silica SearchField is just a specially-styled TextField, the actual search string filtering should be implemented in the application model (QAbstractListModel or QML ListModel). For an example of how to use SearchField see Search page in Component Gallery. When displaying the search results on the view, please use Theme.highlightText(model.text, searchString, Theme.highlightColor) to highlight the matched sub-text on the search results.

Qt Quick unfortunately lacks generic proxy models for doing filtering, so implementing filtering to models can be a bit of pain. Be careful when adding, removing and updating model items during an active search, badly written model logic often leads to lousy performance when the view unnecessarily re-constructs view delegates.

Cheers,

Joona

________________________________________
From: devel-bounces at lists.sailfishos.org [devel-bounces at lists.sailfishos.org] on behalf of Dimitris [sarlis.dim at gmail.com]
Sent: 14 August 2013 14:42
To: devel at lists.sailfishos.org
Subject: [SailfishDevel] Search Field Component

Hello,

I want to use this component and there is not much info about it in the
documentation. Is it just a TextField with two additional icons or does
it actually filters the result according to the text given? Because if
it doesn't I have to implement it on my own.

Thanks.
_______________________________________________
SailfishOS.org Devel mailing list


More information about the Devel mailing list