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.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support