Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Filter Bar

Filter Bar

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    wilson_chan
    wrote on last edited by
    #1

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

    1 Reply Last reply
    0
    • C Offline
      C Offline
      chriadam
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • W Offline
        W Offline
        wilson_chan
        wrote on last edited by
        #3

        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
        width:parent.width
        height:50
        placeHolderText: "Search Text"
        onSearchTextChanged: itemModel.giftName(searchText);
        }@

        @ListModel{
        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
                giftName:model.giftName
                point:model.point
            }
            clip: true
        }@
        

        The List Model is getting data or info from database.

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

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved