Qt World Summit: Register Today!

Filter Bar

  • May I ask how can I put a filter bar or search box in my file using qml code?

  • Both of these are just text edits. It's what you do with the text input from the user, which makes it a search bar or a filter bar - presumably, you need to modify which elements are displayed in a view of a model via filtering etc.

  • HI chriadam,

    Thank for your reply.

    I have put in code below, the search box is shown but it unable to search the text input.

    @SearchBox {
    id: searchBox
    placeHolderText: "Search Text"
    onSearchTextChanged: itemModel.giftName(searchText);

    id: itemModel

    ListView {
    id: itemView
    anchors {
    left: root.left;
    right: root.right
    top: searchBox.bottom;
    bottom: parent.bottom
    model: itemModel

        delegate: RedeemItemView {
            id: todoItemDelegate
            picture: model.picture
        clip: true

    The List Model is getting data or info from database.

    So may I ask where is the problem occur?
    Thank you.

Log in to reply