Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 2 Support (Qt 5) › Search Bar with JsonListModel/AppListView

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #23476

    Edward

    Hey Guys,

    I’ve been trying to implement a search bar into my ListView for functionality – when following the tutorials on the website and searching for something I know is within the data I usually return a single blank list entry with the following warnings on my log:

    search accepted: Hello
    file:allbookd/qml/toolkit/FAQpage.qml:86: Unable to assign [undefined] to bool
    file:allbookd/qml/toolkit/FAQpage.qml:101: Unable to assign [undefined] to QString
    file:allbookd/qml/toolkit/FAQpage.qml:100: Unable to assign [undefined] to bool
    file:allbookd/qml/toolkit/FAQpage.qml:86: Unable to assign [undefined] to bool
    file:allbookd/qml/toolkit/FAQpage.qml:101: Unable to assign [undefined] to QString
    file:allbookd/qml/toolkit/FAQpage.qml:100: Unable to assign [undefined] to bool

     

    My list code and JSON example are in https://felgo.com/developers/forums/t/edit-json-property-in-jsonlistmodel

    lines 86/100/101 are:

     

    86:  visible: model.avisible

    100: visible: model.avisible

    101: text: model.content

    each of the above relate to my SimpleRow visible or text properties.

     

    How could i use the searchBar to search the both the sections and delegate of my list?

    My current list code is as the example:

                    SearchBar {
                        id: searchBar
                        width: parent.width
                        height: parent.height / 5
                        onAccepted: {
                            console.log("search accepted: "+text)
    
                            // if the search bar is not empty, we prevent it from disappearing
                            if(text !== "") {
                                listView.model = 2 // update result
                            }
                            else {
                                // initial settings
                                listView.model = 50
                            }
                        }
                    }

     

     

     

Viewing 1 post (of 1 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded